rez_core 2.2.43 → 2.2.46

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "2.2.43",
3
+ "version": "2.2.46",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -35,7 +35,7 @@ export class AttributeMaster extends BaseEntity {
35
35
  max_length: number;
36
36
 
37
37
  @Column({ name: 'required', nullable: true })
38
- required: number;
38
+ required: boolean;
39
39
 
40
40
  @Column({
41
41
  name: 'description',
@@ -60,7 +60,7 @@ export class AttributeMaster extends BaseEntity {
60
60
  category: string;
61
61
 
62
62
  @Column({ name: 'is_unique', nullable: true })
63
- is_unique: number;
63
+ is_unique: boolean;
64
64
 
65
65
  @Column({ name: 'data_source_attribute', nullable: true })
66
66
  data_source_attribute: string;
@@ -69,7 +69,7 @@ export class AttributeMaster extends BaseEntity {
69
69
  regex: string;
70
70
 
71
71
  @Column({ name: 'can_export', nullable: true })
72
- can_export: number;
72
+ can_export: boolean;
73
73
 
74
74
  @Column({ name: 'appcode', nullable: true })
75
75
  appcode: string;
@@ -42,9 +42,10 @@ export class ViewMasterService extends EntityServiceImpl {
42
42
 
43
43
  async updateEntity(
44
44
  entityData: ViewMaster,
45
- loggedInUserData: UserData | null,
45
+ loggedInUserData: UserData,
46
46
  ): Promise<BaseEntity> {
47
- return entityData;
47
+ const res = await super.updateEntity(entityData, loggedInUserData);
48
+ return res;
48
49
  }
49
50
 
50
51
  async getEntityJson(entityType: string, type: string) {
@@ -69,7 +70,7 @@ export class ViewMasterService extends EntityServiceImpl {
69
70
  entityType: string,
70
71
  id: number,
71
72
  loggedInUserData?: UserData | null,
72
- ) {
73
- return await super.getEntityData(entityType, id,loggedInUserData);
73
+ ) {
74
+ return await super.getEntityData(entityType, id, loggedInUserData);
74
75
  }
75
76
  }
@@ -89,7 +89,8 @@ export class StageGroupService extends EntityServiceImpl {
89
89
  stageMovementMap.set(movement.stage_id, movement);
90
90
  }
91
91
 
92
- // 6. Attach movement info to each stage
92
+ let foundInProgressGroup = false;
93
+
93
94
  for (const group of stageGroupAndStageHierarchy) {
94
95
  for (const stage of group.stages || []) {
95
96
  const movement = stageMovementMap.get(Number(stage.id));
@@ -105,7 +106,7 @@ export class StageGroupService extends EntityServiceImpl {
105
106
  : null;
106
107
  stage.time_spent = await this.calculateTimeSpent(
107
108
  movement.start_date,
108
- movement.end_date ?? new Date(), // fallback to current datetime
109
+ movement.end_date ?? new Date(),
109
110
  );
110
111
  } else {
111
112
  stage.is_current = false;
@@ -117,13 +118,24 @@ export class StageGroupService extends EntityServiceImpl {
117
118
  }
118
119
  }
119
120
 
120
- // 7. Set stage_group_status based on all its stages
121
- group.stage_group_status =
122
- group.stages && group.stages.length > 0
123
- ? group.stages.every((stage) => stage.is_done)
124
- ? 'COMPLETED'
125
- : 'IN_PROGRESS'
126
- : 'NOT_STARTED';
121
+ if (group.stages.length === 0) {
122
+ group.stage_group_status = 'TODO';
123
+ continue;
124
+ }
125
+
126
+ const allDone = group.stages.every((s) => s.is_done);
127
+ const noneStarted = group.stages.every(
128
+ (s) => !s.is_current && !s.is_done,
129
+ );
130
+
131
+ if (allDone) {
132
+ group.stage_group_status = 'COMPLETED';
133
+ } else if (!foundInProgressGroup && !noneStarted) {
134
+ group.stage_group_status = 'IN_PROGRESS';
135
+ foundInProgressGroup = true;
136
+ } else {
137
+ group.stage_group_status = 'TODO';
138
+ }
127
139
  }
128
140
 
129
141
  return stageGroupAndStageHierarchy;