docta-package 1.0.1 → 1.1.0
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/README.md +1 -0
- package/build/config.d.ts +14 -0
- package/build/config.js +15 -0
- package/build/dto/input/doctor.d.ts +28 -0
- package/build/dto/input/doctor.js +131 -0
- package/build/dto/input/education.d.ts +4 -0
- package/build/dto/input/education.js +26 -0
- package/build/dto/input/faq.d.ts +4 -0
- package/build/dto/input/faq.js +26 -0
- package/build/dto/input/index.js +25 -0
- package/build/dto/input/language.d.ts +5 -0
- package/build/dto/input/language.js +28 -0
- package/build/dto/input/location.d.ts +9 -0
- package/build/dto/input/location.js +51 -0
- package/build/dto/input/patient.d.ts +6 -0
- package/build/dto/input/patient.js +33 -0
- package/build/dto/input/position.d.ts +6 -0
- package/build/dto/input/position.js +37 -0
- package/build/dto/input/specialty.d.ts +12 -0
- package/build/dto/input/specialty.js +56 -0
- package/build/dto/input/user.d.ts +29 -0
- package/build/dto/input/user.js +112 -0
- package/build/dto/output/doctor.d.ts +38 -0
- package/build/dto/output/doctor.js +61 -0
- package/build/dto/output/education.d.ts +6 -0
- package/build/dto/output/education.js +10 -0
- package/build/dto/output/faq.d.ts +6 -0
- package/build/dto/output/faq.js +10 -0
- package/build/dto/output/index.js +25 -0
- package/build/dto/output/language.d.ts +6 -0
- package/build/dto/output/language.js +10 -0
- package/build/dto/output/location.d.ts +11 -0
- package/build/dto/output/location.js +16 -0
- package/build/dto/output/patient.d.ts +20 -0
- package/build/dto/output/patient.js +34 -0
- package/build/dto/output/position.d.ts +8 -0
- package/build/dto/output/position.js +13 -0
- package/build/dto/output/specialty.d.ts +23 -0
- package/build/dto/output/specialty.js +40 -0
- package/build/dto/output/user.d.ts +24 -0
- package/build/dto/output/user.js +36 -0
- package/build/enums/gender.d.ts +4 -0
- package/build/enums/gender.js +8 -0
- package/build/enums/index.js +20 -0
- package/build/enums/language-levels.d.ts +8 -0
- package/build/enums/language-levels.js +12 -0
- package/build/enums/status-codes.d.ts +24 -0
- package/build/enums/status-codes.js +28 -0
- package/build/enums/user-role.d.ts +5 -0
- package/build/enums/user-role.js +9 -0
- package/build/errors/BadRequestError.d.ts +8 -0
- package/build/errors/BadRequestError.js +15 -0
- package/build/errors/CustomError.d.ts +8 -0
- package/build/errors/CustomError.js +13 -0
- package/build/errors/NotFoundError.d.ts +8 -0
- package/build/errors/NotFoundError.js +15 -0
- package/build/errors/UnAuthorizedError.d.ts +8 -0
- package/build/errors/UnAuthorizedError.js +15 -0
- package/build/errors/index.js +20 -0
- package/{src/index.ts → build/index.d.ts} +4 -6
- package/build/index.js +25 -0
- package/build/interfaces/LoggedInUserToken.d.ts +6 -0
- package/build/interfaces/LoggedInUserToken.js +2 -0
- package/build/interfaces/index.js +17 -0
- package/build/middleware/errorHandler.d.ts +2 -0
- package/build/middleware/errorHandler.js +26 -0
- package/build/middleware/index.js +21 -0
- package/build/middleware/multer.d.ts +6 -0
- package/build/middleware/multer.js +58 -0
- package/build/middleware/require-auth.d.ts +2 -0
- package/build/middleware/require-auth.js +39 -0
- package/build/middleware/validate-request.d.ts +2 -0
- package/build/middleware/validate-request.js +41 -0
- package/build/middleware/verify-roles.d.ts +3 -0
- package/build/middleware/verify-roles.js +17 -0
- package/build/models/base.d.ts +13 -0
- package/build/models/base.js +41 -0
- package/build/models/doctor.d.ts +33 -0
- package/build/models/doctor.js +55 -0
- package/build/models/education.d.ts +14 -0
- package/build/models/education.js +8 -0
- package/build/models/faq.d.ts +14 -0
- package/build/models/faq.js +8 -0
- package/build/models/index.js +26 -0
- package/build/models/language.d.ts +15 -0
- package/build/models/language.js +14 -0
- package/build/models/location.d.ts +19 -0
- package/{src/models/location.ts → build/models/location.js} +6 -17
- package/build/models/patient.d.ts +15 -0
- package/build/models/patient.js +15 -0
- package/build/models/position.d.ts +16 -0
- package/build/models/position.js +10 -0
- package/build/models/specialty.d.ts +15 -0
- package/build/models/specialty.js +12 -0
- package/build/models/user.d.ts +19 -0
- package/build/models/user.js +47 -0
- package/build/utils/index.js +21 -0
- package/build/utils/orchestration-result.d.ts +38 -0
- package/build/utils/orchestration-result.js +26 -0
- package/build/utils/s3-helper.d.ts +13 -0
- package/build/utils/s3-helper.js +67 -0
- package/build/utils/token-utils.d.ts +11 -0
- package/build/utils/token-utils.js +77 -0
- package/build/utils/validate-info.d.ts +4 -0
- package/build/utils/validate-info.js +20 -0
- package/build/utils/winston.d.ts +3 -0
- package/build/utils/winston.js +32 -0
- package/package.json +7 -2
- package/src/config.ts +0 -25
- package/src/dto/input/doctor.ts +0 -120
- package/src/dto/input/education.ts +0 -11
- package/src/dto/input/faq.ts +0 -11
- package/src/dto/input/language.ts +0 -13
- package/src/dto/input/location.ts +0 -31
- package/src/dto/input/patient.ts +0 -17
- package/src/dto/input/position.ts +0 -21
- package/src/dto/input/specialty.ts +0 -40
- package/src/dto/input/user.ts +0 -87
- package/src/dto/output/doctor.ts +0 -90
- package/src/dto/output/education.ts +0 -11
- package/src/dto/output/faq.ts +0 -11
- package/src/dto/output/language.ts +0 -11
- package/src/dto/output/location.ts +0 -21
- package/src/dto/output/patient.ts +0 -49
- package/src/dto/output/position.ts +0 -15
- package/src/dto/output/specialty.ts +0 -53
- package/src/dto/output/user.ts +0 -57
- package/src/enums/gender.ts +0 -4
- package/src/enums/language-levels.ts +0 -9
- package/src/enums/status-codes.ts +0 -28
- package/src/enums/user-role.ts +0 -5
- package/src/errors/BadRequestError.ts +0 -18
- package/src/errors/CustomError.ts +0 -18
- package/src/errors/NotFoundError.ts +0 -18
- package/src/errors/UnAuthorizedError.ts +0 -18
- package/src/interfaces/LoggedInUserToken.ts +0 -9
- package/src/middleware/errorHandler.ts +0 -31
- package/src/middleware/multer.ts +0 -74
- package/src/middleware/require-auth.ts +0 -46
- package/src/middleware/validate-request.ts +0 -40
- package/src/middleware/verify-roles.ts +0 -17
- package/src/models/base.ts +0 -52
- package/src/models/doctor.ts +0 -96
- package/src/models/education.ts +0 -14
- package/src/models/faq.ts +0 -14
- package/src/models/language.ts +0 -20
- package/src/models/patient.ts +0 -35
- package/src/models/position.ts +0 -19
- package/src/models/specialty.ts +0 -37
- package/src/models/user.ts +0 -67
- package/src/utils/orchestration-result.ts +0 -74
- package/src/utils/s3-helper.ts +0 -72
- package/src/utils/token-utils.ts +0 -86
- package/src/utils/validate-info.ts +0 -26
- package/src/utils/winston.ts +0 -33
- package/tsconfig.json +0 -120
- /package/{src/dto/input/index.ts → build/dto/input/index.d.ts} +0 -0
- /package/{src/dto/output/index.ts → build/dto/output/index.d.ts} +0 -0
- /package/{src/enums/index.ts → build/enums/index.d.ts} +0 -0
- /package/{src/errors/index.ts → build/errors/index.d.ts} +0 -0
- /package/{src/interfaces/index.ts → build/interfaces/index.d.ts} +0 -0
- /package/{src/middleware/index.ts → build/middleware/index.d.ts} +0 -0
- /package/{src/models/index.ts → build/models/index.d.ts} +0 -0
- /package/{src/utils/index.ts → build/utils/index.d.ts} +0 -0
|
@@ -0,0 +1,112 @@
|
|
|
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.UpdatePasswordDto = exports.UpdateUserDto = exports.ResetPasswordDto = exports.ForgotPasswordDto = exports.ActivateAccountDto = exports.RefreshTokenDto = exports.LoginDto = exports.CreateUserDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class CreateUserDto {
|
|
15
|
+
}
|
|
16
|
+
exports.CreateUserDto = CreateUserDto;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsString)(),
|
|
19
|
+
(0, class_validator_1.MinLength)(3),
|
|
20
|
+
(0, class_validator_1.MaxLength)(50),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], CreateUserDto.prototype, "name", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_validator_1.IsEmail)(),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], CreateUserDto.prototype, "email", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_validator_1.IsString)(),
|
|
29
|
+
(0, class_validator_1.MinLength)(6),
|
|
30
|
+
(0, class_validator_1.MaxLength)(30),
|
|
31
|
+
(0, class_validator_1.IsStrongPassword)(),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], CreateUserDto.prototype, "password", void 0);
|
|
34
|
+
class LoginDto {
|
|
35
|
+
}
|
|
36
|
+
exports.LoginDto = LoginDto;
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_validator_1.IsEmail)({}, { message: "Please enter a valid email address" }),
|
|
39
|
+
(0, class_validator_1.IsNotEmpty)({ message: "Email is required" }),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], LoginDto.prototype, "email", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, class_validator_1.IsString)({ message: "Password must be a string" }),
|
|
44
|
+
(0, class_validator_1.IsNotEmpty)({ message: "Password is required" }),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], LoginDto.prototype, "password", void 0);
|
|
47
|
+
class RefreshTokenDto {
|
|
48
|
+
}
|
|
49
|
+
exports.RefreshTokenDto = RefreshTokenDto;
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, class_validator_1.IsString)({ message: "Refresh token must be a string" }),
|
|
52
|
+
(0, class_validator_1.IsNotEmpty)({ message: "Refresh token is required" }),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], RefreshTokenDto.prototype, "refreshToken", void 0);
|
|
55
|
+
class ActivateAccountDto {
|
|
56
|
+
}
|
|
57
|
+
exports.ActivateAccountDto = ActivateAccountDto;
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, class_validator_1.IsString)({ message: "Token must be a string" }),
|
|
60
|
+
(0, class_validator_1.IsNotEmpty)({ message: "Token is required" }),
|
|
61
|
+
__metadata("design:type", String)
|
|
62
|
+
], ActivateAccountDto.prototype, "token", void 0);
|
|
63
|
+
class ForgotPasswordDto {
|
|
64
|
+
}
|
|
65
|
+
exports.ForgotPasswordDto = ForgotPasswordDto;
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, class_validator_1.IsEmail)({}, { message: "Please enter a valid email address" }),
|
|
68
|
+
(0, class_validator_1.IsNotEmpty)({ message: "Email is required" }),
|
|
69
|
+
__metadata("design:type", String)
|
|
70
|
+
], ForgotPasswordDto.prototype, "email", void 0);
|
|
71
|
+
class ResetPasswordDto {
|
|
72
|
+
}
|
|
73
|
+
exports.ResetPasswordDto = ResetPasswordDto;
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, class_validator_1.IsString)({ message: "Token must be a string" }),
|
|
76
|
+
(0, class_validator_1.IsNotEmpty)({ message: "Token is required" }),
|
|
77
|
+
__metadata("design:type", String)
|
|
78
|
+
], ResetPasswordDto.prototype, "token", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, class_validator_1.IsString)(),
|
|
81
|
+
(0, class_validator_1.MinLength)(6),
|
|
82
|
+
(0, class_validator_1.MaxLength)(30),
|
|
83
|
+
(0, class_validator_1.IsStrongPassword)(),
|
|
84
|
+
__metadata("design:type", String)
|
|
85
|
+
], ResetPasswordDto.prototype, "password", void 0);
|
|
86
|
+
class UpdateUserDto {
|
|
87
|
+
}
|
|
88
|
+
exports.UpdateUserDto = UpdateUserDto;
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, class_validator_1.IsOptional)(),
|
|
91
|
+
(0, class_validator_1.IsString)(),
|
|
92
|
+
(0, class_validator_1.MinLength)(3),
|
|
93
|
+
(0, class_validator_1.MaxLength)(50),
|
|
94
|
+
__metadata("design:type", String)
|
|
95
|
+
], UpdateUserDto.prototype, "name", void 0);
|
|
96
|
+
class UpdatePasswordDto {
|
|
97
|
+
}
|
|
98
|
+
exports.UpdatePasswordDto = UpdatePasswordDto;
|
|
99
|
+
__decorate([
|
|
100
|
+
(0, class_validator_1.IsString)(),
|
|
101
|
+
(0, class_validator_1.MinLength)(6),
|
|
102
|
+
(0, class_validator_1.MaxLength)(30),
|
|
103
|
+
(0, class_validator_1.IsStrongPassword)(),
|
|
104
|
+
__metadata("design:type", String)
|
|
105
|
+
], UpdatePasswordDto.prototype, "oldPassword", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
(0, class_validator_1.IsString)(),
|
|
108
|
+
(0, class_validator_1.MinLength)(6),
|
|
109
|
+
(0, class_validator_1.MaxLength)(30),
|
|
110
|
+
(0, class_validator_1.IsStrongPassword)(),
|
|
111
|
+
__metadata("design:type", String)
|
|
112
|
+
], UpdatePasswordDto.prototype, "newPassword", void 0);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { IDoctorDocument } from "../../models";
|
|
2
|
+
import { SpecialtyOutputDto } from ".";
|
|
3
|
+
import { UserOutputDto } from ".";
|
|
4
|
+
import { EducationOutputDto } from ".";
|
|
5
|
+
import { PositionOutputDto } from ".";
|
|
6
|
+
import { LanguageOutputDto } from ".";
|
|
7
|
+
import { FaqOutputDto } from ".";
|
|
8
|
+
import { LocationOutputDto } from ".";
|
|
9
|
+
export declare class DoctorOutputDto {
|
|
10
|
+
id: string;
|
|
11
|
+
user: UserOutputDto;
|
|
12
|
+
specialty: SpecialtyOutputDto;
|
|
13
|
+
name: string;
|
|
14
|
+
biography: string | null;
|
|
15
|
+
slug: string;
|
|
16
|
+
isActive: boolean;
|
|
17
|
+
consultationFee: number | null;
|
|
18
|
+
isVerified: boolean;
|
|
19
|
+
isVisible: boolean;
|
|
20
|
+
photo: string | null;
|
|
21
|
+
educations: EducationOutputDto[];
|
|
22
|
+
positions: PositionOutputDto[];
|
|
23
|
+
languages: LanguageOutputDto[];
|
|
24
|
+
faqs: FaqOutputDto[];
|
|
25
|
+
expertises: string[];
|
|
26
|
+
location: LocationOutputDto | null;
|
|
27
|
+
isDeleted: boolean;
|
|
28
|
+
createdAt: number;
|
|
29
|
+
updatedAt: number;
|
|
30
|
+
constructor(doctor: IDoctorDocument);
|
|
31
|
+
}
|
|
32
|
+
export declare class DoctorAdminOutputDto extends DoctorOutputDto {
|
|
33
|
+
isDeactivatedByAdmin: boolean | null;
|
|
34
|
+
createdBy: UserOutputDto | null;
|
|
35
|
+
updatedBy: UserOutputDto | null;
|
|
36
|
+
deletedBy: UserOutputDto | null;
|
|
37
|
+
constructor(doctor: IDoctorDocument);
|
|
38
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DoctorAdminOutputDto = exports.DoctorOutputDto = void 0;
|
|
4
|
+
const _1 = require(".");
|
|
5
|
+
const _2 = require(".");
|
|
6
|
+
const _3 = require(".");
|
|
7
|
+
const _4 = require(".");
|
|
8
|
+
const _5 = require(".");
|
|
9
|
+
const _6 = require(".");
|
|
10
|
+
const _7 = require(".");
|
|
11
|
+
// Base DTO for everyone
|
|
12
|
+
class DoctorOutputDto {
|
|
13
|
+
constructor(doctor) {
|
|
14
|
+
var _a;
|
|
15
|
+
this.id = doctor.id.toString();
|
|
16
|
+
this.user = new _2.UserOutputDto(doctor.user);
|
|
17
|
+
this.name = doctor.name;
|
|
18
|
+
this.specialty = new _1.SpecialtyOutputDto(doctor.specialty);
|
|
19
|
+
this.slug = doctor.slug;
|
|
20
|
+
this.biography = doctor.biography || null;
|
|
21
|
+
this.isActive = doctor.isActive;
|
|
22
|
+
this.consultationFee = (_a = doctor.consultationFee) !== null && _a !== void 0 ? _a : null;
|
|
23
|
+
this.isVerified = doctor.isVerified;
|
|
24
|
+
this.isVisible = doctor.isVisible;
|
|
25
|
+
this.photo = doctor.photo || null;
|
|
26
|
+
this.educations = (doctor.educations || [])
|
|
27
|
+
.map((e) => new _3.EducationOutputDto(e))
|
|
28
|
+
.sort((a, b) => b.year - a.year);
|
|
29
|
+
this.positions = (doctor.positions || [])
|
|
30
|
+
.map((p) => new _4.PositionOutputDto(p))
|
|
31
|
+
.sort((a, b) => b.startDate - a.startDate);
|
|
32
|
+
this.languages = (doctor.languages || []).map((l) => new _5.LanguageOutputDto(l));
|
|
33
|
+
this.faqs = (doctor.faqs || []).map((f) => new _6.FaqOutputDto(f));
|
|
34
|
+
this.expertises = doctor.expertises || [];
|
|
35
|
+
this.location = doctor.location
|
|
36
|
+
? new _7.LocationOutputDto(doctor.location)
|
|
37
|
+
: null;
|
|
38
|
+
this.isDeleted = doctor.isDeleted;
|
|
39
|
+
this.createdAt = doctor.createdAt;
|
|
40
|
+
this.updatedAt = doctor.updatedAt;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.DoctorOutputDto = DoctorOutputDto;
|
|
44
|
+
// Extended DTO for admin responses
|
|
45
|
+
class DoctorAdminOutputDto extends DoctorOutputDto {
|
|
46
|
+
constructor(doctor) {
|
|
47
|
+
var _a;
|
|
48
|
+
super(doctor); // call base constructor
|
|
49
|
+
this.isDeactivatedByAdmin = (_a = doctor.isDeactivatedByAdmin) !== null && _a !== void 0 ? _a : null;
|
|
50
|
+
this.createdBy = doctor.createdBy
|
|
51
|
+
? new _2.UserOutputDto(doctor.createdBy)
|
|
52
|
+
: null;
|
|
53
|
+
this.updatedBy = doctor.updatedBy
|
|
54
|
+
? new _2.UserOutputDto(doctor.updatedBy)
|
|
55
|
+
: null;
|
|
56
|
+
this.deletedBy = doctor.deletedBy
|
|
57
|
+
? new _2.UserOutputDto(doctor.deletedBy)
|
|
58
|
+
: null;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.DoctorAdminOutputDto = DoctorAdminOutputDto;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EducationOutputDto = void 0;
|
|
4
|
+
class EducationOutputDto {
|
|
5
|
+
constructor(edu) {
|
|
6
|
+
this.year = edu.year;
|
|
7
|
+
this.title = edu.title;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.EducationOutputDto = EducationOutputDto;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FaqOutputDto = void 0;
|
|
4
|
+
class FaqOutputDto {
|
|
5
|
+
constructor(f) {
|
|
6
|
+
this.title = f.title;
|
|
7
|
+
this.description = f.description;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.FaqOutputDto = FaqOutputDto;
|
|
@@ -0,0 +1,25 @@
|
|
|
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("./doctor"), exports);
|
|
18
|
+
__exportStar(require("./education"), exports);
|
|
19
|
+
__exportStar(require("./faq"), exports);
|
|
20
|
+
__exportStar(require("./language"), exports);
|
|
21
|
+
__exportStar(require("./location"), exports);
|
|
22
|
+
__exportStar(require("./patient"), exports);
|
|
23
|
+
__exportStar(require("./position"), exports);
|
|
24
|
+
__exportStar(require("./specialty"), exports);
|
|
25
|
+
__exportStar(require("./user"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LanguageOutputDto = void 0;
|
|
4
|
+
class LanguageOutputDto {
|
|
5
|
+
constructor(lang) {
|
|
6
|
+
this.title = lang.title;
|
|
7
|
+
this.level = lang.level;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.LanguageOutputDto = LanguageOutputDto;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ILocation } from "../../models";
|
|
2
|
+
export declare class LocationOutputDto {
|
|
3
|
+
address: string | null;
|
|
4
|
+
city: string | null;
|
|
5
|
+
country: string | null;
|
|
6
|
+
lat: number | null;
|
|
7
|
+
lng: number | null;
|
|
8
|
+
zipcode: string | null;
|
|
9
|
+
distanceInMeters: number | null;
|
|
10
|
+
constructor(loc: ILocation);
|
|
11
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LocationOutputDto = void 0;
|
|
4
|
+
class LocationOutputDto {
|
|
5
|
+
constructor(loc) {
|
|
6
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
7
|
+
this.address = (_a = loc.address) !== null && _a !== void 0 ? _a : null;
|
|
8
|
+
this.city = (_b = loc.city) !== null && _b !== void 0 ? _b : null;
|
|
9
|
+
this.country = (_c = loc.country) !== null && _c !== void 0 ? _c : null;
|
|
10
|
+
this.lat = (_d = loc.lat) !== null && _d !== void 0 ? _d : null;
|
|
11
|
+
this.lng = (_e = loc.lng) !== null && _e !== void 0 ? _e : null;
|
|
12
|
+
this.zipcode = (_f = loc.zipcode) !== null && _f !== void 0 ? _f : null;
|
|
13
|
+
this.distanceInMeters = (_g = loc.distanceInMeters) !== null && _g !== void 0 ? _g : null;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.LocationOutputDto = LocationOutputDto;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Gender } from "../../enums";
|
|
2
|
+
import { IPatientDocument } from "../../models";
|
|
3
|
+
import { UserOutputDto } from ".";
|
|
4
|
+
export declare class PatientOutputDto {
|
|
5
|
+
id: string;
|
|
6
|
+
user: UserOutputDto;
|
|
7
|
+
dob: number | null;
|
|
8
|
+
phoneNumber: string | null;
|
|
9
|
+
gender: Gender | null;
|
|
10
|
+
isDeleted: boolean;
|
|
11
|
+
createdAt: number;
|
|
12
|
+
updatedAt: number;
|
|
13
|
+
constructor(patient: IPatientDocument);
|
|
14
|
+
}
|
|
15
|
+
export declare class PatientAdminOutputDto extends PatientOutputDto {
|
|
16
|
+
createdBy: UserOutputDto | null;
|
|
17
|
+
updatedBy: UserOutputDto | null;
|
|
18
|
+
deletedBy: UserOutputDto | null;
|
|
19
|
+
constructor(patient: IPatientDocument);
|
|
20
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PatientAdminOutputDto = exports.PatientOutputDto = void 0;
|
|
4
|
+
const _1 = require(".");
|
|
5
|
+
// Base DTO for everyone
|
|
6
|
+
class PatientOutputDto {
|
|
7
|
+
constructor(patient) {
|
|
8
|
+
this.id = patient.id.toString();
|
|
9
|
+
this.user = new _1.UserOutputDto(patient.user);
|
|
10
|
+
this.dob = patient.dob || null;
|
|
11
|
+
this.phoneNumber = patient.phoneNumber || null;
|
|
12
|
+
this.gender = patient.gender || null;
|
|
13
|
+
this.isDeleted = patient.isDeleted;
|
|
14
|
+
this.createdAt = patient.createdAt;
|
|
15
|
+
this.updatedAt = patient.updatedAt;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.PatientOutputDto = PatientOutputDto;
|
|
19
|
+
// Extended DTO for admin responses
|
|
20
|
+
class PatientAdminOutputDto extends PatientOutputDto {
|
|
21
|
+
constructor(patient) {
|
|
22
|
+
super(patient); // call base constructor
|
|
23
|
+
this.createdBy = patient.createdBy
|
|
24
|
+
? new _1.UserOutputDto(patient.createdBy)
|
|
25
|
+
: null;
|
|
26
|
+
this.updatedBy = patient.updatedBy
|
|
27
|
+
? new _1.UserOutputDto(patient.updatedBy)
|
|
28
|
+
: null;
|
|
29
|
+
this.deletedBy = patient.deletedBy
|
|
30
|
+
? new _1.UserOutputDto(patient.deletedBy)
|
|
31
|
+
: null;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.PatientAdminOutputDto = PatientAdminOutputDto;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PositionOutputDto = void 0;
|
|
4
|
+
class PositionOutputDto {
|
|
5
|
+
constructor(pos) {
|
|
6
|
+
var _a;
|
|
7
|
+
this.startDate = pos.startDate;
|
|
8
|
+
this.endDate = (_a = pos.endDate) !== null && _a !== void 0 ? _a : null;
|
|
9
|
+
this.title = pos.title;
|
|
10
|
+
this.company = pos.company;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.PositionOutputDto = PositionOutputDto;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ISpecialtyDocument } from "../../models";
|
|
2
|
+
import { UserOutputDto } from ".";
|
|
3
|
+
export declare class SpecialtyOutputDto {
|
|
4
|
+
id: string;
|
|
5
|
+
en: {
|
|
6
|
+
name: string;
|
|
7
|
+
description: string | null;
|
|
8
|
+
};
|
|
9
|
+
fr: {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string | null;
|
|
12
|
+
} | null;
|
|
13
|
+
isDeleted: boolean;
|
|
14
|
+
createdAt: number;
|
|
15
|
+
updatedAt: number;
|
|
16
|
+
constructor(specialty: ISpecialtyDocument);
|
|
17
|
+
}
|
|
18
|
+
export declare class SpecialtyAdminOutputDto extends SpecialtyOutputDto {
|
|
19
|
+
createdBy: UserOutputDto | null;
|
|
20
|
+
updatedBy: UserOutputDto | null;
|
|
21
|
+
deletedBy: UserOutputDto | null;
|
|
22
|
+
constructor(specialty: ISpecialtyDocument);
|
|
23
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SpecialtyAdminOutputDto = exports.SpecialtyOutputDto = void 0;
|
|
4
|
+
const _1 = require(".");
|
|
5
|
+
// Base DTO for everyone
|
|
6
|
+
class SpecialtyOutputDto {
|
|
7
|
+
constructor(specialty) {
|
|
8
|
+
this.id = specialty.id.toString();
|
|
9
|
+
this.en = {
|
|
10
|
+
name: specialty.en.name,
|
|
11
|
+
description: specialty.en.description || null,
|
|
12
|
+
};
|
|
13
|
+
this.fr = specialty.fr
|
|
14
|
+
? {
|
|
15
|
+
name: specialty.fr.name,
|
|
16
|
+
description: specialty.fr.description || null,
|
|
17
|
+
}
|
|
18
|
+
: null;
|
|
19
|
+
this.isDeleted = specialty.isDeleted;
|
|
20
|
+
this.createdAt = specialty.createdAt;
|
|
21
|
+
this.updatedAt = specialty.updatedAt;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.SpecialtyOutputDto = SpecialtyOutputDto;
|
|
25
|
+
// Extended DTO for admin responses
|
|
26
|
+
class SpecialtyAdminOutputDto extends SpecialtyOutputDto {
|
|
27
|
+
constructor(specialty) {
|
|
28
|
+
super(specialty); // call base constructor
|
|
29
|
+
this.createdBy = specialty.createdBy
|
|
30
|
+
? new _1.UserOutputDto(specialty.createdBy)
|
|
31
|
+
: null;
|
|
32
|
+
this.updatedBy = specialty.updatedBy
|
|
33
|
+
? new _1.UserOutputDto(specialty.updatedBy)
|
|
34
|
+
: null;
|
|
35
|
+
this.deletedBy = specialty.deletedBy
|
|
36
|
+
? new _1.UserOutputDto(specialty.deletedBy)
|
|
37
|
+
: null;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.SpecialtyAdminOutputDto = SpecialtyAdminOutputDto;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IUserDocument } from "../../models";
|
|
2
|
+
export declare class UserOutputDto {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
email: string;
|
|
6
|
+
role: string;
|
|
7
|
+
isActive: boolean;
|
|
8
|
+
isDeleted: boolean;
|
|
9
|
+
createdAt: number;
|
|
10
|
+
updatedAt: number;
|
|
11
|
+
constructor(user: IUserDocument);
|
|
12
|
+
}
|
|
13
|
+
export declare class UserAdminOutputDto extends UserOutputDto {
|
|
14
|
+
createdBy: UserOutputDto | null;
|
|
15
|
+
updatedBy: UserOutputDto | null;
|
|
16
|
+
deletedBy: UserOutputDto | null;
|
|
17
|
+
constructor(user: IUserDocument);
|
|
18
|
+
}
|
|
19
|
+
export declare class LoggedInUserOutputDto {
|
|
20
|
+
user: UserOutputDto | UserAdminOutputDto;
|
|
21
|
+
accessToken: string;
|
|
22
|
+
refreshToken: string;
|
|
23
|
+
constructor(user: UserOutputDto | UserAdminOutputDto, accessToken: string, refreshToken: string);
|
|
24
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LoggedInUserOutputDto = exports.UserAdminOutputDto = exports.UserOutputDto = void 0;
|
|
4
|
+
// Base DTO for everyone
|
|
5
|
+
class UserOutputDto {
|
|
6
|
+
constructor(user) {
|
|
7
|
+
this.id = user.id.toString();
|
|
8
|
+
this.name = user.name;
|
|
9
|
+
this.email = user.email;
|
|
10
|
+
this.role = user.role;
|
|
11
|
+
this.isActive = user.isActive;
|
|
12
|
+
this.isDeleted = user.isDeleted;
|
|
13
|
+
this.createdAt = user.createdAt;
|
|
14
|
+
this.updatedAt = user.updatedAt;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.UserOutputDto = UserOutputDto;
|
|
18
|
+
// Extended DTO for admin responses
|
|
19
|
+
class UserAdminOutputDto extends UserOutputDto {
|
|
20
|
+
constructor(user) {
|
|
21
|
+
super(user); // call base constructor
|
|
22
|
+
this.createdBy = user.createdBy ? new UserOutputDto(user.createdBy) : null;
|
|
23
|
+
this.updatedBy = user.updatedBy ? new UserOutputDto(user.updatedBy) : null;
|
|
24
|
+
this.deletedBy = user.deletedBy ? new UserOutputDto(user.deletedBy) : null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.UserAdminOutputDto = UserAdminOutputDto;
|
|
28
|
+
// DTO for logged-in user responses
|
|
29
|
+
class LoggedInUserOutputDto {
|
|
30
|
+
constructor(user, accessToken, refreshToken) {
|
|
31
|
+
this.user = user;
|
|
32
|
+
this.accessToken = accessToken;
|
|
33
|
+
this.refreshToken = refreshToken;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.LoggedInUserOutputDto = LoggedInUserOutputDto;
|
|
@@ -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("./language-levels"), exports);
|
|
18
|
+
__exportStar(require("./status-codes"), exports);
|
|
19
|
+
__exportStar(require("./user-role"), exports);
|
|
20
|
+
__exportStar(require("./gender"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EnumLanguageLevel = void 0;
|
|
4
|
+
var EnumLanguageLevel;
|
|
5
|
+
(function (EnumLanguageLevel) {
|
|
6
|
+
EnumLanguageLevel["BEGINNER"] = "BEGINNER";
|
|
7
|
+
EnumLanguageLevel["ELEMENTARY"] = "ELEMENTARY";
|
|
8
|
+
EnumLanguageLevel["INTERMEDIATE"] = "INTERMEDIATE";
|
|
9
|
+
EnumLanguageLevel["UPPER_INTERMEDIATE"] = "UPPER_INTERMEDIATE";
|
|
10
|
+
EnumLanguageLevel["ADVANCED"] = "ADVANCED";
|
|
11
|
+
EnumLanguageLevel["PROFICIENT"] = "PROFICIENT";
|
|
12
|
+
})(EnumLanguageLevel || (exports.EnumLanguageLevel = EnumLanguageLevel = {}));
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare enum EnumStatusCode {
|
|
2
|
+
BAD_REQUEST = "BAD_REQUEST",
|
|
3
|
+
SOMETHING_WENT_WRONG = "SOMETHING_WENT_WRONG",
|
|
4
|
+
UNAUTHORIZED = "UNAUTHORIZED",
|
|
5
|
+
VALIDATION_ERROR = "VALIDATION_ERROR",
|
|
6
|
+
EXISTS_ALREADY = "EXISTS_ALREADY",
|
|
7
|
+
CREATED_SUCCESSFULLY = "CREATED_SUCCESSFULLY",
|
|
8
|
+
UPDATED_SUCCESSFULLY = "UPDATED_SUCCESSFULLY",
|
|
9
|
+
NOT_FOUND = "NOT_FOUND",
|
|
10
|
+
SPECIALTY_NOT_FOUND = "SPECIALTY_NOT_FOUND",
|
|
11
|
+
NOT_ALLOWED = "NOT_ALLOWED",
|
|
12
|
+
DOCTOR_NOT_FOUND = "DOCTOR_NOT_FOUND",
|
|
13
|
+
ACCOUNT_DELETED = "ACCOUNT_DELETED",
|
|
14
|
+
ACCOUNT_DEACTIVATED = "ACCOUNT_DEACTIVATED",
|
|
15
|
+
TOKEN_REFRESHED = "TOKEN_REFRESHED",
|
|
16
|
+
NO_ACCESS_TOKEN = "NO_ACCESS_TOKEN",
|
|
17
|
+
ACCESS_TOKEN_EXPIRED = "ACCESS_TOKEN_EXPIRED",
|
|
18
|
+
CANNOT_DECODE_ACCESS_TOKEN = "CANNOT_DECODE_ACCESS_TOKEN",
|
|
19
|
+
RECOVERED_SUCCESSFULLY = "RECOVERED_SUCCESSFULLY",
|
|
20
|
+
FILE_TYPE_MISMATCH = "FILE_TYPE_MISMATCH",
|
|
21
|
+
FILE_TOO_LARGE = "FILE_TOO_LARGE",
|
|
22
|
+
NO_FILE_UPLOADED = "NO_FILE_UPLOADED",
|
|
23
|
+
DELETED_SUCCESSFULLY = "DELETED_SUCCESSFULLY"
|
|
24
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EnumStatusCode = void 0;
|
|
4
|
+
var EnumStatusCode;
|
|
5
|
+
(function (EnumStatusCode) {
|
|
6
|
+
EnumStatusCode["BAD_REQUEST"] = "BAD_REQUEST";
|
|
7
|
+
EnumStatusCode["SOMETHING_WENT_WRONG"] = "SOMETHING_WENT_WRONG";
|
|
8
|
+
EnumStatusCode["UNAUTHORIZED"] = "UNAUTHORIZED";
|
|
9
|
+
EnumStatusCode["VALIDATION_ERROR"] = "VALIDATION_ERROR";
|
|
10
|
+
EnumStatusCode["EXISTS_ALREADY"] = "EXISTS_ALREADY";
|
|
11
|
+
EnumStatusCode["CREATED_SUCCESSFULLY"] = "CREATED_SUCCESSFULLY";
|
|
12
|
+
EnumStatusCode["UPDATED_SUCCESSFULLY"] = "UPDATED_SUCCESSFULLY";
|
|
13
|
+
EnumStatusCode["NOT_FOUND"] = "NOT_FOUND";
|
|
14
|
+
EnumStatusCode["SPECIALTY_NOT_FOUND"] = "SPECIALTY_NOT_FOUND";
|
|
15
|
+
EnumStatusCode["NOT_ALLOWED"] = "NOT_ALLOWED";
|
|
16
|
+
EnumStatusCode["DOCTOR_NOT_FOUND"] = "DOCTOR_NOT_FOUND";
|
|
17
|
+
EnumStatusCode["ACCOUNT_DELETED"] = "ACCOUNT_DELETED";
|
|
18
|
+
EnumStatusCode["ACCOUNT_DEACTIVATED"] = "ACCOUNT_DEACTIVATED";
|
|
19
|
+
EnumStatusCode["TOKEN_REFRESHED"] = "TOKEN_REFRESHED";
|
|
20
|
+
EnumStatusCode["NO_ACCESS_TOKEN"] = "NO_ACCESS_TOKEN";
|
|
21
|
+
EnumStatusCode["ACCESS_TOKEN_EXPIRED"] = "ACCESS_TOKEN_EXPIRED";
|
|
22
|
+
EnumStatusCode["CANNOT_DECODE_ACCESS_TOKEN"] = "CANNOT_DECODE_ACCESS_TOKEN";
|
|
23
|
+
EnumStatusCode["RECOVERED_SUCCESSFULLY"] = "RECOVERED_SUCCESSFULLY";
|
|
24
|
+
EnumStatusCode["FILE_TYPE_MISMATCH"] = "FILE_TYPE_MISMATCH";
|
|
25
|
+
EnumStatusCode["FILE_TOO_LARGE"] = "FILE_TOO_LARGE";
|
|
26
|
+
EnumStatusCode["NO_FILE_UPLOADED"] = "NO_FILE_UPLOADED";
|
|
27
|
+
EnumStatusCode["DELETED_SUCCESSFULLY"] = "DELETED_SUCCESSFULLY";
|
|
28
|
+
})(EnumStatusCode || (exports.EnumStatusCode = EnumStatusCode = {}));
|