rez_core 2.1.132 → 2.2.0
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/enterprise/controller/organization.controller.d.ts +1 -1
- package/dist/module/enterprise/controller/organization.controller.js +1 -1
- package/dist/module/enterprise/controller/organization.controller.js.map +1 -1
- package/dist/module/enterprise/enterprise.module.js +6 -27
- package/dist/module/enterprise/enterprise.module.js.map +1 -1
- package/dist/module/enterprise/entity/organization.entity.d.ts +1 -0
- package/dist/module/enterprise/entity/organization.entity.js +4 -0
- package/dist/module/enterprise/entity/organization.entity.js.map +1 -1
- package/dist/module/enterprise/repository/school.repository.d.ts +4 -6
- package/dist/module/enterprise/repository/school.repository.js +35 -33
- package/dist/module/enterprise/repository/school.repository.js.map +1 -1
- package/dist/module/enterprise/service/brand.service.d.ts +2 -1
- package/dist/module/enterprise/service/brand.service.js +2 -1
- package/dist/module/enterprise/service/brand.service.js.map +1 -1
- package/dist/module/enterprise/service/organization.service.d.ts +5 -7
- package/dist/module/enterprise/service/organization.service.js +48 -12
- package/dist/module/enterprise/service/organization.service.js.map +1 -1
- package/dist/module/filter/service/filter.service.js +1 -1
- package/dist/module/layout_preference/entity/layout_preference.entity.js +1 -1
- package/dist/module/layout_preference/entity/layout_preference.entity.js.map +1 -1
- package/dist/module/lead/controller/lead.controller.d.ts +7 -7
- package/dist/module/lead/lead.module.js +1 -5
- package/dist/module/lead/lead.module.js.map +1 -1
- package/dist/module/lead/repository/lead.repository.d.ts +5 -8
- package/dist/module/lead/repository/lead.repository.js +16 -15
- package/dist/module/lead/repository/lead.repository.js.map +1 -1
- package/dist/module/lead/service/lead.service.d.ts +7 -7
- package/dist/module/meta/entity/brand-profile.entity.d.ts +3 -0
- package/dist/module/{enterprise/entity/brand.entity.js → meta/entity/brand-profile.entity.js} +8 -15
- package/dist/module/meta/entity/brand-profile.entity.js.map +1 -0
- package/dist/module/meta/entity/field-group.entity.d.ts +0 -9
- package/dist/module/meta/entity/field-group.entity.js +0 -46
- package/dist/module/meta/entity/field-group.entity.js.map +1 -1
- package/dist/module/meta/entity/section-master.entity.d.ts +0 -10
- package/dist/module/meta/entity/section-master.entity.js +0 -50
- package/dist/module/meta/entity/section-master.entity.js.map +1 -1
- package/dist/module/meta/entity/user-app-mapping.entity.d.ts +0 -7
- package/dist/module/meta/entity/user-app-mapping.entity.js +0 -40
- package/dist/module/meta/entity/user-app-mapping.entity.js.map +1 -1
- package/dist/module/meta/entity.module.js +2 -18
- package/dist/module/meta/entity.module.js.map +1 -1
- package/dist/module/meta/repository/user-app-mapping.repository.d.ts +0 -8
- package/dist/module/meta/repository/user-app-mapping.repository.js +0 -42
- package/dist/module/meta/repository/user-app-mapping.repository.js.map +1 -1
- package/dist/module/meta/service/user-app-mapping.service.d.ts +0 -7
- package/dist/module/meta/service/user-app-mapping.service.js +0 -30
- package/dist/module/meta/service/user-app-mapping.service.js.map +1 -1
- package/dist/module/meta/service/view-master.service.d.ts +1 -5
- package/dist/module/meta/service/view-master.service.js +2 -34
- package/dist/module/meta/service/view-master.service.js.map +1 -1
- package/dist/module/module/repository/menu.repository.js +1 -1
- package/dist/module/module/repository/module-access.repository.js +3 -1
- package/dist/module/module/repository/module-access.repository.js.map +1 -1
- package/dist/module/module/service/module-access.service.js +1 -1
- package/dist/module/module/service/module-access.service.js.map +1 -1
- package/dist/module/notification/entity/otp.entity.js +1 -1
- package/dist/module/notification/entity/otp.entity.js.map +1 -1
- package/dist/module/third-party-module/entity/third-party-api-registry.entity.js +1 -1
- package/dist/module/third-party-module/entity/third-party-api-registry.entity.js.map +1 -1
- package/dist/module/user/service/login.service.js +1 -1
- package/dist/module/user/service/login.service.js.map +1 -1
- package/dist/module/user/service/user-session.service.js +1 -1
- package/dist/module/user/service/user-session.service.js.map +1 -1
- package/dist/module/user/service/user.service.d.ts +1 -3
- package/dist/module/user/service/user.service.js +3 -6
- package/dist/module/user/service/user.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/service/wbsCodeGen.service.d.ts +3 -0
- package/dist/{module/enterprise/service/school.service.js → utils/service/wbsCodeGen.service.js} +9 -7
- package/dist/utils/service/wbsCodeGen.service.js.map +1 -0
- package/dist/utils/utils.module.js +15 -2
- package/dist/utils/utils.module.js.map +1 -1
- package/package.json +1 -1
- package/src/module/enterprise/controller/organization.controller.ts +1 -2
- package/src/module/enterprise/enterprise.module.ts +6 -27
- package/src/module/enterprise/entity/organization.entity.ts +3 -0
- package/src/module/enterprise/repository/school.repository.ts +44 -31
- package/src/module/enterprise/service/brand.service.ts +2 -1
- package/src/module/enterprise/service/organization.service.ts +63 -10
- package/src/module/filter/service/filter.service.ts +1 -1
- package/src/module/layout_preference/entity/layout_preference.entity.ts +1 -1
- package/src/module/lead/lead.module.ts +1 -5
- package/src/module/lead/repository/lead.repository.ts +19 -15
- package/src/module/meta/entity/brand-profile.entity.ts +5 -0
- package/src/module/meta/entity/field-group.entity.ts +20 -20
- package/src/module/meta/entity/section-master.entity.ts +22 -22
- package/src/module/meta/entity/user-app-mapping.entity.ts +16 -16
- package/src/module/meta/entity.module.ts +20 -18
- package/src/module/meta/repository/user-app-mapping.repository.ts +25 -26
- package/src/module/meta/service/user-app-mapping.service.ts +14 -14
- package/src/module/meta/service/view-master.service.ts +38 -38
- package/src/module/module/repository/menu.repository.ts +1 -1
- package/src/module/module/repository/module-access.repository.ts +23 -33
- package/src/module/module/service/module-access.service.ts +1 -1
- package/src/module/notification/entity/otp.entity.ts +3 -3
- package/src/module/third-party-module/entity/third-party-api-registry.entity.ts +2 -2
- package/src/module/user/service/login.service.ts +1 -1
- package/src/module/user/service/user-session.service.ts +1 -1
- package/src/module/user/service/user.service.ts +2 -2
- package/src/resources/dev.properties.yaml +3 -3
- package/src/utils/service/wbsCodeGen.service.ts +8 -0
- package/src/utils/utils.module.ts +15 -2
- package/dist/module/enterprise/entity/brand.entity.d.ts +0 -4
- package/dist/module/enterprise/entity/brand.entity.js.map +0 -1
- package/dist/module/enterprise/entity/school.entity.d.ts +0 -7
- package/dist/module/enterprise/entity/school.entity.js +0 -37
- package/dist/module/enterprise/entity/school.entity.js.map +0 -1
- package/dist/module/enterprise/repository/brand.repository.d.ts +0 -8
- package/dist/module/enterprise/repository/brand.repository.js +0 -39
- package/dist/module/enterprise/repository/brand.repository.js.map +0 -1
- package/dist/module/enterprise/service/school.service.d.ts +0 -3
- package/dist/module/enterprise/service/school.service.js.map +0 -1
- package/src/module/enterprise/entity/brand.entity.ts +0 -8
- package/src/module/enterprise/entity/school.entity.ts +0 -17
- package/src/module/enterprise/repository/brand.repository.ts +0 -23
- package/src/module/enterprise/service/school.service.ts +0 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OrganizationService } from '../service/organization.service';
|
|
2
1
|
import { Request } from 'express';
|
|
3
2
|
import { UserService } from 'src/module/user/service/user.service';
|
|
3
|
+
import { OrganizationService } from '../service/organization.service';
|
|
4
4
|
export declare class OrganizationController {
|
|
5
5
|
private readonly orgService;
|
|
6
6
|
private readonly userService;
|
|
@@ -14,9 +14,9 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.OrganizationController = void 0;
|
|
16
16
|
const common_1 = require("@nestjs/common");
|
|
17
|
-
const organization_service_1 = require("../service/organization.service");
|
|
18
17
|
const jwt_guard_1 = require("../../auth/guards/jwt.guard");
|
|
19
18
|
const user_service_1 = require("../../user/service/user.service");
|
|
19
|
+
const organization_service_1 = require("../service/organization.service");
|
|
20
20
|
let OrganizationController = class OrganizationController {
|
|
21
21
|
constructor(orgService, userService) {
|
|
22
22
|
this.orgService = orgService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.controller.js","sourceRoot":"","sources":["../../../../src/module/enterprise/controller/organization.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAyE;
|
|
1
|
+
{"version":3,"file":"organization.controller.js","sourceRoot":"","sources":["../../../../src/module/enterprise/controller/organization.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAyE;AAEzE,2DAAgE;AAChE,kEAAmE;AACnE,0EAAsE;AAG/D,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IACjC,YACmB,UAA+B,EACR,WAAwB;QAD/C,eAAU,GAAV,UAAU,CAAqB;QACR,gBAAW,GAAX,WAAW,CAAa;IAC/D,CAAC;IAIE,AAAN,KAAK,CAAC,uBAAuB,CAAQ,GAA4B;QAC/D,MAAM,QAAQ,GAAG,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;QAGnC,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;IAC7D,CAAC;IAIK,AAAN,KAAK,CAAC,wBAAwB,CAAQ,GAA4B;QAChE,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC;QACrC,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC;QAC3C,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,eAAe,CAAC;QAElD,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,wBAAwB,CACnD,MAAM,EACN,OAAO,EACP,MAAM,CACP,CAAC;IACJ,CAAC;CACF,CAAA;AA5BY,wDAAsB;AAQ3B;IAFL,IAAA,kBAAS,EAAC,wBAAY,CAAC;IACvB,IAAA,YAAG,EAAC,UAAU,CAAC;IACe,WAAA,IAAA,YAAG,GAAE,CAAA;;;;qEAKnC;AAIK;IAFL,IAAA,kBAAS,EAAC,wBAAY,CAAC;IACvB,IAAA,YAAG,EAAC,WAAW,CAAC;IACe,WAAA,IAAA,YAAG,GAAE,CAAA;;;;sEAUpC;iCA3BU,sBAAsB;IADlC,IAAA,mBAAU,EAAC,cAAc,CAAC;IAItB,WAAA,IAAA,eAAM,EAAC,aAAa,CAAC,CAAA;qCADO,0CAAmB;QACK,0BAAW;GAHvD,sBAAsB,CA4BlC"}
|
|
@@ -9,33 +9,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.EnterpriseModule = void 0;
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
12
|
-
const organization_service_1 = require("./service/organization.service");
|
|
13
|
-
const organization_entity_1 = require("./entity/organization.entity");
|
|
14
|
-
const organization_controller_1 = require("./controller/organization.controller");
|
|
15
12
|
const user_module_1 = require("../user/user.module");
|
|
16
|
-
const
|
|
13
|
+
const organization_controller_1 = require("./controller/organization.controller");
|
|
17
14
|
const organization_app_mapping_entity_1 = require("./entity/organization-app-mapping.entity");
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const school_repository_1 = require("./repository/school.repository");
|
|
15
|
+
const organization_entity_1 = require("./entity/organization.entity");
|
|
16
|
+
const organization_app_mapping_service_1 = require("./service/organization-app-mapping.service");
|
|
17
|
+
const organization_service_1 = require("./service/organization.service");
|
|
22
18
|
const utils_module_1 = require("../../utils/utils.module");
|
|
23
|
-
const brand_service_1 = require("./service/brand.service");
|
|
24
|
-
const organization_repository_1 = require("./repository/organization.repository");
|
|
25
|
-
const school_service_1 = require("./service/school.service");
|
|
26
19
|
const entity_module_1 = require("../meta/entity.module");
|
|
20
|
+
const organization_repository_1 = require("./repository/organization.repository");
|
|
27
21
|
let EnterpriseModule = class EnterpriseModule {
|
|
28
22
|
};
|
|
29
23
|
exports.EnterpriseModule = EnterpriseModule;
|
|
30
24
|
exports.EnterpriseModule = EnterpriseModule = __decorate([
|
|
31
25
|
(0, common_1.Module)({
|
|
32
26
|
imports: [
|
|
33
|
-
typeorm_1.TypeOrmModule.forFeature([
|
|
34
|
-
organization_entity_1.OrganizationData,
|
|
35
|
-
organization_app_mapping_entity_1.OrganizationAppMapping,
|
|
36
|
-
brand_entity_1.BrandData,
|
|
37
|
-
school_entity_1.SchoolData,
|
|
38
|
-
]),
|
|
27
|
+
typeorm_1.TypeOrmModule.forFeature([organization_entity_1.OrganizationData, organization_app_mapping_entity_1.OrganizationAppMapping]),
|
|
39
28
|
(0, common_1.forwardRef)(() => user_module_1.UserModule),
|
|
40
29
|
utils_module_1.UtilsModule,
|
|
41
30
|
entity_module_1.EntityModule,
|
|
@@ -44,17 +33,7 @@ exports.EnterpriseModule = EnterpriseModule = __decorate([
|
|
|
44
33
|
providers: [
|
|
45
34
|
organization_service_1.OrganizationService,
|
|
46
35
|
organization_app_mapping_service_1.OrganizationAppMappingService,
|
|
47
|
-
brand_repository_1.BrandRepository,
|
|
48
|
-
school_repository_1.SchoolRepository,
|
|
49
36
|
organization_repository_1.OrganizationRepository,
|
|
50
|
-
{
|
|
51
|
-
provide: 'BrandService',
|
|
52
|
-
useClass: brand_service_1.BrandService,
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
provide: 'SchoolService',
|
|
56
|
-
useClass: school_service_1.SchoolService,
|
|
57
|
-
},
|
|
58
37
|
],
|
|
59
38
|
exports: [organization_service_1.OrganizationService, organization_repository_1.OrganizationRepository],
|
|
60
39
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enterprise.module.js","sourceRoot":"","sources":["../../../src/module/enterprise/enterprise.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAoD;AACpD,6CAAgD;AAChD,
|
|
1
|
+
{"version":3,"file":"enterprise.module.js","sourceRoot":"","sources":["../../../src/module/enterprise/enterprise.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAoD;AACpD,6CAAgD;AAChD,qDAAiD;AACjD,kFAA8E;AAC9E,8FAAkF;AAClF,sEAAgE;AAChE,iGAA2F;AAC3F,yEAAqE;AACrE,2DAAqD;AACrD,yDAAqD;AACrD,kFAA8E;AAiBvE,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAAG,CAAA;AAAnB,4CAAgB;2BAAhB,gBAAgB;IAf5B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC,CAAC,sCAAgB,EAAE,wDAAsB,CAAC,CAAC;YACpE,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,wBAAU,CAAC;YAC5B,0BAAW;YACX,4BAAY;SACb;QACD,WAAW,EAAE,CAAC,gDAAsB,CAAC;QACrC,SAAS,EAAE;YACT,0CAAmB;YACnB,gEAA6B;YAC7B,gDAAsB;SACvB;QACD,OAAO,EAAE,CAAC,0CAAmB,EAAE,gDAAsB,CAAC;KACvD,CAAC;GACW,gBAAgB,CAAG"}
|
|
@@ -122,6 +122,10 @@ __decorate([
|
|
|
122
122
|
(0, typeorm_1.Column)({ name: 'type', nullable: true }),
|
|
123
123
|
__metadata("design:type", String)
|
|
124
124
|
], OrganizationData.prototype, "type", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
(0, typeorm_1.Column)({ name: 'wbs_code', nullable: true }),
|
|
127
|
+
__metadata("design:type", String)
|
|
128
|
+
], OrganizationData.prototype, "wbs_code", void 0);
|
|
125
129
|
exports.OrganizationData = OrganizationData = __decorate([
|
|
126
130
|
(0, typeorm_1.Entity)({ name: 'cr_organization' })
|
|
127
131
|
], OrganizationData);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.entity.js","sourceRoot":"","sources":["../../../../src/module/enterprise/entity/organization.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAiE;AAG1D,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;
|
|
1
|
+
{"version":3,"file":"organization.entity.js","sourceRoot":"","sources":["../../../../src/module/enterprise/entity/organization.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAiE;AAG1D,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAqF5B,CAAA;AArFY,4CAAgB;AAE3B;IADC,IAAA,gCAAsB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,QAAQ,EAAE,IAAI;KACf,CAAC;;2DACwB;AAG1B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDAC5C;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CAC5B;AAGb;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDAC5B;2BApFN,gBAAgB;IAD5B,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC;GACvB,gBAAgB,CAqF5B"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { DataSource
|
|
2
|
-
import { SchoolData } from '../entity/school.entity';
|
|
1
|
+
import { DataSource } from 'typeorm';
|
|
3
2
|
export declare class SchoolRepository {
|
|
4
|
-
private readonly schoolRepo;
|
|
5
3
|
private readonly dataSource;
|
|
6
|
-
constructor(
|
|
7
|
-
findAllByOrgId(
|
|
8
|
-
findAllByBrandId(brdId: number): Promise<
|
|
4
|
+
constructor(dataSource: DataSource);
|
|
5
|
+
findAllByOrgId(orgId: number): Promise<any[]>;
|
|
6
|
+
findAllByBrandId(brdId: number): Promise<any[]>;
|
|
9
7
|
getUserContextDropdown(userId: number, appCode: string, org_id: any): Promise<any[]>;
|
|
10
8
|
}
|
|
@@ -8,30 +8,30 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
12
|
exports.SchoolRepository = void 0;
|
|
16
13
|
const common_1 = require("@nestjs/common");
|
|
17
|
-
const typeorm_1 = require("
|
|
18
|
-
const typeorm_2 = require("typeorm");
|
|
19
|
-
const school_entity_1 = require("../entity/school.entity");
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
20
15
|
const user_role_mapping_entity_1 = require("../../user/entity/user-role-mapping.entity");
|
|
21
16
|
let SchoolRepository = class SchoolRepository {
|
|
22
|
-
constructor(
|
|
23
|
-
this.schoolRepo = schoolRepo;
|
|
17
|
+
constructor(dataSource) {
|
|
24
18
|
this.dataSource = dataSource;
|
|
25
19
|
}
|
|
26
|
-
async findAllByOrgId(
|
|
27
|
-
return await this.
|
|
28
|
-
|
|
29
|
-
|
|
20
|
+
async findAllByOrgId(orgId) {
|
|
21
|
+
return await this.dataSource
|
|
22
|
+
.createQueryBuilder()
|
|
23
|
+
.select(['*'])
|
|
24
|
+
.from('eth_school_profile', 'sch')
|
|
25
|
+
.where('sch.organization_id = :orgId', { orgId })
|
|
26
|
+
.getRawMany();
|
|
30
27
|
}
|
|
31
28
|
async findAllByBrandId(brdId) {
|
|
32
|
-
return await this.
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
return await this.dataSource
|
|
30
|
+
.createQueryBuilder()
|
|
31
|
+
.select(['*'])
|
|
32
|
+
.from('eth_school_profile', 'sch')
|
|
33
|
+
.where('sch.brand_id = :brdId', { brdId })
|
|
34
|
+
.getRawMany();
|
|
35
35
|
}
|
|
36
36
|
async getUserContextDropdown(userId, appCode, org_id) {
|
|
37
37
|
const userRoleRepo = this.dataSource.getRepository(user_role_mapping_entity_1.UserRoleMapping);
|
|
@@ -41,6 +41,7 @@ let SchoolRepository = class SchoolRepository {
|
|
|
41
41
|
.andWhere('urm.appcode = :appCode', { appCode })
|
|
42
42
|
.andWhere('urm.level_type = :levelType', { levelType: 'ORG' })
|
|
43
43
|
.getRawMany();
|
|
44
|
+
console.log('hasOrgAccess', hasOrgAccess);
|
|
44
45
|
let currentORGLevel_id = hasOrgAccess[0]?.urm_level_id;
|
|
45
46
|
if (hasOrgAccess[0]?.urm_level_id == 1) {
|
|
46
47
|
currentORGLevel_id = org_id;
|
|
@@ -53,18 +54,21 @@ let SchoolRepository = class SchoolRepository {
|
|
|
53
54
|
'org.name AS org_name',
|
|
54
55
|
'org.address AS org_address',
|
|
55
56
|
'org.status AS org_status',
|
|
56
|
-
'
|
|
57
|
-
'
|
|
58
|
-
'
|
|
59
|
-
'
|
|
60
|
-
'
|
|
61
|
-
'
|
|
62
|
-
'
|
|
57
|
+
'brn.id AS brand_id',
|
|
58
|
+
'brand_profile.name AS brand_name',
|
|
59
|
+
'brand_profile.status AS brand_status',
|
|
60
|
+
'school.id AS school_id',
|
|
61
|
+
'school.name AS school_name',
|
|
62
|
+
'school.location AS school_location',
|
|
63
|
+
'school.status AS school_status',
|
|
63
64
|
])
|
|
64
|
-
.from('
|
|
65
|
-
.innerJoin('
|
|
66
|
-
.innerJoin('
|
|
67
|
-
.
|
|
65
|
+
.from('cr_organization', 'org')
|
|
66
|
+
.innerJoin('cr_organization', 'brn', "brn.type = 'BRN'")
|
|
67
|
+
.innerJoin('eth_brand_profile', 'brand_profile', 'brand_profile.parent_id = brn.id AND brand_profile.organization_id = org.id')
|
|
68
|
+
.innerJoin('eth_school_profile', 'school', 'school.brand_id = brn.id')
|
|
69
|
+
.where('org.id = :orgId', {
|
|
70
|
+
orgId: currentORGLevel_id,
|
|
71
|
+
})
|
|
68
72
|
.getRawMany();
|
|
69
73
|
if (schools.length > 0) {
|
|
70
74
|
const result = {};
|
|
@@ -161,8 +165,8 @@ let SchoolRepository = class SchoolRepository {
|
|
|
161
165
|
'school.status AS school_status',
|
|
162
166
|
])
|
|
163
167
|
.from('cr_user_role_mapping', 'urm')
|
|
164
|
-
.innerJoin('
|
|
165
|
-
.innerJoin('
|
|
168
|
+
.innerJoin('cr_organization', 'brand', 'brand.id = urm.level_id')
|
|
169
|
+
.innerJoin('eth_school_profile', 'school', 'school.brand_id = brand.id')
|
|
166
170
|
.where('urm.user_id = :userId', { userId })
|
|
167
171
|
.andWhere('urm.appcode = :appCode', { appCode })
|
|
168
172
|
.andWhere('urm.level_type = :levelType', { levelType: 'BRN' })
|
|
@@ -179,8 +183,8 @@ let SchoolRepository = class SchoolRepository {
|
|
|
179
183
|
'school.status AS school_status',
|
|
180
184
|
])
|
|
181
185
|
.from('cr_user_role_mapping', 'urm')
|
|
182
|
-
.innerJoin('
|
|
183
|
-
.innerJoin('
|
|
186
|
+
.innerJoin('eth_school_profile', 'school', 'school.id = urm.level_id')
|
|
187
|
+
.innerJoin('cr_organization', 'brand', 'brand.id = school.brand_id')
|
|
184
188
|
.where('urm.user_id = :userId', { userId })
|
|
185
189
|
.andWhere('urm.appcode = :appCode', { appCode })
|
|
186
190
|
.andWhere('urm.level_type = :levelType', { levelType: 'SCH' })
|
|
@@ -216,8 +220,6 @@ let SchoolRepository = class SchoolRepository {
|
|
|
216
220
|
exports.SchoolRepository = SchoolRepository;
|
|
217
221
|
exports.SchoolRepository = SchoolRepository = __decorate([
|
|
218
222
|
(0, common_1.Injectable)(),
|
|
219
|
-
|
|
220
|
-
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
221
|
-
typeorm_2.DataSource])
|
|
223
|
+
__metadata("design:paramtypes", [typeorm_1.DataSource])
|
|
222
224
|
], SchoolRepository);
|
|
223
225
|
//# sourceMappingURL=school.repository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"school.repository.js","sourceRoot":"","sources":["../../../../src/module/enterprise/repository/school.repository.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"school.repository.js","sourceRoot":"","sources":["../../../../src/module/enterprise/repository/school.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,qCAAiD;AAEjD,yFAAkF;AAG3E,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAC3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R,UAAU,EACV,YAAY,EACZ,SAAS,EACT,WAAW,EACX,eAAe,EACf,aAAa,GACd,GAAG,GAAG,CAAC;gBAER,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;oBACtB,MAAM,CAAC,QAAQ,CAAC,GAAG;wBACjB,QAAQ;wBACR,UAAU;wBACV,MAAM,EAAE,YAAY;wBACpB,IAAI,EAAE,OAAO;wBACb,OAAO,EAAE,EAAE;qBACZ,CAAC;gBACJ,CAAC;gBAED,IACE,SAAS;oBACT,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,EAChE,CAAC;oBACD,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;wBAC5B,SAAS;wBACT,WAAW;wBACX,eAAe;wBACf,MAAM,EAAE,aAAa;wBACrB,IAAI,EAAE,QAAQ;qBACf,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;YAED,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;CACF,CAAA;AA1PY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;qCAE8B,oBAAU;GADxC,gBAAgB,CA0P5B"}
|
|
@@ -8,7 +8,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.BrandService = void 0;
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
|
-
|
|
11
|
+
const entity_service_impl_service_1 = require("../../meta/service/entity-service-impl.service");
|
|
12
|
+
let BrandService = class BrandService extends entity_service_impl_service_1.EntityServiceImpl {
|
|
12
13
|
};
|
|
13
14
|
exports.BrandService = BrandService;
|
|
14
15
|
exports.BrandService = BrandService = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brand.service.js","sourceRoot":"","sources":["../../../../src/module/enterprise/service/brand.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;
|
|
1
|
+
{"version":3,"file":"brand.service.js","sourceRoot":"","sources":["../../../../src/module/enterprise/service/brand.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAC5C,gGAAwF;AAGjF,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,+CAAiB;CAAG,CAAA;AAAzC,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;GACA,YAAY,CAA6B"}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
+
import { ClockIDGenService } from 'src/utils/service/clockIDGenUtil.service';
|
|
1
2
|
import { EntityManager, Repository } from 'typeorm';
|
|
2
3
|
import { OrganizationData } from '../entity/organization.entity';
|
|
3
|
-
import {
|
|
4
|
-
import { UserService } from 'src/module/user/service/user.service';
|
|
5
|
-
import { BrandRepository } from '../repository/brand.repository';
|
|
4
|
+
import { WBSCodeGenService } from 'src/utils/service/wbsCodeGen.service';
|
|
6
5
|
import { SchoolRepository } from '../repository/school.repository';
|
|
7
6
|
export declare class OrganizationService {
|
|
8
7
|
private readonly organizationRepository;
|
|
9
|
-
private readonly brandRepository;
|
|
10
|
-
private readonly schoolRepository;
|
|
11
8
|
private readonly idGen;
|
|
12
|
-
private readonly
|
|
13
|
-
|
|
9
|
+
private readonly wbcCodeGenService;
|
|
10
|
+
private readonly schoolRepository;
|
|
11
|
+
constructor(organizationRepository: Repository<OrganizationData>, idGen: ClockIDGenService, wbcCodeGenService: WBSCodeGenService, schoolRepository: SchoolRepository);
|
|
14
12
|
create(organizationDto: Partial<OrganizationData>, manager?: EntityManager): Promise<OrganizationData>;
|
|
15
13
|
findAll(manager?: EntityManager): Promise<OrganizationData[]>;
|
|
16
14
|
findOne(id: number, manager?: EntityManager): Promise<OrganizationData | null>;
|
|
@@ -15,26 +15,64 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.OrganizationService = void 0;
|
|
16
16
|
const common_1 = require("@nestjs/common");
|
|
17
17
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
|
+
const clockIDGenUtil_service_1 = require("../../../utils/service/clockIDGenUtil.service");
|
|
18
19
|
const typeorm_2 = require("typeorm");
|
|
19
20
|
const organization_entity_1 = require("../entity/organization.entity");
|
|
20
|
-
const
|
|
21
|
-
const user_service_1 = require("../../user/service/user.service");
|
|
22
|
-
const brand_repository_1 = require("../repository/brand.repository");
|
|
21
|
+
const wbsCodeGen_service_1 = require("../../../utils/service/wbsCodeGen.service");
|
|
23
22
|
const school_repository_1 = require("../repository/school.repository");
|
|
24
23
|
let OrganizationService = class OrganizationService {
|
|
25
|
-
constructor(organizationRepository,
|
|
24
|
+
constructor(organizationRepository, idGen, wbcCodeGenService, schoolRepository) {
|
|
26
25
|
this.organizationRepository = organizationRepository;
|
|
27
|
-
this.brandRepository = brandRepository;
|
|
28
|
-
this.schoolRepository = schoolRepository;
|
|
29
26
|
this.idGen = idGen;
|
|
30
|
-
this.
|
|
27
|
+
this.wbcCodeGenService = wbcCodeGenService;
|
|
28
|
+
this.schoolRepository = schoolRepository;
|
|
31
29
|
}
|
|
32
30
|
async create(organizationDto, manager) {
|
|
33
31
|
const repo = manager
|
|
34
32
|
? manager.getRepository(organization_entity_1.OrganizationData)
|
|
35
33
|
: this.organizationRepository;
|
|
34
|
+
const isBrand = organizationDto.type === 'BRN';
|
|
35
|
+
if (isBrand) {
|
|
36
|
+
const parentOrgId = organizationDto.parent_id;
|
|
37
|
+
if (!parentOrgId) {
|
|
38
|
+
throw new Error('Parent Org ID is required to create a brand.');
|
|
39
|
+
}
|
|
40
|
+
const parentOrg = await repo.findOne({
|
|
41
|
+
where: { id: parentOrgId },
|
|
42
|
+
});
|
|
43
|
+
if (!parentOrg) {
|
|
44
|
+
throw new Error('Parent organization not found.');
|
|
45
|
+
}
|
|
46
|
+
const existingBrands = await repo.find({
|
|
47
|
+
where: {
|
|
48
|
+
type: 'BRN',
|
|
49
|
+
parent_id: parentOrgId,
|
|
50
|
+
},
|
|
51
|
+
select: ['wbs_code'],
|
|
52
|
+
});
|
|
53
|
+
const brandCodes = existingBrands
|
|
54
|
+
.map((b) => b.wbs_code?.split('.')[1])
|
|
55
|
+
.filter(Boolean)
|
|
56
|
+
.map(Number);
|
|
57
|
+
const nextBrnCode = brandCodes.length ? Math.max(...brandCodes) + 1 : 1;
|
|
58
|
+
const brnWbsCode = this.wbcCodeGenService.padCode(nextBrnCode);
|
|
59
|
+
organizationDto.wbs_code = `${parentOrg.wbs_code}.${brnWbsCode}`;
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
const existingOrgs = await repo.find({
|
|
63
|
+
where: {
|
|
64
|
+
type: (0, typeorm_2.IsNull)(),
|
|
65
|
+
},
|
|
66
|
+
select: ['wbs_code'],
|
|
67
|
+
});
|
|
68
|
+
const orgCodes = existingOrgs
|
|
69
|
+
.map((org) => org.wbs_code)
|
|
70
|
+
.filter(Boolean)
|
|
71
|
+
.map(Number);
|
|
72
|
+
const nextOrgCode = orgCodes.length ? Math.max(...orgCodes) + 1 : 1;
|
|
73
|
+
organizationDto.wbs_code = this.wbcCodeGenService.padCode(nextOrgCode);
|
|
74
|
+
}
|
|
36
75
|
organizationDto.code = this.idGen.idGenerator('ORG');
|
|
37
|
-
organizationDto.status = 'ACTIVE';
|
|
38
76
|
organizationDto.created_date = new Date();
|
|
39
77
|
const organization = repo.create(organizationDto);
|
|
40
78
|
return await repo.save(organization);
|
|
@@ -75,11 +113,9 @@ exports.OrganizationService = OrganizationService;
|
|
|
75
113
|
exports.OrganizationService = OrganizationService = __decorate([
|
|
76
114
|
(0, common_1.Injectable)(),
|
|
77
115
|
__param(0, (0, typeorm_1.InjectRepository)(organization_entity_1.OrganizationData)),
|
|
78
|
-
__param(4, (0, common_1.Inject)('UserService')),
|
|
79
116
|
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
80
|
-
brand_repository_1.BrandRepository,
|
|
81
|
-
school_repository_1.SchoolRepository,
|
|
82
117
|
clockIDGenUtil_service_1.ClockIDGenService,
|
|
83
|
-
|
|
118
|
+
wbsCodeGen_service_1.WBSCodeGenService,
|
|
119
|
+
school_repository_1.SchoolRepository])
|
|
84
120
|
], OrganizationService);
|
|
85
121
|
//# sourceMappingURL=organization.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.service.js","sourceRoot":"","sources":["../../../../src/module/enterprise/service/organization.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"organization.service.js","sourceRoot":"","sources":["../../../../src/module/enterprise/service/organization.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAmD;AACnD,0FAA6E;AAC7E,qCAA4D;AAC5D,uEAAiE;AAEjE,kFAAyE;AACzE,uEAAmE;AAG5D,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YAEmB,sBAAoD,EACpD,KAAwB,EACxB,iBAAoC,EACpC,gBAAkC;QAHlC,2BAAsB,GAAtB,sBAAsB,CAA8B;QACpD,UAAK,GAAL,KAAK,CAAmB;QACxB,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,qBAAgB,GAAhB,gBAAgB,CAAkB;IAClD,CAAC;IAEJ,KAAK,CAAC,MAAM,CACV,eAA0C,EAC1C,OAAuB;QAEvB,MAAM,IAAI,GAAG,OAAO;YAClB,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,sCAAgB,CAAC;YACzC,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC;QAEhC,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,KAAK,KAAK,CAAC;QAE/C,IAAI,OAAO,EAAE,CAAC;YAEZ,MAAM,WAAW,GAAG,eAAe,CAAC,SAAS,CAAC;YAE9C,IAAI,CAAC,WAAW,EAAE,CAAC;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AAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,KAAK,CAAC,MAAM,CACV,EAAU,EACV,eAA0C,EAC1C,OAAuB;QAEvB,MAAM,IAAI,GAAG,OAAO;YAClB,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,sCAAgB,CAAC;YACzC,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC;QAEhC,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC;QACvC,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,OAAuB;QAC9C,MAAM,IAAI,GAAG,OAAO;YAClB,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,sCAAgB,CAAC;YACzC,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC;QAEhC,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,wBAAwB,CAC5B,MAAc,EACd,OAAe,EACf,KAAa;QAEb,OAAO,MAAM,IAAI,CAAC,gBAAgB,CAAC,sBAAsB,CACvD,MAAM,EACN,OAAO,EACP,KAAK,CACN,CAAC;IACJ,CAAC;CACF,CAAA;AAtIY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,sCAAgB,CAAC,CAAA;qCACM,oBAAU;QAC3B,0CAAiB;QACL,sCAAiB;QAClB,oCAAgB;GAN1C,mBAAmB,CAsI/B"}
|
|
@@ -94,7 +94,7 @@ let FilterService = class FilterService {
|
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
const layoutPreference = await this.dataSource.query(`SELECT layout_json
|
|
97
|
-
FROM
|
|
97
|
+
FROM cr_entity_layout_pref
|
|
98
98
|
WHERE user_id = ? AND mapped_entity_type = ?`, [user_id, entity_type]);
|
|
99
99
|
const layout = layoutPreference?.[0]?.layout_json?.quick_tab || {};
|
|
100
100
|
let showList = layout?.show_list?.map((val) => val.toLowerCase()) || [];
|
|
@@ -32,6 +32,6 @@ __decorate([
|
|
|
32
32
|
__metadata("design:type", Object)
|
|
33
33
|
], LayoutPreference.prototype, "navigation_tabs_json", void 0);
|
|
34
34
|
exports.LayoutPreference = LayoutPreference = __decorate([
|
|
35
|
-
(0, typeorm_1.Entity)({ name: '
|
|
35
|
+
(0, typeorm_1.Entity)({ name: 'cr_entity_layout_pref' })
|
|
36
36
|
], LayoutPreference);
|
|
37
37
|
//# sourceMappingURL=layout_preference.entity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout_preference.entity.js","sourceRoot":"","sources":["../../../../src/module/layout_preference/entity/layout_preference.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6EAAuE;AACvE,qCAAiE;AAG1D,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,+BAAU;CAY/C,CAAA;AAZY,4CAAgB;AAE3B;IADC,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACvB;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDACxB;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;4DAC7B;AAG3B;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8DACf;2BAXf,gBAAgB;IAD5B,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"layout_preference.entity.js","sourceRoot":"","sources":["../../../../src/module/layout_preference/entity/layout_preference.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6EAAuE;AACvE,qCAAiE;AAG1D,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,+BAAU;CAY/C,CAAA;AAZY,4CAAgB;AAE3B;IADC,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACvB;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDACxB;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;4DAC7B;AAG3B;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8DACf;2BAXf,gBAAgB;IAD5B,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,CAAC;GAC7B,gBAAgB,CAY5B"}
|
|
@@ -7,14 +7,14 @@ export declare class LeadController {
|
|
|
7
7
|
name: string;
|
|
8
8
|
}[]>;
|
|
9
9
|
getBrandsByOrganization(organizationId: number): Promise<{
|
|
10
|
-
id:
|
|
11
|
-
name:
|
|
12
|
-
organizationId:
|
|
10
|
+
id: any;
|
|
11
|
+
name: any;
|
|
12
|
+
organizationId: any;
|
|
13
13
|
}[]>;
|
|
14
14
|
getSchoolsByBrandAndOrganization(brandId: number, organizationId: number): Promise<{
|
|
15
|
-
id:
|
|
16
|
-
name:
|
|
17
|
-
brandId:
|
|
18
|
-
organizationId:
|
|
15
|
+
id: any;
|
|
16
|
+
name: any;
|
|
17
|
+
brandId: any;
|
|
18
|
+
organizationId: any;
|
|
19
19
|
}[]>;
|
|
20
20
|
}
|
|
@@ -12,16 +12,12 @@ const lead_service_1 = require("./service/lead.service");
|
|
|
12
12
|
const lead_repository_1 = require("./repository/lead.repository");
|
|
13
13
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
14
14
|
const organization_entity_1 = require("../enterprise/entity/organization.entity");
|
|
15
|
-
const brand_entity_1 = require("../enterprise/entity/brand.entity");
|
|
16
|
-
const school_entity_1 = require("../enterprise/entity/school.entity");
|
|
17
15
|
let LeadModule = class LeadModule {
|
|
18
16
|
};
|
|
19
17
|
exports.LeadModule = LeadModule;
|
|
20
18
|
exports.LeadModule = LeadModule = __decorate([
|
|
21
19
|
(0, common_1.Module)({
|
|
22
|
-
imports: [
|
|
23
|
-
typeorm_1.TypeOrmModule.forFeature([organization_entity_1.OrganizationData, brand_entity_1.BrandData, school_entity_1.SchoolData]),
|
|
24
|
-
],
|
|
20
|
+
imports: [typeorm_1.TypeOrmModule.forFeature([organization_entity_1.OrganizationData])],
|
|
25
21
|
providers: [lead_service_1.LeadService, lead_repository_1.LeadRepository],
|
|
26
22
|
controllers: [],
|
|
27
23
|
exports: [lead_service_1.LeadService],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lead.module.js","sourceRoot":"","sources":["../../../src/module/lead/lead.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AAExC,yDAAqD;AACrD,kEAA8D;AAC9D,6CAAgD;AAChD,kFAA4E;
|
|
1
|
+
{"version":3,"file":"lead.module.js","sourceRoot":"","sources":["../../../src/module/lead/lead.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AAExC,yDAAqD;AACrD,kEAA8D;AAC9D,6CAAgD;AAChD,kFAA4E;AAQrE,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,gCAAU;qBAAV,UAAU;IANtB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,CAAC,sCAAgB,CAAC,CAAC,CAAC;QACvD,SAAS,EAAE,CAAC,0BAAW,EAAE,gCAAc,CAAC;QACxC,WAAW,EAAE,EAAE;QACf,OAAO,EAAE,CAAC,0BAAW,CAAC;KACvB,CAAC;GACW,UAAU,CAAG"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { BrandData } from 'src/module/enterprise/entity/brand.entity';
|
|
2
1
|
import { OrganizationData } from 'src/module/enterprise/entity/organization.entity';
|
|
3
|
-
import {
|
|
4
|
-
import { Repository } from 'typeorm';
|
|
2
|
+
import { DataSource, Repository } from 'typeorm';
|
|
5
3
|
export declare class LeadRepository {
|
|
6
4
|
private organizationRepository;
|
|
7
|
-
private
|
|
8
|
-
|
|
9
|
-
constructor(organizationRepository: Repository<OrganizationData>, brandRepository: Repository<BrandData>, schoolRepository: Repository<SchoolData>);
|
|
5
|
+
private readonly dataSource;
|
|
6
|
+
constructor(organizationRepository: Repository<OrganizationData>, dataSource: DataSource);
|
|
10
7
|
getAllOrganizations(): Promise<OrganizationData[]>;
|
|
11
|
-
getBrandsByOrganization(organization_id: number): Promise<
|
|
12
|
-
getSchoolsByBrandAndOrganization(brand_id: number, organization_id: number): Promise<
|
|
8
|
+
getBrandsByOrganization(organization_id: number): Promise<any[]>;
|
|
9
|
+
getSchoolsByBrandAndOrganization(brand_id: number, organization_id: number): Promise<any[]>;
|
|
13
10
|
}
|
|
@@ -15,38 +15,39 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.LeadRepository = void 0;
|
|
16
16
|
const common_1 = require("@nestjs/common");
|
|
17
17
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
|
-
const brand_entity_1 = require("../../enterprise/entity/brand.entity");
|
|
19
18
|
const organization_entity_1 = require("../../enterprise/entity/organization.entity");
|
|
20
|
-
const school_entity_1 = require("../../enterprise/entity/school.entity");
|
|
21
19
|
const typeorm_2 = require("typeorm");
|
|
22
20
|
let LeadRepository = class LeadRepository {
|
|
23
|
-
constructor(organizationRepository,
|
|
21
|
+
constructor(organizationRepository, dataSource) {
|
|
24
22
|
this.organizationRepository = organizationRepository;
|
|
25
|
-
this.
|
|
26
|
-
this.schoolRepository = schoolRepository;
|
|
23
|
+
this.dataSource = dataSource;
|
|
27
24
|
}
|
|
28
25
|
async getAllOrganizations() {
|
|
29
26
|
return this.organizationRepository.find();
|
|
30
27
|
}
|
|
31
28
|
async getBrandsByOrganization(organization_id) {
|
|
32
|
-
return this.
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
return await this.dataSource
|
|
30
|
+
.createQueryBuilder()
|
|
31
|
+
.select(['*'])
|
|
32
|
+
.from('eth_brand_profile', 'brd')
|
|
33
|
+
.where('brd.organization_id = :orgId', { orgId: organization_id })
|
|
34
|
+
.getRawMany();
|
|
35
35
|
}
|
|
36
36
|
async getSchoolsByBrandAndOrganization(brand_id, organization_id) {
|
|
37
|
-
return this.
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
return await this.dataSource
|
|
38
|
+
.createQueryBuilder()
|
|
39
|
+
.select(['*'])
|
|
40
|
+
.from('eth_school_profile', 'sch')
|
|
41
|
+
.where('sch.brand_id = :brdId', { brdId: brand_id })
|
|
42
|
+
.andWhere('sch.organization_id = :orgId', { orgId: organization_id })
|
|
43
|
+
.getRawMany();
|
|
40
44
|
}
|
|
41
45
|
};
|
|
42
46
|
exports.LeadRepository = LeadRepository;
|
|
43
47
|
exports.LeadRepository = LeadRepository = __decorate([
|
|
44
48
|
(0, common_1.Injectable)(),
|
|
45
49
|
__param(0, (0, typeorm_1.InjectRepository)(organization_entity_1.OrganizationData)),
|
|
46
|
-
__param(1, (0, typeorm_1.InjectRepository)(brand_entity_1.BrandData)),
|
|
47
|
-
__param(2, (0, typeorm_1.InjectRepository)(school_entity_1.SchoolData)),
|
|
48
50
|
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
49
|
-
typeorm_2.
|
|
50
|
-
typeorm_2.Repository])
|
|
51
|
+
typeorm_2.DataSource])
|
|
51
52
|
], LeadRepository);
|
|
52
53
|
//# sourceMappingURL=lead.repository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lead.repository.js","sourceRoot":"","sources":["../../../../src/module/lead/repository/lead.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAmD;
|
|
1
|
+
{"version":3,"file":"lead.repository.js","sourceRoot":"","sources":["../../../../src/module/lead/repository/lead.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAmD;AAEnD,qFAAoF;AAEpF,qCAAiD;AAG1C,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAEU,sBAAoD,EAC3C,UAAsB;QAD/B,2BAAsB,GAAtB,sBAAsB,CAA8B;QAC3C,eAAU,GAAV,UAAU,CAAY;IACtC,CAAC;IAEJ,KAAK,CAAC,mBAAmB;QACvB,OAAO,IAAI,CAAC,sBAAsB,CAAC,IAAI,EAAE,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,uBAAuB,CAAC,eAAuB;QACnD,OAAO,MAAM,IAAI,CAAC,UAAU;aACzB,kBAAkB,EAAE;aACpB,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;aACb,IAAI,CAAC,mBAAmB,EAAE,KAAK,CAAC;aAChC,KAAK,CAAC,8BAA8B,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC;aACjE,UAAU,EAAE,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,gCAAgC,CACpC,QAAgB,EAChB,eAAuB;QAEvB,OAAO,MAAM,IAAI,CAAC,UAAU;aACzB,kBAAkB,EAAE;aACpB,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;aACb,IAAI,CAAC,oBAAoB,EAAE,KAAK,CAAC;aACjC,KAAK,CAAC,uBAAuB,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;aACnD,QAAQ,CAAC,8BAA8B,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC;aACpE,UAAU,EAAE,CAAC;IAClB,CAAC;CACF,CAAA;AAhCY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,sCAAgB,CAAC,CAAA;qCACH,oBAAU;QACb,oBAAU;GAJ9B,cAAc,CAgC1B"}
|