rez_core 6.5.89 → 6.5.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module/meta/controller/attribute-master.controller.d.ts +2 -2
- package/dist/module/meta/controller/attribute-master.controller.js +2 -2
- package/dist/module/meta/controller/attribute-master.controller.js.map +1 -1
- package/dist/module/meta/service/attribute-master.service.js +7 -7
- package/dist/module/meta/service/attribute-master.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/meta/controller/attribute-master.controller.ts +9 -11
- package/src/module/meta/service/attribute-master.service.ts +7 -7
package/package.json
CHANGED
|
@@ -26,11 +26,10 @@ export class AttributeMasterController {
|
|
|
26
26
|
@Req() req: Request & { user: any },
|
|
27
27
|
) {
|
|
28
28
|
const loggedInUser = req.user.userData;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return true
|
|
29
|
+
return await this.attributeMasterService.createAttribute(
|
|
30
|
+
attributeData,
|
|
31
|
+
loggedInUser,
|
|
32
|
+
);
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
|
|
@@ -42,12 +41,11 @@ export class AttributeMasterController {
|
|
|
42
41
|
@Req() req: Request & { user: any },
|
|
43
42
|
) {
|
|
44
43
|
const loggedInUser = req.user.userData;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return true
|
|
44
|
+
return await this.attributeMasterService.updateAttribute(
|
|
45
|
+
attributeData,
|
|
46
|
+
id,
|
|
47
|
+
loggedInUser,
|
|
48
|
+
);
|
|
51
49
|
}
|
|
52
50
|
|
|
53
51
|
@Get('getById/:id')
|
|
@@ -42,7 +42,7 @@ export class AttributeMasterService {
|
|
|
42
42
|
const createdAttr = await this.entityServiceImpl.createEntity(entityData, loggedInUser);
|
|
43
43
|
|
|
44
44
|
// Only create DB column if attribute storage_type is DB_COL
|
|
45
|
-
if (entityData.storage_type === AttributeStorageType.DB_COL && loggedInUser) {
|
|
45
|
+
if (entityData.storage_type.toLowerCase === AttributeStorageType.DB_COL.toLowerCase && loggedInUser) {
|
|
46
46
|
// Get the table name and storage type from entity_master
|
|
47
47
|
const entityInfo = await this.attributeMasterRepository.getTableNameByEntityType(
|
|
48
48
|
entityData.mapped_entity_type,
|
|
@@ -118,8 +118,8 @@ export class AttributeMasterService {
|
|
|
118
118
|
// Only perform column operations if entity storage_type is SELF
|
|
119
119
|
if (entityInfo.storageType === StorageType.SELF) {
|
|
120
120
|
// Case 1: Storage type changed from EAV to DB_COL - add column
|
|
121
|
-
if (entityData.storage_type === AttributeStorageType.DB_COL &&
|
|
122
|
-
existingAttr.storage_type === AttributeStorageType.EAV) {
|
|
121
|
+
if (entityData.storage_type.toLowerCase() === AttributeStorageType.DB_COL.toLowerCase() &&
|
|
122
|
+
existingAttr.storage_type.toLowerCase === AttributeStorageType.EAV.toLowerCase) {
|
|
123
123
|
const columnType = getDbColumnType(
|
|
124
124
|
entityData.element_type || existingAttr.element_type,
|
|
125
125
|
entityData.db_length || existingAttr.db_length
|
|
@@ -139,8 +139,8 @@ export class AttributeMasterService {
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
// Case 2: Storage type changed from DB_COL to EAV - drop column
|
|
142
|
-
else if (entityData.storage_type === AttributeStorageType.EAV &&
|
|
143
|
-
existingAttr.storage_type === AttributeStorageType.DB_COL) {
|
|
142
|
+
else if (entityData.storage_type.toLowerCase === AttributeStorageType.EAV.toLowerCase &&
|
|
143
|
+
existingAttr.storage_type.toLowerCase === AttributeStorageType.DB_COL.toLowerCase) {
|
|
144
144
|
const columnExists = await this.attributeMasterRepository.checkIfColumnExists(
|
|
145
145
|
entityInfo.tableName,
|
|
146
146
|
existingAttr.attribute_key,
|
|
@@ -155,8 +155,8 @@ export class AttributeMasterService {
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
// Case 3: Element type or db_length changed while storage_type is DB_COL - alter column type
|
|
158
|
-
else if (entityData.storage_type === AttributeStorageType.DB_COL &&
|
|
159
|
-
existingAttr.storage_type === AttributeStorageType.DB_COL &&
|
|
158
|
+
else if (entityData.storage_type.toLowerCase === AttributeStorageType.DB_COL.toLowerCase &&
|
|
159
|
+
existingAttr.storage_type.toLowerCase === AttributeStorageType.DB_COL.toLowerCase &&
|
|
160
160
|
(
|
|
161
161
|
(entityData.element_type && entityData.element_type !== existingAttr.element_type) ||
|
|
162
162
|
(entityData.db_length && entityData.db_length !== existingAttr.db_length)
|