@aldb2b/common 1.0.926 → 1.0.928
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/build/entities/models/common/common.provider.d.ts +12 -0
- package/build/entities/models/common/common.provider.js +16 -0
- package/build/entities/models/common/common.provider.js.map +1 -1
- package/build/entities/models/common/controllers/preference-customization.controller.d.ts +15 -0
- package/build/entities/models/common/controllers/preference-customization.controller.js +86 -0
- package/build/entities/models/common/controllers/preference-customization.controller.js.map +1 -0
- package/build/entities/models/common/dto/create-preference-customization.dto.d.ts +10 -0
- package/build/entities/models/common/dto/create-preference-customization.dto.js +46 -0
- package/build/entities/models/common/dto/create-preference-customization.dto.js.map +1 -0
- package/build/entities/models/common/dto/find-preference-customization.dto.d.ts +3 -0
- package/build/entities/models/common/dto/find-preference-customization.dto.js +8 -0
- package/build/entities/models/common/dto/find-preference-customization.dto.js.map +1 -0
- package/build/entities/models/common/dto/update-preference-customization.dto.d.ts +7 -0
- package/build/entities/models/common/dto/update-preference-customization.dto.js +36 -0
- package/build/entities/models/common/dto/update-preference-customization.dto.js.map +1 -0
- package/build/entities/models/common/entities/preference-customization.entity.d.ts +49 -0
- package/build/entities/models/common/entities/preference-customization.entity.js +123 -0
- package/build/entities/models/common/entities/preference-customization.entity.js.map +1 -0
- package/build/entities/models/common/index.d.ts +4 -0
- package/build/entities/models/common/index.js +4 -0
- package/build/entities/models/common/index.js.map +1 -1
- package/build/entities/models/common/repositories/preference-customization.repository.d.ts +7 -0
- package/build/entities/models/common/repositories/preference-customization.repository.js +12 -0
- package/build/entities/models/common/repositories/preference-customization.repository.js.map +1 -0
- package/build/entities/models/common/services/preference-customization.service.d.ts +17 -0
- package/build/entities/models/common/services/preference-customization.service.js +33 -0
- package/build/entities/models/common/services/preference-customization.service.js.map +1 -0
- package/build/enums/database-model.enum.d.ts +1 -0
- package/build/enums/database-model.enum.js +1 -0
- package/build/enums/database-model.enum.js.map +1 -1
- package/build/enums/preference-customization-type.enum.d.ts +5 -0
- package/build/enums/preference-customization-type.enum.js +10 -0
- package/build/enums/preference-customization-type.enum.js.map +1 -0
- package/build/enums/repository-provider.enum.d.ts +2 -1
- package/build/enums/repository-provider.enum.js +1 -0
- package/build/enums/repository-provider.enum.js.map +1 -1
- package/build/enums/service-provider.enum.d.ts +2 -1
- package/build/enums/service-provider.enum.js +1 -0
- package/build/enums/service-provider.enum.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -33,6 +33,8 @@ import { AuditTrail } from './entities/audit-trail.entity';
|
|
|
33
33
|
import { AuditTrailRepository } from './repositories/audit-trail.repository';
|
|
34
34
|
import { AuditTrailService } from './services/audit-trail.service';
|
|
35
35
|
import { CustomModel } from '../../../db/CustomModel';
|
|
36
|
+
import { PreferenceCustomization } from './entities/preference-customization.entity';
|
|
37
|
+
import { PreferenceCustomizationRepository } from './repositories/preference-customization.repository';
|
|
36
38
|
export declare const commonProviders: ({
|
|
37
39
|
provide: DatabaseModel;
|
|
38
40
|
useFactory: (connection: import("mongoose").Connection, eventConnection: import("mongoose").Connection, userConnection: import("mongoose").Connection) => import("mongoose").Model<AuditTrail, {}, {}, {}, import("mongoose").Document<unknown, {}, AuditTrail> & AuditTrail & Required<{
|
|
@@ -47,4 +49,14 @@ export declare const commonProviders: ({
|
|
|
47
49
|
provide: ServiceProvider;
|
|
48
50
|
inject: (DatabaseModel | RepositoryProvider)[];
|
|
49
51
|
useFactory: (auditLogRepository: AuditTrailRepository, userModel: CustomModel<User>) => AuditTrailService;
|
|
52
|
+
} | {
|
|
53
|
+
provide: DatabaseModel;
|
|
54
|
+
useFactory: (connection: import("mongoose").Connection, eventConnection: import("mongoose").Connection, companyConnection: import("mongoose").Connection) => import("mongoose").Model<PreferenceCustomization, {}, {}, {}, import("mongoose").Document<unknown, {}, PreferenceCustomization> & PreferenceCustomization & Required<{
|
|
55
|
+
_id: string;
|
|
56
|
+
}>, any>;
|
|
57
|
+
inject: DatabaseConnection[];
|
|
58
|
+
} | {
|
|
59
|
+
provide: RepositoryProvider;
|
|
60
|
+
inject: DatabaseModel[];
|
|
61
|
+
useFactory: (preferenceCustomizationModel: CustomModel<PreferenceCustomization>) => PreferenceCustomizationRepository;
|
|
50
62
|
})[];
|
|
@@ -8,6 +8,8 @@ const service_provider_enum_1 = require("../../../enums/service-provider.enum");
|
|
|
8
8
|
const audit_trail_entity_1 = require("./entities/audit-trail.entity");
|
|
9
9
|
const audit_trail_repository_1 = require("./repositories/audit-trail.repository");
|
|
10
10
|
const audit_trail_service_1 = require("./services/audit-trail.service");
|
|
11
|
+
const preference_customization_entity_1 = require("./entities/preference-customization.entity");
|
|
12
|
+
const preference_customization_repository_1 = require("./repositories/preference-customization.repository");
|
|
11
13
|
exports.commonProviders = [
|
|
12
14
|
{
|
|
13
15
|
provide: database_model_enum_1.DatabaseModel.AUDIT_TRAIL_MODEL,
|
|
@@ -31,5 +33,19 @@ exports.commonProviders = [
|
|
|
31
33
|
],
|
|
32
34
|
useFactory: (auditLogRepository, userModel) => new audit_trail_service_1.AuditTrailService(auditLogRepository, userModel),
|
|
33
35
|
},
|
|
36
|
+
{
|
|
37
|
+
provide: database_model_enum_1.DatabaseModel.PREFERENCE_CUSTOMIZATION_MODEL,
|
|
38
|
+
useFactory: preference_customization_entity_1.preferenceCustomizationFactory,
|
|
39
|
+
inject: [
|
|
40
|
+
database_connection_enum_1.DatabaseConnection.CURRENT_CONNECTION,
|
|
41
|
+
database_connection_enum_1.DatabaseConnection.EVENT_CONNECTION,
|
|
42
|
+
database_connection_enum_1.DatabaseConnection.COMPANY_CONNECTION,
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
provide: repository_provider_enum_1.RepositoryProvider.PREFERENCE_CUSTOMIZATION_REPOSITORY,
|
|
47
|
+
inject: [database_model_enum_1.DatabaseModel.PREFERENCE_CUSTOMIZATION_MODEL],
|
|
48
|
+
useFactory: (preferenceCustomizationModel) => new preference_customization_repository_1.PreferenceCustomizationRepository(preferenceCustomizationModel),
|
|
49
|
+
},
|
|
34
50
|
];
|
|
35
51
|
//# sourceMappingURL=common.provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.provider.js","sourceRoot":"","sources":["../../../../src/entities/models/common/common.provider.ts"],"names":[],"mappings":";;;AAAA,4EAAkE;AAClE,sFAA4E;AAC5E,sFAA4E;AAC5E,gFAAsE;AAEtE,sEAA6E;AAC7E,kFAA4E;AAC5E,wEAAkE;
|
|
1
|
+
{"version":3,"file":"common.provider.js","sourceRoot":"","sources":["../../../../src/entities/models/common/common.provider.ts"],"names":[],"mappings":";;;AAAA,4EAAkE;AAClE,sFAA4E;AAC5E,sFAA4E;AAC5E,gFAAsE;AAEtE,sEAA6E;AAC7E,kFAA4E;AAC5E,wEAAkE;AAElE,gGAGmD;AACnD,4GAAsG;AAEzF,QAAA,eAAe,GAAG;IAC7B;QACE,OAAO,EAAE,mCAAa,CAAC,iBAAiB;QACxC,UAAU,EAAE,sCAAiB;QAC7B,MAAM,EAAE;YACN,6CAAkB,CAAC,kBAAkB;YACrC,6CAAkB,CAAC,gBAAgB;YACnC,6CAAkB,CAAC,eAAe;SACnC;KACF;IACD;QACE,OAAO,EAAE,6CAAkB,CAAC,sBAAsB;QAClD,MAAM,EAAE,CAAC,mCAAa,CAAC,iBAAiB,CAAC;QACzC,UAAU,EAAE,CAAC,UAAmC,EAAE,EAAE,CAClD,IAAI,6CAAoB,CAAC,UAAU,CAAC;KACvC;IACD;QACE,OAAO,EAAE,uCAAe,CAAC,mBAAmB;QAC5C,MAAM,EAAE;YACN,6CAAkB,CAAC,sBAAsB;YACzC,mCAAa,CAAC,UAAU;SACzB;QACD,UAAU,EAAE,CACV,kBAAwC,EACxC,SAA4B,EAC5B,EAAE,CAAC,IAAI,uCAAiB,CAAC,kBAAkB,EAAE,SAAS,CAAC;KAC1D;IAED;QACE,OAAO,EAAE,mCAAa,CAAC,8BAA8B;QACrD,UAAU,EAAE,gEAA8B;QAC1C,MAAM,EAAE;YACN,6CAAkB,CAAC,kBAAkB;YACrC,6CAAkB,CAAC,gBAAgB;YACnC,6CAAkB,CAAC,kBAAkB;SACtC;KACF;IACD;QACE,OAAO,EAAE,6CAAkB,CAAC,mCAAmC;QAC/D,MAAM,EAAE,CAAC,mCAAa,CAAC,8BAA8B,CAAC;QACtD,UAAU,EAAE,CACV,4BAAkE,EAClE,EAAE,CAAC,IAAI,uEAAiC,CAAC,4BAA4B,CAAC;KACzE;CACF,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PreferenceCustomizationService } from '../services/preference-customization.service';
|
|
2
|
+
import { PreferenceCustomization } from '../entities/preference-customization.entity';
|
|
3
|
+
import { FindPreferenceCustomizationDto } from '../dto/find-preference-customization.dto';
|
|
4
|
+
import { ReadResult } from '../../../../types/read-result.interface';
|
|
5
|
+
import { CreatePreferenceCustomizationDto } from '../dto/create-preference-customization.dto';
|
|
6
|
+
import { UpdatePreferenceCustomizationDto } from '../dto/update-preference-customization.dto';
|
|
7
|
+
import { HeaderUser } from '../../../../types/header-user.interface';
|
|
8
|
+
export declare class PreferenceCustomizationController {
|
|
9
|
+
private readonly preferenceCustomizationService;
|
|
10
|
+
constructor(preferenceCustomizationService: PreferenceCustomizationService);
|
|
11
|
+
getPreferenceCustomizations(findPreferenceCustomizationDto: FindPreferenceCustomizationDto, eventId: string): Promise<ReadResult<PreferenceCustomization>>;
|
|
12
|
+
getPreferenceCustomizationById(id: string, eventId: string): Promise<PreferenceCustomization>;
|
|
13
|
+
createPreferenceCustomization(createPreferenceCustomizationDto: CreatePreferenceCustomizationDto, user: HeaderUser): Promise<PreferenceCustomization>;
|
|
14
|
+
updatePreferenceCustomizationById(updatePreferenceCustomizationDto: UpdatePreferenceCustomizationDto, id: string, eventId: string): Promise<PreferenceCustomization>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
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.PreferenceCustomizationController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const preference_customization_service_1 = require("../services/preference-customization.service");
|
|
18
|
+
const response_interceptor_1 = require("../../../../interceptors/response.interceptor");
|
|
19
|
+
const find_preference_customization_dto_1 = require("../dto/find-preference-customization.dto");
|
|
20
|
+
const service_provider_enum_1 = require("../../../../enums/service-provider.enum");
|
|
21
|
+
const create_preference_customization_dto_1 = require("../dto/create-preference-customization.dto");
|
|
22
|
+
const update_preference_customization_dto_1 = require("../dto/update-preference-customization.dto");
|
|
23
|
+
const get_user_decorator_1 = require("../../../../decorators/get-user-decorator");
|
|
24
|
+
const get_event_id_decorator_1 = require("../../../../decorators/get-event-id-decorator");
|
|
25
|
+
let PreferenceCustomizationController = class PreferenceCustomizationController {
|
|
26
|
+
constructor(preferenceCustomizationService) {
|
|
27
|
+
this.preferenceCustomizationService = preferenceCustomizationService;
|
|
28
|
+
}
|
|
29
|
+
async getPreferenceCustomizations(findPreferenceCustomizationDto, eventId) {
|
|
30
|
+
return await this.preferenceCustomizationService.getPreferenceCustomizations(findPreferenceCustomizationDto, eventId);
|
|
31
|
+
}
|
|
32
|
+
async getPreferenceCustomizationById(id, eventId) {
|
|
33
|
+
return await this.preferenceCustomizationService.getPreferenceCustomizationById(id, eventId);
|
|
34
|
+
}
|
|
35
|
+
async createPreferenceCustomization(createPreferenceCustomizationDto, user) {
|
|
36
|
+
return await this.preferenceCustomizationService.createPreferenceCustomization(createPreferenceCustomizationDto, user);
|
|
37
|
+
}
|
|
38
|
+
async updatePreferenceCustomizationById(updatePreferenceCustomizationDto, id, eventId) {
|
|
39
|
+
return await this.preferenceCustomizationService.updatePreferenceCustomizationById(id, updatePreferenceCustomizationDto, eventId);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
exports.PreferenceCustomizationController = PreferenceCustomizationController;
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, common_1.Get)(),
|
|
45
|
+
(0, common_1.UsePipes)(new common_1.ValidationPipe({ whitelist: true, transform: true })),
|
|
46
|
+
__param(0, (0, common_1.Query)()),
|
|
47
|
+
__param(1, (0, get_event_id_decorator_1.GetEventId)()),
|
|
48
|
+
__metadata("design:type", Function),
|
|
49
|
+
__metadata("design:paramtypes", [find_preference_customization_dto_1.FindPreferenceCustomizationDto, String]),
|
|
50
|
+
__metadata("design:returntype", Promise)
|
|
51
|
+
], PreferenceCustomizationController.prototype, "getPreferenceCustomizations", null);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, common_1.Get)('/one/:id'),
|
|
54
|
+
(0, common_1.UsePipes)(new common_1.ValidationPipe({ whitelist: true, transform: true })),
|
|
55
|
+
__param(0, (0, common_1.Param)('id')),
|
|
56
|
+
__param(1, (0, get_event_id_decorator_1.GetEventId)()),
|
|
57
|
+
__metadata("design:type", Function),
|
|
58
|
+
__metadata("design:paramtypes", [String, String]),
|
|
59
|
+
__metadata("design:returntype", Promise)
|
|
60
|
+
], PreferenceCustomizationController.prototype, "getPreferenceCustomizationById", null);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, common_1.Post)(),
|
|
63
|
+
(0, common_1.UsePipes)(new common_1.ValidationPipe({ whitelist: true, transform: true })),
|
|
64
|
+
__param(0, (0, common_1.Body)()),
|
|
65
|
+
__param(1, (0, get_user_decorator_1.GetUser)()),
|
|
66
|
+
__metadata("design:type", Function),
|
|
67
|
+
__metadata("design:paramtypes", [create_preference_customization_dto_1.CreatePreferenceCustomizationDto, Object]),
|
|
68
|
+
__metadata("design:returntype", Promise)
|
|
69
|
+
], PreferenceCustomizationController.prototype, "createPreferenceCustomization", null);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, common_1.Put)('/:id'),
|
|
72
|
+
(0, common_1.UsePipes)(new common_1.ValidationPipe({ whitelist: true, transform: true })),
|
|
73
|
+
__param(0, (0, common_1.Body)()),
|
|
74
|
+
__param(1, (0, common_1.Param)('id')),
|
|
75
|
+
__param(2, (0, get_event_id_decorator_1.GetEventId)()),
|
|
76
|
+
__metadata("design:type", Function),
|
|
77
|
+
__metadata("design:paramtypes", [update_preference_customization_dto_1.UpdatePreferenceCustomizationDto, String, String]),
|
|
78
|
+
__metadata("design:returntype", Promise)
|
|
79
|
+
], PreferenceCustomizationController.prototype, "updatePreferenceCustomizationById", null);
|
|
80
|
+
exports.PreferenceCustomizationController = PreferenceCustomizationController = __decorate([
|
|
81
|
+
(0, response_interceptor_1.SerializeResponse)(),
|
|
82
|
+
(0, common_1.Controller)('preference-customization'),
|
|
83
|
+
__param(0, (0, common_1.Inject)(service_provider_enum_1.ServiceProvider.PREFERENCE_CUSTOMIZATION_SERVICE)),
|
|
84
|
+
__metadata("design:paramtypes", [preference_customization_service_1.PreferenceCustomizationService])
|
|
85
|
+
], PreferenceCustomizationController);
|
|
86
|
+
//# sourceMappingURL=preference-customization.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preference-customization.controller.js","sourceRoot":"","sources":["../../../../../src/entities/models/common/controllers/preference-customization.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAWuB;AACvB,mGAA6F;AAC7F,wFAAiF;AAEjF,gGAAyF;AAEzF,mFAAyE;AACzE,oGAA6F;AAC7F,oGAA6F;AAE7F,kFAAmE;AACnE,0FAA0E;AAInE,IAAM,iCAAiC,GAAvC,MAAM,iCAAiC;IAC5C,YAEmB,8BAA8D;QAA9D,mCAA8B,GAA9B,8BAA8B,CAAgC;IAC9E,CAAC;IAIE,AAAN,KAAK,CAAC,2BAA2B,CACtB,8BAA8D,EACzD,OAAe;QAE7B,OAAO,MAAM,IAAI,CAAC,8BAA8B,CAAC,2BAA2B,CAC1E,8BAA8B,EAC9B,OAAO,CACR,CAAA;IACH,CAAC;IAIK,AAAN,KAAK,CAAC,8BAA8B,CACrB,EAAU,EACT,OAAe;QAE7B,OAAO,MAAM,IAAI,CAAC,8BAA8B,CAAC,8BAA8B,CAC7E,EAAE,EACF,OAAO,CACR,CAAA;IACH,CAAC;IAIK,AAAN,KAAK,CAAC,6BAA6B,CACzB,gCAAkE,EAC/D,IAAgB;QAE3B,OAAO,MAAM,IAAI,CAAC,8BAA8B,CAAC,6BAA6B,CAC5E,gCAAgC,EAChC,IAAI,CACL,CAAA;IACH,CAAC;IAIK,AAAN,KAAK,CAAC,iCAAiC,CAC7B,gCAAkE,EAC7D,EAAU,EACT,OAAe;QAE7B,OAAO,MAAM,IAAI,CAAC,8BAA8B,CAAC,iCAAiC,CAChF,EAAE,EACF,gCAAgC,EAChC,OAAO,CACR,CAAA;IACH,CAAC;CACF,CAAA;AAvDY,8EAAiC;AAQtC;IAFL,IAAA,YAAG,GAAE;IACL,IAAA,iBAAQ,EAAC,IAAI,uBAAc,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAEhE,WAAA,IAAA,cAAK,GAAE,CAAA;IACP,WAAA,IAAA,mCAAU,GAAE,CAAA;;qCAD4B,kEAA8B;;oFAOxE;AAIK;IAFL,IAAA,YAAG,EAAC,UAAU,CAAC;IACf,IAAA,iBAAQ,EAAC,IAAI,uBAAc,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAEhE,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IACX,WAAA,IAAA,mCAAU,GAAE,CAAA;;;;uFAMd;AAIK;IAFL,IAAA,aAAI,GAAE;IACN,IAAA,iBAAQ,EAAC,IAAI,uBAAc,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAEhE,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,4BAAO,GAAE,CAAA;;qCADgC,sEAAgC;;sFAO3E;AAIK;IAFL,IAAA,YAAG,EAAC,MAAM,CAAC;IACX,IAAA,iBAAQ,EAAC,IAAI,uBAAc,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAEhE,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IACX,WAAA,IAAA,mCAAU,GAAE,CAAA;;qCAF6B,sEAAgC;;0FAS3E;4CAtDU,iCAAiC;IAF7C,IAAA,wCAAiB,GAAE;IACnB,IAAA,mBAAU,EAAC,0BAA0B,CAAC;IAGlC,WAAA,IAAA,eAAM,EAAC,uCAAe,CAAC,gCAAgC,CAAC,CAAA;qCACR,iEAA8B;GAHtE,iCAAiC,CAuD7C"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PreferenceCustomizationType } from '../../../../enums/preference-customization-type.enum';
|
|
2
|
+
import { RequestMethod } from '../../../../enums/request-method.enum';
|
|
3
|
+
export declare class CreatePreferenceCustomizationDto {
|
|
4
|
+
title: string;
|
|
5
|
+
module: string;
|
|
6
|
+
method?: RequestMethod;
|
|
7
|
+
payload: any;
|
|
8
|
+
isDefault?: boolean;
|
|
9
|
+
type?: PreferenceCustomizationType;
|
|
10
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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.CreatePreferenceCustomizationDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const preference_customization_type_enum_1 = require("../../../../enums/preference-customization-type.enum");
|
|
15
|
+
const request_method_enum_1 = require("../../../../enums/request-method.enum");
|
|
16
|
+
class CreatePreferenceCustomizationDto {
|
|
17
|
+
}
|
|
18
|
+
exports.CreatePreferenceCustomizationDto = CreatePreferenceCustomizationDto;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, class_validator_1.IsString)(),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], CreatePreferenceCustomizationDto.prototype, "title", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_validator_1.IsString)(),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], CreatePreferenceCustomizationDto.prototype, "module", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_validator_1.IsEnum)(request_method_enum_1.RequestMethod),
|
|
29
|
+
(0, class_validator_1.IsOptional)(),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], CreatePreferenceCustomizationDto.prototype, "method", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
34
|
+
__metadata("design:type", Object)
|
|
35
|
+
], CreatePreferenceCustomizationDto.prototype, "payload", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, class_validator_1.IsBoolean)(),
|
|
38
|
+
(0, class_validator_1.IsOptional)(),
|
|
39
|
+
__metadata("design:type", Boolean)
|
|
40
|
+
], CreatePreferenceCustomizationDto.prototype, "isDefault", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, class_validator_1.IsEnum)(preference_customization_type_enum_1.PreferenceCustomizationType),
|
|
43
|
+
(0, class_validator_1.IsOptional)(),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], CreatePreferenceCustomizationDto.prototype, "type", void 0);
|
|
46
|
+
//# sourceMappingURL=create-preference-customization.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-preference-customization.dto.js","sourceRoot":"","sources":["../../../../../src/entities/models/common/dto/create-preference-customization.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAMwB;AACxB,6GAAkG;AAClG,+EAAqE;AAErE,MAAa,gCAAgC;CAqB5C;AArBD,4EAqBC;AAnBC;IADC,IAAA,0BAAQ,GAAE;;+DACE;AAGb;IADC,IAAA,0BAAQ,GAAE;;gEACG;AAId;IAFC,IAAA,wBAAM,EAAC,mCAAa,CAAC;IACrB,IAAA,4BAAU,GAAE;;gEACS;AAGtB;IADC,IAAA,4BAAU,GAAE;;iEACD;AAIZ;IAFC,IAAA,2BAAS,GAAE;IACX,IAAA,4BAAU,GAAE;;mEACM;AAInB;IAFC,IAAA,wBAAM,EAAC,gEAA2B,CAAC;IACnC,IAAA,4BAAU,GAAE;;8DACqB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindPreferenceCustomizationDto = void 0;
|
|
4
|
+
const mongoose_find_options_1 = require("../../../../db/mongoose-find-options");
|
|
5
|
+
class FindPreferenceCustomizationDto extends mongoose_find_options_1.MongooseFindOptions {
|
|
6
|
+
}
|
|
7
|
+
exports.FindPreferenceCustomizationDto = FindPreferenceCustomizationDto;
|
|
8
|
+
//# sourceMappingURL=find-preference-customization.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-preference-customization.dto.js","sourceRoot":"","sources":["../../../../../src/entities/models/common/dto/find-preference-customization.dto.ts"],"names":[],"mappings":";;;AAAA,gFAA0E;AAE1E,MAAa,8BAA+B,SAAQ,2CAAmB;CAAG;AAA1E,wEAA0E"}
|
|
@@ -0,0 +1,36 @@
|
|
|
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.UpdatePreferenceCustomizationDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const preference_customization_type_enum_1 = require("../../../../enums/preference-customization-type.enum");
|
|
15
|
+
class UpdatePreferenceCustomizationDto {
|
|
16
|
+
}
|
|
17
|
+
exports.UpdatePreferenceCustomizationDto = UpdatePreferenceCustomizationDto;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_validator_1.IsString)(),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], UpdatePreferenceCustomizationDto.prototype, "title", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
24
|
+
__metadata("design:type", Object)
|
|
25
|
+
], UpdatePreferenceCustomizationDto.prototype, "payload", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, class_validator_1.IsBoolean)(),
|
|
28
|
+
(0, class_validator_1.IsOptional)(),
|
|
29
|
+
__metadata("design:type", Boolean)
|
|
30
|
+
], UpdatePreferenceCustomizationDto.prototype, "isDefault", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_validator_1.IsEnum)(preference_customization_type_enum_1.PreferenceCustomizationType),
|
|
33
|
+
(0, class_validator_1.IsOptional)(),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], UpdatePreferenceCustomizationDto.prototype, "type", void 0);
|
|
36
|
+
//# sourceMappingURL=update-preference-customization.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-preference-customization.dto.js","sourceRoot":"","sources":["../../../../../src/entities/models/common/dto/update-preference-customization.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAMwB;AACxB,6GAAkG;AAElG,MAAa,gCAAgC;CAc5C;AAdD,4EAcC;AAZC;IADC,IAAA,0BAAQ,GAAE;;+DACE;AAGb;IADC,IAAA,4BAAU,GAAE;;iEACD;AAIZ;IAFC,IAAA,2BAAS,GAAE;IACX,IAAA,4BAAU,GAAE;;mEACM;AAInB;IAFC,IAAA,wBAAM,EAAC,gEAA2B,CAAC;IACnC,IAAA,4BAAU,GAAE;;8DACqB"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/document" />
|
|
2
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
3
|
+
/// <reference types="mongoose/types/callback" />
|
|
4
|
+
/// <reference types="mongoose/types/collection" />
|
|
5
|
+
/// <reference types="mongoose/types/connection" />
|
|
6
|
+
/// <reference types="mongoose/types/cursor" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
26
|
+
import { Connection } from 'mongoose';
|
|
27
|
+
import { Event } from '../../events';
|
|
28
|
+
import { CustomModel } from '../../../../db/CustomModel';
|
|
29
|
+
import { Contact } from '../../companies';
|
|
30
|
+
import { PreferenceCustomizationType } from '../../../../enums/preference-customization-type.enum';
|
|
31
|
+
import { RequestMethod } from '../../../../enums/request-method.enum';
|
|
32
|
+
export type PreferenceCustomizationModel = CustomModel<PreferenceCustomization>;
|
|
33
|
+
export declare class PreferenceCustomization {
|
|
34
|
+
_id: string;
|
|
35
|
+
title: string;
|
|
36
|
+
module: string;
|
|
37
|
+
method: RequestMethod;
|
|
38
|
+
route: string;
|
|
39
|
+
payload: any;
|
|
40
|
+
isDefault: boolean;
|
|
41
|
+
type: PreferenceCustomizationType;
|
|
42
|
+
eventId: Event;
|
|
43
|
+
contactId: Contact;
|
|
44
|
+
createdAt: Date;
|
|
45
|
+
updatedAt: Date;
|
|
46
|
+
}
|
|
47
|
+
export declare const preferenceCustomizationFactory: (connection: Connection, eventConnection: Connection, companyConnection: Connection) => import("mongoose").Model<PreferenceCustomization, {}, {}, {}, import("mongoose").Document<unknown, {}, PreferenceCustomization> & PreferenceCustomization & Required<{
|
|
48
|
+
_id: string;
|
|
49
|
+
}>, any>;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.preferenceCustomizationFactory = exports.PreferenceCustomization = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const validateNewItem_1 = require("../../../../validators/validateNewItem");
|
|
6
|
+
const validateProjection_1 = require("../../../../validators/validateProjection");
|
|
7
|
+
const validateProjectionResult_1 = require("../../../../validators/validateProjectionResult");
|
|
8
|
+
const validateUpdateItem_1 = require("../../../../validators/validateUpdateItem");
|
|
9
|
+
const get_model_ref_1 = require("../../../services/get-model-ref");
|
|
10
|
+
const generate_model_1 = require("../../../services/generate-model");
|
|
11
|
+
const preference_customization_type_enum_1 = require("../../../../enums/preference-customization-type.enum");
|
|
12
|
+
const request_method_enum_1 = require("../../../../enums/request-method.enum");
|
|
13
|
+
const ObjectId = mongoose_1.Schema.Types.ObjectId;
|
|
14
|
+
const Mixed = mongoose_1.Schema.Types.Mixed;
|
|
15
|
+
class PreferenceCustomization {
|
|
16
|
+
}
|
|
17
|
+
exports.PreferenceCustomization = PreferenceCustomization;
|
|
18
|
+
const preferenceCustomizationFactory = (connection, eventConnection, companyConnection) => {
|
|
19
|
+
const preferenceCustomizationSchema = new mongoose_1.Schema({
|
|
20
|
+
title: {
|
|
21
|
+
type: String,
|
|
22
|
+
trim: true,
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
module: {
|
|
26
|
+
type: String,
|
|
27
|
+
trim: true,
|
|
28
|
+
required: true,
|
|
29
|
+
},
|
|
30
|
+
method: {
|
|
31
|
+
type: String,
|
|
32
|
+
enum: Object.values(request_method_enum_1.RequestMethod),
|
|
33
|
+
required: true,
|
|
34
|
+
default: request_method_enum_1.RequestMethod.GET,
|
|
35
|
+
},
|
|
36
|
+
payload: {
|
|
37
|
+
type: Mixed,
|
|
38
|
+
trim: true,
|
|
39
|
+
required: true,
|
|
40
|
+
},
|
|
41
|
+
isDefault: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
required: true,
|
|
44
|
+
default: false,
|
|
45
|
+
},
|
|
46
|
+
type: {
|
|
47
|
+
type: String,
|
|
48
|
+
enum: Object.values(preference_customization_type_enum_1.PreferenceCustomizationType),
|
|
49
|
+
required: true,
|
|
50
|
+
default: preference_customization_type_enum_1.PreferenceCustomizationType.WEB,
|
|
51
|
+
},
|
|
52
|
+
eventId: {
|
|
53
|
+
type: ObjectId,
|
|
54
|
+
required: true,
|
|
55
|
+
ref: (0, get_model_ref_1.getModelRef)('Event', eventConnection),
|
|
56
|
+
},
|
|
57
|
+
contactId: {
|
|
58
|
+
type: ObjectId,
|
|
59
|
+
required: true,
|
|
60
|
+
ref: (0, get_model_ref_1.getModelRef)('Contact', companyConnection),
|
|
61
|
+
},
|
|
62
|
+
createdAt: { type: Date, required: true, default: Date.now },
|
|
63
|
+
updatedAt: { type: Date, required: true, default: Date.now },
|
|
64
|
+
});
|
|
65
|
+
const allProjectionFieldArray = [
|
|
66
|
+
'_id',
|
|
67
|
+
'title',
|
|
68
|
+
'module',
|
|
69
|
+
'method',
|
|
70
|
+
'payload',
|
|
71
|
+
'isDefault',
|
|
72
|
+
'type',
|
|
73
|
+
'eventId',
|
|
74
|
+
'contactId',
|
|
75
|
+
'createdAt',
|
|
76
|
+
'updatedAt',
|
|
77
|
+
];
|
|
78
|
+
const allValidateNewItemFieldArray = [
|
|
79
|
+
'_id',
|
|
80
|
+
'title',
|
|
81
|
+
'module',
|
|
82
|
+
'method',
|
|
83
|
+
'payload',
|
|
84
|
+
'isDefault',
|
|
85
|
+
'type',
|
|
86
|
+
'eventId',
|
|
87
|
+
'contactId',
|
|
88
|
+
'createdAt',
|
|
89
|
+
'updatedAt',
|
|
90
|
+
];
|
|
91
|
+
const allValidateUpdateItemFieldArray = [
|
|
92
|
+
'title',
|
|
93
|
+
'payload',
|
|
94
|
+
'isDefault',
|
|
95
|
+
'updatedAt',
|
|
96
|
+
];
|
|
97
|
+
const defaultPopulations = [
|
|
98
|
+
{
|
|
99
|
+
path: 'contactId',
|
|
100
|
+
select: '_id firstname lastname fullname email userType avatar company jobTitle jobLevel jobDepartment',
|
|
101
|
+
populate: [
|
|
102
|
+
{
|
|
103
|
+
path: 'company',
|
|
104
|
+
select: '_id name',
|
|
105
|
+
model: 'Company',
|
|
106
|
+
strictPopulate: false,
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
];
|
|
111
|
+
preferenceCustomizationSchema.statics.validateProjectionResult = (necessaryProjectionObj) => (0, validateProjectionResult_1.validateProjectionResult)(allProjectionFieldArray, necessaryProjectionObj);
|
|
112
|
+
preferenceCustomizationSchema.statics.validateProjection = (necessaryProjectionArray) => (0, validateProjection_1.validateProjection)(allProjectionFieldArray, necessaryProjectionArray);
|
|
113
|
+
preferenceCustomizationSchema.statics.validateNewItem = (newItemObj) => (0, validateNewItem_1.validateNewItem)(allValidateNewItemFieldArray, newItemObj);
|
|
114
|
+
preferenceCustomizationSchema.statics.validateUpdateItem = (updateItemObj) => (0, validateUpdateItem_1.validateUpdateItem)(allValidateUpdateItemFieldArray, updateItemObj);
|
|
115
|
+
preferenceCustomizationSchema.statics.getDefaultPopulations = () => defaultPopulations;
|
|
116
|
+
preferenceCustomizationSchema.pre('findOneAndUpdate', async function (next) {
|
|
117
|
+
this._update.updatedAt = new Date();
|
|
118
|
+
next();
|
|
119
|
+
});
|
|
120
|
+
return (0, generate_model_1.generateModel)('PreferenceCustomization', connection, preferenceCustomizationSchema);
|
|
121
|
+
};
|
|
122
|
+
exports.preferenceCustomizationFactory = preferenceCustomizationFactory;
|
|
123
|
+
//# sourceMappingURL=preference-customization.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preference-customization.entity.js","sourceRoot":"","sources":["../../../../../src/entities/models/common/entities/preference-customization.entity.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export * from './common.provider';
|
|
2
2
|
export * from './entities/audit-trail.entity';
|
|
3
3
|
export * from './entities/location.entity';
|
|
4
|
+
export * from './entities/preference-customization.entity';
|
|
4
5
|
export * from './repositories/audit-trail.repository';
|
|
6
|
+
export * from './repositories/preference-customization.repository';
|
|
5
7
|
export * from './services/audit-trail.service';
|
|
8
|
+
export * from './services/preference-customization.service';
|
|
6
9
|
export * from './controllers/audit-trail.controller';
|
|
10
|
+
export * from './controllers/preference-customization.controller';
|
|
@@ -17,7 +17,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./common.provider"), exports);
|
|
18
18
|
__exportStar(require("./entities/audit-trail.entity"), exports);
|
|
19
19
|
__exportStar(require("./entities/location.entity"), exports);
|
|
20
|
+
__exportStar(require("./entities/preference-customization.entity"), exports);
|
|
20
21
|
__exportStar(require("./repositories/audit-trail.repository"), exports);
|
|
22
|
+
__exportStar(require("./repositories/preference-customization.repository"), exports);
|
|
21
23
|
__exportStar(require("./services/audit-trail.service"), exports);
|
|
24
|
+
__exportStar(require("./services/preference-customization.service"), exports);
|
|
22
25
|
__exportStar(require("./controllers/audit-trail.controller"), exports);
|
|
26
|
+
__exportStar(require("./controllers/preference-customization.controller"), exports);
|
|
23
27
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/entities/models/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAiC;AACjC,gEAA6C;AAC7C,6DAA0C;AAC1C,wEAAqD;AACrD,iEAA8C;AAC9C,uEAAoD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/entities/models/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAiC;AACjC,gEAA6C;AAC7C,6DAA0C;AAC1C,6EAA0D;AAC1D,wEAAqD;AACrD,qFAAkE;AAClE,iEAA8C;AAC9C,8EAA2D;AAC3D,uEAAoD;AACpD,oFAAiE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CustomModel } from '../../../../db/CustomModel';
|
|
2
|
+
import { MongooseBase } from '../../../../db/MongooseBase';
|
|
3
|
+
import { PreferenceCustomization } from '../entities/preference-customization.entity';
|
|
4
|
+
export declare class PreferenceCustomizationRepository extends MongooseBase<PreferenceCustomization> {
|
|
5
|
+
private preferenceCustomizationModel;
|
|
6
|
+
constructor(preferenceCustomizationModel: CustomModel<PreferenceCustomization>);
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PreferenceCustomizationRepository = void 0;
|
|
4
|
+
const MongooseBase_1 = require("../../../../db/MongooseBase");
|
|
5
|
+
class PreferenceCustomizationRepository extends MongooseBase_1.MongooseBase {
|
|
6
|
+
constructor(preferenceCustomizationModel) {
|
|
7
|
+
super(preferenceCustomizationModel);
|
|
8
|
+
this.preferenceCustomizationModel = preferenceCustomizationModel;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.PreferenceCustomizationRepository = PreferenceCustomizationRepository;
|
|
12
|
+
//# sourceMappingURL=preference-customization.repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preference-customization.repository.js","sourceRoot":"","sources":["../../../../../src/entities/models/common/repositories/preference-customization.repository.ts"],"names":[],"mappings":";;;AACA,8DAA0D;AAG1D,MAAa,iCAAkC,SAAQ,2BAAqC;IAC1F,YACU,4BAAkE;QAE1E,KAAK,CAAC,4BAA4B,CAAC,CAAA;QAF3B,iCAA4B,GAA5B,4BAA4B,CAAsC;IAG5E,CAAC;CACF;AAND,8EAMC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { User } from '../../users';
|
|
2
|
+
import { PreferenceCustomization } from '../entities/preference-customization.entity';
|
|
3
|
+
import { PreferenceCustomizationRepository } from '../repositories/preference-customization.repository';
|
|
4
|
+
import { FindPreferenceCustomizationDto } from '../dto/find-preference-customization.dto';
|
|
5
|
+
import { ReadResult } from '../../../../types/read-result.interface';
|
|
6
|
+
import { HeaderUser } from '../../../../types/header-user.interface';
|
|
7
|
+
import { CreatePreferenceCustomizationDto } from '../dto/create-preference-customization.dto';
|
|
8
|
+
import { UpdatePreferenceCustomizationDto } from '../dto/update-preference-customization.dto';
|
|
9
|
+
export declare class PreferenceCustomizationService {
|
|
10
|
+
private readonly preferenceCustomizationRepository;
|
|
11
|
+
userData?: User;
|
|
12
|
+
constructor(preferenceCustomizationRepository: PreferenceCustomizationRepository);
|
|
13
|
+
getPreferenceCustomizations(findPreferenceCustomizationDto: FindPreferenceCustomizationDto, eventId: string): Promise<ReadResult<PreferenceCustomization>>;
|
|
14
|
+
getPreferenceCustomizationById(id: string, eventId: string): Promise<PreferenceCustomization>;
|
|
15
|
+
createPreferenceCustomization(createPreferenceCustomizationDto: CreatePreferenceCustomizationDto, user: HeaderUser): Promise<PreferenceCustomization>;
|
|
16
|
+
updatePreferenceCustomizationById(id: string, updatePreferenceCustomizationDto: UpdatePreferenceCustomizationDto, eventId: string): Promise<PreferenceCustomization>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PreferenceCustomizationService = void 0;
|
|
4
|
+
const get_parsed_query_1 = require("../../../../utils/get-parsed-query");
|
|
5
|
+
class PreferenceCustomizationService {
|
|
6
|
+
constructor(preferenceCustomizationRepository) {
|
|
7
|
+
this.preferenceCustomizationRepository = preferenceCustomizationRepository;
|
|
8
|
+
}
|
|
9
|
+
async getPreferenceCustomizations(findPreferenceCustomizationDto, eventId) {
|
|
10
|
+
findPreferenceCustomizationDto.query = (0, get_parsed_query_1.getParsedQuery)(findPreferenceCustomizationDto);
|
|
11
|
+
findPreferenceCustomizationDto.query.eventId = eventId;
|
|
12
|
+
return await this.preferenceCustomizationRepository.read(findPreferenceCustomizationDto);
|
|
13
|
+
}
|
|
14
|
+
async getPreferenceCustomizationById(id, eventId) {
|
|
15
|
+
return await this.preferenceCustomizationRepository.findOne({ _id: id, eventId: eventId }, {}, [], { lean: true });
|
|
16
|
+
}
|
|
17
|
+
async createPreferenceCustomization(createPreferenceCustomizationDto, user) {
|
|
18
|
+
const toCreate = {
|
|
19
|
+
...createPreferenceCustomizationDto,
|
|
20
|
+
contactId: user.contactId,
|
|
21
|
+
eventId: user.eventId,
|
|
22
|
+
};
|
|
23
|
+
return await this.preferenceCustomizationRepository.create(toCreate);
|
|
24
|
+
}
|
|
25
|
+
async updatePreferenceCustomizationById(id, updatePreferenceCustomizationDto, eventId) {
|
|
26
|
+
return await this.preferenceCustomizationRepository.findOneAndUpdate({
|
|
27
|
+
query: { _id: id, eventId: eventId },
|
|
28
|
+
data: { ...updatePreferenceCustomizationDto },
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.PreferenceCustomizationService = PreferenceCustomizationService;
|
|
33
|
+
//# sourceMappingURL=preference-customization.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preference-customization.service.js","sourceRoot":"","sources":["../../../../../src/entities/models/common/services/preference-customization.service.ts"],"names":[],"mappings":";;;AAKA,yEAAmE;AAKnE,MAAa,8BAA8B;IAEzC,YACmB,iCAAoE;QAApE,sCAAiC,GAAjC,iCAAiC,CAAmC;IACpF,CAAC;IAEJ,KAAK,CAAC,2BAA2B,CAC/B,8BAA8D,EAC9D,OAAe;QAEf,8BAA8B,CAAC,KAAK,GAAG,IAAA,iCAAc,EACnD,8BAA8B,CAC/B,CAAA;QACD,8BAA8B,CAAC,KAAK,CAAC,OAAO,GAAG,OAAO,CAAA;QACtD,OAAO,MAAM,IAAI,CAAC,iCAAiC,CAAC,IAAI,CACtD,8BAA8B,CAC/B,CAAA;IACH,CAAC;IAED,KAAK,CAAC,8BAA8B,CAClC,EAAU,EACV,OAAe;QAEf,OAAO,MAAM,IAAI,CAAC,iCAAiC,CAAC,OAAO,CACzD,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,EAC7B,EAAE,EACF,EAAE,EACF,EAAE,IAAI,EAAE,IAAI,EAAE,CACf,CAAA;IACH,CAAC;IAED,KAAK,CAAC,6BAA6B,CACjC,gCAAkE,EAClE,IAAgB;QAEhB,MAAM,QAAQ,GAAQ;YACpB,GAAG,gCAAgC;YACnC,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAA;QACD,OAAO,MAAM,IAAI,CAAC,iCAAiC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;IACtE,CAAC;IAED,KAAK,CAAC,iCAAiC,CACrC,EAAU,EACV,gCAAkE,EAClE,OAAe;QAEf,OAAO,MAAM,IAAI,CAAC,iCAAiC,CAAC,gBAAgB,CAAC;YACnE,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;YACpC,IAAI,EAAE,EAAE,GAAG,gCAAgC,EAAE;SAC9C,CAAC,CAAA;IACJ,CAAC;CACF;AArDD,wEAqDC"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DatabaseModel = void 0;
|
|
4
4
|
var DatabaseModel;
|
|
5
5
|
(function (DatabaseModel) {
|
|
6
|
+
DatabaseModel["PREFERENCE_CUSTOMIZATION_MODEL"] = "PreferenceCustomizationModel";
|
|
6
7
|
DatabaseModel["AUDIT_TRAIL_MODEL"] = "AuditTrailModel";
|
|
7
8
|
DatabaseModel["COMPANY_MODEL"] = "CompanyModel";
|
|
8
9
|
DatabaseModel["CONTACT_MODEL"] = "ContactModel";
|