rez_core 6.5.78 → 6.5.80
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/listmaster/service/list-master-item.service.js +42 -14
- package/dist/module/listmaster/service/list-master-item.service.js.map +1 -1
- package/dist/module/meta/controller/entity.controller.js +3 -1
- package/dist/module/meta/controller/entity.controller.js.map +1 -1
- package/dist/module/meta/service/entity-master.service.d.ts +5 -2
- package/dist/module/meta/service/entity-master.service.js +9 -6
- package/dist/module/meta/service/entity-master.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/listmaster/service/list-master-item.service.ts +61 -19
- package/src/module/meta/controller/entity.controller.ts +4 -3
- package/src/module/meta/service/entity-master.service.ts +9 -4
- package/.claude/settings.local.json +0 -26
- package/.idea/250218_nodejs_core.iml +0 -9
- package/.idea/codeStyles/Project.xml +0 -59
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/copilot.data.migration.agent.xml +0 -6
- package/.idea/copilot.data.migration.ask.xml +0 -6
- package/.idea/copilot.data.migration.ask2agent.xml +0 -6
- package/.idea/copilot.data.migration.edit.xml +0 -6
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/misc.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/prettier.xml +0 -6
- package/.idea/vcs.xml +0 -6
- package/server.log +0 -850
package/package.json
CHANGED
|
@@ -67,41 +67,83 @@ export class ListMasterItemService extends EntityServiceImpl {
|
|
|
67
67
|
const item = items[i];
|
|
68
68
|
const name = item.name?.trim();
|
|
69
69
|
const code = item.code?.trim();
|
|
70
|
+
const itemId = item.id;
|
|
70
71
|
|
|
71
72
|
try {
|
|
72
73
|
if (!name) {
|
|
73
74
|
throw new BadRequestException(`name is missing at index ${i}`);
|
|
74
75
|
}
|
|
75
|
-
|
|
76
|
-
//
|
|
76
|
+
|
|
77
|
+
// Check if this is an update (item has an id)
|
|
78
|
+
let existingItem;
|
|
79
|
+
if (itemId) {
|
|
80
|
+
existingItem = await this.listItemsRepo.findOneByCondition({
|
|
81
|
+
id: itemId,
|
|
82
|
+
listtype: listType,
|
|
83
|
+
enterprise_id: entId,
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
if (!existingItem) {
|
|
87
|
+
throw new BadRequestException(
|
|
88
|
+
`list item with id ${itemId} not found`,
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Check for duplicate name (excluding current item if updating)
|
|
77
94
|
const nameExists = await this.listItemsRepo.findOneByCondition({
|
|
78
95
|
name,
|
|
79
96
|
listtype: listType,
|
|
80
97
|
enterprise_id: entId,
|
|
81
98
|
});
|
|
82
99
|
|
|
83
|
-
|
|
84
|
-
code,
|
|
85
|
-
listtype: listType,
|
|
86
|
-
enterprise_id: entId,
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
if (nameExists || codeExists) {
|
|
100
|
+
if (nameExists && (!itemId || nameExists.id !== itemId)) {
|
|
90
101
|
throw new BadRequestException(
|
|
91
|
-
`list item with name ${name}
|
|
102
|
+
`list item with name ${name} already exists`,
|
|
92
103
|
);
|
|
93
104
|
}
|
|
94
105
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
code: code,
|
|
106
|
+
// Check for duplicate code (excluding current item if updating)
|
|
107
|
+
if (code) {
|
|
108
|
+
const codeExists = await this.listItemsRepo.findOneByCondition({
|
|
109
|
+
code,
|
|
100
110
|
listtype: listType,
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
111
|
+
enterprise_id: entId,
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
if (codeExists && (!itemId || codeExists.id !== itemId)) {
|
|
115
|
+
throw new BadRequestException(
|
|
116
|
+
`list item with code ${code} already exists`,
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Update or Create
|
|
122
|
+
if (existingItem) {
|
|
123
|
+
// Update path
|
|
124
|
+
await this.updateEntity(
|
|
125
|
+
{
|
|
126
|
+
...item,
|
|
127
|
+
id: itemId,
|
|
128
|
+
name,
|
|
129
|
+
code: code || existingItem.code,
|
|
130
|
+
listtype: listType,
|
|
131
|
+
},
|
|
132
|
+
loggedInUser,
|
|
133
|
+
);
|
|
134
|
+
} else {
|
|
135
|
+
// Creation path
|
|
136
|
+
await this.createEntity(
|
|
137
|
+
{
|
|
138
|
+
...item,
|
|
139
|
+
name,
|
|
140
|
+
code: code,
|
|
141
|
+
listtype: listType,
|
|
142
|
+
value: '',
|
|
143
|
+
},
|
|
144
|
+
loggedInUser,
|
|
145
|
+
);
|
|
146
|
+
}
|
|
105
147
|
} catch (error) {
|
|
106
148
|
errors.push({
|
|
107
149
|
row: i,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
Post,
|
|
11
11
|
Query,
|
|
12
12
|
Req,
|
|
13
|
-
Request,
|
|
13
|
+
Request, UseGuards,
|
|
14
14
|
} from '@nestjs/common';
|
|
15
15
|
import { EntityServiceImpl } from '../service/entity-service-impl.service';
|
|
16
16
|
import { ReflectionHelper } from '../../../utils/service/reflection-helper.service';
|
|
@@ -20,8 +20,9 @@ import { UserData } from '../../user/entity/user.entity';
|
|
|
20
20
|
import {
|
|
21
21
|
WorkflowAutomationEngineService,
|
|
22
22
|
} from 'src/module/workflow-automation/service/workflow-automation-engine.service';
|
|
23
|
+
import { JwtAuthGuard } from '../../auth/guards/jwt.guard';
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
@UseGuards(JwtAuthGuard)
|
|
25
26
|
@Controller('entity')
|
|
26
27
|
export class EntityController {
|
|
27
28
|
constructor(
|
|
@@ -134,7 +135,7 @@ export class EntityController {
|
|
|
134
135
|
@Query('entity_type') entityType: string,
|
|
135
136
|
@Req() req: Request & { user: any },
|
|
136
137
|
) {
|
|
137
|
-
const loggedInUser = req.user
|
|
138
|
+
const loggedInUser = req.user.userData;
|
|
138
139
|
|
|
139
140
|
if (!entityType) {
|
|
140
141
|
throw new BadRequestException(
|
|
@@ -9,24 +9,29 @@ import { AttributeMasterRepository } from '../repository/attribute-master.reposi
|
|
|
9
9
|
import { StorageType } from '../../../constant/storage-type.constant';
|
|
10
10
|
import { BaseEntity } from '../entity/base-entity.entity';
|
|
11
11
|
import { UserData } from '../../user/entity/user.entity';
|
|
12
|
-
import {
|
|
12
|
+
import { ConfigService } from '@nestjs/config';
|
|
13
|
+
import { EntityServiceImpl } from './entity-service-impl.service';
|
|
13
14
|
|
|
14
15
|
@Injectable()
|
|
15
16
|
export class EntityMasterService {
|
|
17
|
+
schema: string|undefined;
|
|
16
18
|
constructor(
|
|
17
19
|
@InjectRepository(EntityMaster)
|
|
18
20
|
private entityMasterRepository: Repository<EntityMaster>,
|
|
19
21
|
private attributeMasterRepo: AttributeMasterRepository,
|
|
20
22
|
private entityMasterRepo: EntityMasterRepository,
|
|
21
23
|
private readonly dataSource: DataSource,
|
|
22
|
-
|
|
23
|
-
private readonly entityService: EntityDynamicService,
|
|
24
|
+
private readonly entityService: EntityServiceImpl,
|
|
24
25
|
@Inject('ListMasterService')
|
|
25
26
|
private readonly listMasterService: ListMasterService,
|
|
26
27
|
private readonly savedFilterRepoService: SavedFilterRepositoryService,
|
|
28
|
+
private readonly configService: ConfigService
|
|
27
29
|
) {
|
|
30
|
+
this.schema = this.configService.get('DB_SCHEMA');
|
|
28
31
|
}
|
|
29
32
|
|
|
33
|
+
|
|
34
|
+
|
|
30
35
|
/**
|
|
31
36
|
* Override createEntity to add dynamic table creation for SELF storage type
|
|
32
37
|
*/
|
|
@@ -105,7 +110,7 @@ export class EntityMasterService {
|
|
|
105
110
|
|
|
106
111
|
// Create table with all BaseEntity columns
|
|
107
112
|
const createTableQuery = `
|
|
108
|
-
CREATE TABLE ${tableName} (
|
|
113
|
+
CREATE TABLE ${this.schema}.${tableName} (
|
|
109
114
|
id BIGSERIAL PRIMARY KEY,
|
|
110
115
|
entity_type VARCHAR(50),
|
|
111
116
|
code VARCHAR(100),
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"permissions": {
|
|
3
|
-
"allow": [
|
|
4
|
-
"Bash(npm run build:*)",
|
|
5
|
-
"Bash(npm install)",
|
|
6
|
-
"Bash(npm run lint)",
|
|
7
|
-
"Bash(npm install:*)",
|
|
8
|
-
"Bash(curl:*)",
|
|
9
|
-
"Bash(npm run start:dev:*)",
|
|
10
|
-
"Bash(mkdir:*)",
|
|
11
|
-
"Bash(lsof:*)",
|
|
12
|
-
"Bash(kill:*)",
|
|
13
|
-
"Bash(npx eslint:*)",
|
|
14
|
-
"Read(/Users/admin/yash/**)",
|
|
15
|
-
"Bash(timeout 15 npm run start:dev)",
|
|
16
|
-
"Read(/Users/admin/yash/**)",
|
|
17
|
-
"Bash(find:*)",
|
|
18
|
-
"Bash(sed:*)",
|
|
19
|
-
"Bash(git checkout:*)",
|
|
20
|
-
"Read(//Users/admin/yash/**)",
|
|
21
|
-
"Bash(npx tsc:*)"
|
|
22
|
-
],
|
|
23
|
-
"deny": [],
|
|
24
|
-
"ask": []
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="JAVA_MODULE" version="4">
|
|
3
|
-
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
4
|
-
<exclude-output />
|
|
5
|
-
<content url="file://$MODULE_DIR$" />
|
|
6
|
-
<orderEntry type="inheritedJdk" />
|
|
7
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
|
8
|
-
</component>
|
|
9
|
-
</module>
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
<component name="ProjectCodeStyleConfiguration">
|
|
2
|
-
<code_scheme name="Project" version="173">
|
|
3
|
-
<HTMLCodeStyleSettings>
|
|
4
|
-
<option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
|
|
5
|
-
</HTMLCodeStyleSettings>
|
|
6
|
-
<JSCodeStyleSettings version="0">
|
|
7
|
-
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
8
|
-
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
9
|
-
<option name="USE_DOUBLE_QUOTES" value="false" />
|
|
10
|
-
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
11
|
-
<option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
|
|
12
|
-
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
13
|
-
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
14
|
-
</JSCodeStyleSettings>
|
|
15
|
-
<TypeScriptCodeStyleSettings version="0">
|
|
16
|
-
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
17
|
-
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
18
|
-
<option name="USE_DOUBLE_QUOTES" value="false" />
|
|
19
|
-
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
20
|
-
<option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
|
|
21
|
-
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
22
|
-
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
23
|
-
</TypeScriptCodeStyleSettings>
|
|
24
|
-
<VueCodeStyleSettings>
|
|
25
|
-
<option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
|
|
26
|
-
<option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
|
|
27
|
-
</VueCodeStyleSettings>
|
|
28
|
-
<codeStyleSettings language="HTML">
|
|
29
|
-
<option name="SOFT_MARGINS" value="80" />
|
|
30
|
-
<indentOptions>
|
|
31
|
-
<option name="INDENT_SIZE" value="2" />
|
|
32
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
33
|
-
<option name="TAB_SIZE" value="2" />
|
|
34
|
-
</indentOptions>
|
|
35
|
-
</codeStyleSettings>
|
|
36
|
-
<codeStyleSettings language="JavaScript">
|
|
37
|
-
<option name="SOFT_MARGINS" value="80" />
|
|
38
|
-
<indentOptions>
|
|
39
|
-
<option name="INDENT_SIZE" value="2" />
|
|
40
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
41
|
-
<option name="TAB_SIZE" value="2" />
|
|
42
|
-
</indentOptions>
|
|
43
|
-
</codeStyleSettings>
|
|
44
|
-
<codeStyleSettings language="TypeScript">
|
|
45
|
-
<option name="SOFT_MARGINS" value="80" />
|
|
46
|
-
<indentOptions>
|
|
47
|
-
<option name="INDENT_SIZE" value="2" />
|
|
48
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
49
|
-
<option name="TAB_SIZE" value="2" />
|
|
50
|
-
</indentOptions>
|
|
51
|
-
</codeStyleSettings>
|
|
52
|
-
<codeStyleSettings language="Vue">
|
|
53
|
-
<option name="SOFT_MARGINS" value="80" />
|
|
54
|
-
<indentOptions>
|
|
55
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
56
|
-
</indentOptions>
|
|
57
|
-
</codeStyleSettings>
|
|
58
|
-
</code_scheme>
|
|
59
|
-
</component>
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<component name="InspectionProjectProfileManager">
|
|
2
|
-
<profile version="1.0">
|
|
3
|
-
<option name="myName" value="Project Default" />
|
|
4
|
-
<inspection_tool class="SqlNoDataSourceInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
5
|
-
</profile>
|
|
6
|
-
</component>
|
package/.idea/misc.xml
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="21" project-jdk-type="JavaSDK">
|
|
4
|
-
<output url="file://$PROJECT_DIR$/out" />
|
|
5
|
-
</component>
|
|
6
|
-
</project>
|
package/.idea/modules.xml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ProjectModuleManager">
|
|
4
|
-
<modules>
|
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/250218_nodejs_core.iml" filepath="$PROJECT_DIR$/.idea/250218_nodejs_core.iml" />
|
|
6
|
-
</modules>
|
|
7
|
-
</component>
|
|
8
|
-
</project>
|
package/.idea/prettier.xml
DELETED