rez_core 2.2.35 → 2.2.36

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.
@@ -6,7 +6,27 @@ export declare class StageController {
6
6
  user: any;
7
7
  }, body: {
8
8
  stage_group_id: number;
9
- }): Promise<import("../entity/stage.entity").Stage[]>;
9
+ }): Promise<{
10
+ name: string;
11
+ stage_group_id: number;
12
+ sequence: number;
13
+ description: string;
14
+ id: number;
15
+ entity_type: string;
16
+ status: string;
17
+ parent_type: string;
18
+ parent_id: number;
19
+ code: string;
20
+ created_by: number;
21
+ created_date: Date;
22
+ modified_by: number;
23
+ modified_date: Date;
24
+ enterprise_id: number;
25
+ organization_id: number;
26
+ appcode: string;
27
+ level_id: string;
28
+ level_type: string;
29
+ }[]>;
10
30
  getStagesWithGroupName(workflow_id: number, req: Request & {
11
31
  user: any;
12
32
  }): Promise<any>;
@@ -1,7 +1,28 @@
1
- import { Repository } from 'typeorm';
1
+ import { DataSource, Repository } from 'typeorm';
2
2
  import { Stage } from '../entity/stage.entity';
3
3
  export declare class StageRepository {
4
4
  private readonly stageRepository;
5
- constructor(stageRepository: Repository<Stage>);
6
- getAllStage(stage_group_id: number, organization_id: number): Promise<Stage[]>;
5
+ private readonly dataSource;
6
+ constructor(stageRepository: Repository<Stage>, dataSource: DataSource);
7
+ getAllStage(stage_group_id: number, organization_id: number): Promise<{
8
+ name: string;
9
+ stage_group_id: number;
10
+ sequence: number;
11
+ description: string;
12
+ id: number;
13
+ entity_type: string;
14
+ status: string;
15
+ parent_type: string;
16
+ parent_id: number;
17
+ code: string;
18
+ created_by: number;
19
+ created_date: Date;
20
+ modified_by: number;
21
+ modified_date: Date;
22
+ enterprise_id: number;
23
+ organization_id: number;
24
+ appcode: string;
25
+ level_id: string;
26
+ level_type: string;
27
+ }[]>;
7
28
  }
@@ -18,13 +18,21 @@ const typeorm_1 = require("@nestjs/typeorm");
18
18
  const typeorm_2 = require("typeorm");
19
19
  const stage_entity_1 = require("../entity/stage.entity");
