@dirayaah/corporate-module 1.0.17
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/.prettierrc +4 -0
- package/README.md +93 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/jest.config.d.ts +0 -0
- package/dist/jest.config.js +10 -0
- package/dist/jest.config.js.map +1 -0
- package/dist/src/constants/corporates-options.d.ts +1 -0
- package/dist/src/constants/corporates-options.js +5 -0
- package/dist/src/constants/corporates-options.js.map +1 -0
- package/dist/src/constants/index.d.ts +1 -0
- package/dist/src/constants/index.js +6 -0
- package/dist/src/constants/index.js.map +1 -0
- package/dist/src/dto/base.dto.d.ts +7 -0
- package/dist/src/dto/base.dto.js +7 -0
- package/dist/src/dto/base.dto.js.map +1 -0
- package/dist/src/dto/corporate.dto.d.ts +8 -0
- package/dist/src/dto/corporate.dto.js +46 -0
- package/dist/src/dto/corporate.dto.js.map +1 -0
- package/dist/src/dto/index.d.ts +2 -0
- package/dist/src/dto/index.js +6 -0
- package/dist/src/dto/index.js.map +1 -0
- package/dist/src/dto/rel-corporate-user.dto.d.ts +0 -0
- package/dist/src/dto/rel-corporate-user.dto.js +1 -0
- package/dist/src/dto/rel-corporate-user.dto.js.map +1 -0
- package/dist/src/entities/base.entity.d.ts +7 -0
- package/dist/src/entities/base.entity.js +37 -0
- package/dist/src/entities/base.entity.js.map +1 -0
- package/dist/src/entities/corporate.entity.d.ts +10 -0
- package/dist/src/entities/corporate.entity.js +46 -0
- package/dist/src/entities/corporate.entity.js.map +1 -0
- package/dist/src/entities/index.d.ts +3 -0
- package/dist/src/entities/index.js +8 -0
- package/dist/src/entities/index.js.map +1 -0
- package/dist/src/entities/pagination.d.ts +19 -0
- package/dist/src/entities/pagination.js +58 -0
- package/dist/src/entities/pagination.js.map +1 -0
- package/dist/src/entities/rel-corporate-user.entity.d.ts +6 -0
- package/dist/src/entities/rel-corporate-user.entity.js +30 -0
- package/dist/src/entities/rel-corporate-user.entity.js.map +1 -0
- package/dist/src/enum/corporate-status.enum.d.ts +4 -0
- package/dist/src/enum/corporate-status.enum.js +9 -0
- package/dist/src/enum/corporate-status.enum.js.map +1 -0
- package/dist/src/enum/index.d.ts +1 -0
- package/dist/src/enum/index.js +6 -0
- package/dist/src/enum/index.js.map +1 -0
- package/dist/src/interfaces/corporates-options.interface.d.ts +6 -0
- package/dist/src/interfaces/corporates-options.interface.js +3 -0
- package/dist/src/interfaces/corporates-options.interface.js.map +1 -0
- package/dist/src/mappers/corporate.mapper.d.ts +6 -0
- package/dist/src/mappers/corporate.mapper.js +31 -0
- package/dist/src/mappers/corporate.mapper.js.map +1 -0
- package/dist/src/migrations/1756375671676-CreateRelCorporateUserTable.d.ts +6 -0
- package/dist/src/migrations/1756375671676-CreateRelCorporateUserTable.js +48 -0
- package/dist/src/migrations/1756375671676-CreateRelCorporateUserTable.js.map +1 -0
- package/dist/src/migrations/1756375695674-CreateCorporateTable.d.ts +6 -0
- package/dist/src/migrations/1756375695674-CreateCorporateTable.js +51 -0
- package/dist/src/migrations/1756375695674-CreateCorporateTable.js.map +1 -0
- package/dist/src/migrations/1756375696676-CreateRelCorporateParticipantTable.d.ts +6 -0
- package/dist/src/migrations/1756375696676-CreateRelCorporateParticipantTable.js +48 -0
- package/dist/src/migrations/1756375696676-CreateRelCorporateParticipantTable.js.map +1 -0
- package/dist/src/migrations/index.d.ts +4 -0
- package/dist/src/migrations/index.js +12 -0
- package/dist/src/migrations/index.js.map +1 -0
- package/dist/src/modules/corporate.module.d.ts +5 -0
- package/dist/src/modules/corporate.module.js +35 -0
- package/dist/src/modules/corporate.module.js.map +1 -0
- package/dist/src/repository/base.repository.d.ts +9 -0
- package/dist/src/repository/base.repository.js +29 -0
- package/dist/src/repository/base.repository.js.map +1 -0
- package/dist/src/repository/corporate.repository.d.ts +4 -0
- package/dist/src/repository/corporate.repository.js +8 -0
- package/dist/src/repository/corporate.repository.js.map +1 -0
- package/dist/src/repository/index.d.ts +1 -0
- package/dist/src/repository/index.js +18 -0
- package/dist/src/repository/index.js.map +1 -0
- package/dist/src/services/corporate.service.d.ts +22 -0
- package/dist/src/services/corporate.service.js +111 -0
- package/dist/src/services/corporate.service.js.map +1 -0
- package/dist/src/services/index.d.ts +2 -0
- package/dist/src/services/index.js +6 -0
- package/dist/src/services/index.js.map +1 -0
- package/dist/src/test/corporate-criteria.service.spec.d.ts +1 -0
- package/dist/src/test/corporate-criteria.service.spec.js +17 -0
- package/dist/src/test/corporate-criteria.service.spec.js.map +1 -0
- package/dist/src/utilities/index.d.ts +2 -0
- package/dist/src/utilities/index.js +6 -0
- package/dist/src/utilities/index.js.map +1 -0
- package/dist/src/utilities/migrations/get-base-columns.d.ts +2 -0
- package/dist/src/utilities/migrations/get-base-columns.js +34 -0
- package/dist/src/utilities/migrations/get-base-columns.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/index.ts +29 -0
- package/jest.config.ts +10 -0
- package/nest-cli.json +8 -0
- package/package.json +53 -0
- package/src/constants/corporates-options.ts +1 -0
- package/src/constants/index.ts +1 -0
- package/src/dto/base.dto.ts +14 -0
- package/src/dto/corporate.dto.ts +27 -0
- package/src/dto/index.ts +6 -0
- package/src/dto/rel-corporate-user.dto.ts +0 -0
- package/src/entities/base.entity.ts +23 -0
- package/src/entities/corporate.entity.ts +24 -0
- package/src/entities/index.ts +4 -0
- package/src/entities/pagination.ts +42 -0
- package/src/entities/rel-corporate-user.entity.ts +15 -0
- package/src/enum/corporate-status.enum.ts +4 -0
- package/src/enum/index.ts +1 -0
- package/src/interfaces/corporates-options.interface.ts +6 -0
- package/src/mappers/corporate.mapper.ts +36 -0
- package/src/migrations/1756375695674-CreateCorporateTable.ts +50 -0
- package/src/migrations/1756375696676-CreateRelCorporateParticipantTable.ts +48 -0
- package/src/migrations/index.ts +12 -0
- package/src/modules/corporate.module.ts +23 -0
- package/src/repository/base.repository.ts +42 -0
- package/src/repository/corporate.repository.ts +4 -0
- package/src/repository/index.ts +1 -0
- package/src/services/corporate.service.ts +142 -0
- package/src/services/index.ts +5 -0
- package/src/test/corporate-criteria.service.spec.ts +20 -0
- package/src/utilities/index.ts +5 -0
- package/src/utilities/migrations/get-base-columns.ts +32 -0
- package/tsconfig.build.json +4 -0
- package/tsconfig.json +21 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CorporateMapper = void 0;
|
|
4
|
+
const corporate_dto_1 = require("../dto/corporate.dto");
|
|
5
|
+
const entities_1 = require("../entities");
|
|
6
|
+
class CorporateMapper {
|
|
7
|
+
static fromDTOToEntity(corporateDto) {
|
|
8
|
+
if (!corporateDto) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
let corporateEntity = new entities_1.CorporateEntity();
|
|
12
|
+
const fields = Object.getOwnPropertyNames(corporateDto);
|
|
13
|
+
fields.forEach((field) => {
|
|
14
|
+
corporateEntity[field] = corporateDto[field];
|
|
15
|
+
});
|
|
16
|
+
return corporateEntity;
|
|
17
|
+
}
|
|
18
|
+
static fromEntityToDTO(entity) {
|
|
19
|
+
if (!entity) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
let entityDTO = new corporate_dto_1.CorporateDto();
|
|
23
|
+
const fields = Object.getOwnPropertyNames(entity);
|
|
24
|
+
fields.forEach((field) => {
|
|
25
|
+
entityDTO[field] = entity[field];
|
|
26
|
+
});
|
|
27
|
+
return entityDTO;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.CorporateMapper = CorporateMapper;
|
|
31
|
+
//# sourceMappingURL=corporate.mapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"corporate.mapper.js","sourceRoot":"","sources":["../../../src/mappers/corporate.mapper.ts"],"names":[],"mappings":";;;AAAA,wDAAoD;AACpD,0CAA8C;AAE9C,MAAa,eAAe;IAE1B,MAAM,CAAC,eAAe,CAAC,YAA0B;QAC/C,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,OAAO;QACT,CAAC;QACD,IAAI,eAAe,GAAG,IAAI,0BAAe,EAAE,CAAC;QAG5C,MAAM,MAAM,GAAG,MAAM,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;QAExD,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACvB,eAAe,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;QAEH,OAAO,eAAe,CAAC;IACzB,CAAC;IAED,MAAM,CAAC,eAAe,CAAC,MAAuB;QAC5C,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO;QACT,CAAC;QACD,IAAI,SAAS,GAAG,IAAI,4BAAY,EAAE,CAAC;QAEnC,MAAM,MAAM,GAAG,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;QAElD,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACvB,SAAS,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;QAEH,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAhCD,0CAgCC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
|
+
export declare class CreateRelCorporateUserTable1756375671676 implements MigrationInterface {
|
|
3
|
+
private readonly table;
|
|
4
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
5
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateRelCorporateUserTable1756375671676 = void 0;
|
|
4
|
+
const utilities_1 = require("../utilities");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
class CreateRelCorporateUserTable1756375671676 {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.table = 'rel_corporate_participant';
|
|
9
|
+
}
|
|
10
|
+
async up(queryRunner) {
|
|
11
|
+
const [idColumn, ...otherBaseColumns] = utilities_1.baseColumns;
|
|
12
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
|
13
|
+
name: this.table,
|
|
14
|
+
columns: [
|
|
15
|
+
idColumn,
|
|
16
|
+
{
|
|
17
|
+
name: 'corporateId',
|
|
18
|
+
type: 'int4',
|
|
19
|
+
isNullable: false,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'participantId',
|
|
23
|
+
type: 'int4',
|
|
24
|
+
isNullable: false,
|
|
25
|
+
},
|
|
26
|
+
...otherBaseColumns,
|
|
27
|
+
],
|
|
28
|
+
foreignKeys: [
|
|
29
|
+
{
|
|
30
|
+
name: `fk_${this.table}_corporate`,
|
|
31
|
+
columnNames: ['corporateId'],
|
|
32
|
+
referencedTableName: 'corporate',
|
|
33
|
+
referencedColumnNames: ['id'],
|
|
34
|
+
onDelete: 'CASCADE',
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
uniques: [
|
|
38
|
+
{
|
|
39
|
+
name: `UQ_${this.table}_corporateId_participantId`,
|
|
40
|
+
columnNames: ['corporateId', 'participantId'],
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
}), false);
|
|
44
|
+
}
|
|
45
|
+
async down(queryRunner) { }
|
|
46
|
+
}
|
|
47
|
+
exports.CreateRelCorporateUserTable1756375671676 = CreateRelCorporateUserTable1756375671676;
|
|
48
|
+
//# sourceMappingURL=1756375671676-CreateRelCorporateUserTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1756375671676-CreateRelCorporateUserTable.js","sourceRoot":"","sources":["../../../src/migrations/1756375671676-CreateRelCorporateUserTable.ts"],"names":[],"mappings":";;;AAAA,4CAA2C;AAC3C,qCAAiE;AAEjE,MAAa,wCAAwC;IAArD;QAGmB,UAAK,GAAG,2BAA2B,CAAC;IAyCvD,CAAC;IAxCQ,KAAK,CAAC,EAAE,CAAC,WAAwB;QACtC,MAAM,CAAC,QAAQ,EAAE,GAAG,gBAAgB,CAAC,GAAG,uBAAW,CAAC;QACpD,MAAM,WAAW,CAAC,WAAW,CAC3B,IAAI,eAAK,CAAC;YACR,IAAI,EAAE,IAAI,CAAC,KAAK;YAChB,OAAO,EAAE;gBACP,QAAQ;gBACR;oBACE,IAAI,EAAE,aAAa;oBACnB,IAAI,EAAE,MAAM;oBACZ,UAAU,EAAE,KAAK;iBAClB;gBACD;oBACE,IAAI,EAAE,eAAe;oBACrB,IAAI,EAAE,MAAM;oBACZ,UAAU,EAAE,KAAK;iBAClB;gBACD,GAAG,gBAAgB;aACpB;YACD,WAAW,EAAE;gBACX;oBACE,IAAI,EAAE,MAAM,IAAI,CAAC,KAAK,YAAY;oBAClC,WAAW,EAAE,CAAC,aAAa,CAAC;oBAC5B,mBAAmB,EAAE,WAAW;oBAChC,qBAAqB,EAAE,CAAC,IAAI,CAAC;oBAC7B,QAAQ,EAAE,SAAS;iBACpB;aACF;YACD,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM,IAAI,CAAC,KAAK,4BAA4B;oBAClD,WAAW,EAAE,CAAC,aAAa,EAAE,eAAe,CAAC;iBAC9C;aACF;SACF,CAAC,EACF,KAAK,CACN,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB,IAAkB,CAAC;CAC9D;AA5CD,4FA4CC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
|
+
export declare class CreateCorporateTable1756375695674 implements MigrationInterface {
|
|
3
|
+
private readonly table;
|
|
4
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
5
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateCorporateTable1756375695674 = void 0;
|
|
4
|
+
const utilities_1 = require("../utilities");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
class CreateCorporateTable1756375695674 {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.table = 'corporate';
|
|
9
|
+
}
|
|
10
|
+
async up(queryRunner) {
|
|
11
|
+
const [idColumn, ...otherBaseColumns] = utilities_1.baseColumns;
|
|
12
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
|
13
|
+
name: this.table,
|
|
14
|
+
columns: [
|
|
15
|
+
idColumn,
|
|
16
|
+
{
|
|
17
|
+
name: 'name',
|
|
18
|
+
type: 'varchar',
|
|
19
|
+
isNullable: false,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'managerId',
|
|
23
|
+
type: 'int4',
|
|
24
|
+
isNullable: false,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'email',
|
|
28
|
+
type: 'varchar',
|
|
29
|
+
isNullable: true,
|
|
30
|
+
isUnique: true,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'status',
|
|
34
|
+
type: 'varchar',
|
|
35
|
+
isNullable: false,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'max_participants_count',
|
|
39
|
+
type: 'int4',
|
|
40
|
+
isNullable: true,
|
|
41
|
+
},
|
|
42
|
+
...otherBaseColumns,
|
|
43
|
+
],
|
|
44
|
+
}), false);
|
|
45
|
+
}
|
|
46
|
+
async down(queryRunner) {
|
|
47
|
+
await queryRunner.dropTable(this.table, true, true, true);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.CreateCorporateTable1756375695674 = CreateCorporateTable1756375695674;
|
|
51
|
+
//# sourceMappingURL=1756375695674-CreateCorporateTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1756375695674-CreateCorporateTable.js","sourceRoot":"","sources":["../../../src/migrations/1756375695674-CreateCorporateTable.ts"],"names":[],"mappings":";;;AAAA,4CAA2C;AAC3C,qCAAiE;AAGjE,MAAa,iCAAiC;IAA9C;QACmB,UAAK,GAAG,WAAW,CAAC;IA4CvC,CAAC;IA3CQ,KAAK,CAAC,EAAE,CAAC,WAAwB;QACtC,MAAM,CAAC,QAAQ,EAAE,GAAG,gBAAgB,CAAC,GAAG,uBAAW,CAAC;QACpD,MAAM,WAAW,CAAC,WAAW,CAC3B,IAAI,eAAK,CAAC;YACR,IAAI,EAAE,IAAI,CAAC,KAAK;YAChB,OAAO,EAAE;gBACP,QAAQ;gBACR;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,SAAS;oBACf,UAAU,EAAE,KAAK;iBAClB;gBACD;oBACE,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,MAAM;oBACZ,UAAU,EAAE,KAAK;iBAClB;gBACD;oBACE,IAAI,EAAE,OAAO;oBACb,IAAI,EAAE,SAAS;oBACf,UAAU,EAAE,IAAI;oBAChB,QAAQ,EAAE,IAAI;iBACf;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,SAAS;oBACf,UAAU,EAAE,KAAK;iBAClB;gBACD;oBACE,IAAI,EAAE,wBAAwB;oBAC9B,IAAI,EAAE,MAAM;oBACZ,UAAU,EAAE,IAAI;iBACjB;gBACD,GAAG,gBAAgB;aACpB;SACF,CAAC,EACF,KAAK,CACN,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACxC,MAAM,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC5D,CAAC;CACF;AA7CD,8EA6CC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
|
+
export declare class CreateRelCorporateParticipantTable1756375696676 implements MigrationInterface {
|
|
3
|
+
private readonly table;
|
|
4
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
5
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateRelCorporateParticipantTable1756375696676 = void 0;
|
|
4
|
+
const utilities_1 = require("../utilities");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
class CreateRelCorporateParticipantTable1756375696676 {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.table = 'rel_corporate_participant';
|
|
9
|
+
}
|
|
10
|
+
async up(queryRunner) {
|
|
11
|
+
const [idColumn, ...otherBaseColumns] = utilities_1.baseColumns;
|
|
12
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
|
13
|
+
name: this.table,
|
|
14
|
+
columns: [
|
|
15
|
+
idColumn,
|
|
16
|
+
{
|
|
17
|
+
name: 'corporateId',
|
|
18
|
+
type: 'int4',
|
|
19
|
+
isNullable: false,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'participantId',
|
|
23
|
+
type: 'int4',
|
|
24
|
+
isNullable: false,
|
|
25
|
+
},
|
|
26
|
+
...otherBaseColumns,
|
|
27
|
+
],
|
|
28
|
+
foreignKeys: [
|
|
29
|
+
{
|
|
30
|
+
name: `fk_${this.table}_corporate`,
|
|
31
|
+
columnNames: ['corporateId'],
|
|
32
|
+
referencedTableName: 'corporate',
|
|
33
|
+
referencedColumnNames: ['id'],
|
|
34
|
+
onDelete: 'CASCADE',
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
uniques: [
|
|
38
|
+
{
|
|
39
|
+
name: `UQ_${this.table}_corporateId_participantId`,
|
|
40
|
+
columnNames: ['corporateId', 'participantId'],
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
}), false);
|
|
44
|
+
}
|
|
45
|
+
async down(queryRunner) { }
|
|
46
|
+
}
|
|
47
|
+
exports.CreateRelCorporateParticipantTable1756375696676 = CreateRelCorporateParticipantTable1756375696676;
|
|
48
|
+
//# sourceMappingURL=1756375696676-CreateRelCorporateParticipantTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1756375696676-CreateRelCorporateParticipantTable.js","sourceRoot":"","sources":["../../../src/migrations/1756375696676-CreateRelCorporateParticipantTable.ts"],"names":[],"mappings":";;;AAAA,4CAA2C;AAC3C,qCAAiE;AAEjE,MAAa,+CAA+C;IAA5D;QAGmB,UAAK,GAAG,2BAA2B,CAAC;IAyCvD,CAAC;IAxCQ,KAAK,CAAC,EAAE,CAAC,WAAwB;QACtC,MAAM,CAAC,QAAQ,EAAE,GAAG,gBAAgB,CAAC,GAAG,uBAAW,CAAC;QACpD,MAAM,WAAW,CAAC,WAAW,CAC3B,IAAI,eAAK,CAAC;YACR,IAAI,EAAE,IAAI,CAAC,KAAK;YAChB,OAAO,EAAE;gBACP,QAAQ;gBACR;oBACE,IAAI,EAAE,aAAa;oBACnB,IAAI,EAAE,MAAM;oBACZ,UAAU,EAAE,KAAK;iBAClB;gBACD;oBACE,IAAI,EAAE,eAAe;oBACrB,IAAI,EAAE,MAAM;oBACZ,UAAU,EAAE,KAAK;iBAClB;gBACD,GAAG,gBAAgB;aACpB;YACD,WAAW,EAAE;gBACX;oBACE,IAAI,EAAE,MAAM,IAAI,CAAC,KAAK,YAAY;oBAClC,WAAW,EAAE,CAAC,aAAa,CAAC;oBAC5B,mBAAmB,EAAE,WAAW;oBAChC,qBAAqB,EAAE,CAAC,IAAI,CAAC;oBAC7B,QAAQ,EAAE,SAAS;iBACpB;aACF;YACD,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM,IAAI,CAAC,KAAK,4BAA4B;oBAClD,WAAW,EAAE,CAAC,aAAa,EAAE,eAAe,CAAC;iBAC9C;aACF;SACF,CAAC,EACF,KAAK,CACN,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB,IAAkB,CAAC;CAC9D;AA5CD,0GA4CC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CreateCorporateTable1756375695674 } from './1756375695674-CreateCorporateTable';
|
|
2
|
+
import { CreateRelCorporateParticipantTable1756375696676 } from './1756375696676-CreateRelCorporateParticipantTable';
|
|
3
|
+
export declare const CorporateMigrations: (typeof CreateRelCorporateParticipantTable1756375696676 | typeof CreateCorporateTable1756375695674)[];
|
|
4
|
+
export { CreateCorporateTable1756375695674, CreateRelCorporateParticipantTable1756375696676, };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateRelCorporateParticipantTable1756375696676 = exports.CreateCorporateTable1756375695674 = exports.CorporateMigrations = void 0;
|
|
4
|
+
const _1756375695674_CreateCorporateTable_1 = require("./1756375695674-CreateCorporateTable");
|
|
5
|
+
Object.defineProperty(exports, "CreateCorporateTable1756375695674", { enumerable: true, get: function () { return _1756375695674_CreateCorporateTable_1.CreateCorporateTable1756375695674; } });
|
|
6
|
+
const _1756375696676_CreateRelCorporateParticipantTable_1 = require("./1756375696676-CreateRelCorporateParticipantTable");
|
|
7
|
+
Object.defineProperty(exports, "CreateRelCorporateParticipantTable1756375696676", { enumerable: true, get: function () { return _1756375696676_CreateRelCorporateParticipantTable_1.CreateRelCorporateParticipantTable1756375696676; } });
|
|
8
|
+
exports.CorporateMigrations = [
|
|
9
|
+
_1756375695674_CreateCorporateTable_1.CreateCorporateTable1756375695674,
|
|
10
|
+
_1756375696676_CreateRelCorporateParticipantTable_1.CreateRelCorporateParticipantTable1756375696676,
|
|
11
|
+
];
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/migrations/index.ts"],"names":[],"mappings":";;;AAAA,8FAAyF;AASvF,kHATO,uEAAiC,OASP;AARnC,0HAAqH;AASnH,gIATO,mGAA+C,OASP;AAPpC,QAAA,mBAAmB,GAAG;IACjC,uEAAiC;IACjC,mGAA+C;CAChD,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var CorporateModule_1;
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.CorporateModule = void 0;
|
|
11
|
+
const common_1 = require("@nestjs/common");
|
|
12
|
+
const corporates_options_1 = require("../constants/corporates-options");
|
|
13
|
+
const services_1 = require("../services");
|
|
14
|
+
let CorporateModule = CorporateModule_1 = class CorporateModule {
|
|
15
|
+
static forRoot(options) {
|
|
16
|
+
return {
|
|
17
|
+
module: CorporateModule_1,
|
|
18
|
+
providers: [
|
|
19
|
+
{
|
|
20
|
+
provide: corporates_options_1.CORPORATES_OPTIONS,
|
|
21
|
+
useValue: options,
|
|
22
|
+
},
|
|
23
|
+
services_1.CorporateService,
|
|
24
|
+
],
|
|
25
|
+
exports: [
|
|
26
|
+
services_1.CorporateService,
|
|
27
|
+
],
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
exports.CorporateModule = CorporateModule;
|
|
32
|
+
exports.CorporateModule = CorporateModule = CorporateModule_1 = __decorate([
|
|
33
|
+
(0, common_1.Module)({})
|
|
34
|
+
], CorporateModule);
|
|
35
|
+
//# sourceMappingURL=corporate.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"corporate.module.js","sourceRoot":"","sources":["../../../src/modules/corporate.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAuD;AACvD,wEAAqE;AAErE,0CAA+C;AAGxC,IAAM,eAAe,uBAArB,MAAM,eAAe;IAC1B,MAAM,CAAC,OAAO,CAAC,OAA+B;QAC5C,OAAO;YACL,MAAM,EAAE,iBAAe;YACvB,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,uCAAkB;oBAC3B,QAAQ,EAAE,OAAO;iBAClB;gBACD,2BAAgB;aACjB;YACD,OAAO,EAAE;gBACP,2BAAgB;aACjB;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AAhBY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,eAAe,CAgB3B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Repository, DeepPartial, FindManyOptions } from 'typeorm';
|
|
2
|
+
import { BaseEntity } from '../entities/base.entity';
|
|
3
|
+
import { QueryDeepPartialEntity } from 'typeorm/query-builder/QueryPartialEntity';
|
|
4
|
+
export declare abstract class BaseRepository<T extends BaseEntity> extends Repository<T> {
|
|
5
|
+
findById(id: number | string): Promise<T | undefined>;
|
|
6
|
+
findWithOptions(options: FindManyOptions<T>): Promise<[T[], number]>;
|
|
7
|
+
createEntity(data: DeepPartial<T>, creator?: string): Promise<T>;
|
|
8
|
+
updateEntity(id: number | string, data: QueryDeepPartialEntity<T>, updater?: string): Promise<T | undefined>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseRepository = void 0;
|
|
4
|
+
const typeorm_1 = require("typeorm");
|
|
5
|
+
class BaseRepository extends typeorm_1.Repository {
|
|
6
|
+
async findById(id) {
|
|
7
|
+
return this.findOne({ where: { id } });
|
|
8
|
+
}
|
|
9
|
+
async findWithOptions(options) {
|
|
10
|
+
return this.findAndCount(options);
|
|
11
|
+
}
|
|
12
|
+
async createEntity(data, creator) {
|
|
13
|
+
const entity = this.create(data);
|
|
14
|
+
if (creator) {
|
|
15
|
+
entity.createdBy = creator;
|
|
16
|
+
entity.lastModifiedBy = creator;
|
|
17
|
+
}
|
|
18
|
+
return this.save(entity);
|
|
19
|
+
}
|
|
20
|
+
async updateEntity(id, data, updater) {
|
|
21
|
+
await this.update(id, {
|
|
22
|
+
...data,
|
|
23
|
+
lastModifiedBy: updater,
|
|
24
|
+
});
|
|
25
|
+
return this.findById(id);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.BaseRepository = BaseRepository;
|
|
29
|
+
//# sourceMappingURL=base.repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.repository.js","sourceRoot":"","sources":["../../../src/repository/base.repository.ts"],"names":[],"mappings":";;;AAAA,qCAKiB;AAIjB,MAAsB,cAEpB,SAAQ,oBAAa;IACnB,KAAK,CAAC,QAAQ,CAAC,EAAmB;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAuB,CAAC,CAAC;IAChE,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,OAA2B;QAC7C,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,IAAoB,EAAE,OAAgB;QACrD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,OAAO,EAAE,CAAC;YACV,MAAM,CAAC,SAAS,GAAG,OAAO,CAAC;YAC3B,MAAM,CAAC,cAAc,GAAG,OAAO,CAAC;QACpC,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,MAAwB,CAAC,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,YAAY,CACd,EAAmB,EACnB,IAA+B,EAC/B,OAAgB;QAEhB,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE;YAClB,GAAG,IAAI;YACP,cAAc,EAAE,OAAO;SACG,CAAC,CAAC;QAEhC,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC7B,CAAC;CACJ;AAhCD,wCAgCC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CorporateRepository = void 0;
|
|
4
|
+
const base_repository_1 = require("./base.repository");
|
|
5
|
+
class CorporateRepository extends base_repository_1.BaseRepository {
|
|
6
|
+
}
|
|
7
|
+
exports.CorporateRepository = CorporateRepository;
|
|
8
|
+
//# sourceMappingURL=corporate.repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"corporate.repository.js","sourceRoot":"","sources":["../../../src/repository/corporate.repository.ts"],"names":[],"mappings":";;;AACA,uDAAmD;AAEnD,MAAa,mBAAoB,SAAQ,gCAA+B;CAAG;AAA3E,kDAA2E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './corporate.repository';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./corporate.repository"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/repository/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FindManyOptions, FindOneOptions } from 'typeorm';
|
|
2
|
+
import { CorporateEntity } from '../entities/corporate.entity';
|
|
3
|
+
import { CorporateModuleOptions } from '../interfaces/corporates-options.interface';
|
|
4
|
+
import { CorporateDto } from '../dto/corporate.dto';
|
|
5
|
+
import { PageRequest } from '../entities/pagination';
|
|
6
|
+
export declare class CorporateService {
|
|
7
|
+
private readonly options;
|
|
8
|
+
constructor(options: CorporateModuleOptions);
|
|
9
|
+
private getRepository;
|
|
10
|
+
private validateUniqueCorporateProps;
|
|
11
|
+
create(createCorporateDto: CorporateDto, tenantId: string): Promise<CorporateEntity>;
|
|
12
|
+
findAll(tenantId: string): Promise<CorporateDto[]>;
|
|
13
|
+
findByOptions(options: FindManyOptions<CorporateEntity>, tenantId: string): Promise<CorporateDto[]>;
|
|
14
|
+
findOne(id: number, tenantId: string): Promise<CorporateDto>;
|
|
15
|
+
findOneByOptions(options: FindOneOptions<CorporateEntity>, tenantId: string): Promise<CorporateDto>;
|
|
16
|
+
getPaginatedCorporates(pageRequest: PageRequest, tenantId: string): Promise<{
|
|
17
|
+
result: CorporateDto[];
|
|
18
|
+
totalCount: number;
|
|
19
|
+
}>;
|
|
20
|
+
update(updateCorporateDto: CorporateDto, tenantId: string): Promise<import("typeorm").UpdateResult>;
|
|
21
|
+
remove(id: number, tenantId: string): Promise<import("typeorm").DeleteResult>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.CorporateService = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const corporate_entity_1 = require("../entities/corporate.entity");
|
|
18
|
+
const corporates_options_1 = require("../constants/corporates-options");
|
|
19
|
+
const corporate_mapper_1 = require("../mappers/corporate.mapper");
|
|
20
|
+
let CorporateService = class CorporateService {
|
|
21
|
+
constructor(options) {
|
|
22
|
+
this.options = options;
|
|
23
|
+
}
|
|
24
|
+
async getRepository(tenantId) {
|
|
25
|
+
const connection = await this.options.connectionProvider.getTenantConnection(tenantId);
|
|
26
|
+
return connection.getRepository(corporate_entity_1.CorporateEntity);
|
|
27
|
+
}
|
|
28
|
+
async validateUniqueCorporateProps(createCorporateDto, tenantId) {
|
|
29
|
+
const corporate = await this.findOneByOptions({
|
|
30
|
+
where: { email: createCorporateDto.email },
|
|
31
|
+
}, tenantId);
|
|
32
|
+
if (corporate) {
|
|
33
|
+
throw new common_1.BadRequestException('CORPORATE_EMAIL_ALREADY_EXISTS');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
async create(createCorporateDto, tenantId) {
|
|
37
|
+
await this.validateUniqueCorporateProps(createCorporateDto, tenantId);
|
|
38
|
+
const repository = await this.getRepository(tenantId);
|
|
39
|
+
const corporateEntity = corporate_mapper_1.CorporateMapper.fromDTOToEntity(createCorporateDto);
|
|
40
|
+
return repository.save(corporateEntity);
|
|
41
|
+
}
|
|
42
|
+
async findAll(tenantId) {
|
|
43
|
+
const repository = await this.getRepository(tenantId);
|
|
44
|
+
const corporates = await repository
|
|
45
|
+
.createQueryBuilder('corporate')
|
|
46
|
+
.getMany();
|
|
47
|
+
return corporates.map((corporate) => corporate_mapper_1.CorporateMapper.fromEntityToDTO(corporate));
|
|
48
|
+
}
|
|
49
|
+
async findByOptions(options, tenantId) {
|
|
50
|
+
const repository = await this.getRepository(tenantId);
|
|
51
|
+
const corporates = await repository.find(options);
|
|
52
|
+
return corporates.map((corporate) => corporate_mapper_1.CorporateMapper.fromEntityToDTO(corporate));
|
|
53
|
+
}
|
|
54
|
+
async findOne(id, tenantId) {
|
|
55
|
+
const repository = await this.getRepository(tenantId);
|
|
56
|
+
const corporate = await repository
|
|
57
|
+
.createQueryBuilder('corporate')
|
|
58
|
+
.where('corporate.id = :id', { id })
|
|
59
|
+
.getOne();
|
|
60
|
+
return corporate_mapper_1.CorporateMapper.fromEntityToDTO(corporate);
|
|
61
|
+
}
|
|
62
|
+
async findOneByOptions(options, tenantId) {
|
|
63
|
+
const repository = await this.getRepository(tenantId);
|
|
64
|
+
const corporate = await repository.findOne(options);
|
|
65
|
+
return corporate_mapper_1.CorporateMapper.fromEntityToDTO(corporate);
|
|
66
|
+
}
|
|
67
|
+
async getPaginatedCorporates(pageRequest, tenantId) {
|
|
68
|
+
const repository = await this.getRepository(tenantId);
|
|
69
|
+
const corporates = await repository
|
|
70
|
+
.createQueryBuilder('corporate')
|
|
71
|
+
.skip(pageRequest.page * pageRequest.size)
|
|
72
|
+
.take(pageRequest.size)
|
|
73
|
+
.orderBy('corporate.id', 'DESC')
|
|
74
|
+
.getMany();
|
|
75
|
+
const totalCount = await repository.count();
|
|
76
|
+
return {
|
|
77
|
+
result: corporates.map((corporate) => corporate_mapper_1.CorporateMapper.fromEntityToDTO(corporate)),
|
|
78
|
+
totalCount,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
async update(updateCorporateDto, tenantId) {
|
|
82
|
+
const repository = await this.getRepository(tenantId);
|
|
83
|
+
const existingCorporate = await repository.findOne({
|
|
84
|
+
where: { id: updateCorporateDto.id },
|
|
85
|
+
});
|
|
86
|
+
if (!existingCorporate) {
|
|
87
|
+
throw new common_1.NotFoundException('CORPORATE_DOES_NOT_EXIST');
|
|
88
|
+
}
|
|
89
|
+
if (updateCorporateDto.email && existingCorporate.email !== updateCorporateDto.email) {
|
|
90
|
+
const existingCorporateWithNewData = await repository.findOne({
|
|
91
|
+
where: { email: updateCorporateDto.email },
|
|
92
|
+
});
|
|
93
|
+
if (existingCorporateWithNewData) {
|
|
94
|
+
throw new common_1.BadRequestException('CORPORATE_EMAIL_ALREADY_EXISTS');
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
const updateCorporateEntity = corporate_mapper_1.CorporateMapper.fromDTOToEntity(updateCorporateDto);
|
|
98
|
+
return repository.update(updateCorporateDto.id, updateCorporateEntity);
|
|
99
|
+
}
|
|
100
|
+
async remove(id, tenantId) {
|
|
101
|
+
const repository = await this.getRepository(tenantId);
|
|
102
|
+
return await repository.delete(id);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
exports.CorporateService = CorporateService;
|
|
106
|
+
exports.CorporateService = CorporateService = __decorate([
|
|
107
|
+
(0, common_1.Injectable)(),
|
|
108
|
+
__param(0, (0, common_1.Inject)(corporates_options_1.CORPORATES_OPTIONS)),
|
|
109
|
+
__metadata("design:paramtypes", [Object])
|
|
110
|
+
], CorporateService);
|
|
111
|
+
//# sourceMappingURL=corporate.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"corporate.service.js","sourceRoot":"","sources":["../../../src/services/corporate.service.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CorporateService = void 0;
|
|
4
|
+
const corporate_service_1 = require("./corporate.service");
|
|
5
|
+
Object.defineProperty(exports, "CorporateService", { enumerable: true, get: function () { return corporate_service_1.CorporateService; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":";;;AAAA,2DAAuD;AAGrD,iGAHO,oCAAgB,OAGP"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const testing_1 = require("@nestjs/testing");
|
|
4
|
+
const services_1 = require("../services");
|
|
5
|
+
describe('Corporate Service', () => {
|
|
6
|
+
let corporateService;
|
|
7
|
+
beforeEach(async () => {
|
|
8
|
+
const module = await testing_1.Test.createTestingModule({
|
|
9
|
+
providers: [services_1.CorporateService],
|
|
10
|
+
}).compile();
|
|
11
|
+
corporateService = module.get(services_1.CorporateService);
|
|
12
|
+
});
|
|
13
|
+
it('should be defined', () => {
|
|
14
|
+
expect(corporateService).toBeDefined();
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=corporate-criteria.service.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"corporate-criteria.service.spec.js","sourceRoot":"","sources":["../../../src/test/corporate-criteria.service.spec.ts"],"names":[],"mappings":";;AACA,6CAAsD;AACtD,0CAA+C;AAE/C,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,IAAI,gBAAkC,CAAC;IAEvC,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,MAAM,MAAM,GAAkB,MAAM,cAAI,CAAC,mBAAmB,CAAC;YAC3D,SAAS,EAAE,CAAC,2BAAgB,CAAC;SAC9B,CAAC,CAAC,OAAO,EAAE,CAAC;QAEb,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAmB,2BAAgB,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mBAAmB,EAAE,GAAG,EAAE;QAC3B,MAAM,CAAC,gBAAgB,CAAC,CAAC,WAAW,EAAE,CAAC;IACzC,CAAC,CAAC,CAAC;AAEL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.baseColumns = void 0;
|
|
4
|
+
const get_base_columns_1 = require("./migrations/get-base-columns");
|
|
5
|
+
Object.defineProperty(exports, "baseColumns", { enumerable: true, get: function () { return get_base_columns_1.baseColumns; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utilities/index.ts"],"names":[],"mappings":";;;AAAA,oEAA4D;AAG1D,4FAHO,8BAAW,OAGP"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.baseColumns = void 0;
|
|
4
|
+
exports.baseColumns = [
|
|
5
|
+
{
|
|
6
|
+
name: 'id',
|
|
7
|
+
type: 'int4',
|
|
8
|
+
isPrimary: true,
|
|
9
|
+
isGenerated: true,
|
|
10
|
+
generationStrategy: 'increment',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: 'createdDate',
|
|
14
|
+
type: 'timestamptz',
|
|
15
|
+
isNullable: true,
|
|
16
|
+
default: 'now()',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: 'createdBy',
|
|
20
|
+
type: 'varchar',
|
|
21
|
+
isNullable: true,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'lastModifiedDate',
|
|
25
|
+
type: 'timestamptz',
|
|
26
|
+
isNullable: true,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'lastModifiedBy',
|
|
30
|
+
type: 'varchar',
|
|
31
|
+
isNullable: true,
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
//# sourceMappingURL=get-base-columns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-base-columns.js","sourceRoot":"","sources":["../../../../src/utilities/migrations/get-base-columns.ts"],"names":[],"mappings":";;;AAEa,QAAA,WAAW,GAAyB;IAC/C;QACE,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,MAAM;QACZ,SAAS,EAAE,IAAI;QACf,WAAW,EAAE,IAAI;QACjB,kBAAkB,EAAE,WAAW;KAChC;IACD;QACE,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,aAAa;QACnB,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,OAAO;KACjB;IACD;QACE,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,UAAU,EAAE,IAAI;KACjB;IACD;QACE,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,aAAa;QACnB,UAAU,EAAE,IAAI;KACjB;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,SAAS;QACf,UAAU,EAAE,IAAI;KACjB;CACF,CAAC"}
|