grm-shared-library 1.0.41 → 1.0.43

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.
Files changed (35) hide show
  1. package/dist/index.d.ts +2 -0
  2. package/dist/index.js +2 -0
  3. package/dist/modules/common/dtos/contact-person.dto.d.ts +6 -0
  4. package/dist/modules/common/dtos/contact-person.dto.js +38 -0
  5. package/dist/modules/control-centre/dtos/create-control-centre.dto.d.ts +13 -0
  6. package/dist/modules/control-centre/dtos/create-control-centre.dto.js +62 -0
  7. package/dist/modules/control-centre/dtos/update-control-centre.dto.d.ts +5 -0
  8. package/dist/modules/control-centre/dtos/update-control-centre.dto.js +8 -0
  9. package/dist/modules/control-centre/enums/control-centre.enum.d.ts +5 -0
  10. package/dist/modules/control-centre/enums/control-centre.enum.js +9 -0
  11. package/dist/modules/control-centre/index.d.ts +4 -0
  12. package/dist/modules/control-centre/index.js +20 -0
  13. package/dist/modules/control-centre/interfaces/control-centre.d.ts +15 -0
  14. package/dist/modules/control-centre/interfaces/control-centre.js +2 -0
  15. package/dist/modules/organization/dtos/create-organization.dto.d.ts +2 -1
  16. package/dist/modules/organization/dtos/create-organization.dto.js +11 -3
  17. package/dist/modules/organization/enums/org-status.enum.d.ts +5 -5
  18. package/dist/modules/organization/enums/org-status.enum.js +5 -5
  19. package/dist/modules/organization/index.d.ts +0 -1
  20. package/dist/modules/organization/index.js +0 -1
  21. package/dist/modules/organization/interfaces/organization.d.ts +6 -2
  22. package/dist/modules/partner/dtos/create-partner.dto.d.ts +15 -0
  23. package/dist/modules/partner/dtos/create-partner.dto.js +80 -0
  24. package/dist/modules/partner/dtos/update-partner.dto.d.ts +5 -0
  25. package/dist/modules/partner/dtos/update-partner.dto.js +8 -0
  26. package/dist/modules/partner/enums/partner-status.enum.d.ts +7 -0
  27. package/dist/modules/partner/enums/partner-status.enum.js +11 -0
  28. package/dist/modules/partner/index.d.ts +4 -0
  29. package/dist/modules/partner/index.js +20 -0
  30. package/dist/modules/partner/interfaces/partner.d.ts +19 -0
  31. package/dist/modules/partner/interfaces/partner.js +2 -0
  32. package/dist/modules/user/dtos/create-user.dto.d.ts +6 -8
  33. package/dist/modules/user/dtos/create-user.dto.js +11 -17
  34. package/dist/modules/user/interfaces/user.d.ts +3 -3
  35. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -6,6 +6,8 @@ export * from './modules/common/index';
6
6
  export * from './modules/permission/index';
7
7
  export * from './modules/role/index';
8
8
  export * from './modules/user/index';
9
+ export * from './modules/partner/index';
10
+ export * from './modules/control-centre/index';
9
11
  /**
10
12
  * Kafka
11
13
  */
package/dist/index.js CHANGED
@@ -22,6 +22,8 @@ __exportStar(require("./modules/common/index"), exports);
22
22
  __exportStar(require("./modules/permission/index"), exports);
23
23
  __exportStar(require("./modules/role/index"), exports);
24
24
  __exportStar(require("./modules/user/index"), exports);
25
+ __exportStar(require("./modules/partner/index"), exports);
26
+ __exportStar(require("./modules/control-centre/index"), exports);
25
27
  /**
26
28
  * Kafka
27
29
  */
