grm-shared-library 1.1.71 → 1.1.73
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/cjs/kafka/dtos/otp/create-otp-payload.dto.js +1 -2
- package/dist/cjs/kafka/dtos/otp/create-otp-payload.dto.js.map +1 -1
- package/dist/cjs/modules/user/dtos/create-guardian.dto.js +48 -0
- package/dist/cjs/modules/user/dtos/create-guardian.dto.js.map +1 -0
- package/dist/cjs/modules/user/dtos/create-user.dto.js +14 -0
- package/dist/cjs/modules/user/dtos/create-user.dto.js.map +1 -1
- package/dist/cjs/modules/user/enums/guardian-relationship.enum.js +17 -0
- package/dist/cjs/modules/user/enums/guardian-relationship.enum.js.map +1 -0
- package/dist/cjs/modules/user/index.js +3 -0
- package/dist/cjs/modules/user/index.js.map +1 -1
- package/dist/cjs/modules/user/interfaces/guardian.js +3 -0
- package/dist/cjs/modules/user/interfaces/guardian.js.map +1 -0
- package/dist/esm/kafka/dtos/otp/create-otp-payload.dto.js +2 -3
- package/dist/esm/kafka/dtos/otp/create-otp-payload.dto.js.map +1 -1
- package/dist/esm/modules/user/dtos/create-guardian.dto.js +44 -0
- package/dist/esm/modules/user/dtos/create-guardian.dto.js.map +1 -0
- package/dist/esm/modules/user/dtos/create-user.dto.js +15 -1
- package/dist/esm/modules/user/dtos/create-user.dto.js.map +1 -1
- package/dist/esm/modules/user/enums/guardian-relationship.enum.js +14 -0
- package/dist/esm/modules/user/enums/guardian-relationship.enum.js.map +1 -0
- package/dist/esm/modules/user/index.js +3 -0
- package/dist/esm/modules/user/index.js.map +1 -1
- package/dist/esm/modules/user/interfaces/guardian.js +2 -0
- package/dist/esm/modules/user/interfaces/guardian.js.map +1 -0
- package/dist/types/modules/user/dtos/create-guardian.dto.d.ts +9 -0
- package/dist/types/modules/user/dtos/create-user.dto.d.ts +3 -0
- package/dist/types/modules/user/enums/guardian-relationship.enum.d.ts +12 -0
- package/dist/types/modules/user/index.d.ts +3 -0
- package/dist/types/modules/user/interfaces/guardian.d.ts +9 -0
- package/dist/types/modules/user/interfaces/user.d.ts +3 -0
- package/package.json +1 -1
|
@@ -26,8 +26,7 @@ __decorate([
|
|
|
26
26
|
__metadata("design:type", String)
|
|
27
27
|
], CreateOTPPayloadDto.prototype, "email", void 0);
|
|
28
28
|
__decorate([
|
|
29
|
-
(0, class_validator_1.
|
|
30
|
-
,
|
|
29
|
+
(0, class_validator_1.IsPhoneNumber)(),
|
|
31
30
|
(0, class_validator_1.IsOptional)(),
|
|
32
31
|
__metadata("design:type", String)
|
|
33
32
|
], CreateOTPPayloadDto.prototype, "phoneNumber", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-otp-payload.dto.js","sourceRoot":"","sources":["../../../../../src/kafka/dtos/otp/create-otp-payload.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA6G;AAC7G,uEAAmE;AAEnE,MAAa,mBAAmB;CA4C/B;AA5CD,kDA4CC;AAzCG;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;iDACC;AAId;IAFC,IAAA,yBAAO,GAAE;IACT,IAAA,4BAAU,GAAE;;kDACE;AAIf;IAFC,IAAA,
|
|
1
|
+
{"version":3,"file":"create-otp-payload.dto.js","sourceRoot":"","sources":["../../../../../src/kafka/dtos/otp/create-otp-payload.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA6G;AAC7G,uEAAmE;AAEnE,MAAa,mBAAmB;CA4C/B;AA5CD,kDA4CC;AAzCG;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;iDACC;AAId;IAFC,IAAA,yBAAO,GAAE;IACT,IAAA,4BAAU,GAAE;;kDACE;AAIf;IAFC,IAAA,+BAAa,GAAE;IACf,IAAA,4BAAU,GAAE;;wDACQ;AAIrB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;iDACC;AAId;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;8DACc;AAI3B;IAFC,IAAA,wBAAM,GAAE;IACR,IAAA,4BAAU,GAAE;8BACgB,IAAI;uEAAC;AAIlC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;gDACA;AAIb;IAFC,IAAA,wBAAM,GAAE;IACR,IAAA,4BAAU,GAAE;8BACE,IAAI;yDAAC;AAIpB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;qEACqB;AAIlC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;mDACM;AAInB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;uDACoB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
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.CreateGuardianDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const guardian_relationship_enum_1 = require("../enums/guardian-relationship.enum");
|
|
15
|
+
class CreateGuardianDto {
|
|
16
|
+
}
|
|
17
|
+
exports.CreateGuardianDto = CreateGuardianDto;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_validator_1.IsNumber)(),
|
|
20
|
+
(0, class_validator_1.IsOptional)(),
|
|
21
|
+
__metadata("design:type", Number)
|
|
22
|
+
], CreateGuardianDto.prototype, "userId", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_validator_1.IsString)(),
|
|
25
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], CreateGuardianDto.prototype, "name", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_validator_1.IsPhoneNumber)(),
|
|
30
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], CreateGuardianDto.prototype, "phoneNumber", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsBoolean)(),
|
|
35
|
+
(0, class_validator_1.IsOptional)(),
|
|
36
|
+
__metadata("design:type", Boolean)
|
|
37
|
+
], CreateGuardianDto.prototype, "isPrimary", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, class_validator_1.IsEnum)(guardian_relationship_enum_1.GuardianRelationship),
|
|
40
|
+
(0, class_validator_1.IsOptional)(),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], CreateGuardianDto.prototype, "relationship", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, class_validator_1.IsEmail)(),
|
|
45
|
+
(0, class_validator_1.IsString)(),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], CreateGuardianDto.prototype, "email", void 0);
|
|
48
|
+
//# sourceMappingURL=create-guardian.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-guardian.dto.js","sourceRoot":"","sources":["../../../../../src/modules/user/dtos/create-guardian.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAwH;AACxH,oFAA2E;AAE3E,MAAa,iBAAiB;CAwB7B;AAxBD,8CAwBC;AArBG;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;iDACG;AAIhB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;+CACC;AAId;IAFC,IAAA,+BAAa,GAAE;IACf,IAAA,4BAAU,GAAE;;sDACQ;AAIrB;IAFC,IAAA,2BAAS,GAAE;IACX,IAAA,4BAAU,GAAE;;oDACO;AAIpB;IAFC,IAAA,wBAAM,EAAC,iDAAoB,CAAC;IAC5B,IAAA,4BAAU,GAAE;;uDACuB;AAIpC;IAFC,IAAA,yBAAO,GAAE;IACT,IAAA,0BAAQ,GAAE;;gDACI"}
|
|
@@ -15,6 +15,8 @@ const case_decorators_1 = require("../../../decorators/case-decorators");
|
|
|
15
15
|
const user_status_enum_1 = require("../enums/user-status.enum");
|
|
16
16
|
const password_regex_const_1 = require("../../common/constants/password-regex.const");
|
|
17
17
|
const role_1 = require("../../role");
|
|
18
|
+
const class_transformer_1 = require("class-transformer");
|
|
19
|
+
const create_guardian_dto_1 = require("./create-guardian.dto");
|
|
18
20
|
class CreateUserDto {
|
|
19
21
|
}
|
|
20
22
|
exports.CreateUserDto = CreateUserDto;
|
|
@@ -67,6 +69,18 @@ __decorate([
|
|
|
67
69
|
(0, class_validator_1.IsOptional)(),
|
|
68
70
|
__metadata("design:type", String)
|
|
69
71
|
], CreateUserDto.prototype, "status", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
74
|
+
(0, class_transformer_1.Type)(() => create_guardian_dto_1.CreateGuardianDto),
|
|
75
|
+
(0, class_validator_1.IsOptional)(),
|
|
76
|
+
__metadata("design:type", Array)
|
|
77
|
+
], CreateUserDto.prototype, "guardians", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, class_validator_1.IsArray)(),
|
|
80
|
+
(0, class_validator_1.IsNumber)({}, { each: true }),
|
|
81
|
+
(0, class_validator_1.IsOptional)(),
|
|
82
|
+
__metadata("design:type", Array)
|
|
83
|
+
], CreateUserDto.prototype, "dependantIds", void 0);
|
|
70
84
|
__decorate([
|
|
71
85
|
(0, class_validator_1.IsBoolean)(),
|
|
72
86
|
(0, class_validator_1.IsOptional)(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-user.dto.js","sourceRoot":"","sources":["../../../../../src/modules/user/dtos/create-user.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"create-user.dto.js","sourceRoot":"","sources":["../../../../../src/modules/user/dtos/create-user.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAgByB;AACzB,yEAAmE;AACnE,gEAAuD;AACvD,sFAAqG;AACrG,qCAAmC;AACnC,yDAAyC;AACzC,+DAA0D;AAE1D,MAAa,aAAa;CAuEzB;AAvED,sCAuEC;AAjEG;IALC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,EAAC,CAAC,CAAC;IACZ,IAAA,2BAAS,EAAC,EAAE,CAAC;IACb,IAAA,8BAAY,GAAE;;2CACD;AAKd;IAHC,IAAA,yBAAO,GAAE;IACT,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,EAAC,EAAE,CAAC;;4CACC;AAKf;IAHC,IAAA,+BAAa,GAAE;IACf,IAAA,2BAAS,EAAC,EAAE,CAAC;IACb,IAAA,4BAAU,GAAE;;kDACQ;AAKrB;IAHC,IAAA,yBAAO,GAAE;IACT,IAAA,wBAAM,EAAC,YAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC7B,IAAA,+BAAa,GAAE;;4CACA;AAMhB;IAJC,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,CAAC,CAAC;IACZ,IAAA,yBAAO,EAAC,qCAAc,EAAE,EAAE,OAAO,EAAE,6CAAsB,EAAE,CAAC;IAC5D,IAAA,4BAAU,GAAE;;+CACK;AAIlB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;6CACG;AAKhB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,EAAC,EAAE,CAAC;;kDACO;AAIrB;IAFC,IAAA,wBAAM,EAAC,6BAAU,CAAC;IAClB,IAAA,4BAAU,GAAE;;6CACO;AAKpB;IAHC,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,uCAAiB,CAAC;IAC7B,IAAA,4BAAU,GAAE;;gDACmB;AAKhC;IAHC,IAAA,yBAAO,GAAE;IACT,IAAA,0BAAQ,EAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC5B,IAAA,4BAAU,GAAE;;mDACW;AAIxB;IAFC,IAAA,2BAAS,GAAE;IACX,IAAA,4BAAU,GAAE;;sDACa;AAI1B;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;wDACc;AAI3B;IAFC,IAAA,wBAAM,GAAE;IACR,IAAA,4BAAU,GAAE;8BACgB,IAAI;iEAAC;AAIlC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;sDACY;AAIzB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;qDACW"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GuardianRelationship = void 0;
|
|
4
|
+
var GuardianRelationship;
|
|
5
|
+
(function (GuardianRelationship) {
|
|
6
|
+
GuardianRelationship["PARENT"] = "parent";
|
|
7
|
+
GuardianRelationship["SIBLING"] = "sibling";
|
|
8
|
+
GuardianRelationship["GRANDPARENT"] = "grandparent";
|
|
9
|
+
GuardianRelationship["AUNT"] = "aunt";
|
|
10
|
+
GuardianRelationship["UNCLE"] = "uncle";
|
|
11
|
+
GuardianRelationship["OTHER_RELATIVE"] = "other relative";
|
|
12
|
+
GuardianRelationship["GUARDIAN"] = "guardian";
|
|
13
|
+
GuardianRelationship["FRIEND"] = "friend";
|
|
14
|
+
GuardianRelationship["EMERGENCY_CONTACT"] = "emergency contact";
|
|
15
|
+
GuardianRelationship["OTHER"] = "other";
|
|
16
|
+
})(GuardianRelationship || (exports.GuardianRelationship = GuardianRelationship = {}));
|
|
17
|
+
//# sourceMappingURL=guardian-relationship.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guardian-relationship.enum.js","sourceRoot":"","sources":["../../../../../src/modules/user/enums/guardian-relationship.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,oBAWX;AAXD,WAAY,oBAAoB;IAC5B,yCAAiB,CAAA;IACjB,2CAAmB,CAAA;IACnB,mDAA2B,CAAA;IAC3B,qCAAa,CAAA;IACb,uCAAe,CAAA;IACf,yDAAiC,CAAA;IACjC,6CAAqB,CAAA;IACrB,yCAAiB,CAAA;IACjB,+DAAuC,CAAA;IACvC,uCAAe,CAAA;AACnB,CAAC,EAXW,oBAAoB,oCAApB,oBAAoB,QAW/B"}
|
|
@@ -16,8 +16,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./dtos/create-user.dto"), exports);
|
|
18
18
|
__exportStar(require("./dtos/update-user.dto"), exports);
|
|
19
|
+
__exportStar(require("./dtos/create-guardian.dto"), exports);
|
|
19
20
|
__exportStar(require("./enums/user-status.enum"), exports);
|
|
21
|
+
__exportStar(require("./enums/guardian-relationship.enum"), exports);
|
|
20
22
|
__exportStar(require("./interfaces/user"), exports);
|
|
21
23
|
__exportStar(require("./interfaces/user-context"), exports);
|
|
22
24
|
__exportStar(require("./interfaces/access-scope"), exports);
|
|
25
|
+
__exportStar(require("./interfaces/guardian"), exports);
|
|
23
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/user/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,yDAAuC;AACvC,2DAAyC;AACzC,oDAAkC;AAClC,4DAA0C;AAC1C,4DAA0C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/user/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,yDAAuC;AACvC,6DAA2C;AAC3C,2DAAyC;AACzC,qEAAmD;AACnD,oDAAkC;AAClC,4DAA0C;AAC1C,4DAA0C;AAC1C,wDAAsC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guardian.js","sourceRoot":"","sources":["../../../../../src/modules/user/interfaces/guardian.ts"],"names":[],"mappings":""}
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { IsDate, IsEmail, IsNotEmpty, IsObject, IsOptional, IsString } from "class-validator";
|
|
10
|
+
import { IsDate, IsEmail, IsNotEmpty, IsObject, IsOptional, IsPhoneNumber, IsString } from "class-validator";
|
|
11
11
|
import { OtpAction } from "../../../modules/auth/enums/otp-action";
|
|
12
12
|
export class CreateOTPPayloadDto {
|
|
13
13
|
}
|
|
@@ -22,8 +22,7 @@ __decorate([
|
|
|
22
22
|
__metadata("design:type", String)
|
|
23
23
|
], CreateOTPPayloadDto.prototype, "email", void 0);
|
|
24
24
|
__decorate([
|
|
25
|
-
|
|
26
|
-
,
|
|
25
|
+
IsPhoneNumber(),
|
|
27
26
|
IsOptional(),
|
|
28
27
|
__metadata("design:type", String)
|
|
29
28
|
], CreateOTPPayloadDto.prototype, "phoneNumber", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-otp-payload.dto.js","sourceRoot":"","sources":["../../../../../src/kafka/dtos/otp/create-otp-payload.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"create-otp-payload.dto.js","sourceRoot":"","sources":["../../../../../src/kafka/dtos/otp/create-otp-payload.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC7G,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AAEnE,MAAM,OAAO,mBAAmB;CA4C/B;AAzCG;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;iDACC;AAId;IAFC,OAAO,EAAE;IACT,UAAU,EAAE;;kDACE;AAIf;IAFC,aAAa,EAAE;IACf,UAAU,EAAE;;wDACQ;AAIrB;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;iDACC;AAId;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;8DACc;AAI3B;IAFC,MAAM,EAAE;IACR,UAAU,EAAE;8BACgB,IAAI;uEAAC;AAIlC;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;gDACA;AAIb;IAFC,MAAM,EAAE;IACR,UAAU,EAAE;8BACE,IAAI;yDAAC;AAIpB;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;qEACqB;AAIlC;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;mDACM;AAInB;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;uDACoB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { IsBoolean, IsEmail, IsEnum, IsNotEmpty, IsNumber, IsOptional, IsPhoneNumber, IsString } from "class-validator";
|
|
11
|
+
import { GuardianRelationship } from "../enums/guardian-relationship.enum";
|
|
12
|
+
export class CreateGuardianDto {
|
|
13
|
+
}
|
|
14
|
+
__decorate([
|
|
15
|
+
IsNumber(),
|
|
16
|
+
IsOptional(),
|
|
17
|
+
__metadata("design:type", Number)
|
|
18
|
+
], CreateGuardianDto.prototype, "userId", void 0);
|
|
19
|
+
__decorate([
|
|
20
|
+
IsString(),
|
|
21
|
+
IsNotEmpty(),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], CreateGuardianDto.prototype, "name", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
IsPhoneNumber(),
|
|
26
|
+
IsNotEmpty(),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], CreateGuardianDto.prototype, "phoneNumber", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
IsBoolean(),
|
|
31
|
+
IsOptional(),
|
|
32
|
+
__metadata("design:type", Boolean)
|
|
33
|
+
], CreateGuardianDto.prototype, "isPrimary", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
IsEnum(GuardianRelationship),
|
|
36
|
+
IsOptional(),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], CreateGuardianDto.prototype, "relationship", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
IsEmail(),
|
|
41
|
+
IsString(),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], CreateGuardianDto.prototype, "email", void 0);
|
|
44
|
+
//# sourceMappingURL=create-guardian.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-guardian.dto.js","sourceRoot":"","sources":["../../../../../src/modules/user/dtos/create-guardian.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACxH,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E,MAAM,OAAO,iBAAiB;CAwB7B;AArBG;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;iDACG;AAIhB;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;+CACC;AAId;IAFC,aAAa,EAAE;IACf,UAAU,EAAE;;sDACQ;AAIrB;IAFC,SAAS,EAAE;IACX,UAAU,EAAE;;oDACO;AAIpB;IAFC,MAAM,CAAC,oBAAoB,CAAC;IAC5B,UAAU,EAAE;;uDACuB;AAIpC;IAFC,OAAO,EAAE;IACT,QAAQ,EAAE;;gDACI"}
|
|
@@ -7,11 +7,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { ArrayNotEmpty, IsArray, IsBoolean, IsDate, IsEmail, IsEnum, IsNotEmpty, IsNumber, IsOptional, IsPhoneNumber, IsString, Matches, MaxLength, MinLength, } from 'class-validator';
|
|
10
|
+
import { ArrayNotEmpty, IsArray, IsBoolean, IsDate, IsEmail, IsEnum, IsNotEmpty, IsNumber, IsOptional, IsPhoneNumber, IsString, Matches, MaxLength, MinLength, ValidateNested, } from 'class-validator';
|
|
11
11
|
import { SentenceCase } from '../../../decorators/case-decorators';
|
|
12
12
|
import { UserStatus } from '../enums/user-status.enum';
|
|
13
13
|
import { PASSWORD_ERROR_MESSAGE, PASSWORD_REGEX } from '../../common/constants/password-regex.const';
|
|
14
14
|
import { Roles } from '../../role';
|
|
15
|
+
import { Type } from 'class-transformer';
|
|
16
|
+
import { CreateGuardianDto } from './create-guardian.dto';
|
|
15
17
|
export class CreateUserDto {
|
|
16
18
|
}
|
|
17
19
|
__decorate([
|
|
@@ -63,6 +65,18 @@ __decorate([
|
|
|
63
65
|
IsOptional(),
|
|
64
66
|
__metadata("design:type", String)
|
|
65
67
|
], CreateUserDto.prototype, "status", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
ValidateNested({ each: true }),
|
|
70
|
+
Type(() => CreateGuardianDto),
|
|
71
|
+
IsOptional(),
|
|
72
|
+
__metadata("design:type", Array)
|
|
73
|
+
], CreateUserDto.prototype, "guardians", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
IsArray(),
|
|
76
|
+
IsNumber({}, { each: true }),
|
|
77
|
+
IsOptional(),
|
|
78
|
+
__metadata("design:type", Array)
|
|
79
|
+
], CreateUserDto.prototype, "dependantIds", void 0);
|
|
66
80
|
__decorate([
|
|
67
81
|
IsBoolean(),
|
|
68
82
|
IsOptional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-user.dto.js","sourceRoot":"","sources":["../../../../../src/modules/user/dtos/create-user.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACH,aAAa,EACb,OAAO,EACP,SAAS,EACT,MAAM,EACN,OAAO,EACP,MAAM,EACN,UAAU,EACV,QAAQ,EACR,UAAU,EACV,aAAa,EACb,QAAQ,EACR,OAAO,EACP,SAAS,EACT,SAAS,
|
|
1
|
+
{"version":3,"file":"create-user.dto.js","sourceRoot":"","sources":["../../../../../src/modules/user/dtos/create-user.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACH,aAAa,EACb,OAAO,EACP,SAAS,EACT,MAAM,EACN,OAAO,EACP,MAAM,EACN,UAAU,EACV,QAAQ,EACR,UAAU,EACV,aAAa,EACb,QAAQ,EACR,OAAO,EACP,SAAS,EACT,SAAS,EACT,cAAc,GACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AACrG,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,MAAM,OAAO,aAAa;CAuEzB;AAjEG;IALC,QAAQ,EAAE;IACV,UAAU,EAAE;IACZ,SAAS,CAAC,CAAC,CAAC;IACZ,SAAS,CAAC,EAAE,CAAC;IACb,YAAY,EAAE;;2CACD;AAKd;IAHC,OAAO,EAAE;IACT,UAAU,EAAE;IACZ,SAAS,CAAC,EAAE,CAAC;;4CACC;AAKf;IAHC,aAAa,EAAE;IACf,SAAS,CAAC,EAAE,CAAC;IACb,UAAU,EAAE;;kDACQ;AAKrB;IAHC,OAAO,EAAE;IACT,MAAM,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC7B,aAAa,EAAE;;4CACA;AAMhB;IAJC,QAAQ,EAAE;IACV,SAAS,CAAC,CAAC,CAAC;IACZ,OAAO,CAAC,cAAc,EAAE,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC;IAC5D,UAAU,EAAE;;+CACK;AAIlB;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;6CACG;AAKhB;IAHC,QAAQ,EAAE;IACV,UAAU,EAAE;IACZ,SAAS,CAAC,EAAE,CAAC;;kDACO;AAIrB;IAFC,MAAM,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;;6CACO;AAKpB;IAHC,cAAc,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAI,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC;IAC7B,UAAU,EAAE;;gDACmB;AAKhC;IAHC,OAAO,EAAE;IACT,QAAQ,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC5B,UAAU,EAAE;;mDACW;AAIxB;IAFC,SAAS,EAAE;IACX,UAAU,EAAE;;sDACa;AAI1B;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;wDACc;AAI3B;IAFC,MAAM,EAAE;IACR,UAAU,EAAE;8BACgB,IAAI;iEAAC;AAIlC;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;sDACY;AAIzB;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;qDACW"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export var GuardianRelationship;
|
|
2
|
+
(function (GuardianRelationship) {
|
|
3
|
+
GuardianRelationship["PARENT"] = "parent";
|
|
4
|
+
GuardianRelationship["SIBLING"] = "sibling";
|
|
5
|
+
GuardianRelationship["GRANDPARENT"] = "grandparent";
|
|
6
|
+
GuardianRelationship["AUNT"] = "aunt";
|
|
7
|
+
GuardianRelationship["UNCLE"] = "uncle";
|
|
8
|
+
GuardianRelationship["OTHER_RELATIVE"] = "other relative";
|
|
9
|
+
GuardianRelationship["GUARDIAN"] = "guardian";
|
|
10
|
+
GuardianRelationship["FRIEND"] = "friend";
|
|
11
|
+
GuardianRelationship["EMERGENCY_CONTACT"] = "emergency contact";
|
|
12
|
+
GuardianRelationship["OTHER"] = "other";
|
|
13
|
+
})(GuardianRelationship || (GuardianRelationship = {}));
|
|
14
|
+
//# sourceMappingURL=guardian-relationship.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guardian-relationship.enum.js","sourceRoot":"","sources":["../../../../../src/modules/user/enums/guardian-relationship.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,oBAWX;AAXD,WAAY,oBAAoB;IAC5B,yCAAiB,CAAA;IACjB,2CAAmB,CAAA;IACnB,mDAA2B,CAAA;IAC3B,qCAAa,CAAA;IACb,uCAAe,CAAA;IACf,yDAAiC,CAAA;IACjC,6CAAqB,CAAA;IACrB,yCAAiB,CAAA;IACjB,+DAAuC,CAAA;IACvC,uCAAe,CAAA;AACnB,CAAC,EAXW,oBAAoB,KAApB,oBAAoB,QAW/B"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export * from './dtos/create-user.dto';
|
|
2
2
|
export * from './dtos/update-user.dto';
|
|
3
|
+
export * from './dtos/create-guardian.dto';
|
|
3
4
|
export * from './enums/user-status.enum';
|
|
5
|
+
export * from './enums/guardian-relationship.enum';
|
|
4
6
|
export * from './interfaces/user';
|
|
5
7
|
export * from './interfaces/user-context';
|
|
6
8
|
export * from './interfaces/access-scope';
|
|
9
|
+
export * from './interfaces/guardian';
|
|
7
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/user/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/user/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guardian.js","sourceRoot":"","sources":["../../../../../src/modules/user/interfaces/guardian.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { UserStatus } from '../enums/user-status.enum';
|
|
2
2
|
import { Roles } from '../../role';
|
|
3
|
+
import { CreateGuardianDto } from './create-guardian.dto';
|
|
3
4
|
export declare class CreateUserDto {
|
|
4
5
|
name: string;
|
|
5
6
|
email: string;
|
|
@@ -9,6 +10,8 @@ export declare class CreateUserDto {
|
|
|
9
10
|
avatar?: string;
|
|
10
11
|
designation?: string;
|
|
11
12
|
status?: UserStatus;
|
|
13
|
+
guardians?: CreateGuardianDto[];
|
|
14
|
+
dependantIds?: number[];
|
|
12
15
|
isTermsAccepted?: boolean;
|
|
13
16
|
verificationToken?: string;
|
|
14
17
|
verificationTokenExpiresAt?: Date;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare enum GuardianRelationship {
|
|
2
|
+
PARENT = "parent",
|
|
3
|
+
SIBLING = "sibling",
|
|
4
|
+
GRANDPARENT = "grandparent",
|
|
5
|
+
AUNT = "aunt",
|
|
6
|
+
UNCLE = "uncle",
|
|
7
|
+
OTHER_RELATIVE = "other relative",
|
|
8
|
+
GUARDIAN = "guardian",
|
|
9
|
+
FRIEND = "friend",
|
|
10
|
+
EMERGENCY_CONTACT = "emergency contact",
|
|
11
|
+
OTHER = "other"
|
|
12
|
+
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export * from './dtos/create-user.dto';
|
|
2
2
|
export * from './dtos/update-user.dto';
|
|
3
|
+
export * from './dtos/create-guardian.dto';
|
|
3
4
|
export * from './enums/user-status.enum';
|
|
5
|
+
export * from './enums/guardian-relationship.enum';
|
|
4
6
|
export * from './interfaces/user';
|
|
5
7
|
export * from './interfaces/user-context';
|
|
6
8
|
export * from './interfaces/access-scope';
|
|
9
|
+
export * from './interfaces/guardian';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Roles } from "../../role";
|
|
2
|
+
import { Guardian } from "./guardian";
|
|
2
3
|
export interface User {
|
|
3
4
|
id?: number;
|
|
4
5
|
name: string;
|
|
@@ -9,6 +10,8 @@ export interface User {
|
|
|
9
10
|
avatar?: string;
|
|
10
11
|
designation?: string;
|
|
11
12
|
status?: string;
|
|
13
|
+
guardians?: Guardian[];
|
|
14
|
+
dependantIds?: number[];
|
|
12
15
|
isTermsAccepted?: boolean;
|
|
13
16
|
isIdentityVerified?: boolean;
|
|
14
17
|
otp?: string;
|