From e00f6fb7b9ab0123f8ef4582bb4e0563c6320766 Mon Sep 17 00:00:00 2001 From: nedelcho-delchev-tues Date: Thu, 26 Feb 2026 20:59:32 +0200 Subject: [PATCH 1/3] Revisit property requirements and added checks for convert api --- codbex-uoms/api/ConverterController.ts | 29 ++++++- codbex-uoms/codbex-uoms.edm | 28 +++--- codbex-uoms/codbex-uoms.gen | 86 ++++++++++--------- codbex-uoms/codbex-uoms.model | 37 +++++--- .../codbex-uoms/api/Settings/UoMController.ts | 18 ++++ .../codbex-uoms/dao/Settings/UoMRepository.ts | 41 ++++++--- .../codbex-uoms/data/Settings/UoMEntity.ts | 19 ++-- .../gen/codbex-uoms/schema/codbex-uoms.schema | 14 +-- .../ui/Settings/UoM/dialog-window/index.html | 24 +++--- 9 files changed, 181 insertions(+), 115 deletions(-) diff --git a/codbex-uoms/api/ConverterController.ts b/codbex-uoms/api/ConverterController.ts index 8359f97..c03cefd 100644 --- a/codbex-uoms/api/ConverterController.ts +++ b/codbex-uoms/api/ConverterController.ts @@ -15,7 +15,7 @@ class ConverterController { private readonly repository = new UoMRepository(); @Get("/:source/:target/:value") - public convertValue(_: any, ctx: any): number { + public convertValue(_: any, ctx: any): number | undefined { try { const source = ctx.pathParameters.source; const target = ctx.pathParameters.target; @@ -29,6 +29,7 @@ class ConverterController { } ] })[0]; + const entityTarget = this.repository.findAll({ conditions: [ { @@ -38,13 +39,37 @@ class ConverterController { } ] })[0]; + if (entitySource && entityTarget) { if (entitySource.Dimension !== entityTarget.Dimension) { - HttpUtils.sendResponseBadRequest("Both Source and Target Unit of Measures should have the same Dimension"); + HttpUtils.sendResponseBadRequest( + "Both Source and Target Unit of Measures should have the same Dimension" + ); + return; + } + + if ( + entitySource.Numerator == null || + entitySource.Denominator == null || + entityTarget.Numerator == null || + entityTarget.Denominator == null + ) { + HttpUtils.sendResponseBadRequest( + "Invalid conversion factors defined" + ); return; } + + if (entitySource.Denominator === 0 || entityTarget.Numerator === 0) { + HttpUtils.sendResponseBadRequest( + "Invalid conversion configuration (division by zero)" + ); + return; + } + const valueBase = value * entitySource.Numerator / entitySource.Denominator; const valueTarget = valueBase * entityTarget.Denominator / entityTarget.Numerator; + return valueTarget; } else { HttpUtils.sendResponseNotFound("Unit of Measures not found: [" + source + "] and/or [" + target + "]"); diff --git a/codbex-uoms/codbex-uoms.edm b/codbex-uoms/codbex-uoms.edm index d10907b..8175cb9 100644 --- a/codbex-uoms/codbex-uoms.edm +++ b/codbex-uoms/codbex-uoms.edm @@ -1,27 +1,27 @@ - + - - + + - + - - - - - - - - + + + + + + + + - + - + \ No newline at end of file diff --git a/codbex-uoms/codbex-uoms.gen b/codbex-uoms/codbex-uoms.gen index 92421c5..2ef0e21 100644 --- a/codbex-uoms/codbex-uoms.gen +++ b/codbex-uoms/codbex-uoms.gen @@ -4,13 +4,26 @@ "brandUrl": "https://www.codbex.com/", "title": "UOMs Management Module", "description": "Managing UOMs Data", + "fileName": "codbex-uoms", + "genFolderName": "codbex-uoms", + "dataSource": "DefaultDB", + "roles": [ + { + "entityName": "Dimension", + "roleRead": "codbex-uoms.Dimensions.DimensionReadOnly", + "roleWrite": "codbex-uoms.Dimensions.DimensionFullAccess" + }, + { + "entityName": "UoM", + "roleRead": "codbex-uoms.UnitsOfMeasures.UoMReadOnly", + "roleWrite": "codbex-uoms.UnitsOfMeasures.UoMFullAccess" + } + ], + "tprefix": "codbex-uoms-model", "projectName": "codbex-uoms", "workspaceName": "workspace", "filePath": "codbex-uoms.model", "templateId": "template-application-angular-v2/template/template.js", - "fileName": "codbex-uoms", - "genFolderName": "codbex-uoms", - "dataSource": "DefaultDB", "perspectives": { "Settings": { "views": [ @@ -26,19 +39,6 @@ "role": "" } }, - "roles": [ - { - "entityName": "Dimension", - "roleRead": "codbex-uoms.Dimensions.DimensionReadOnly", - "roleWrite": "codbex-uoms.Dimensions.DimensionFullAccess" - }, - { - "entityName": "UoM", - "roleRead": "codbex-uoms.UnitsOfMeasures.UoMReadOnly", - "roleWrite": "codbex-uoms.UnitsOfMeasures.UoMFullAccess" - } - ], - "tprefix": "codbex-uoms-model", "models": [ { "properties": [ @@ -71,6 +71,7 @@ "dataName": "DIMENSION_NAME", "dataNullable": false, "dataType": "VARCHAR", + "dataUnique": true, "description": "", "isRequiredProperty": true, "name": "Name", @@ -82,7 +83,6 @@ "dataNotNull": true, "dataAutoIncrement": false, "dataPrimaryKey": false, - "dataUnique": false, "isCalculatedProperty": false, "widgetLabel": "Name", "widgetDropdownUrl": "", @@ -98,6 +98,7 @@ "dataName": "DIMENSION_SAP", "dataNullable": true, "dataType": "VARCHAR", + "dataUnique": true, "description": "", "name": "SAP", "tooltip": "", @@ -108,7 +109,6 @@ "dataNotNull": false, "dataAutoIncrement": false, "dataPrimaryKey": false, - "dataUnique": false, "isRequiredProperty": false, "isCalculatedProperty": false, "widgetLabel": "SAP", @@ -183,20 +183,20 @@ { "dataLength": "100", "dataName": "UOM_NAME", - "dataNullable": true, + "dataNullable": false, "dataType": "VARCHAR", + "dataUnique": true, "description": "", + "isRequiredProperty": true, "name": "Name", "tooltip": "", "widgetIsMajor": true, "widgetLength": "100", "widgetSize": "fd-col-md--4 fd-col--6", "widgetType": "TEXTBOX", - "dataNotNull": false, + "dataNotNull": true, "dataAutoIncrement": false, "dataPrimaryKey": false, - "dataUnique": false, - "isRequiredProperty": false, "isCalculatedProperty": false, "widgetLabel": "Name", "widgetDropdownUrl": "", @@ -210,20 +210,20 @@ { "dataLength": "20", "dataName": "UOM_ISO", - "dataNullable": true, + "dataNullable": false, "dataType": "VARCHAR", + "dataUnique": true, "description": "", + "isRequiredProperty": true, "name": "ISO", "tooltip": "", "widgetIsMajor": true, "widgetLength": "20", "widgetSize": "", "widgetType": "TEXTBOX", - "dataNotNull": false, + "dataNotNull": true, "dataAutoIncrement": false, "dataPrimaryKey": false, - "dataUnique": false, - "isRequiredProperty": false, "isCalculatedProperty": false, "widgetLabel": "ISO", "widgetDropdownUrl": "", @@ -236,9 +236,10 @@ }, { "dataName": "UOM_DIMENSION", - "dataNullable": true, + "dataNullable": false, "dataType": "INTEGER", "description": "", + "isRequiredProperty": true, "name": "Dimension", "tooltip": "", "widgetDropDownKey": "Id", @@ -250,12 +251,11 @@ "relationshipName": "UoM_Dimension", "relationshipEntityName": "Dimension", "relationshipEntityPerspectiveName": "Settings", - "relationshipEntityPerspectiveLabel": "", - "dataNotNull": false, + "relationshipEntityPerspectiveLabel": "Entities", + "dataNotNull": true, "dataAutoIncrement": false, "dataPrimaryKey": false, "dataUnique": false, - "isRequiredProperty": false, "isCalculatedProperty": false, "widgetLabel": "Dimension", "widgetDropdownUrl": "/services/ts/codbex-uoms/gen/codbex-uoms/api/Settings/DimensionService.ts", @@ -269,6 +269,7 @@ "dataName": "UOM_SAP", "dataNullable": true, "dataType": "VARCHAR", + "dataUnique": true, "description": "", "name": "SAP", "tooltip": "", @@ -283,7 +284,6 @@ "dataNotNull": false, "dataAutoIncrement": false, "dataPrimaryKey": false, - "dataUnique": false, "isRequiredProperty": false, "isCalculatedProperty": false, "widgetLabel": "SAP", @@ -297,20 +297,20 @@ }, { "dataName": "UOM_NUMERATOR", - "dataNullable": true, + "dataNullable": false, "dataType": "BIGINT", "description": "", + "isRequiredProperty": true, "name": "Numerator", "tooltip": "", "widgetIsMajor": true, "widgetLength": "20", "widgetSize": "fd-col-md--4 fd-col--6", "widgetType": "NUMBER", - "dataNotNull": false, + "dataNotNull": true, "dataAutoIncrement": false, "dataPrimaryKey": false, "dataUnique": false, - "isRequiredProperty": false, "isCalculatedProperty": false, "widgetLabel": "Numerator", "widgetDropdownUrl": "", @@ -321,20 +321,20 @@ }, { "dataName": "UOM_DENOMINATOR", - "dataNullable": true, + "dataNullable": false, "dataType": "BIGINT", "description": "", + "isRequiredProperty": true, "name": "Denominator", "tooltip": "", "widgetIsMajor": true, "widgetLength": "20", "widgetSize": "fd-col-md--4 fd-col--6", "widgetType": "NUMBER", - "dataNotNull": false, + "dataNotNull": true, "dataAutoIncrement": false, "dataPrimaryKey": false, "dataUnique": false, - "isRequiredProperty": false, "isCalculatedProperty": false, "widgetLabel": "Denominator", "widgetDropdownUrl": "", @@ -344,21 +344,22 @@ "inputRule": "" }, { + "dataDefaultValue": "0", "dataName": "UOM_ROUNDING", - "dataNullable": true, + "dataNullable": false, "dataType": "INTEGER", "description": "", + "isRequiredProperty": true, "name": "Rounding", "tooltip": "", "widgetIsMajor": true, "widgetLength": "20", "widgetSize": "fd-col-md--2 fd-col--3", "widgetType": "NUMBER", - "dataNotNull": false, + "dataNotNull": true, "dataAutoIncrement": false, "dataPrimaryKey": false, "dataUnique": false, - "isRequiredProperty": false, "isCalculatedProperty": false, "widgetLabel": "Rounding", "widgetDropdownUrl": "", @@ -368,8 +369,9 @@ "inputRule": "" }, { + "dataDefaultValue": "false", "dataName": "UOM_BASE", - "dataNullable": true, + "dataNullable": false, "dataType": "BOOLEAN", "description": "", "name": "Base", @@ -378,7 +380,7 @@ "widgetLength": "20", "widgetSize": "fd-col-md--2 fd-col--3", "widgetType": "CHECKBOX", - "dataNotNull": false, + "dataNotNull": true, "dataAutoIncrement": false, "dataPrimaryKey": false, "dataUnique": false, diff --git a/codbex-uoms/codbex-uoms.model b/codbex-uoms/codbex-uoms.model index 79a44fc..3e81d07 100644 --- a/codbex-uoms/codbex-uoms.model +++ b/codbex-uoms/codbex-uoms.model @@ -22,6 +22,7 @@ "dataName": "DIMENSION_NAME", "dataNullable": "false", "dataType": "VARCHAR", + "dataUnique": "true", "description": "", "isRequiredProperty": "true", "name": "Name", @@ -36,6 +37,7 @@ "dataName": "DIMENSION_SAP", "dataNullable": "true", "dataType": "VARCHAR", + "dataUnique": "true", "description": "", "name": "SAP", "tooltip": "", @@ -55,7 +57,7 @@ "generateDefaultRoles": "true", "generateReport": "false", "icon": "cube", - "layoutType": "", + "layoutType": "MANAGE", "menuIndex": "100", "menuKey": "dimension", "menuLabel": "Dimension", @@ -63,7 +65,7 @@ "name": "Dimension", "perspectiveHeader": "", "perspectiveIcon": "cubes", - "perspectiveLabel": "", + "perspectiveLabel": "Entities", "perspectiveName": "Settings", "perspectiveNavId": "", "perspectiveOrder": "970", @@ -93,9 +95,11 @@ { "dataLength": "100", "dataName": "UOM_NAME", - "dataNullable": "true", + "dataNullable": "false", "dataType": "VARCHAR", + "dataUnique": "true", "description": "", + "isRequiredProperty": "true", "name": "Name", "tooltip": "", "widgetIsMajor": "true", @@ -106,9 +110,11 @@ { "dataLength": "20", "dataName": "UOM_ISO", - "dataNullable": "true", + "dataNullable": "false", "dataType": "VARCHAR", + "dataUnique": "true", "description": "", + "isRequiredProperty": "true", "name": "ISO", "tooltip": "", "widgetIsMajor": "true", @@ -118,9 +124,10 @@ }, { "dataName": "UOM_DIMENSION", - "dataNullable": "true", + "dataNullable": "false", "dataType": "INTEGER", "description": "", + "isRequiredProperty": "true", "name": "Dimension", "tooltip": "", "widgetDropDownKey": "Id", @@ -132,13 +139,14 @@ "relationshipName": "UoM_Dimension", "relationshipEntityName": "Dimension", "relationshipEntityPerspectiveName": "Settings", - "relationshipEntityPerspectiveLabel": "" + "relationshipEntityPerspectiveLabel": "Entities" }, { "dataLength": "20", "dataName": "UOM_SAP", "dataNullable": "true", "dataType": "VARCHAR", + "dataUnique": "true", "description": "", "name": "SAP", "tooltip": "", @@ -153,9 +161,10 @@ }, { "dataName": "UOM_NUMERATOR", - "dataNullable": "true", + "dataNullable": "false", "dataType": "BIGINT", "description": "", + "isRequiredProperty": "true", "name": "Numerator", "tooltip": "", "widgetIsMajor": "true", @@ -165,9 +174,10 @@ }, { "dataName": "UOM_DENOMINATOR", - "dataNullable": "true", + "dataNullable": "false", "dataType": "BIGINT", "description": "", + "isRequiredProperty": "true", "name": "Denominator", "tooltip": "", "widgetIsMajor": "true", @@ -176,10 +186,12 @@ "widgetType": "NUMBER" }, { + "dataDefaultValue": "0", "dataName": "UOM_ROUNDING", - "dataNullable": "true", + "dataNullable": "false", "dataType": "INTEGER", "description": "", + "isRequiredProperty": "true", "name": "Rounding", "tooltip": "", "widgetIsMajor": "true", @@ -188,8 +200,9 @@ "widgetType": "NUMBER" }, { + "dataDefaultValue": "false", "dataName": "UOM_BASE", - "dataNullable": "true", + "dataNullable": "false", "dataType": "BOOLEAN", "description": "", "name": "Base", @@ -210,7 +223,7 @@ "generateDefaultRoles": "true", "generateReport": "false", "icon": "cubes", - "layoutType": "", + "layoutType": "MANAGE", "menuIndex": "100", "menuKey": "uom", "menuLabel": "UoM", @@ -218,7 +231,7 @@ "name": "UoM", "perspectiveHeader": "", "perspectiveIcon": "cubes", - "perspectiveLabel": "", + "perspectiveLabel": "Entities", "perspectiveName": "Settings", "perspectiveNavId": "", "perspectiveOrder": "970", diff --git a/codbex-uoms/gen/codbex-uoms/api/Settings/UoMController.ts b/codbex-uoms/gen/codbex-uoms/api/Settings/UoMController.ts index a50443e..712c4e0 100644 --- a/codbex-uoms/gen/codbex-uoms/api/Settings/UoMController.ts +++ b/codbex-uoms/gen/codbex-uoms/api/Settings/UoMController.ts @@ -164,15 +164,33 @@ class UoMController { } private validateEntity(entity: any): void { + if (entity.Name === null || entity.Name === undefined) { + throw new ValidationError(`The 'Name' property is required, provide a valid value`); + } if (entity.Name?.length > 100) { throw new ValidationError(`The 'Name' exceeds the maximum length of [100] characters`); } + if (entity.ISO === null || entity.ISO === undefined) { + throw new ValidationError(`The 'ISO' property is required, provide a valid value`); + } if (entity.ISO?.length > 20) { throw new ValidationError(`The 'ISO' exceeds the maximum length of [20] characters`); } + if (entity.Dimension === null || entity.Dimension === undefined) { + throw new ValidationError(`The 'Dimension' property is required, provide a valid value`); + } if (entity.SAP?.length > 20) { throw new ValidationError(`The 'SAP' exceeds the maximum length of [20] characters`); } + if (entity.Numerator === null || entity.Numerator === undefined) { + throw new ValidationError(`The 'Numerator' property is required, provide a valid value`); + } + if (entity.Denominator === null || entity.Denominator === undefined) { + throw new ValidationError(`The 'Denominator' property is required, provide a valid value`); + } + if (entity.Rounding === null || entity.Rounding === undefined) { + throw new ValidationError(`The 'Rounding' property is required, provide a valid value`); + } for (const next of validationModules) { next.validate(entity); } diff --git a/codbex-uoms/gen/codbex-uoms/dao/Settings/UoMRepository.ts b/codbex-uoms/gen/codbex-uoms/dao/Settings/UoMRepository.ts index 250ad1c..ea129a7 100644 --- a/codbex-uoms/gen/codbex-uoms/dao/Settings/UoMRepository.ts +++ b/codbex-uoms/gen/codbex-uoms/dao/Settings/UoMRepository.ts @@ -6,25 +6,25 @@ import { EntityUtils } from "../utils/EntityUtils"; export interface UoMEntity { readonly Id: number; - Name?: string; - ISO?: string; - Dimension?: number; + Name: string; + ISO: string; + Dimension: number; SAP?: string; - Numerator?: number; - Denominator?: number; - Rounding?: number; - Base?: boolean; + Numerator: number; + Denominator: number; + Rounding: number; + Base: boolean; } export interface UoMCreateEntity { - readonly Name?: string; - readonly ISO?: string; - readonly Dimension?: number; + readonly Name: string; + readonly ISO: string; + readonly Dimension: number; readonly SAP?: string; - readonly Numerator?: number; - readonly Denominator?: number; - readonly Rounding?: number; - readonly Base?: boolean; + readonly Numerator: number; + readonly Denominator: number; + readonly Rounding: number; + readonly Base: boolean; } export interface UoMUpdateEntity extends UoMCreateEntity { @@ -150,16 +150,19 @@ export class UoMRepository { name: "Name", column: "UOM_NAME", type: "VARCHAR", + required: true }, { name: "ISO", column: "UOM_ISO", type: "VARCHAR", + required: true }, { name: "Dimension", column: "UOM_DIMENSION", type: "INTEGER", + required: true }, { name: "SAP", @@ -170,21 +173,25 @@ export class UoMRepository { name: "Numerator", column: "UOM_NUMERATOR", type: "BIGINT", + required: true }, { name: "Denominator", column: "UOM_DENOMINATOR", type: "BIGINT", + required: true }, { name: "Rounding", column: "UOM_ROUNDING", type: "INTEGER", + required: true }, { name: "Base", column: "UOM_BASE", type: "BOOLEAN", + required: true } ] }; @@ -237,6 +244,12 @@ export class UoMRepository { public create(entity: UoMCreateEntity): number { EntityUtils.setBoolean(entity, "Base"); + if (entity.Rounding === undefined || entity.Rounding === null) { + (entity as UoMEntity).Rounding = 0; + } + if (entity.Base === undefined || entity.Base === null) { + (entity as UoMEntity).Base = false; + } const id = this.dao.insert(entity); this.triggerEvent({ operation: "create", diff --git a/codbex-uoms/gen/codbex-uoms/data/Settings/UoMEntity.ts b/codbex-uoms/gen/codbex-uoms/data/Settings/UoMEntity.ts index 746d120..4e60d33 100644 --- a/codbex-uoms/gen/codbex-uoms/data/Settings/UoMEntity.ts +++ b/codbex-uoms/gen/codbex-uoms/data/Settings/UoMEntity.ts @@ -19,26 +19,23 @@ export class UoMEntity { name: 'UOM_NAME', type: 'string', length: 100, - nullable: true, }) - public Name?: string; + public Name!: string; @Documentation('ISO') @Column({ name: 'UOM_ISO', type: 'string', length: 20, - nullable: true, }) - public ISO?: string; + public ISO!: string; @Documentation('Dimension') @Column({ name: 'UOM_DIMENSION', type: 'integer', - nullable: true, }) - public Dimension?: number; + public Dimension!: number; @Documentation('SAP') @Column({ @@ -53,23 +50,21 @@ export class UoMEntity { @Column({ name: 'UOM_NUMERATOR', type: 'long', - nullable: true, }) - public Numerator?: number; + public Numerator!: number; @Documentation('Denominator') @Column({ name: 'UOM_DENOMINATOR', type: 'long', - nullable: true, }) - public Denominator?: number; + public Denominator!: number; @Documentation('Rounding') @Column({ name: 'UOM_ROUNDING', type: 'integer', - nullable: true, + defaultValue: `0`, }) public Rounding?: number; @@ -77,7 +72,7 @@ export class UoMEntity { @Column({ name: 'UOM_BASE', type: 'boolean', - nullable: true, + defaultValue: `false`, }) public Base?: boolean; diff --git a/codbex-uoms/gen/codbex-uoms/schema/codbex-uoms.schema b/codbex-uoms/gen/codbex-uoms/schema/codbex-uoms.schema index 5024af3..45bc722 100644 --- a/codbex-uoms/gen/codbex-uoms/schema/codbex-uoms.schema +++ b/codbex-uoms/gen/codbex-uoms/schema/codbex-uoms.schema @@ -15,12 +15,14 @@ { "type": "VARCHAR", "length": 100, + "unique": true, "name": "DIMENSION_NAME" }, { "type": "VARCHAR", "length": 20, "nullable": true, + "unique": true, "name": "DIMENSION_SAP" } ] @@ -39,44 +41,42 @@ { "type": "VARCHAR", "length": 100, - "nullable": true, + "unique": true, "name": "UOM_NAME" }, { "type": "VARCHAR", "length": 20, - "nullable": true, + "unique": true, "name": "UOM_ISO" }, { "type": "INTEGER", - "nullable": true, "name": "UOM_DIMENSION" }, { "type": "VARCHAR", "length": 20, "nullable": true, + "unique": true, "name": "UOM_SAP" }, { "type": "BIGINT", - "nullable": true, "name": "UOM_NUMERATOR" }, { "type": "BIGINT", - "nullable": true, "name": "UOM_DENOMINATOR" }, { "type": "INTEGER", - "nullable": true, + "defaultValue": "0", "name": "UOM_ROUNDING" }, { "type": "BOOLEAN", - "nullable": true, + "defaultValue": "false", "name": "UOM_BASE" } ] diff --git a/codbex-uoms/gen/codbex-uoms/ui/Settings/UoM/dialog-window/index.html b/codbex-uoms/gen/codbex-uoms/ui/Settings/UoM/dialog-window/index.html index d84607c..26c6ce5 100644 --- a/codbex-uoms/gen/codbex-uoms/ui/Settings/UoM/dialog-window/index.html +++ b/codbex-uoms/gen/codbex-uoms/ui/Settings/UoM/dialog-window/index.html @@ -20,14 +20,14 @@
- {{ 'codbex-uoms:codbex-uoms-model.t.UOM_NAME' | t }} + {{ 'codbex-uoms:codbex-uoms-model.t.UOM_NAME' | t }}
- {{ 'codbex-uoms:codbex-uoms-model.t.UOM_ISO' | t }} + {{ 'codbex-uoms:codbex-uoms-model.t.UOM_ISO' | t }}
- {{ 'codbex-uoms:codbex-uoms-model.t.UOM_DIMENSION' | t }} + {{ 'codbex-uoms:codbex-uoms-model.t.UOM_DIMENSION' | t }}
- {{ 'codbex-uoms:codbex-uoms-model.t.UOM_NUMERATOR' | t }} + {{ 'codbex-uoms:codbex-uoms-model.t.UOM_NUMERATOR' | t }}
@@ -112,13 +112,13 @@
- {{ 'codbex-uoms:codbex-uoms-model.t.UOM_DENOMINATOR' | t }} + {{ 'codbex-uoms:codbex-uoms-model.t.UOM_DENOMINATOR' | t }}
@@ -127,13 +127,13 @@
- {{ 'codbex-uoms:codbex-uoms-model.t.UOM_ROUNDING' | t }} + {{ 'codbex-uoms:codbex-uoms-model.t.UOM_ROUNDING' | t }}
From a6c8f62f81799e10c801c5657eb9038030fbe819 Mon Sep 17 00:00:00 2001 From: nedelcho-delchev-tues Date: Thu, 26 Feb 2026 21:00:14 +0200 Subject: [PATCH 2/3] Revisit property requirements and added checks for convert api From 2577dc35d1f9ae0e2f2dcdd86e42f70a9db2265c Mon Sep 17 00:00:00 2001 From: nedelcho-delchev-tues Date: Fri, 27 Feb 2026 10:07:39 +0200 Subject: [PATCH 3/3] Regenerate for new fields --- codbex-uoms/codbex-uoms.edm | 24 +++++++++---------- codbex-uoms/codbex-uoms.model | 12 ++++++++++ .../data/Settings/DimensionEntity.ts | 2 +- .../codbex-uoms/data/Settings/UoMEntity.ts | 2 +- .../Dimension/dialog-window/index.html | 4 ++-- .../ui/Settings/UoM/dialog-window/index.html | 16 ++++++------- 6 files changed, 36 insertions(+), 24 deletions(-) diff --git a/codbex-uoms/codbex-uoms.edm b/codbex-uoms/codbex-uoms.edm index 8175cb9..0ef370b 100644 --- a/codbex-uoms/codbex-uoms.edm +++ b/codbex-uoms/codbex-uoms.edm @@ -1,20 +1,20 @@ - - - + + + - - - - - - - - - + + + + + + + + + diff --git a/codbex-uoms/codbex-uoms.model b/codbex-uoms/codbex-uoms.model index 3e81d07..222e122 100644 --- a/codbex-uoms/codbex-uoms.model +++ b/codbex-uoms/codbex-uoms.model @@ -4,6 +4,7 @@ { "properties": [ { + "auditType": "NONE", "dataAutoIncrement": "true", "dataName": "DIMENSION_ID", "dataNullable": "true", @@ -18,6 +19,7 @@ "widgetType": "TEXTBOX" }, { + "auditType": "NONE", "dataLength": "100", "dataName": "DIMENSION_NAME", "dataNullable": "false", @@ -33,6 +35,7 @@ "widgetType": "TEXTBOX" }, { + "auditType": "NONE", "dataLength": "20", "dataName": "DIMENSION_SAP", "dataNullable": "true", @@ -79,6 +82,7 @@ { "properties": [ { + "auditType": "NONE", "dataAutoIncrement": "true", "dataName": "UOM_ID", "dataNullable": "true", @@ -93,6 +97,7 @@ "widgetType": "TEXTBOX" }, { + "auditType": "NONE", "dataLength": "100", "dataName": "UOM_NAME", "dataNullable": "false", @@ -108,6 +113,7 @@ "widgetType": "TEXTBOX" }, { + "auditType": "NONE", "dataLength": "20", "dataName": "UOM_ISO", "dataNullable": "false", @@ -123,6 +129,7 @@ "widgetType": "TEXTBOX" }, { + "auditType": "NONE", "dataName": "UOM_DIMENSION", "dataNullable": "false", "dataType": "INTEGER", @@ -142,6 +149,7 @@ "relationshipEntityPerspectiveLabel": "Entities" }, { + "auditType": "NONE", "dataLength": "20", "dataName": "UOM_SAP", "dataNullable": "true", @@ -160,6 +168,7 @@ "widgetType": "TEXTBOX" }, { + "auditType": "NONE", "dataName": "UOM_NUMERATOR", "dataNullable": "false", "dataType": "BIGINT", @@ -173,6 +182,7 @@ "widgetType": "NUMBER" }, { + "auditType": "NONE", "dataName": "UOM_DENOMINATOR", "dataNullable": "false", "dataType": "BIGINT", @@ -186,6 +196,7 @@ "widgetType": "NUMBER" }, { + "auditType": "NONE", "dataDefaultValue": "0", "dataName": "UOM_ROUNDING", "dataNullable": "false", @@ -200,6 +211,7 @@ "widgetType": "NUMBER" }, { + "auditType": "NONE", "dataDefaultValue": "false", "dataName": "UOM_BASE", "dataNullable": "false", diff --git a/codbex-uoms/gen/codbex-uoms/data/Settings/DimensionEntity.ts b/codbex-uoms/gen/codbex-uoms/data/Settings/DimensionEntity.ts index 80c22bf..6818844 100644 --- a/codbex-uoms/gen/codbex-uoms/data/Settings/DimensionEntity.ts +++ b/codbex-uoms/gen/codbex-uoms/data/Settings/DimensionEntity.ts @@ -1,4 +1,4 @@ -import { Entity, Table, Id, Generated, Column, Documentation } from '@aerokit/sdk/db' +import { Entity, Table, Id, Generated, Column, Documentation, CreatedAt, CreatedBy, UpdatedAt, UpdatedBy} from '@aerokit/sdk/db' @Entity('DimensionEntity') @Table('CODBEX_DIMENSION') diff --git a/codbex-uoms/gen/codbex-uoms/data/Settings/UoMEntity.ts b/codbex-uoms/gen/codbex-uoms/data/Settings/UoMEntity.ts index 4e60d33..164faa3 100644 --- a/codbex-uoms/gen/codbex-uoms/data/Settings/UoMEntity.ts +++ b/codbex-uoms/gen/codbex-uoms/data/Settings/UoMEntity.ts @@ -1,4 +1,4 @@ -import { Entity, Table, Id, Generated, Column, Documentation } from '@aerokit/sdk/db' +import { Entity, Table, Id, Generated, Column, Documentation, CreatedAt, CreatedBy, UpdatedAt, UpdatedBy} from '@aerokit/sdk/db' @Entity('UoMEntity') @Table('CODBEX_UOM') diff --git a/codbex-uoms/gen/codbex-uoms/ui/Settings/Dimension/dialog-window/index.html b/codbex-uoms/gen/codbex-uoms/ui/Settings/Dimension/dialog-window/index.html index f38efa7..21d692d 100644 --- a/codbex-uoms/gen/codbex-uoms/ui/Settings/Dimension/dialog-window/index.html +++ b/codbex-uoms/gen/codbex-uoms/ui/Settings/Dimension/dialog-window/index.html @@ -29,7 +29,7 @@ state="{{ forms.details['Name'].$valid ? '' : 'error' }}" ng-required="true" ng-model="entity.Name" - ng-readonly="action === 'select'" + ng-readonly="true" ng-maxlength="100.0" input-rules="{ patterns: [''] }" type="text" @@ -49,7 +49,7 @@ state="{{ forms.details['SAP'].$valid ? '' : 'error' }}" ng-required="false" ng-model="entity.SAP" - ng-readonly="action === 'select'" + ng-readonly="true" ng-maxlength="20.0" input-rules="{ patterns: [''] }" type="text" diff --git a/codbex-uoms/gen/codbex-uoms/ui/Settings/UoM/dialog-window/index.html b/codbex-uoms/gen/codbex-uoms/ui/Settings/UoM/dialog-window/index.html index 26c6ce5..f860774 100644 --- a/codbex-uoms/gen/codbex-uoms/ui/Settings/UoM/dialog-window/index.html +++ b/codbex-uoms/gen/codbex-uoms/ui/Settings/UoM/dialog-window/index.html @@ -29,7 +29,7 @@ state="{{ forms.details['Name'].$valid ? '' : 'error' }}" ng-required="true" ng-model="entity.Name" - ng-readonly="action === 'select'" + ng-readonly="true" ng-maxlength="100.0" input-rules="{ patterns: [''] }" type="text" @@ -49,7 +49,7 @@ state="{{ forms.details['ISO'].$valid ? '' : 'error' }}" ng-required="true" ng-model="entity.ISO" - ng-readonly="action === 'select'" + ng-readonly="true" ng-maxlength="20.0" input-rules="{ patterns: [''] }" type="text" @@ -68,7 +68,7 @@ state="{{ forms.details['Dimension'].$valid ? '' : 'error' }}" ng-required="true" ng-model="entity.Dimension" - is-readonly="action === 'select'" + is-readonly="true" dropdown-items="optionsDimension" placeholder="{{ 'codbex-uoms:codbex-uoms-model.messages.inputSearch' | t:{'name':'$t(codbex-uoms:codbex-uoms-model.t.UOM_DIMENSION)'} }}" btn-aria-label="{{ 'codbex-uoms:codbex-uoms-model.aria.showHide' | t:{'name':'Dimension'} }}" list-aria-label="{{ 'codbex-uoms:codbex-uoms-model.aria.options' | t:{'name':'Dimension'} }}"> @@ -86,7 +86,7 @@ state="{{ forms.details['SAP'].$valid ? '' : 'error' }}" ng-required="false" ng-model="entity.SAP" - ng-readonly="action === 'select'" + ng-readonly="true" ng-maxlength="20.0" input-rules="{ patterns: [''] }" type="text" @@ -105,7 +105,7 @@ state="{{ forms.details['Numerator'].$valid ? '' : 'error' }}" ng-required="true" ng-model="entity.Numerator" - is-readonly="action === 'select'" + is-readonly="true" placeholder="{{ 'codbex-uoms:codbex-uoms-model.messages.inputEnter' | t:{'name':'$t(codbex-uoms:codbex-uoms-model.t.UOM_NUMERATOR)'} }}">
@@ -120,7 +120,7 @@ state="{{ forms.details['Denominator'].$valid ? '' : 'error' }}" ng-required="true" ng-model="entity.Denominator" - is-readonly="action === 'select'" + is-readonly="true" placeholder="{{ 'codbex-uoms:codbex-uoms-model.messages.inputEnter' | t:{'name':'$t(codbex-uoms:codbex-uoms-model.t.UOM_DENOMINATOR)'} }}">
@@ -135,7 +135,7 @@ state="{{ forms.details['Rounding'].$valid ? '' : 'error' }}" ng-required="true" ng-model="entity.Rounding" - is-readonly="action === 'select'" + is-readonly="true" placeholder="{{ 'codbex-uoms:codbex-uoms-model.messages.inputEnter' | t:{'name':'$t(codbex-uoms:codbex-uoms-model.t.UOM_ROUNDING)'} }}">
@@ -146,7 +146,7 @@ {{ 'codbex-uoms:codbex-uoms-model.t.UOM_BASE' | t }}