20
20
  let StageRepository = class StageRepository {
21
- constructor(stageRepository) {
21
+ constructor(stageRepository, dataSource) {
22
22
  this.stageRepository = stageRepository;
23
+ this.dataSource = dataSource;
23
24
  }
24
25
  async getAllStage(stage_group_id, organization_id) {
25
26
  if (!stage_group_id) {
26
27
  throw new common_1.BadRequestException('stage_group_id is required');
27
28
  }
29
+ const stageGroup = (await this.dataSource.manager.findOne('cr_wf_stage_group', {
30
+ where: { id: stage_group_id },
31
+ }));
32
+ if (!stageGroup) {
33
+ throw new common_1.NotFoundException('Stage group not found');
34
+ }
35
+ const stageGroupName = stageGroup.name;
28
36
  const result = await this.stageRepository.find({
29
37
  where: {
30
38
  stage_group_id,
@@ -37,13 +45,18 @@ let StageRepository = class StageRepository {
37
45
  if (!result || result.length === 0) {
38
46
  return [];
39
47
  }
40
- return result;
48
+ const updatedStages = result.map((stage) => ({
49
+ ...stage,
50
+ name: `${stageGroupName} - ${stage.name}`,
51
+ }));
52
+ return updatedStages;
41
53
  }
42
54
  };
43
55
  exports.StageRepository = StageRepository;
44
56
  exports.StageRepository = StageRepository = __decorate([
45
57
  (0, common_1.Injectable)(),
46
58
  __param(0, (0, typeorm_1.InjectRepository)(stage_entity_1.Stage)),
47
- __metadata("design:paramtypes", [typeorm_2.Repository])
59
+ __metadata("design:paramtypes", [typeorm_2.Repository,
60
+ typeorm_2.DataSource])
48
61
  ], StageRepository);
49
62
  //# sourceMappingURL=stage.repository.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stage.repository.js","sourceRoot":"","sources":["../../../../src/module/workflow/repository/stage.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAKwB;AAExB,6CAAmD;AACnD,qCAAqC;AACrC,yDAA+C;AAGxC,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,YAEmB,eAAkC;QAAlC,oBAAe,GAAf,eAAe,CAAmB;IAClD,CAAC;IAEJ,KAAK,CAAC,WAAW,CAAC,cAAsB,EAAE,eAAuB;QAC/D,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,MAAM,IAAI,4BAAmB,CAAC,4BAA4B,CAAC,CAAC;QAC9D,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC;YAC7C,KAAK,EAAE;gBACL,cAAc;gBACd,eAAe;aAChB;YACD,KAAK,EAAE;gBACL,QAAQ,EAAE,KAAK;aAChB;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACnC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAA;AA3BY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,oBAAK,CAAC,CAAA;qCACU,oBAAU;GAHnC,eAAe,CA2B3B"}
1
+ {"version":3,"file":"stage.repository.js","sourceRoot":"","sources":["../../../../src/module/workflow/repository/stage.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAKwB;AAExB,6CAAmD;AACnD,qCAAiD;AACjD,yDAA+C;AAGxC,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,YAEmB,eAAkC,EAClC,UAAsB;QADtB,oBAAe,GAAf,eAAe,CAAmB;QAClC,eAAU,GAAV,UAAU,CAAY;IACtC,CAAC;IAEJ,KAAK,CAAC,WAAW,CAAC,cAAsB,EAAE,eAAuB;QAC/D,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,MAAM,IAAI,4BAAmB,CAAC,4BAA4B,CAAC,CAAC;QAC9D,CAAC;QAGD,MAAM,UAAU,GAAG,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,CACvD,mBAAmB,EACnB;YACE,KAAK,EAAE,EAAE,EAAE,EAAE,cAAc,EAAE;SAC9B,CACF,CAAe,CAAC;QAEjB,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,0BAAiB,CAAC,uBAAuB,CAAC,CAAC;QACvD,CAAC;QAED,MAAM,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;QAGvC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC;YAC7C,KAAK,EAAE;gBACL,cAAc;gBACd,eAAe;aAChB;YACD,KAAK,EAAE;gBACL,QAAQ,EAAE,KAAK;aAChB;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACnC,OAAO,EAAE,CAAC;QACZ,CAAC;QAGD,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YAC3C,GAAG,KAAK;YACR,IAAI,EAAE,GAAG,cAAc,MAAM,KAAK,CAAC,IAAI,EAAE;SAC1C,CAAC,CAAC,CAAC;QAEJ,OAAO,aAAa,CAAC;IACvB,CAAC;CACF,CAAA;AAjDY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,oBAAK,CAAC,CAAA;qCACU,oBAAU;QACf,oBAAU;GAJ9B,eAAe,CAiD3B"}
@@ -11,7 +11,27 @@ export declare class StageService extends EntityServiceImpl {
11
11
  private readonly dataSource;
12
12
  private readonly actionService;
13
13
  constructor(stageRepository: StageRepository, stageGroupRepository: StageGroupRepository, dataSource: DataSource, actionService: ActionService);
14
- getAllStage(stage_group_id: number, organization_id: number): Promise<import("../entity/stage.entity").Stage[]>;
14
+ getAllStage(stage_group_id: number, organization_id: number): Promise<{
15
+ name: string;
16
+ stage_group_id: number;
17
+ sequence: number;
18
+ description: string;
19
+ id: number;
20
+ entity_type: string;
21
+ status: string;
22
+ parent_type: string;
23
+ parent_id: number;
24
+ code: string;
25
+ created_by: number;
26
+ created_date: Date;
27
+ modified_by: number;
28
+ modified_date: Date;
29
+ enterprise_id: number;
30
+ organization_id: number;
31
+ appcode: string;
32
+ level_id: string;
33
+ level_type: string;
34
+ }[]>;
15
35
  updateEntity(entityData: BaseEntity, loggedInUser: UserData): Promise<any>;
16
36
  getEntityData(entityType: string, id: number, loggedInUser?: UserData): Promise<BaseEntity | null>;
17
37
  deleteEntity(entityType: string, id: number, loggedInUser: UserData): Promise<any>;