rez_core 2.0.42 → 2.0.44
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/auth/strategies/jwt.strategy.d.ts +2 -0
- package/dist/module/auth/strategies/jwt.strategy.js +3 -1
- package/dist/module/auth/strategies/jwt.strategy.js.map +1 -1
- package/dist/module/enterprise/controller/organization.controller.d.ts +3 -0
- package/dist/module/enterprise/controller/organization.controller.js +14 -0
- package/dist/module/enterprise/controller/organization.controller.js.map +1 -1
- package/dist/module/enterprise/enterprise.module.js +10 -1
- package/dist/module/enterprise/enterprise.module.js.map +1 -1
- package/dist/module/enterprise/entity/school.entity.js +11 -0
- package/dist/module/enterprise/entity/school.entity.js.map +1 -1
- package/dist/module/enterprise/repository/brand.repository.d.ts +8 -0
- package/dist/module/enterprise/repository/brand.repository.js +39 -0
- package/dist/module/enterprise/repository/brand.repository.js.map +1 -0
- package/dist/module/enterprise/repository/school.repository.d.ts +10 -0
- package/dist/module/enterprise/repository/school.repository.js +146 -0
- package/dist/module/enterprise/repository/school.repository.js.map +1 -0
- package/dist/module/enterprise/service/organization.service.d.ts +8 -1
- package/dist/module/enterprise/service/organization.service.js +15 -2
- package/dist/module/enterprise/service/organization.service.js.map +1 -1
- package/dist/module/meta/controller/app-master.controller.d.ts +9 -0
- package/dist/module/meta/controller/app-master.controller.js +51 -0
- package/dist/module/meta/controller/app-master.controller.js.map +1 -0
- package/dist/module/meta/entity/app-master.entity.d.ts +6 -1
- package/dist/module/meta/entity/app-master.entity.js +26 -6
- package/dist/module/meta/entity/app-master.entity.js.map +1 -1
- package/dist/module/meta/entity.module.js +13 -0
- package/dist/module/meta/entity.module.js.map +1 -1
- package/dist/module/meta/repository/app-master.repository.d.ts +7 -0
- package/dist/module/meta/repository/app-master.repository.js +36 -0
- package/dist/module/meta/repository/app-master.repository.js.map +1 -0
- package/dist/module/meta/service/app-master.service.d.ts +8 -0
- package/dist/module/meta/service/app-master.service.js +42 -0
- package/dist/module/meta/service/app-master.service.js.map +1 -0
- package/dist/module/user/repository/user-role-mapping.repository.d.ts +3 -0
- package/dist/module/user/repository/user-role-mapping.repository.js +9 -0
- package/dist/module/user/repository/user-role-mapping.repository.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/auth/strategies/jwt.strategy.ts +4 -0
- package/src/module/enterprise/controller/organization.controller.ts +11 -0
- package/src/module/enterprise/enterprise.module.ts +10 -1
- package/src/module/enterprise/entity/school.entity.ts +3 -1
- package/src/module/enterprise/repository/brand.repository.ts +23 -0
- package/src/module/enterprise/repository/school.repository.ts +155 -0
- package/src/module/enterprise/service/organization.service.ts +13 -2
- package/src/module/meta/controller/app-master.controller.ts +38 -0
- package/src/module/meta/entity/app-master.entity.ts +17 -2
- package/src/module/meta/entity.module.ts +13 -0
- package/src/module/meta/repository/app-master.repository.ts +20 -0
- package/src/module/meta/service/app-master.service.ts +34 -0
- package/src/module/user/repository/user-role-mapping.repository.ts +14 -0
|
@@ -24,7 +24,7 @@ let JwtStrategy = class JwtStrategy extends (0, passport_1.PassportStrategy)(pas
|
|
|
24
24
|
this.configService = configService;
|
|
25
25
|
}
|
|
26
26
|
async validate(payload) {
|
|
27
|
-
const { userId, sessionToken, appcode, email_id, organization_id, enterprise_id, } = payload;
|
|
27
|
+
const { userId, sessionToken, appcode, email_id, organization_id, enterprise_id, level_id, level_type } = payload;
|
|
28
28
|
let userData = {
|
|
29
29
|
id: userId,
|
|
30
30
|
sessionToken: sessionToken,
|
|
@@ -32,6 +32,8 @@ let JwtStrategy = class JwtStrategy extends (0, passport_1.PassportStrategy)(pas
|
|
|
32
32
|
email_id: email_id,
|
|
33
33
|
organization_id: organization_id,
|
|
34
34
|
enterprise_id: enterprise_id,
|
|
35
|
+
level_id: level_id,
|
|
36
|
+
level_type: level_type,
|
|
35
37
|
};
|
|
36
38
|
return { userData };
|
|
37
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jwt.strategy.js","sourceRoot":"","sources":["../../../../src/module/auth/strategies/jwt.strategy.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAAoD;AACpD,+CAAoD;AACpD,2CAAmE;AAKnE,2CAA+C;AAGxC,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,IAAA,2BAAgB,EAAC,uBAAQ,CAAC;IACzD,YAA6B,aAA4B;QACvD,KAAK,CAAC;YACJ,cAAc,EAAE,yBAAU,CAAC,2BAA2B,EAAE;YACxD,gBAAgB,EAAE,KAAK;YACvB,WAAW,EAAE,aAAa,CAAC,GAAG,CAAC,YAAY,CAAC;SAC7C,CAAC,CAAC;QALwB,kBAAa,GAAb,aAAa,CAAe;IAMzD,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,OAAO;QACpB,MAAM,EACJ,MAAM,EACN,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,eAAe,EACf,aAAa,
|
|
1
|
+
{"version":3,"file":"jwt.strategy.js","sourceRoot":"","sources":["../../../../src/module/auth/strategies/jwt.strategy.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAAoD;AACpD,+CAAoD;AACpD,2CAAmE;AAKnE,2CAA+C;AAGxC,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,IAAA,2BAAgB,EAAC,uBAAQ,CAAC;IACzD,YAA6B,aAA4B;QACvD,KAAK,CAAC;YACJ,cAAc,EAAE,yBAAU,CAAC,2BAA2B,EAAE;YACxD,gBAAgB,EAAE,KAAK;YACvB,WAAW,EAAE,aAAa,CAAC,GAAG,CAAC,YAAY,CAAC;SAC7C,CAAC,CAAC;QALwB,kBAAa,GAAb,aAAa,CAAe;IAMzD,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,OAAO;QACpB,MAAM,EACJ,MAAM,EACN,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,eAAe,EACf,aAAa,EACb,QAAQ,EACR,UAAU,EACX,GAAG,OAAO,CAAC;QAeZ,IAAI,QAAQ,GAAG;YACb,EAAE,EAAE,MAAM;YACV,YAAY,EAAE,YAAY;YAC1B,OAAO,EAAE,OAAO;YAChB,QAAQ,EAAE,QAAQ;YAClB,eAAe,EAAE,eAAe;YAChC,aAAa,EAAE,aAAa;YAC5B,QAAQ,EAAE,QAAQ;YAClB,UAAU,EAAE,UAAU;SACvB,CAAC;QAEF,OAAO,EAAE,QAAQ,EAAE,CAAC;IACtB,CAAC;CACF,CAAA;AA/CY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;qCAEiC,sBAAa;GAD9C,WAAW,CA+CvB"}
|
|
@@ -8,4 +8,7 @@ export declare class OrganizationController {
|
|
|
8
8
|
getOrganizationDropdown(req: Request & {
|
|
9
9
|
user: any;
|
|
10
10
|
}): Promise<import("../entity/organization.entity").OrganizationData[]>;
|
|
11
|
+
getOrganizationHierarchy(req: Request & {
|
|
12
|
+
user: any;
|
|
13
|
+
}): Promise<unknown[]>;
|
|
11
14
|
}
|
|
@@ -26,6 +26,12 @@ let OrganizationController = class OrganizationController {
|
|
|
26
26
|
const userData = req.user.userData;
|
|
27
27
|
return this.orgService.findById(userData?.organization_id);
|
|
28
28
|
}
|
|
29
|
+
async getOrganizationHierarchy(req) {
|
|
30
|
+
const userId = req.user.userData?.id;
|
|
31
|
+
const appcode = req.user.userData?.appcode;
|
|
32
|
+
console.log(userId, appcode, 'userId, appcode');
|
|
33
|
+
return await this.orgService.getOrganizationHierarchy(userId, appcode);
|
|
34
|
+
}
|
|
29
35
|
};
|
|
30
36
|
exports.OrganizationController = OrganizationController;
|
|
31
37
|
__decorate([
|
|
@@ -36,6 +42,14 @@ __decorate([
|
|
|
36
42
|
__metadata("design:paramtypes", [Object]),
|
|
37
43
|
__metadata("design:returntype", Promise)
|
|
38
44
|
], OrganizationController.prototype, "getOrganizationDropdown", null);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, common_1.UseGuards)(jwt_guard_1.JwtAuthGuard),
|
|
47
|
+
(0, common_1.Get)('hierarchy'),
|
|
48
|
+
__param(0, (0, common_1.Req)()),
|
|
49
|
+
__metadata("design:type", Function),
|
|
50
|
+
__metadata("design:paramtypes", [Object]),
|
|
51
|
+
__metadata("design:returntype", Promise)
|
|
52
|
+
], OrganizationController.prototype, "getOrganizationHierarchy", null);
|
|
39
53
|
exports.OrganizationController = OrganizationController = __decorate([
|
|
40
54
|
(0, common_1.Controller)('organization'),
|
|
41
55
|
__param(1, (0, common_1.Inject)('UserService')),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.controller.js","sourceRoot":"","sources":["../../../../src/module/enterprise/controller/organization.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAyE;AACzE,0EAAsE;AAEtE,2DAAgE;AAChE,kEAAmE;AAI5D,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;CACF,CAAA;
|
|
1
|
+
{"version":3,"file":"organization.controller.js","sourceRoot":"","sources":["../../../../src/module/enterprise/controller/organization.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAyE;AACzE,0EAAsE;AAEtE,2DAAgE;AAChE,kEAAmE;AAI5D,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;QAE3C,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC;QAEhD,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,wBAAwB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzE,CAAC;CACF,CAAA;AAzBY,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;;;;sEAOpC;iCAxBU,sBAAsB;IADlC,IAAA,mBAAU,EAAC,cAAc,CAAC;IAItB,WAAA,IAAA,eAAM,EAAC,aAAa,CAAC,CAAA;qCADO,0CAAmB;QACK,0BAAW;GAHvD,sBAAsB,CAyBlC"}
|
|
@@ -17,6 +17,9 @@ const organization_app_mapping_service_1 = require("./service/organization-app-m
|
|
|
17
17
|
const organization_app_mapping_entity_1 = require("./entity/organization-app-mapping.entity");
|
|
18
18
|
const brand_entity_1 = require("./entity/brand.entity");
|
|
19
19
|
const school_entity_1 = require("./entity/school.entity");
|
|
20
|
+
const brand_repository_1 = require("./repository/brand.repository");
|
|
21
|
+
const school_repository_1 = require("./repository/school.repository");
|
|
22
|
+
const utils_module_1 = require("../../utils/utils.module");
|
|
20
23
|
let EnterpriseModule = class EnterpriseModule {
|
|
21
24
|
};
|
|
22
25
|
exports.EnterpriseModule = EnterpriseModule;
|
|
@@ -30,9 +33,15 @@ exports.EnterpriseModule = EnterpriseModule = __decorate([
|
|
|
30
33
|
school_entity_1.SchoolData,
|
|
31
34
|
]),
|
|
32
35
|
user_module_1.UserModule,
|
|
36
|
+
utils_module_1.UtilsModule,
|
|
33
37
|
],
|
|
34
38
|
controllers: [organization_controller_1.OrganizationController],
|
|
35
|
-
providers: [
|
|
39
|
+
providers: [
|
|
40
|
+
organization_service_1.OrganizationService,
|
|
41
|
+
organization_app_mapping_service_1.OrganizationAppMappingService,
|
|
42
|
+
brand_repository_1.BrandRepository,
|
|
43
|
+
school_repository_1.SchoolRepository,
|
|
44
|
+
],
|
|
36
45
|
exports: [organization_service_1.OrganizationService],
|
|
37
46
|
})
|
|
38
47
|
], EnterpriseModule);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enterprise.module.js","sourceRoot":"","sources":["../../../src/module/enterprise/enterprise.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,yEAAqE;AACrE,sEAAgE;AAChE,kFAA8E;AAC9E,qDAAiD;AACjD,iGAA2F;AAC3F,8FAAkF;AAClF,wDAAkD;AAClD,0DAAoD;
|
|
1
|
+
{"version":3,"file":"enterprise.module.js","sourceRoot":"","sources":["../../../src/module/enterprise/enterprise.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,yEAAqE;AACrE,sEAAgE;AAChE,kFAA8E;AAC9E,qDAAiD;AACjD,iGAA2F;AAC3F,8FAAkF;AAClF,wDAAkD;AAClD,0DAAoD;AACpD,oEAAgE;AAChE,sEAAkE;AAClE,2DAAqD;AAsB9C,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAAG,CAAA;AAAnB,4CAAgB;2BAAhB,gBAAgB;IApB5B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC;gBACvB,sCAAgB;gBAChB,wDAAsB;gBACtB,wBAAS;gBACT,0BAAU;aACX,CAAC;YACF,wBAAU;YACV,0BAAW;SACZ;QACD,WAAW,EAAE,CAAC,gDAAsB,CAAC;QACrC,SAAS,EAAE;YACT,0CAAmB;YACnB,gEAA6B;YAC7B,kCAAe;YACf,oCAAgB;SACjB;QACD,OAAO,EAAE,CAAC,0CAAmB,CAAC;KAC/B,CAAC;GACW,gBAAgB,CAAG"}
|
|
@@ -5,6 +5,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
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
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
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
|
+
};
|
|
8
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
12
|
exports.SchoolData = void 0;
|
|
10
13
|
const base_entity_entity_1 = require("../../meta/entity/base-entity.entity");
|
|
@@ -12,6 +15,14 @@ const typeorm_1 = require("typeorm");
|
|
|
12
15
|
let SchoolData = class SchoolData extends base_entity_entity_1.BaseEntity {
|
|
13
16
|
};
|
|
14
17
|
exports.SchoolData = SchoolData;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.Column)({ name: 'brand_id', nullable: true }),
|
|
20
|
+
__metadata("design:type", Number)
|
|
21
|
+
], SchoolData.prototype, "brand_id", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.Column)({ name: 'brand_code', nullable: true }),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], SchoolData.prototype, "brand_code", void 0);
|
|
15
26
|
exports.SchoolData = SchoolData = __decorate([
|
|
16
27
|
(0, typeorm_1.Entity)({ name: 'cr_school' })
|
|
17
28
|
], SchoolData);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"school.entity.js","sourceRoot":"","sources":["../../../../src/module/enterprise/entity/school.entity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"school.entity.js","sourceRoot":"","sources":["../../../../src/module/enterprise/entity/school.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6EAAuE;AACvE,qCAAyC;AAGlC,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,+BAAU;CAMzC,CAAA;AANY,gCAAU;AAErB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CAC5B;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CAC5B;qBALR,UAAU;IADtB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;GACjB,UAAU,CAMtB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Repository } from 'typeorm';
|
|
2
|
+
import { BrandData } from '../entity/brand.entity';
|
|
3
|
+
export declare class BrandRepository {
|
|
4
|
+
private readonly brandRepository;
|
|
5
|
+
constructor(brandRepository: Repository<BrandData>);
|
|
6
|
+
findAllByOrgId(orgId: number): Promise<BrandData[]>;
|
|
7
|
+
findOne(id: number): Promise<BrandData | null>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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.BrandRepository = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
|
+
const typeorm_2 = require("typeorm");
|
|
19
|
+
const brand_entity_1 = require("../entity/brand.entity");
|
|
20
|
+
let BrandRepository = class BrandRepository {
|
|
21
|
+
constructor(brandRepository) {
|
|
22
|
+
this.brandRepository = brandRepository;
|
|
23
|
+
}
|
|
24
|
+
async findAllByOrgId(orgId) {
|
|
25
|
+
return await this.brandRepository.find({
|
|
26
|
+
where: { organization_id: orgId },
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
async findOne(id) {
|
|
30
|
+
return await this.brandRepository.findOne({ where: { id } });
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports.BrandRepository = BrandRepository;
|
|
34
|
+
exports.BrandRepository = BrandRepository = __decorate([
|
|
35
|
+
(0, common_1.Injectable)(),
|
|
36
|
+
__param(0, (0, typeorm_1.InjectRepository)(brand_entity_1.BrandData)),
|
|
37
|
+
__metadata("design:paramtypes", [typeorm_2.Repository])
|
|
38
|
+
], BrandRepository);
|
|
39
|
+
//# sourceMappingURL=brand.repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brand.repository.js","sourceRoot":"","sources":["../../../../src/module/enterprise/repository/brand.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAmD;AAEnD,qCAAqC;AACrC,yDAAmD;AAG5C,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,YAEmB,eAAsC;QAAtC,oBAAe,GAAf,eAAe,CAAuB;IACtD,CAAC;IAEJ,KAAK,CAAC,cAAc,CAAC,KAAa;QAChC,OAAO,MAAM,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC;YACrC,KAAK,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE;SAClC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,EAAU;QACtB,OAAO,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAC/D,CAAC;CACF,CAAA;AAfY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,wBAAS,CAAC,CAAA;qCACM,oBAAU;GAHnC,eAAe,CAe3B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DataSource, Repository } from 'typeorm';
|
|
2
|
+
import { SchoolData } from '../entity/school.entity';
|
|
3
|
+
export declare class SchoolRepository {
|
|
4
|
+
private readonly schoolRepo;
|
|
5
|
+
private readonly dataSource;
|
|
6
|
+
constructor(schoolRepo: Repository<SchoolData>, dataSource: DataSource);
|
|
7
|
+
findAllByOrgId(brdId: number): Promise<SchoolData[]>;
|
|
8
|
+
findAllByBrandId(brdId: number): Promise<SchoolData[]>;
|
|
9
|
+
getUserContextDropdown(userId: number, appCode: string): Promise<unknown[]>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
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.SchoolRepository = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
|
+
const typeorm_2 = require("typeorm");
|
|
19
|
+
const school_entity_1 = require("../entity/school.entity");
|
|
20
|
+
const user_role_mapping_entity_1 = require("../../user/entity/user-role-mapping.entity");
|
|
21
|
+
let SchoolRepository = class SchoolRepository {
|
|
22
|
+
constructor(schoolRepo, dataSource) {
|
|
23
|
+
this.schoolRepo = schoolRepo;
|
|
24
|
+
this.dataSource = dataSource;
|
|
25
|
+
}
|
|
26
|
+
async findAllByOrgId(brdId) {
|
|
27
|
+
return await this.schoolRepo.find({
|
|
28
|
+
where: { brand_id: brdId },
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
async findAllByBrandId(brdId) {
|
|
32
|
+
return await this.schoolRepo.find({
|
|
33
|
+
where: { brand_id: brdId },
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
async getUserContextDropdown(userId, appCode) {
|
|
37
|
+
const userRoleRepo = this.dataSource.getRepository(user_role_mapping_entity_1.UserRoleMapping);
|
|
38
|
+
const hasOrgAccess = await userRoleRepo
|
|
39
|
+
.createQueryBuilder('urm')
|
|
40
|
+
.where('urm.user_id = :userId', { userId })
|
|
41
|
+
.andWhere('urm.appcode = :appCode', { appCode })
|
|
42
|
+
.andWhere('urm.level_type = :levelType', { levelType: 'ORG' })
|
|
43
|
+
.getRawMany();
|
|
44
|
+
console.log(hasOrgAccess);
|
|
45
|
+
if (hasOrgAccess.length > 0) {
|
|
46
|
+
const schools = await this.dataSource
|
|
47
|
+
.createQueryBuilder()
|
|
48
|
+
.select([
|
|
49
|
+
'org.id AS org_id',
|
|
50
|
+
'org.name AS org_name',
|
|
51
|
+
'br.id AS brand_id',
|
|
52
|
+
'br.name AS brand_name',
|
|
53
|
+
'sch.id AS school_id',
|
|
54
|
+
'sch.name AS school_name',
|
|
55
|
+
])
|
|
56
|
+
.from('cr_school', 'sch')
|
|
57
|
+
.innerJoin('cr_brand', 'br', 'sch.brand_id = br.id')
|
|
58
|
+
.innerJoin('cr_organization', 'org', 'br.organization_id = org.id')
|
|
59
|
+
.where('org.id = :orgId', { orgId: hasOrgAccess[0].urm_level_id })
|
|
60
|
+
.getRawMany();
|
|
61
|
+
const result = {};
|
|
62
|
+
for (const row of schools) {
|
|
63
|
+
const { org_id, org_name, brand_id, brand_name, school_id, school_name, } = row;
|
|
64
|
+
if (!result[org_id]) {
|
|
65
|
+
result[org_id] = {
|
|
66
|
+
org_id,
|
|
67
|
+
org_name,
|
|
68
|
+
brands: {},
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
if (!result[org_id].brands[brand_id]) {
|
|
72
|
+
result[org_id].brands[brand_id] = {
|
|
73
|
+
brand_id,
|
|
74
|
+
brand_name,
|
|
75
|
+
schools: [],
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
result[org_id].brands[brand_id].schools.push({
|
|
79
|
+
school_id,
|
|
80
|
+
school_name,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
return Object.values(result).map((org) => ({
|
|
84
|
+
...org,
|
|
85
|
+
brands: Object.values(org.brands),
|
|
86
|
+
}));
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
const brnMappings = await this.dataSource
|
|
90
|
+
.createQueryBuilder()
|
|
91
|
+
.select([
|
|
92
|
+
'brand.id AS brand_id',
|
|
93
|
+
'brand.name AS brand_name',
|
|
94
|
+
'school.id AS school_id',
|
|
95
|
+
'school.name AS school_name',
|
|
96
|
+
])
|
|
97
|
+
.from('cr_user_role_mapping', 'urm')
|
|
98
|
+
.innerJoin('cr_brand', 'brand', 'brand.id = urm.level_id')
|
|
99
|
+
.innerJoin('cr_school', 'school', 'school.brand_id = brand.id')
|
|
100
|
+
.where('urm.user_id = :userId', { userId })
|
|
101
|
+
.andWhere('urm.appcode = :appCode', { appCode })
|
|
102
|
+
.andWhere('urm.level_type = :levelType', { levelType: 'BRN' })
|
|
103
|
+
.getRawMany();
|
|
104
|
+
const schMappings = await this.dataSource
|
|
105
|
+
.createQueryBuilder()
|
|
106
|
+
.select([
|
|
107
|
+
'brand.id AS brand_id',
|
|
108
|
+
'brand.name AS brand_name',
|
|
109
|
+
'school.id AS school_id',
|
|
110
|
+
'school.name AS school_name',
|
|
111
|
+
])
|
|
112
|
+
.from('cr_user_role_mapping', 'urm')
|
|
113
|
+
.innerJoin('cr_school', 'school', 'school.id = urm.level_id')
|
|
114
|
+
.innerJoin('cr_brand', 'brand', 'brand.id = school.brand_id')
|
|
115
|
+
.where('urm.user_id = :userId', { userId })
|
|
116
|
+
.andWhere('urm.appcode = :appCode', { appCode })
|
|
117
|
+
.andWhere('urm.level_type = :levelType', { levelType: 'SCH' })
|
|
118
|
+
.getRawMany();
|
|
119
|
+
const allMappings = [...brnMappings, ...schMappings];
|
|
120
|
+
const result = {};
|
|
121
|
+
for (const row of allMappings) {
|
|
122
|
+
const { brand_id, brand_name, school_id, school_name } = row;
|
|
123
|
+
if (!result[brand_id]) {
|
|
124
|
+
result[brand_id] = {
|
|
125
|
+
brand_id,
|
|
126
|
+
brand_name,
|
|
127
|
+
schools: [],
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
if (school_id &&
|
|
131
|
+
!result[brand_id].schools.some((s) => s.school_id === school_id)) {
|
|
132
|
+
result[brand_id].schools.push({ school_id, school_name });
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return Object.values(result);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
exports.SchoolRepository = SchoolRepository;
|
|
140
|
+
exports.SchoolRepository = SchoolRepository = __decorate([
|
|
141
|
+
(0, common_1.Injectable)(),
|
|
142
|
+
__param(0, (0, typeorm_1.InjectRepository)(school_entity_1.SchoolData)),
|
|
143
|
+
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
144
|
+
typeorm_2.DataSource])
|
|
145
|
+
], SchoolRepository);
|
|
146
|
+
//# sourceMappingURL=school.repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"school.repository.js","sourceRoot":"","sources":["../../../../src/module/enterprise/repository/school.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAmD;AACnD,qCAAiD;AACjD,2DAAqD;AACrD,yFAAkF;AAG3E,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAC3B,YAEmB,UAAkC,EAClC,UAAsB;QADtB,eAAU,GAAV,UAAU,CAAwB;QAClC,eAAU,GAAV,UAAU,CAAY;IACtC,CAAC;IAEJ,KAAK,CAAC,cAAc,CAAC,KAAa;QAChC,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YAChC,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE;SAC3B,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,KAAa;Q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CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,EAChE,CAAC;oBACD,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,CAAC;gBAC5D,CAAC;YACH,CAAC;YAED,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;CACF,CAAA;AAnJY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,0BAAU,CAAC,CAAA;qCACA,oBAAU;QACV,oBAAU;GAJ9B,gBAAgB,CAmJ5B"}
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import { EntityManager, Repository } from 'typeorm';
|
|
2
2
|
import { OrganizationData } from '../entity/organization.entity';
|
|
3
3
|
import { ClockIDGenService } from 'src/utils/service/clockIDGenUtil.service';
|
|
4
|
+
import { UserService } from 'src/module/user/service/user.service';
|
|
5
|
+
import { BrandRepository } from '../repository/brand.repository';
|
|
6
|
+
import { SchoolRepository } from '../repository/school.repository';
|
|
4
7
|
export declare class OrganizationService {
|
|
5
8
|
private readonly organizationRepository;
|
|
9
|
+
private readonly brandRepository;
|
|
10
|
+
private readonly schoolRepository;
|
|
6
11
|
private readonly idGen;
|
|
7
|
-
|
|
12
|
+
private readonly userService;
|
|
13
|
+
constructor(organizationRepository: Repository<OrganizationData>, brandRepository: BrandRepository, schoolRepository: SchoolRepository, idGen: ClockIDGenService, userService: UserService);
|
|
8
14
|
create(organizationDto: Partial<OrganizationData>, manager?: EntityManager): Promise<OrganizationData>;
|
|
9
15
|
findAll(manager?: EntityManager): Promise<OrganizationData[]>;
|
|
10
16
|
findOne(id: number, manager?: EntityManager): Promise<OrganizationData | null>;
|
|
11
17
|
findById(id: number | undefined): Promise<OrganizationData[]>;
|
|
12
18
|
update(id: number, organizationDto: Partial<OrganizationData>, manager?: EntityManager): Promise<OrganizationData | null>;
|
|
13
19
|
remove(id: number, manager?: EntityManager): Promise<void>;
|
|
20
|
+
getOrganizationHierarchy(userId: number, appCode: string): Promise<unknown[]>;
|
|
14
21
|
}
|
|
@@ -18,10 +18,16 @@ const typeorm_1 = require("@nestjs/typeorm");
|
|
|
18
18
|
const typeorm_2 = require("typeorm");
|
|
19
19
|
const organization_entity_1 = require("../entity/organization.entity");
|
|
20
20
|
const clockIDGenUtil_service_1 = require("../../../utils/service/clockIDGenUtil.service");
|
|
21
|
+
const user_service_1 = require("../../user/service/user.service");
|
|
22
|
+
const brand_repository_1 = require("../repository/brand.repository");
|
|
23
|
+
const school_repository_1 = require("../repository/school.repository");
|
|
21
24
|
let OrganizationService = class OrganizationService {
|
|
22
|
-
constructor(organizationRepository, idGen) {
|
|
25
|
+
constructor(organizationRepository, brandRepository, schoolRepository, idGen, userService) {
|
|
23
26
|
this.organizationRepository = organizationRepository;
|
|
27
|
+
this.brandRepository = brandRepository;
|
|
28
|
+
this.schoolRepository = schoolRepository;
|
|
24
29
|
this.idGen = idGen;
|
|
30
|
+
this.userService = userService;
|
|
25
31
|
}
|
|
26
32
|
async create(organizationDto, manager) {
|
|
27
33
|
const repo = manager
|
|
@@ -61,12 +67,19 @@ let OrganizationService = class OrganizationService {
|
|
|
61
67
|
: this.organizationRepository;
|
|
62
68
|
await repo.delete(id);
|
|
63
69
|
}
|
|
70
|
+
async getOrganizationHierarchy(userId, appCode) {
|
|
71
|
+
return await this.schoolRepository.getUserContextDropdown(userId, appCode);
|
|
72
|
+
}
|
|
64
73
|
};
|
|
65
74
|
exports.OrganizationService = OrganizationService;
|
|
66
75
|
exports.OrganizationService = OrganizationService = __decorate([
|
|
67
76
|
(0, common_1.Injectable)(),
|
|
68
77
|
__param(0, (0, typeorm_1.InjectRepository)(organization_entity_1.OrganizationData)),
|
|
78
|
+
__param(4, (0, common_1.Inject)('UserService')),
|
|
69
79
|
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
70
|
-
|
|
80
|
+
brand_repository_1.BrandRepository,
|
|
81
|
+
school_repository_1.SchoolRepository,
|
|
82
|
+
clockIDGenUtil_service_1.ClockIDGenService,
|
|
83
|
+
user_service_1.UserService])
|
|
71
84
|
], OrganizationService);
|
|
72
85
|
//# 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,2CAAoD;AACpD,6CAAmD;AACnD,qCAAoD;AACpD,uEAAiE;AACjE,0FAA6E;AAC7E,kEAAmE;AAEnE,qEAAiE;AACjE,uEAAmE;AAG5D,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YAEmB,sBAAoD,EACpD,eAAgC,EAChC,gBAAkC,EAClC,KAAwB,EACD,WAAwB;QAJ/C,2BAAsB,GAAtB,sBAAsB,CAA8B;QACpD,oBAAe,GAAf,eAAe,CAAiB;QAChC,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,UAAK,GAAL,KAAK,CAAmB;QACD,gBAAW,GAAX,WAAW,CAAa;IAC/D,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,eAAe,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QACrD,eAAe,CAAC,MAAM,GAAG,QAAQ,CAAC;QAClC,eAAe,CAAC,YAAY,GAAG,IAAI,IAAI,EAAE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AE,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,CAAC,MAAc,EAAE,OAAe;QAC5D,OAAO,MAAM,IAAI,CAAC,gBAAgB,CAAC,sBAAsB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7E,CAAC;CACF,CAAA;AAxEY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,sCAAgB,CAAC,CAAA;IAKlC,WAAA,IAAA,eAAM,EAAC,aAAa,CAAC,CAAA;qCAJmB,oBAAU;QACjB,kCAAe;QACd,oCAAgB;QAC3B,0CAAiB;QACY,0BAAW;GAPvD,mBAAmB,CAwE/B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Response } from 'express';
|
|
2
|
+
import { AppMasterService } from '../service/app-master.service';
|
|
3
|
+
export declare class AppMasterController {
|
|
4
|
+
private appMasterService;
|
|
5
|
+
constructor(appMasterService: AppMasterService);
|
|
6
|
+
getAppByAppCode(req: Request & {
|
|
7
|
+
user: any;
|
|
8
|
+
}, res: Response): Promise<Response<any, Record<string, any>>>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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.AppMasterController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const jwt_guard_1 = require("../../auth/guards/jwt.guard");
|
|
18
|
+
const app_master_service_1 = require("../service/app-master.service");
|
|
19
|
+
let AppMasterController = class AppMasterController {
|
|
20
|
+
constructor(appMasterService) {
|
|
21
|
+
this.appMasterService = appMasterService;
|
|
22
|
+
}
|
|
23
|
+
async getAppByAppCode(req, res) {
|
|
24
|
+
try {
|
|
25
|
+
const id = req.user.userData.id;
|
|
26
|
+
const data = await this.appMasterService.getAppMasterDataByAppCode(id);
|
|
27
|
+
return res.status(common_1.HttpStatus.OK).json(data);
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
return res.status(common_1.HttpStatus.INTERNAL_SERVER_ERROR).json({
|
|
31
|
+
success: false,
|
|
32
|
+
message: error.message || 'Error fetching entity data',
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
exports.AppMasterController = AppMasterController;
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, common_1.Get)(''),
|
|
40
|
+
__param(0, (0, common_1.Req)()),
|
|
41
|
+
__param(1, (0, common_1.Res)()),
|
|
42
|
+
__metadata("design:type", Function),
|
|
43
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
44
|
+
__metadata("design:returntype", Promise)
|
|
45
|
+
], AppMasterController.prototype, "getAppByAppCode", null);
|
|
46
|
+
exports.AppMasterController = AppMasterController = __decorate([
|
|
47
|
+
(0, common_1.Controller)('apps'),
|
|
48
|
+
(0, common_1.UseGuards)(jwt_guard_1.JwtAuthGuard),
|
|
49
|
+
__metadata("design:paramtypes", [app_master_service_1.AppMasterService])
|
|
50
|
+
], AppMasterController);
|
|
51
|
+
//# sourceMappingURL=app-master.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-master.controller.js","sourceRoot":"","sources":["../../../../src/module/meta/controller/app-master.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CASwB;AACxB,2DAA2D;AAE3D,sEAAiE;AAI1D,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YAAoB,gBAAkC;QAAlC,qBAAgB,GAAhB,gBAAgB,CAAkB;IAAG,CAAC;IAGpD,AAAN,KAAK,CAAC,eAAe,CACZ,GAA4B,EAC5B,GAAa;QAEpB,IAAI,CAAC;YACH,MAAM,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YAEhC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,yBAAyB,CAAC,EAAE,CAAC,CAAC;YAEvE,OAAO,GAAG,CAAC,MAAM,CAAC,mBAAU,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,GAAG,CAAC,MAAM,CAAC,mBAAU,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC;gBACvD,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,4BAA4B;aACvD,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF,CAAA;AArBY,kDAAmB;AAIxB;IADL,IAAA,YAAG,EAAC,EAAE,CAAC;IAEL,WAAA,IAAA,YAAG,GAAE,CAAA;IACL,WAAA,IAAA,YAAG,GAAE,CAAA;;;;0DAcP;8BApBU,mBAAmB;IAF/B,IAAA,mBAAU,EAAC,MAAM,CAAC;IAClB,IAAA,kBAAS,EAAC,wBAAY,CAAC;qCAEgB,qCAAgB;GAD3C,mBAAmB,CAqB/B"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { BaseEntity } from './base-entity.entity';
|
|
2
|
-
export declare class
|
|
2
|
+
export declare class AppMaster extends BaseEntity {
|
|
3
3
|
constructor();
|
|
4
4
|
id: number;
|
|
5
|
+
type: string;
|
|
6
|
+
color: string;
|
|
7
|
+
route: string;
|
|
8
|
+
description: string;
|
|
9
|
+
backgroudColor: string;
|
|
5
10
|
}
|
|
@@ -9,22 +9,42 @@ 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
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.AppMaster = void 0;
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
const base_entity_entity_1 = require("./base-entity.entity");
|
|
15
|
-
let
|
|
15
|
+
let AppMaster = class AppMaster extends base_entity_entity_1.BaseEntity {
|
|
16
16
|
constructor() {
|
|
17
17
|
super();
|
|
18
18
|
this.entity_type = 'APM';
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
|
-
exports.
|
|
21
|
+
exports.AppMaster = AppMaster;
|
|
22
22
|
__decorate([
|
|
23
23
|
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
24
24
|
__metadata("design:type", Number)
|
|
25
|
-
],
|
|
26
|
-
|
|
25
|
+
], AppMaster.prototype, "id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.Column)({ name: 'type', type: 'varchar', nullable: true }),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], AppMaster.prototype, "type", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({ name: 'color', type: 'varchar', nullable: true }),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], AppMaster.prototype, "color", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({ name: 'route', type: 'varchar', nullable: true }),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], AppMaster.prototype, "route", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)({ name: 'description', type: 'varchar', nullable: true }),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], AppMaster.prototype, "description", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({ name: 'backgroudColor', type: 'varchar', nullable: true }),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], AppMaster.prototype, "backgroudColor", void 0);
|
|
46
|
+
exports.AppMaster = AppMaster = __decorate([
|
|
27
47
|
(0, typeorm_1.Entity)({ name: 'cr_app_master' }),
|
|
28
48
|
__metadata("design:paramtypes", [])
|
|
29
|
-
],
|
|
49
|
+
], AppMaster);
|
|
30
50
|
//# sourceMappingURL=app-master.entity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-master.entity.js","sourceRoot":"","sources":["../../../../src/module/meta/entity/app-master.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"app-master.entity.js","sourceRoot":"","sources":["../../../../src/module/meta/entity/app-master.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAiE;AACjE,6DAAkD;AAG3C,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,+BAAU;IACvC;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC3B,CAAC;CAmBF,CAAA;AAvBY,8BAAS;AAOpB;IADC,IAAA,gCAAsB,GAAE;;qCACd;AAGX;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uCAC7C;AAGb;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCAC7C;AAGd;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCAC7C;AAGd;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CAC7C;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDAC7C;oBAtBZ,SAAS;IADrB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC;;GACrB,SAAS,CAuBrB"}
|
|
@@ -50,6 +50,12 @@ const filter_module_1 = require("../filter/filter.module");
|
|
|
50
50
|
const user_app_mapping_service_1 = require("./service/user-app-mapping.service");
|
|
51
51
|
const user_app_mapping_repository_1 = require("./repository/user-app-mapping.repository");
|
|
52
52
|
const user_app_mapping_entity_1 = require("./entity/user-app-mapping.entity");
|
|
53
|
+
const app_master_controller_1 = require("./controller/app-master.controller");
|
|
54
|
+
const user_role_mapping_repository_1 = require("../user/repository/user-role-mapping.repository");
|
|
55
|
+
const user_role_mapping_entity_1 = require("../user/entity/user-role-mapping.entity");
|
|
56
|
+
const app_master_service_1 = require("./service/app-master.service");
|
|
57
|
+
const app_master_repository_1 = require("./repository/app-master.repository");
|
|
58
|
+
const app_master_entity_1 = require("./entity/app-master.entity");
|
|
53
59
|
let EntityModule = class EntityModule {
|
|
54
60
|
};
|
|
55
61
|
exports.EntityModule = EntityModule;
|
|
@@ -69,6 +75,8 @@ exports.EntityModule = EntityModule = __decorate([
|
|
|
69
75
|
section_master_entity_1.SectionMaster,
|
|
70
76
|
field_group_entity_1.FieldGroup,
|
|
71
77
|
user_app_mapping_entity_1.UserAppMapping,
|
|
78
|
+
user_role_mapping_entity_1.UserRoleMapping,
|
|
79
|
+
app_master_entity_1.AppMaster,
|
|
72
80
|
]),
|
|
73
81
|
(0, common_1.forwardRef)(() => listmaster_module_1.ListMasterModule),
|
|
74
82
|
(0, common_1.forwardRef)(() => filter_module_1.FilterModule),
|
|
@@ -96,6 +104,9 @@ exports.EntityModule = EntityModule = __decorate([
|
|
|
96
104
|
{ provide: 'ViewMasterService', useClass: view_master_service_1.ViewMasterService },
|
|
97
105
|
user_app_mapping_service_1.UserAppMappingService,
|
|
98
106
|
user_app_mapping_repository_1.UserAppMappingRepository,
|
|
107
|
+
user_role_mapping_repository_1.UserRoleMappingRepository,
|
|
108
|
+
app_master_repository_1.AppMasterRespository,
|
|
109
|
+
app_master_service_1.AppMasterService,
|
|
99
110
|
],
|
|
100
111
|
exports: [
|
|
101
112
|
entity_master_service_1.EntityMasterService,
|
|
@@ -112,6 +123,7 @@ exports.EntityModule = EntityModule = __decorate([
|
|
|
112
123
|
attribute_master_service_1.AttributeMasterService,
|
|
113
124
|
user_app_mapping_service_1.UserAppMappingService,
|
|
114
125
|
user_app_mapping_repository_1.UserAppMappingRepository,
|
|
126
|
+
app_master_service_1.AppMasterService,
|
|
115
127
|
],
|
|
116
128
|
controllers: [
|
|
117
129
|
entity_controller_1.EntityController,
|
|
@@ -119,6 +131,7 @@ exports.EntityModule = EntityModule = __decorate([
|
|
|
119
131
|
media_controller_1.MediaController,
|
|
120
132
|
view_master_controller_1.ViewMasterController,
|
|
121
133
|
meta_controller_1.MetaController,
|
|
134
|
+
app_master_controller_1.AppMasterController,
|
|
122
135
|
],
|
|
123
136
|
})
|
|
124
137
|
], EntityModule);
|