rez_core 2.0.49 → 2.0.50
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/app.module.js +4 -0
- package/dist/app.module.js.map +1 -1
- package/dist/module/lead/controller/lead.controller.d.ts +20 -0
- package/dist/module/lead/controller/lead.controller.js +58 -0
- package/dist/module/lead/controller/lead.controller.js.map +1 -0
- package/dist/module/lead/lead.module.d.ts +2 -0
- package/dist/module/lead/lead.module.js +31 -0
- package/dist/module/lead/lead.module.js.map +1 -0
- package/dist/module/lead/repository/lead.repository.d.ts +13 -0
- package/dist/module/lead/repository/lead.repository.js +52 -0
- package/dist/module/lead/repository/lead.repository.js.map +1 -0
- package/dist/module/lead/service/lead.service.d.ts +20 -0
- package/dist/module/lead/service/lead.service.js +55 -0
- package/dist/module/lead/service/lead.service.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/app.module.ts +4 -0
- package/src/module/lead/controller/lead.controller.ts +30 -0
- package/src/module/lead/lead.module.ts +18 -0
- package/src/module/lead/repository/lead.repository.ts +37 -0
- package/src/module/lead/service/lead.service.ts +54 -0
package/dist/app.module.js
CHANGED
|
@@ -19,6 +19,8 @@ const properties_module_1 = require("./resources/properties.module");
|
|
|
19
19
|
const layout_module_1 = require("./module/layout/layout.module");
|
|
20
20
|
const listmaster_module_1 = require("./module/listmaster/listmaster.module");
|
|
21
21
|
const third_party_module_1 = require("./module/third-party-module/third-party.module");
|
|
22
|
+
const filter_module_1 = require("./module/filter/filter.module");
|
|
23
|
+
const lead_module_1 = require("./module/lead/lead.module");
|
|
22
24
|
let AppModule = class AppModule {
|
|
23
25
|
};
|
|
24
26
|
exports.AppModule = AppModule;
|
|
@@ -36,6 +38,8 @@ exports.AppModule = AppModule = __decorate([
|
|
|
36
38
|
layout_module_1.LayoutModule,
|
|
37
39
|
listmaster_module_1.ListMasterModule,
|
|
38
40
|
third_party_module_1.ThirdPartyModule,
|
|
41
|
+
filter_module_1.FilterModule,
|
|
42
|
+
lead_module_1.LeadModule,
|
|
39
43
|
],
|
|
40
44
|
})
|
|
41
45
|
], AppModule);
|
package/dist/app.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,0DAAwD;AACxD,6EAAyE;AACzE,uDAAmD;AACnD,2DAAuD;AACvD,+DAA2D;AAC3D,iEAA6D;AAC7D,mFAA+E;AAC/E,qEAAuD;AACvD,iEAA6D;AAC7D,6EAAyE;AACzE,uFAAkF;
|
|
1
|
+
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,0DAAwD;AACxD,6EAAyE;AACzE,uDAAmD;AACnD,2DAAuD;AACvD,+DAA2D;AAC3D,iEAA6D;AAC7D,mFAA+E;AAC/E,qEAAuD;AACvD,iEAA6D;AAC7D,6EAAyE;AACzE,uFAAkF;AAClF,iEAA6D;AAC7D,2DAAuD;AAmBhD,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IAjBrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,4BAAY;YACZ,8BAAc;YACd,oCAAgB;YAChB,0BAAW;YACX,wBAAU;YACV,4BAAY;YACZ,wCAAkB;YAClB,2BAAU;YACV,4BAAY;YACZ,oCAAgB;YAChB,qCAAgB;YAChB,4BAAY;YACZ,wBAAU;SACX;KACF,CAAC;GACW,SAAS,CAAG"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LeadService } from '../service/lead.service';
|
|
2
|
+
export declare class LeadController {
|
|
3
|
+
private readonly leadService;
|
|
4
|
+
constructor(leadService: LeadService);
|
|
5
|
+
getAllOrganizations(): Promise<{
|
|
6
|
+
id: number;
|
|
7
|
+
name: string;
|
|
8
|
+
}[]>;
|
|
9
|
+
getBrandsByOrganization(organizationId: number): Promise<{
|
|
10
|
+
id: number;
|
|
11
|
+
name: string;
|
|
12
|
+
organizationId: number;
|
|
13
|
+
}[]>;
|
|
14
|
+
getSchoolsByBrandAndOrganization(brandId: number, organizationId: number): Promise<{
|
|
15
|
+
id: number;
|
|
16
|
+
name: string;
|
|
17
|
+
brandId: number;
|
|
18
|
+
organizationId: number;
|
|
19
|
+
}[]>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
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.LeadController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const lead_service_1 = require("../service/lead.service");
|
|
18
|
+
let LeadController = class LeadController {
|
|
19
|
+
constructor(leadService) {
|
|
20
|
+
this.leadService = leadService;
|
|
21
|
+
}
|
|
22
|
+
async getAllOrganizations() {
|
|
23
|
+
return this.leadService.getAllOrganizations();
|
|
24
|
+
}
|
|
25
|
+
async getBrandsByOrganization(organizationId) {
|
|
26
|
+
return this.leadService.getBrandsByOrganization(organizationId);
|
|
27
|
+
}
|
|
28
|
+
async getSchoolsByBrandAndOrganization(brandId, organizationId) {
|
|
29
|
+
return this.leadService.getSchoolsByBrandAndOrganization(brandId, organizationId);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.LeadController = LeadController;
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, common_1.Get)('organizations'),
|
|
35
|
+
__metadata("design:type", Function),
|
|
36
|
+
__metadata("design:paramtypes", []),
|
|
37
|
+
__metadata("design:returntype", Promise)
|
|
38
|
+
], LeadController.prototype, "getAllOrganizations", null);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, common_1.Get)('brands/:organizationId'),
|
|
41
|
+
__param(0, (0, common_1.Param)('organizationId')),
|
|
42
|
+
__metadata("design:type", Function),
|
|
43
|
+
__metadata("design:paramtypes", [Number]),
|
|
44
|
+
__metadata("design:returntype", Promise)
|
|
45
|
+
], LeadController.prototype, "getBrandsByOrganization", null);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, common_1.Get)('schools'),
|
|
48
|
+
__param(0, (0, common_1.Query)('brandId')),
|
|
49
|
+
__param(1, (0, common_1.Query)('organizationId')),
|
|
50
|
+
__metadata("design:type", Function),
|
|
51
|
+
__metadata("design:paramtypes", [Number, Number]),
|
|
52
|
+
__metadata("design:returntype", Promise)
|
|
53
|
+
], LeadController.prototype, "getSchoolsByBrandAndOrganization", null);
|
|
54
|
+
exports.LeadController = LeadController = __decorate([
|
|
55
|
+
(0, common_1.Controller)('lead'),
|
|
56
|
+
__metadata("design:paramtypes", [lead_service_1.LeadService])
|
|
57
|
+
], LeadController);
|
|
58
|
+
//# sourceMappingURL=lead.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lead.controller.js","sourceRoot":"","sources":["../../../../src/module/lead/controller/lead.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA+D;AAC/D,0DAAsD;AAG/C,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAA6B,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IAAG,CAAC;IAGnD,AAAN,KAAK,CAAC,mBAAmB;QACvB,OAAO,IAAI,CAAC,WAAW,CAAC,mBAAmB,EAAE,CAAC;IAChD,CAAC;IAGK,AAAN,KAAK,CAAC,uBAAuB,CACF,cAAsB;QAE/C,OAAO,IAAI,CAAC,WAAW,CAAC,uBAAuB,CAAC,cAAc,CAAC,CAAC;IAClE,CAAC;IAGK,AAAN,KAAK,CAAC,gCAAgC,CAClB,OAAe,EACR,cAAsB;QAE/C,OAAO,IAAI,CAAC,WAAW,CAAC,gCAAgC,CACtD,OAAO,EACP,cAAc,CACf,CAAC;IACJ,CAAC;CACF,CAAA;AAzBY,wCAAc;AAInB;IADL,IAAA,YAAG,EAAC,eAAe,CAAC;;;;yDAGpB;AAGK;IADL,IAAA,YAAG,EAAC,wBAAwB,CAAC;IAE3B,WAAA,IAAA,cAAK,EAAC,gBAAgB,CAAC,CAAA;;;;6DAGzB;AAGK;IADL,IAAA,YAAG,EAAC,SAAS,CAAC;IAEZ,WAAA,IAAA,cAAK,EAAC,SAAS,CAAC,CAAA;IAChB,WAAA,IAAA,cAAK,EAAC,gBAAgB,CAAC,CAAA;;;;sEAMzB;yBAxBU,cAAc;IAD1B,IAAA,mBAAU,EAAC,MAAM,CAAC;qCAEyB,0BAAW;GAD1C,cAAc,CAyB1B"}
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.LeadModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const lead_controller_1 = require("./controller/lead.controller");
|
|
12
|
+
const lead_service_1 = require("./service/lead.service");
|
|
13
|
+
const lead_repository_1 = require("./repository/lead.repository");
|
|
14
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
15
|
+
const organization_entity_1 = require("../enterprise/entity/organization.entity");
|
|
16
|
+
const brand_entity_1 = require("../enterprise/entity/brand.entity");
|
|
17
|
+
const school_entity_1 = require("../enterprise/entity/school.entity");
|
|
18
|
+
let LeadModule = class LeadModule {
|
|
19
|
+
};
|
|
20
|
+
exports.LeadModule = LeadModule;
|
|
21
|
+
exports.LeadModule = LeadModule = __decorate([
|
|
22
|
+
(0, common_1.Module)({
|
|
23
|
+
imports: [
|
|
24
|
+
typeorm_1.TypeOrmModule.forFeature([organization_entity_1.OrganizationData, brand_entity_1.BrandData, school_entity_1.SchoolData]),
|
|
25
|
+
],
|
|
26
|
+
providers: [lead_service_1.LeadService, lead_repository_1.LeadRepository],
|
|
27
|
+
controllers: [lead_controller_1.LeadController],
|
|
28
|
+
exports: [],
|
|
29
|
+
})
|
|
30
|
+
], LeadModule);
|
|
31
|
+
//# sourceMappingURL=lead.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lead.module.js","sourceRoot":"","sources":["../../../src/module/lead/lead.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,kEAA8D;AAC9D,yDAAqD;AACrD,kEAA8D;AAC9D,6CAAgD;AAChD,kFAA4E;AAC5E,oEAA8D;AAC9D,sEAAgE;AAUzD,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,gCAAU;qBAAV,UAAU;IARtB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC,CAAC,sCAAgB,EAAE,wBAAS,EAAE,0BAAU,CAAC,CAAC;SACpE;QACD,SAAS,EAAE,CAAC,0BAAW,EAAE,gCAAc,CAAC;QACxC,WAAW,EAAE,CAAC,gCAAc,CAAC;QAC7B,OAAO,EAAE,EAAE;KACZ,CAAC;GACW,UAAU,CAAG"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BrandData } from 'src/module/enterprise/entity/brand.entity';
|
|
2
|
+
import { OrganizationData } from 'src/module/enterprise/entity/organization.entity';
|
|
3
|
+
import { SchoolData } from 'src/module/enterprise/entity/school.entity';
|
|
4
|
+
import { Repository } from 'typeorm';
|
|
5
|
+
export declare class LeadRepository {
|
|
6
|
+
private organizationRepository;
|
|
7
|
+
private brandRepository;
|
|
8
|
+
private schoolRepository;
|
|
9
|
+
constructor(organizationRepository: Repository<OrganizationData>, brandRepository: Repository<BrandData>, schoolRepository: Repository<SchoolData>);
|
|
10
|
+
getAllOrganizations(): Promise<OrganizationData[]>;
|
|
11
|
+
getBrandsByOrganization(organization_id: number): Promise<BrandData[]>;
|
|
12
|
+
getSchoolsByBrandAndOrganization(brand_id: number, organization_id: number): Promise<SchoolData[]>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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.LeadRepository = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
|
+
const brand_entity_1 = require("../../enterprise/entity/brand.entity");
|
|
19
|
+
const organization_entity_1 = require("../../enterprise/entity/organization.entity");
|
|
20
|
+
const school_entity_1 = require("../../enterprise/entity/school.entity");
|
|
21
|
+
const typeorm_2 = require("typeorm");
|
|
22
|
+
let LeadRepository = class LeadRepository {
|
|
23
|
+
constructor(organizationRepository, brandRepository, schoolRepository) {
|
|
24
|
+
this.organizationRepository = organizationRepository;
|
|
25
|
+
this.brandRepository = brandRepository;
|
|
26
|
+
this.schoolRepository = schoolRepository;
|
|
27
|
+
}
|
|
28
|
+
async getAllOrganizations() {
|
|
29
|
+
return this.organizationRepository.find();
|
|
30
|
+
}
|
|
31
|
+
async getBrandsByOrganization(organization_id) {
|
|
32
|
+
return this.brandRepository.find({
|
|
33
|
+
where: { organization_id },
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
async getSchoolsByBrandAndOrganization(brand_id, organization_id) {
|
|
37
|
+
return this.schoolRepository.find({
|
|
38
|
+
where: { brand_id, organization_id },
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
exports.LeadRepository = LeadRepository;
|
|
43
|
+
exports.LeadRepository = LeadRepository = __decorate([
|
|
44
|
+
(0, common_1.Injectable)(),
|
|
45
|
+
__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
|
+
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
49
|
+
typeorm_2.Repository,
|
|
50
|
+
typeorm_2.Repository])
|
|
51
|
+
], LeadRepository);
|
|
52
|
+
//# sourceMappingURL=lead.repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lead.repository.js","sourceRoot":"","sources":["../../../../src/module/lead/repository/lead.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAmD;AACnD,uEAAsE;AACtE,qFAAoF;AACpF,yEAAwE;AACxE,qCAAqC;AAG9B,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAEU,sBAAoD,EAEpD,eAAsC,EAEtC,gBAAwC;QAJxC,2BAAsB,GAAtB,sBAAsB,CAA8B;QAEpD,oBAAe,GAAf,eAAe,CAAuB;QAEtC,qBAAgB,GAAhB,gBAAgB,CAAwB;IAC/C,CAAC;IAEJ,KAAK,CAAC,mBAAmB;QACvB,OAAO,IAAI,CAAC,sBAAsB,CAAC,IAAI,EAAE,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,uBAAuB,CAAC,eAAuB;QACnD,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC;YAC/B,KAAK,EAAE,EAAE,eAAe,EAAE;SAC3B,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,gCAAgC,CACpC,QAAgB,EAChB,eAAuB;QAEvB,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC;YAChC,KAAK,EAAE,EAAE,QAAQ,EAAE,eAAe,EAAE;SACrC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AA5BY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,sCAAgB,CAAC,CAAA;IAElC,WAAA,IAAA,0BAAgB,EAAC,wBAAS,CAAC,CAAA;IAE3B,WAAA,IAAA,0BAAgB,EAAC,0BAAU,CAAC,CAAA;qCAHG,oBAAU;QAEjB,oBAAU;QAET,oBAAU;GAP3B,cAAc,CA4B1B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LeadRepository } from '../repository/lead.repository';
|
|
2
|
+
export declare class LeadService {
|
|
3
|
+
private readonly leadRepository;
|
|
4
|
+
constructor(leadRepository: LeadRepository);
|
|
5
|
+
getAllOrganizations(): Promise<{
|
|
6
|
+
id: number;
|
|
7
|
+
name: string;
|
|
8
|
+
}[]>;
|
|
9
|
+
getBrandsByOrganization(organizationId: number): Promise<{
|
|
10
|
+
id: number;
|
|
11
|
+
name: string;
|
|
12
|
+
organizationId: number;
|
|
13
|
+
}[]>;
|
|
14
|
+
getSchoolsByBrandAndOrganization(brandId: number, organizationId: number): Promise<{
|
|
15
|
+
id: number;
|
|
16
|
+
name: string;
|
|
17
|
+
brandId: number;
|
|
18
|
+
organizationId: number;
|
|
19
|
+
}[]>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.LeadService = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const lead_repository_1 = require("../repository/lead.repository");
|
|
15
|
+
let LeadService = class LeadService {
|
|
16
|
+
constructor(leadRepository) {
|
|
17
|
+
this.leadRepository = leadRepository;
|
|
18
|
+
}
|
|
19
|
+
async getAllOrganizations() {
|
|
20
|
+
const organizations = await this.leadRepository.getAllOrganizations();
|
|
21
|
+
return organizations.map((org) => ({
|
|
22
|
+
id: org.id,
|
|
23
|
+
name: org.name,
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
async getBrandsByOrganization(organizationId) {
|
|
27
|
+
const brands = await this.leadRepository.getBrandsByOrganization(organizationId);
|
|
28
|
+
if (!brands.length) {
|
|
29
|
+
throw new common_1.NotFoundException(`No brands found for organization ID ${organizationId}`);
|
|
30
|
+
}
|
|
31
|
+
return brands.map((brand) => ({
|
|
32
|
+
id: brand.id,
|
|
33
|
+
name: brand.name,
|
|
34
|
+
organizationId: brand.organization_id,
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
async getSchoolsByBrandAndOrganization(brandId, organizationId) {
|
|
38
|
+
const schools = await this.leadRepository.getSchoolsByBrandAndOrganization(brandId, organizationId);
|
|
39
|
+
if (!schools.length) {
|
|
40
|
+
throw new common_1.NotFoundException(`No schools found for brand ID ${brandId} and organization ID ${organizationId}`);
|
|
41
|
+
}
|
|
42
|
+
return schools.map((school) => ({
|
|
43
|
+
id: school.id,
|
|
44
|
+
name: school.name,
|
|
45
|
+
brandId: school.brand_id,
|
|
46
|
+
organizationId: school.organization_id,
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
exports.LeadService = LeadService;
|
|
51
|
+
exports.LeadService = LeadService = __decorate([
|
|
52
|
+
(0, common_1.Injectable)(),
|
|
53
|
+
__metadata("design:paramtypes", [lead_repository_1.LeadRepository])
|
|
54
|
+
], LeadService);
|
|
55
|
+
//# sourceMappingURL=lead.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lead.service.js","sourceRoot":"","sources":["../../../../src/module/lead/service/lead.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA+D;AAC/D,mEAA+D;AAGxD,IAAM,WAAW,GAAjB,MAAM,WAAW;IACtB,YAA6B,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;IAAG,CAAC;IAE/D,KAAK,CAAC,mBAAmB;QACvB,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,mBAAmB,EAAE,CAAC;QACtE,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YACjC,EAAE,EAAE,GAAG,CAAC,EAAE;YACV,IAAI,EAAE,GAAG,CAAC,IAAI;SAEf,CAAC,CAAC,CAAC;IACN,CAAC;IAED,KAAK,CAAC,uBAAuB,CAAC,cAAsB;QAClD,MAAM,MAAM,GACV,MAAM,IAAI,CAAC,cAAc,CAAC,uBAAuB,CAAC,cAAc,CAAC,CAAC;QACpE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YACnB,MAAM,IAAI,0BAAiB,CACzB,uCAAuC,cAAc,EAAE,CACxD,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YAC5B,EAAE,EAAE,KAAK,CAAC,EAAE;YACZ,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,cAAc,EAAE,KAAK,CAAC,eAAe;SAEtC,CAAC,CAAC,CAAC;IACN,CAAC;IAED,KAAK,CAAC,gCAAgC,CACpC,OAAe,EACf,cAAsB;QAEtB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,gCAAgC,CACxE,OAAO,EACP,cAAc,CACf,CAAC;QACF,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;YACpB,MAAM,IAAI,0BAAiB,CACzB,iCAAiC,OAAO,wBAAwB,cAAc,EAAE,CACjF,CAAC;QACJ,CAAC;QACD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YAC9B,EAAE,EAAE,MAAM,CAAC,EAAE;YACb,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,OAAO,EAAE,MAAM,CAAC,QAAQ;YACxB,cAAc,EAAE,MAAM,CAAC,eAAe;SAEvC,CAAC,CAAC,CAAC;IACN,CAAC;CACF,CAAA;AAjDY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;qCAEkC,gCAAc;GADhD,WAAW,CAiDvB"}
|