@@ -0,0 +1,6 @@
1
+ export declare class ContactPersonDto {
2
+ name: string;
3
+ phoneNumber: string;
4
+ email: string;
5
+ designation: string;
6
+ }
@@ -0,0 +1,38 @@
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.ContactPersonDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const case_decorators_1 = require("../../../decorators/case-decorators");
15
+ class ContactPersonDto {
16
+ }
17
+ exports.ContactPersonDto = ContactPersonDto;
18
+ __decorate([
19
+ (0, class_validator_1.IsString)(),
20
+ (0, case_decorators_1.SentenceCase)(),
21
+ (0, class_validator_1.IsNotEmpty)(),
22
+ __metadata("design:type", String)
23
+ ], ContactPersonDto.prototype, "name", void 0);
24
+ __decorate([
25
+ (0, class_validator_1.IsPhoneNumber)(),
26
+ (0, class_validator_1.IsNotEmpty)(),
27
+ __metadata("design:type", String)
28
+ ], ContactPersonDto.prototype, "phoneNumber", void 0);
29
+ __decorate([
30
+ (0, class_validator_1.IsEmail)(),
31
+ (0, class_validator_1.IsNotEmpty)(),
32
+ __metadata("design:type", String)
33
+ ], ContactPersonDto.prototype, "email", void 0);
34
+ __decorate([
35
+ (0, class_validator_1.IsString)(),
36
+ (0, class_validator_1.IsNotEmpty)(),
37
+ __metadata("design:type", String)
38
+ ], ContactPersonDto.prototype, "designation", void 0);
@@ -0,0 +1,13 @@
1
+ import { MapAddressDto } from "../../common";
2
+ import { ControlCentreStatus } from "../enums/control-centre.enum";
3
+ import { ContactPersonDto } from "../../common/dtos/contact-person.dto";
4
+ export declare class CreateControlCentreDto {
5
+ name: string;
6
+ phoneNumber?: string;
7
+ email?: string;
8
+ physicalAddress: MapAddressDto;
9
+ status?: ControlCentreStatus;
10
+ logo?: string;
11
+ contactPerson: ContactPersonDto;
12
+ attributes?: Record<string, any>;
13
+ }
@@ -0,0 +1,62 @@
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.CreateControlCentreDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const common_1 = require("../../common");
15
+ const class_transformer_1 = require("class-transformer");
16
+ const control_centre_enum_1 = require("../enums/control-centre.enum");
17
+ const contact_person_dto_1 = require("../../common/dtos/contact-person.dto");
18
+ class CreateControlCentreDto {
19
+ }
20
+ exports.CreateControlCentreDto = CreateControlCentreDto;
21
+ __decorate([
22
+ (0, class_validator_1.IsString)(),
23
+ (0, class_validator_1.IsNotEmpty)(),
24
+ (0, class_validator_1.MaxLength)(50),
25
+ __metadata("design:type", String)
26
+ ], CreateControlCentreDto.prototype, "name", void 0);
27
+ __decorate([
28
+ (0, class_validator_1.IsPhoneNumber)(),
29
+ (0, class_validator_1.IsOptional)(),
30
+ (0, class_validator_1.MaxLength)(20),
31
+ __metadata("design:type", String)
32
+ ], CreateControlCentreDto.prototype, "phoneNumber", void 0);
33
+ __decorate([
34
+ (0, class_validator_1.IsEmail)(),
35
+ (0, class_validator_1.IsOptional)(),
36
+ __metadata("design:type", String)
37
+ ], CreateControlCentreDto.prototype, "email", void 0);
38
+ __decorate([
39
+ (0, class_validator_1.ValidateNested)(),
40
+ (0, class_transformer_1.Type)(() => common_1.MapAddressDto),
41
+ __metadata("design:type", common_1.MapAddressDto)
42
+ ], CreateControlCentreDto.prototype, "physicalAddress", void 0);
43
+ __decorate([
44
+ (0, class_validator_1.IsEnum)(control_centre_enum_1.ControlCentreStatus),
45
+ (0, class_validator_1.IsOptional)(),
46
+ __metadata("design:type", String)
47
+ ], CreateControlCentreDto.prototype, "status", void 0);
48
+ __decorate([
49
+ (0, class_validator_1.IsUrl)(),
50
+ (0, class_validator_1.IsOptional)(),
51
+ __metadata("design:type", String)
52
+ ], CreateControlCentreDto.prototype, "logo", void 0);
53
+ __decorate([
54
+ (0, class_validator_1.ValidateNested)(),
55
+ (0, class_transformer_1.Type)(() => contact_person_dto_1.ContactPersonDto),
56
+ __metadata("design:type", contact_person_dto_1.ContactPersonDto)
57
+ ], CreateControlCentreDto.prototype, "contactPerson", void 0);
58
+ __decorate([
59
+ (0, class_validator_1.IsObject)(),
60
+ (0, class_validator_1.IsOptional)(),
61
+ __metadata("design:type", Object)
62
+ ], CreateControlCentreDto.prototype, "attributes", void 0);
@@ -0,0 +1,5 @@
1
+ import { CreateControlCentreDto } from "./create-control-centre.dto";
2
+ declare const UpdateControlCentreDto_base: import("@nestjs/mapped-types").MappedType<Partial<CreateControlCentreDto>>;
3
+ export declare class UpdateControlCentreDto extends UpdateControlCentreDto_base {
4
+ }
5
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateControlCentreDto = void 0;
4
+ const mapped_types_1 = require("@nestjs/mapped-types");
5
+ const create_control_centre_dto_1 = require("./create-control-centre.dto");
6
+ class UpdateControlCentreDto extends (0, mapped_types_1.PartialType)(create_control_centre_dto_1.CreateControlCentreDto) {
7
+ }
8
+ exports.UpdateControlCentreDto = UpdateControlCentreDto;
@@ -0,0 +1,5 @@
1
+ export declare enum ControlCentreStatus {
2
+ ACTIVE = "Active",
3
+ INACTIVE = "Inactive",
4
+ PENDING = "Pending"
5
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ControlCentreStatus = void 0;
4
+ var ControlCentreStatus;
5
+ (function (ControlCentreStatus) {
6
+ ControlCentreStatus["ACTIVE"] = "Active";
7
+ ControlCentreStatus["INACTIVE"] = "Inactive";
8
+ ControlCentreStatus["PENDING"] = "Pending";
9
+ })(ControlCentreStatus || (exports.ControlCentreStatus = ControlCentreStatus = {}));
@@ -0,0 +1,4 @@
1
+ export * from './dtos/create-control-centre.dto';
2
+ export * from './dtos/update-control-centre.dto';
3
+ export * from './enums/control-centre.enum';
4
+ export * from './interfaces/control-centre';
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./dtos/create-control-centre.dto"), exports);
18
+ __exportStar(require("./dtos/update-control-centre.dto"), exports);
19
+ __exportStar(require("./enums/control-centre.enum"), exports);
20
+ __exportStar(require("./interfaces/control-centre"), exports);
@@ -0,0 +1,15 @@
1
+ import { MapAddressDto } from "../../common";
2
+ import { ContactPersonDto } from "../../common/dtos/contact-person.dto";
3
+ export interface ControlCentre {
4
+ id?: number;
5
+ name: string;
6
+ phoneNumber?: string;
7
+ email?: string;
8
+ physicalAddress: MapAddressDto;
9
+ status?: string;
10
+ logo?: string;
11
+ contactPerson: ContactPersonDto;
12
+ attributes?: Record<string, any>;
13
+ createdAt?: Date;
14
+ updatedAt?: Date;
15
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,5 @@
1
1
  import { MapAddressDto } from "../../common/dtos/map-address.dto";
2
- import { ContactPersonDto } from "./contact-person.dto";
2
+ import { ContactPersonDto } from "../../common/dtos/contact-person.dto";
3
3
  export declare class CreateOrganizationDto {
4
4
  name: string;
5
5
  phoneNumber?: string;
@@ -11,5 +11,6 @@ export declare class CreateOrganizationDto {
11
11
  status: string;
12
12
  logo?: string;
13
13
  contactPerson: ContactPersonDto;
14
+ controlCentreIds?: number[];
14
15
  partnerIds?: number[];
15
16
  }
@@ -14,18 +14,20 @@ const class_validator_1 = require("class-validator");
14
14
  const class_transformer_1 = require("class-transformer");
15
15
  const map_address_dto_1 = require("../../common/dtos/map-address.dto");
16
16
  const org_status_enum_1 = require("../enums/org-status.enum");
17
- const contact_person_dto_1 = require("./contact-person.dto");
17
+ const contact_person_dto_1 = require("../../common/dtos/contact-person.dto");
18
18
  class CreateOrganizationDto {
19
19
  }
20
20
  exports.CreateOrganizationDto = CreateOrganizationDto;
21
21
  __decorate([
22
22
  (0, class_validator_1.IsString)(),
23
23
  (0, class_validator_1.IsNotEmpty)(),
24
+ (0, class_validator_1.MaxLength)(50),
24
25
  __metadata("design:type", String)
25
26
  ], CreateOrganizationDto.prototype, "name", void 0);
26
27
  __decorate([
27
28
  (0, class_validator_1.IsPhoneNumber)(),
28
29
  (0, class_validator_1.IsOptional)(),
30
+ (0, class_validator_1.MaxLength)(20),
29
31
  __metadata("design:type", String)
30
32
  ], CreateOrganizationDto.prototype, "phoneNumber", void 0);
31
33
  __decorate([
@@ -60,7 +62,7 @@ __decorate([
60
62
  __metadata("design:type", String)
61
63
  ], CreateOrganizationDto.prototype, "status", void 0);
62
64
  __decorate([
63
- (0, class_validator_1.IsString)(),
65
+ (0, class_validator_1.IsUrl)(),
64
66
  (0, class_validator_1.IsOptional)(),
65
67
  __metadata("design:type", String)
66
68
  ], CreateOrganizationDto.prototype, "logo", void 0);
@@ -71,6 +73,12 @@ __decorate([
71
73
  __metadata("design:type", contact_person_dto_1.ContactPersonDto)
72
74
  ], CreateOrganizationDto.prototype, "contactPerson", void 0);
73
75
  __decorate([
74
- (0, class_validator_1.IsString)({ each: true }),
76
+ (0, class_validator_1.IsArray)(),
77
+ (0, class_validator_1.IsNumber)({}, { each: true }),
78
+ (0, class_validator_1.IsOptional)(),
79
+ __metadata("design:type", Array)
80
+ ], CreateOrganizationDto.prototype, "controlCentreIds", void 0);
81
+ __decorate([
82
+ (0, class_validator_1.IsNumber)({}, { each: true }),
75
83
  __metadata("design:type", Array)
76
84
  ], CreateOrganizationDto.prototype, "partnerIds", void 0);
@@ -1,7 +1,7 @@
1
1
  export declare enum OrganizationStatus {
2
- active = "Active",
3
- inactive = "Inactive",
4
- pending = "Pending",
5
- suspended = "Suspended",
6
- rejected = "Rejected"
2
+ ACTIVE = "Active",
3
+ INACTIVE = "Inactive",
4
+ PENDING = "Pending",
5
+ SUSPENDED = "Suspended",
6
+ REJECTED = "Rejected"
7
7
  }
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OrganizationStatus = void 0;
4
4
  var OrganizationStatus;
5
5
  (function (OrganizationStatus) {
6
- OrganizationStatus["active"] = "Active";
7
- OrganizationStatus["inactive"] = "Inactive";
8
- OrganizationStatus["pending"] = "Pending";
9
- OrganizationStatus["suspended"] = "Suspended";
10
- OrganizationStatus["rejected"] = "Rejected";
6
+ OrganizationStatus["ACTIVE"] = "Active";
7
+ OrganizationStatus["INACTIVE"] = "Inactive";
8
+ OrganizationStatus["PENDING"] = "Pending";
9
+ OrganizationStatus["SUSPENDED"] = "Suspended";
10
+ OrganizationStatus["REJECTED"] = "Rejected";
11
11
  })(OrganizationStatus || (exports.OrganizationStatus = OrganizationStatus = {}));
@@ -1,5 +1,4 @@
1
1
  export * from './dtos/create-organization.dto';
2
2
  export * from './dtos/update-organization.dto';
3
- export * from './dtos/contact-person.dto';
4
3
  export * from './interfaces/organization';
5
4
  export * from './enums/org-status.enum';
@@ -16,6 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./dtos/create-organization.dto"), exports);
18
18
  __exportStar(require("./dtos/update-organization.dto"), exports);
19
- __exportStar(require("./dtos/contact-person.dto"), exports);
20
19
  __exportStar(require("./interfaces/organization"), exports);
21
20
  __exportStar(require("./enums/org-status.enum"), exports);
@@ -1,4 +1,7 @@
1
+ import { ContactPersonDto } from "../../common/dtos/contact-person.dto";
1
2
  import { MapAddressDto } from "../../common/dtos/map-address.dto";
3
+ import { ControlCentre } from "../../control-centre";
4
+ import { Partner } from "../../partner";
2
5
  export interface Organization {
3
6
  id?: number;
4
7
  name: string;
@@ -10,8 +13,9 @@ export interface Organization {
10
13
  description?: string;
11
14
  status: string;
12
15
  logo?: string;
13
- contactPerson: MapAddressDto;
14
- partners?: number[];
16
+ contactPerson: ContactPersonDto;
17
+ controlCentres?: ControlCentre[];
18
+ partners?: Partner[];
15
19
  createdAt?: Date;
16
20
  updatedAt?: Date;
17
21
  }
@@ -0,0 +1,15 @@
1
+ import { MapAddressDto } from "../../common/dtos/map-address.dto";
2
+ import { ContactPersonDto } from "../../common/dtos/contact-person.dto";
3
+ export declare class CreatePartnerDto {
4
+ name: string;
5
+ phoneNumber?: string;
6
+ email?: string;
7
+ physicalAddress: MapAddressDto;
8
+ website: string;
9
+ type: string;
10
+ description?: string;
11
+ status: string;
12
+ logo?: string;
13
+ contactPerson: ContactPersonDto;
14
+ controlCentreIds?: number[];
15
+ }
@@ -0,0 +1,80 @@
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.CreatePartnerDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const class_transformer_1 = require("class-transformer");
15
+ const map_address_dto_1 = require("../../common/dtos/map-address.dto");
16
+ const partner_status_enum_1 = require("../enums/partner-status.enum");
17
+ const contact_person_dto_1 = require("../../common/dtos/contact-person.dto");
18
+ class CreatePartnerDto {
19
+ }
20
+ exports.CreatePartnerDto = CreatePartnerDto;
21
+ __decorate([
22
+ (0, class_validator_1.IsString)(),
23
+ (0, class_validator_1.IsNotEmpty)(),
24
+ (0, class_validator_1.MaxLength)(50),
25
+ __metadata("design:type", String)
26
+ ], CreatePartnerDto.prototype, "name", void 0);
27
+ __decorate([
28
+ (0, class_validator_1.IsPhoneNumber)(),
29
+ (0, class_validator_1.IsOptional)(),
30
+ (0, class_validator_1.MaxLength)(20),
31
+ __metadata("design:type", String)
32
+ ], CreatePartnerDto.prototype, "phoneNumber", void 0);
33
+ __decorate([
34
+ (0, class_validator_1.IsEmail)(),
35
+ (0, class_validator_1.IsOptional)(),
36
+ __metadata("design:type", String)
37
+ ], CreatePartnerDto.prototype, "email", void 0);
38
+ __decorate([
39
+ (0, class_validator_1.ValidateNested)(),
40
+ (0, class_transformer_1.Type)(() => map_address_dto_1.MapAddressDto),
41
+ (0, class_validator_1.IsNotEmpty)(),
42
+ __metadata("design:type", map_address_dto_1.MapAddressDto)
43
+ ], CreatePartnerDto.prototype, "physicalAddress", void 0);
44
+ __decorate([
45
+ (0, class_validator_1.IsString)(),
46
+ (0, class_validator_1.IsNotEmpty)(),
47
+ __metadata("design:type", String)
48
+ ], CreatePartnerDto.prototype, "website", void 0);
49
+ __decorate([
50
+ (0, class_validator_1.IsString)(),
51
+ (0, class_validator_1.IsNotEmpty)(),
52
+ __metadata("design:type", String)
53
+ ], CreatePartnerDto.prototype, "type", void 0);
54
+ __decorate([
55
+ (0, class_validator_1.IsString)(),
56
+ (0, class_validator_1.IsOptional)(),
57
+ __metadata("design:type", String)
58
+ ], CreatePartnerDto.prototype, "description", void 0);
59
+ __decorate([
60
+ (0, class_validator_1.IsEnum)(partner_status_enum_1.PartnerStatus),
61
+ (0, class_validator_1.IsNotEmpty)(),
62
+ __metadata("design:type", String)
63
+ ], CreatePartnerDto.prototype, "status", void 0);
64
+ __decorate([
65
+ (0, class_validator_1.IsUrl)(),
66
+ (0, class_validator_1.IsOptional)(),
67
+ __metadata("design:type", String)
68
+ ], CreatePartnerDto.prototype, "logo", void 0);
69
+ __decorate([
70
+ (0, class_validator_1.ValidateNested)(),
71
+ (0, class_transformer_1.Type)(() => contact_person_dto_1.ContactPersonDto),
72
+ (0, class_validator_1.IsNotEmpty)(),
73
+ __metadata("design:type", contact_person_dto_1.ContactPersonDto)
74
+ ], CreatePartnerDto.prototype, "contactPerson", void 0);
75
+ __decorate([
76
+ (0, class_validator_1.IsArray)(),
77
+ (0, class_validator_1.IsNumber)({}, { each: true }),
78
+ (0, class_validator_1.IsOptional)(),
79
+ __metadata("design:type", Array)
80
+ ], CreatePartnerDto.prototype, "controlCentreIds", void 0);
@@ -0,0 +1,5 @@
1
+ import { CreatePartnerDto } from "./create-partner.dto";
2
+ declare const UpdatePartnerDto_base: import("@nestjs/mapped-types").MappedType<Partial<CreatePartnerDto>>;
3
+ export declare class UpdatePartnerDto extends UpdatePartnerDto_base {
4
+ }
5
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdatePartnerDto = void 0;
4
+ const mapped_types_1 = require("@nestjs/mapped-types");
5
+ const create_partner_dto_1 = require("./create-partner.dto");
6
+ class UpdatePartnerDto extends (0, mapped_types_1.PartialType)(create_partner_dto_1.CreatePartnerDto) {
7
+ }
8
+ exports.UpdatePartnerDto = UpdatePartnerDto;
@@ -0,0 +1,7 @@
1
+ export declare enum PartnerStatus {
2
+ ACTIVE = "Active",
3
+ INACTIVE = "Inactive",
4
+ PENDING = "Pending",
5
+ SUSPENDED = "Suspended",
6
+ REJECTED = "Rejected"
7
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PartnerStatus = void 0;
4
+ var PartnerStatus;
5
+ (function (PartnerStatus) {
6
+ PartnerStatus["ACTIVE"] = "Active";
7
+ PartnerStatus["INACTIVE"] = "Inactive";
8
+ PartnerStatus["PENDING"] = "Pending";
9
+ PartnerStatus["SUSPENDED"] = "Suspended";
10
+ PartnerStatus["REJECTED"] = "Rejected";
11
+ })(PartnerStatus || (exports.PartnerStatus = PartnerStatus = {}));
@@ -0,0 +1,4 @@
1
+ export * from './dtos/create-partner.dto';
2
+ export * from './dtos/update-partner.dto';
3
+ export * from './enums/partner-status.enum';
4
+ export * from './interfaces/partner';
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./dtos/create-partner.dto"), exports);
18
+ __exportStar(require("./dtos/update-partner.dto"), exports);
19
+ __exportStar(require("./enums/partner-status.enum"), exports);
20
+ __exportStar(require("./interfaces/partner"), exports);
@@ -0,0 +1,19 @@
1
+ import { MapAddressDto } from "../../common";
2
+ import { ContactPersonDto } from "../../common/dtos/contact-person.dto";
3
+ import { ControlCentre } from "../../control-centre";
4
+ export interface Partner {
5
+ id?: number;
6
+ name: string;
7
+ phoneNumber?: string;
8
+ email?: string;
9
+ physicalAddress: MapAddressDto;
10
+ website: string;
11
+ type: string;
12
+ description?: string;
13
+ status: string;
14
+ logo?: string;
15
+ contactPerson: ContactPersonDto;
16
+ controlCentres?: ControlCentre[];
17
+ createdAt?: Date;
18
+ updatedAt?: Date;
19
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,17 +1,15 @@
1
- import { UserStatus } from "../enums/user-status.enum";
1
+ import { UserStatus } from '../enums/user-status.enum';
2
2
  export declare class CreateUserDto {
3
3
  name: string;
4
4
  email: string;
5
5
  phoneNumber?: string;
6
- roles: number[];
6
+ roleIds: number[];
7
7
  password?: string;
8
8
  avatar?: string;
9
9
  designation?: string;
10
- status: UserStatus;
11
- isTermsAccepted?: boolean;
12
- isEmailVerified?: boolean;
10
+ status?: UserStatus;
11
+ isTermsAccepted: boolean;
13
12
  otp?: string;
14
- otpExpiresAt?: Date;
15
- partner: number;
16
- organization: number;
13
+ partnerId?: number;
14
+ organizationId: number;
17
15
  }
@@ -20,17 +20,19 @@ __decorate([
20
20
  (0, class_validator_1.IsString)(),
21
21
  (0, class_validator_1.IsNotEmpty)(),
22
22
  (0, class_validator_1.MinLength)(2),
23
+ (0, class_validator_1.MaxLength)(50),
23
24
  (0, case_decorators_1.SentenceCase)(),
24
25
  __metadata("design:type", String)
25
26
  ], CreateUserDto.prototype, "name", void 0);
26
27
  __decorate([
27
28
  (0, class_validator_1.IsEmail)(),
28
29
  (0, class_validator_1.IsNotEmpty)(),
30
+ (0, class_validator_1.MaxLength)(50),
29
31
  __metadata("design:type", String)
30
32
  ], CreateUserDto.prototype, "email", void 0);
31
33
  __decorate([
32
- (0, class_validator_1.IsOptional)(),
33
34
  (0, class_validator_1.IsPhoneNumber)(),
35
+ (0, class_validator_1.MaxLength)(20),
34
36
  (0, class_validator_1.IsOptional)(),
35
37
  __metadata("design:type", String)
36
38
  ], CreateUserDto.prototype, "phoneNumber", void 0);
@@ -39,13 +41,14 @@ __decorate([
39
41
  (0, class_validator_1.IsNumber)({}, { each: true }),
40
42
  (0, class_validator_1.IsNotEmpty)(),
41
43
  __metadata("design:type", Array)
42
- ], CreateUserDto.prototype, "roles", void 0);
44
+ ], CreateUserDto.prototype, "roleIds", void 0);
43
45
  __decorate([
44
46
  (0, class_validator_1.IsString)(),
45
47
  (0, class_validator_1.MinLength)(8),
46
48
  (0, class_validator_1.Matches)(/((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/, {
47
- message: 'Password must contain at least 1 uppercase letter, 1 lowercase letter, and 1 number or special character'
49
+ message: 'Password must contain at least 1 uppercase letter, 1 lowercase letter, and 1 number or special character',
48
50
  }),
51
+ (0, class_validator_1.IsOptional)(),
49
52
  __metadata("design:type", String)
50
53
  ], CreateUserDto.prototype, "password", void 0);
51
54
  __decorate([
@@ -56,11 +59,12 @@ __decorate([
56
59
  __decorate([
57
60
  (0, class_validator_1.IsString)(),
58
61
  (0, class_validator_1.IsOptional)(),
62
+ (0, class_validator_1.MaxLength)(20),
59
63
  __metadata("design:type", String)
60
64
  ], CreateUserDto.prototype, "designation", void 0);
61
65
  __decorate([
62
66
  (0, class_validator_1.IsEnum)(user_status_enum_1.UserStatus),
63
- (0, class_validator_1.IsNotEmpty)(),
67
+ (0, class_validator_1.IsOptional)(),
64
68
  __metadata("design:type", String)
65
69
  ], CreateUserDto.prototype, "status", void 0);
66
70
  __decorate([
@@ -68,28 +72,18 @@ __decorate([
68
72
  (0, class_validator_1.IsOptional)(),
69
73
  __metadata("design:type", Boolean)
70
74
  ], CreateUserDto.prototype, "isTermsAccepted", void 0);
71
- __decorate([
72
- (0, class_validator_1.IsBoolean)(),
73
- (0, class_validator_1.IsOptional)(),
74
- __metadata("design:type", Boolean)
75
- ], CreateUserDto.prototype, "isEmailVerified", void 0);
76
75
  __decorate([
77
76
  (0, class_validator_1.IsString)(),
78
77
  (0, class_validator_1.IsOptional)(),
79
78
  __metadata("design:type", String)
80
79
  ], CreateUserDto.prototype, "otp", void 0);
81
- __decorate([
82
- (0, class_validator_1.IsDateString)(),
83
- (0, class_validator_1.IsOptional)(),
84
- __metadata("design:type", Date)
85
- ], CreateUserDto.prototype, "otpExpiresAt", void 0);
86
80
  __decorate([
87
81
  (0, class_validator_1.IsNumber)(),
88
- (0, class_validator_1.IsNotEmpty)(),
82
+ (0, class_validator_1.IsOptional)(),
89
83
  __metadata("design:type", Number)
90
- ], CreateUserDto.prototype, "partner", void 0);
84
+ ], CreateUserDto.prototype, "partnerId", void 0);
91
85
  __decorate([
92
86
  (0, class_validator_1.IsNumber)(),
93
87
  (0, class_validator_1.IsNotEmpty)(),
94
88
  __metadata("design:type", Number)
95
- ], CreateUserDto.prototype, "organization", void 0);
89
+ ], CreateUserDto.prototype, "organizationId", void 0);
@@ -1,5 +1,5 @@
1
1
  import { Organization } from "../../organization";
2
- import { Partner } from "../../organization/interfaces/partner";
2
+ import { Partner } from "../../partner/interfaces/partner";
3
3
  import { Role } from "../../role";
4
4
  export interface User {
5
5
  id?: number;
@@ -10,12 +10,12 @@ export interface User {
10
10
  password?: string;
11
11
  avatar?: string;
12
12
  designation?: string;
13
- status: string;
13
+ status?: string;
14
14
  isTermsAccepted?: boolean;
15
15
  isEmailVerified?: boolean;
16
16
  otp?: string;
17
17
  otpExpiresAt?: Date;
18
- partner: Partner;
18
+ partner?: Partner;
19
19
  organization: Organization;
20
20
  createdAt?: Date;
21
21
  updatedAt?: Date;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grm-shared-library",
3
- "version": "1.0.41",
3
+ "version": "1.0.43",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [