docta-package 1.2.36 → 1.2.38

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.
@@ -33,4 +33,5 @@ export declare class DoctorFilterDto {
33
33
  maxConsultationFee?: number;
34
34
  isVerified?: boolean;
35
35
  expertises?: string[];
36
+ email?: string;
36
37
  }
@@ -167,3 +167,8 @@ __decorate([
167
167
  (0, class_validator_1.IsString)({ each: true }),
168
168
  __metadata("design:type", Array)
169
169
  ], DoctorFilterDto.prototype, "expertises", void 0);
170
+ __decorate([
171
+ (0, class_validator_1.IsOptional)(),
172
+ (0, class_validator_1.IsEmail)(),
173
+ __metadata("design:type", String)
174
+ ], DoctorFilterDto.prototype, "email", void 0);
@@ -0,0 +1,12 @@
1
+ export declare class LocalizedExpertiseDto {
2
+ name: string;
3
+ description?: string | null;
4
+ }
5
+ export declare class CreateExpertiseDto {
6
+ en: LocalizedExpertiseDto;
7
+ fr?: LocalizedExpertiseDto;
8
+ }
9
+ export declare class UpdateExpertiseDto {
10
+ en?: LocalizedExpertiseDto;
11
+ fr?: LocalizedExpertiseDto;
12
+ }
@@ -0,0 +1,56 @@
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.UpdateExpertiseDto = exports.CreateExpertiseDto = exports.LocalizedExpertiseDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const class_transformer_1 = require("class-transformer");
15
+ class LocalizedExpertiseDto {
16
+ }
17
+ exports.LocalizedExpertiseDto = LocalizedExpertiseDto;
18
+ __decorate([
19
+ (0, class_validator_1.IsString)(),
20
+ (0, class_validator_1.IsNotEmpty)(),
21
+ __metadata("design:type", String)
22
+ ], LocalizedExpertiseDto.prototype, "name", void 0);
23
+ __decorate([
24
+ (0, class_validator_1.IsOptional)(),
25
+ (0, class_validator_1.IsString)(),
26
+ __metadata("design:type", Object)
27
+ ], LocalizedExpertiseDto.prototype, "description", void 0);
28
+ class CreateExpertiseDto {
29
+ }
30
+ exports.CreateExpertiseDto = CreateExpertiseDto;
31
+ __decorate([
32
+ (0, class_validator_1.ValidateNested)(),
33
+ (0, class_transformer_1.Type)(() => LocalizedExpertiseDto),
34
+ __metadata("design:type", LocalizedExpertiseDto)
35
+ ], CreateExpertiseDto.prototype, "en", void 0);
36
+ __decorate([
37
+ (0, class_validator_1.IsOptional)(),
38
+ (0, class_validator_1.ValidateNested)(),
39
+ (0, class_transformer_1.Type)(() => LocalizedExpertiseDto),
40
+ __metadata("design:type", LocalizedExpertiseDto)
41
+ ], CreateExpertiseDto.prototype, "fr", void 0);
42
+ class UpdateExpertiseDto {
43
+ }
44
+ exports.UpdateExpertiseDto = UpdateExpertiseDto;
45
+ __decorate([
46
+ (0, class_validator_1.IsOptional)(),
47
+ (0, class_validator_1.ValidateNested)(),
48
+ (0, class_transformer_1.Type)(() => LocalizedExpertiseDto),
49
+ __metadata("design:type", LocalizedExpertiseDto)
50
+ ], UpdateExpertiseDto.prototype, "en", void 0);
51
+ __decorate([
52
+ (0, class_validator_1.IsOptional)(),
53
+ (0, class_validator_1.ValidateNested)(),
54
+ (0, class_transformer_1.Type)(() => LocalizedExpertiseDto),
55
+ __metadata("design:type", LocalizedExpertiseDto)
56
+ ], UpdateExpertiseDto.prototype, "fr", void 0);
@@ -1,5 +1,6 @@
1
1
  export * from "./doctor";
2
2
  export * from "./education";
3
+ export * from "./expertise";
3
4
  export * from "./faq";
4
5
  export * from "./language";
5
6
  export * from "./location";
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./doctor"), exports);
18
18
  __exportStar(require("./education"), exports);
19
+ __exportStar(require("./expertise"), exports);
19
20
  __exportStar(require("./faq"), exports);
20
21
  __exportStar(require("./language"), exports);
21
22
  __exportStar(require("./location"), exports);
@@ -1,5 +1,6 @@
1
1
  import { IDoctorDocument } from "../../models";
2
2
  import { SpecialtyOutputDto } from "./specialty";
3
+ import { ExpertiseOutputDto } from "./expertise";
3
4
  import { UserOutputDto } from "./user";
4
5
  import { EducationOutputDto } from "./education";
5
6
  import { PositionOutputDto } from "./position";
@@ -22,7 +23,7 @@ export declare class DoctorOutputDto {
22
23
  positions: PositionOutputDto[];
23
24
  languages: LanguageOutputDto[];
24
25
  faqs: FaqOutputDto[];
25
- expertises: string[];
26
+ expertises: ExpertiseOutputDto[];
26
27
  location: LocationOutputDto | null;
27
28
  isDeleted: boolean;
28
29
  createdAt: number;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DoctorAdminOutputDto = exports.DoctorOutputDto = void 0;
4
4
  const specialty_1 = require("./specialty");
5
+ const expertise_1 = require("./expertise");
5
6
  const user_1 = require("./user");
6
7
  const education_1 = require("./education");
7
8
  const position_1 = require("./position");
@@ -31,7 +32,7 @@ class DoctorOutputDto {
31
32
  .sort((a, b) => b.startDate - a.startDate);
32
33
  this.languages = (doctor.languages || []).map((l) => new language_1.LanguageOutputDto(l));
33
34
  this.faqs = (doctor.faqs || []).map((f) => new faq_1.FaqOutputDto(f));
34
- this.expertises = doctor.expertises || [];
35
+ this.expertises = (doctor.expertises || []).map((e) => new expertise_1.ExpertiseOutputDto(e));
35
36
  this.location = doctor.location
36
37
  ? new location_1.LocationOutputDto(doctor.location)
37
38
  : null;
@@ -0,0 +1,23 @@
1
+ import { IExpertiseDocument } from "../../models";
2
+ import { UserOutputDto } from "./user";
3
+ export declare class ExpertiseOutputDto {
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(expertise: IExpertiseDocument);
17
+ }
18
+ export declare class ExpertiseAdminOutputDto extends ExpertiseOutputDto {
19
+ createdBy: UserOutputDto | null;
20
+ updatedBy: UserOutputDto | null;
21
+ deletedBy: UserOutputDto | null;
22
+ constructor(expertise: IExpertiseDocument);
23
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExpertiseAdminOutputDto = exports.ExpertiseOutputDto = void 0;
4
+ const user_1 = require("./user");
5
+ // Base DTO for everyone
6
+ class ExpertiseOutputDto {
7
+ constructor(expertise) {
8
+ this.id = expertise.id.toString();
9
+ this.en = {
10
+ name: expertise.en.name,
11
+ description: expertise.en.description || null,
12
+ };
13
+ this.fr = expertise.fr
14
+ ? {
15
+ name: expertise.fr.name,
16
+ description: expertise.fr.description || null,
17
+ }
18
+ : null;
19
+ this.isDeleted = expertise.isDeleted;
20
+ this.createdAt = expertise.createdAt;
21
+ this.updatedAt = expertise.updatedAt;
22
+ }
23
+ }
24
+ exports.ExpertiseOutputDto = ExpertiseOutputDto;
25
+ // Extended DTO for admin responses
26
+ class ExpertiseAdminOutputDto extends ExpertiseOutputDto {
27
+ constructor(expertise) {
28
+ super(expertise); // call base constructor
29
+ this.createdBy = expertise.createdBy
30
+ ? new user_1.UserOutputDto(expertise.createdBy)
31
+ : null;
32
+ this.updatedBy = expertise.updatedBy
33
+ ? new user_1.UserOutputDto(expertise.updatedBy)
34
+ : null;
35
+ this.deletedBy = expertise.deletedBy
36
+ ? new user_1.UserOutputDto(expertise.deletedBy)
37
+ : null;
38
+ }
39
+ }
40
+ exports.ExpertiseAdminOutputDto = ExpertiseAdminOutputDto;
@@ -1,5 +1,6 @@
1
1
  export * from "./doctor";
2
2
  export * from "./education";
3
+ export * from "./expertise";
3
4
  export * from "./faq";
4
5
  export * from "./language";
5
6
  export * from "./location";
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./doctor"), exports);
18
18
  __exportStar(require("./education"), exports);
19
+ __exportStar(require("./expertise"), exports);
19
20
  __exportStar(require("./faq"), exports);
20
21
  __exportStar(require("./language"), exports);
21
22
  __exportStar(require("./location"), exports);
@@ -8,6 +8,7 @@ export declare enum EnumStatusCode {
8
8
  UPDATED_SUCCESSFULLY = "UPDATED_SUCCESSFULLY",
9
9
  NOT_FOUND = "NOT_FOUND",
10
10
  SPECIALTY_NOT_FOUND = "SPECIALTY_NOT_FOUND",
11
+ EXPERTISE_NOT_FOUND = "EXPERTISE_NOT_FOUND",
11
12
  NOT_ALLOWED = "NOT_ALLOWED",
12
13
  DOCTOR_NOT_FOUND = "DOCTOR_NOT_FOUND",
13
14
  USER_NOT_FOUND = "USER_NOT_FOUND",
@@ -12,6 +12,7 @@ var EnumStatusCode;
12
12
  EnumStatusCode["UPDATED_SUCCESSFULLY"] = "UPDATED_SUCCESSFULLY";
13
13
  EnumStatusCode["NOT_FOUND"] = "NOT_FOUND";
14
14
  EnumStatusCode["SPECIALTY_NOT_FOUND"] = "SPECIALTY_NOT_FOUND";
15
+ EnumStatusCode["EXPERTISE_NOT_FOUND"] = "EXPERTISE_NOT_FOUND";
15
16
  EnumStatusCode["NOT_ALLOWED"] = "NOT_ALLOWED";
16
17
  EnumStatusCode["DOCTOR_NOT_FOUND"] = "DOCTOR_NOT_FOUND";
17
18
  EnumStatusCode["USER_NOT_FOUND"] = "USER_NOT_FOUND";
@@ -1,5 +1,6 @@
1
1
  import { Document, Model } from "mongoose";
2
2
  import { ISpecialtyDocument } from "./specialty";
3
+ import { IExpertiseDocument } from "./expertise";
3
4
  import { IUserDocument } from "./user";
4
5
  import { IBaseModel } from "./base";
5
6
  import { IEducation } from "./education";
@@ -23,7 +24,7 @@ export interface IDoctor extends IBaseModel {
23
24
  positions: IPosition[];
24
25
  languages: ILanguage[];
25
26
  faqs: IFaq[];
26
- expertises: string[];
27
+ expertises: IExpertiseDocument[];
27
28
  location?: ILocation;
28
29
  }
29
30
  export interface IDoctorDocument extends IDoctor, Document {
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.DoctorModel = void 0;
13
13
  const mongoose_1 = require("mongoose");
14
14
  const specialty_1 = require("./specialty");
15
+ const expertise_1 = require("./expertise");
15
16
  const user_1 = require("./user");
16
17
  const base_1 = require("./base");
17
18
  const education_1 = require("./education");
@@ -28,7 +29,11 @@ const DoctorSchema = new mongoose_1.Schema(Object.assign(Object.assign({}, base_
28
29
  type: mongoose_1.Schema.Types.ObjectId,
29
30
  ref: specialty_1.SpecialtyModel,
30
31
  required: true,
31
- }, name: { type: String, required: true, trim: true }, biography: { type: String, required: false }, slug: { type: String, required: true, unique: true, trim: true }, isActive: { type: Boolean, default: false }, consultationFee: { type: Number, required: false }, isVerified: { type: Boolean, default: false }, isVisible: { type: Boolean, default: true }, isDeactivatedByAdmin: { type: Boolean, default: false }, photo: { type: String, required: false }, educations: { type: [education_1.EducationSchema], required: true, default: [] }, positions: { type: [position_1.PositionSchema], required: true, default: [] }, languages: { type: [language_1.LanguageSchema], required: true, default: [] }, faqs: { type: [faq_1.FaqSchema], required: true, default: [] }, expertises: { type: [String], required: true, default: [] }, location: { type: location_1.LocationSchema, required: false } }));
32
+ }, name: { type: String, required: true, trim: true }, biography: { type: String, required: false }, slug: { type: String, required: true, unique: true, trim: true }, isActive: { type: Boolean, default: false }, consultationFee: { type: Number, required: false }, isVerified: { type: Boolean, default: false }, isVisible: { type: Boolean, default: true }, isDeactivatedByAdmin: { type: Boolean, default: false }, photo: { type: String, required: false }, educations: { type: [education_1.EducationSchema], required: true, default: [] }, positions: { type: [position_1.PositionSchema], required: true, default: [] }, languages: { type: [language_1.LanguageSchema], required: true, default: [] }, faqs: { type: [faq_1.FaqSchema], required: true, default: [] }, expertises: {
33
+ type: [{ type: mongoose_1.Schema.Types.ObjectId, ref: expertise_1.ExpertiseModel }],
34
+ required: true,
35
+ default: [],
36
+ }, location: { type: location_1.LocationSchema, required: false } }));
32
37
  const createSlug = (text) => text
33
38
  .toLowerCase()
34
39
  .trim()
@@ -0,0 +1,15 @@
1
+ import { Document, Model } from "mongoose";
2
+ import { IBaseModel } from "./base";
3
+ export interface ILocalizedExpertiseFields {
4
+ name: string;
5
+ description?: string | null;
6
+ }
7
+ export interface IExpertise extends IBaseModel {
8
+ en: ILocalizedExpertiseFields;
9
+ fr?: ILocalizedExpertiseFields;
10
+ }
11
+ export interface IExpertiseDocument extends IExpertise, Document {
12
+ }
13
+ export interface IExpertiseModel extends Model<IExpertiseDocument> {
14
+ }
15
+ export declare const ExpertiseModel: IExpertiseModel;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExpertiseModel = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ const base_1 = require("./base");
6
+ const LocalizedFieldsSchema = new mongoose_1.Schema({
7
+ name: { type: String, required: true },
8
+ description: { type: String, default: null },
9
+ }, { _id: false });
10
+ const ExpertiseSchema = new mongoose_1.Schema(Object.assign(Object.assign({}, base_1.BaseSchemaFields), { en: { type: LocalizedFieldsSchema, required: true }, fr: { type: LocalizedFieldsSchema, required: false, default: null } }));
11
+ ExpertiseSchema.plugin(base_1.BaseSchemaPlugin);
12
+ exports.ExpertiseModel = (0, mongoose_1.model)("Expertise", ExpertiseSchema);
@@ -1,6 +1,7 @@
1
1
  export * from "./base";
2
2
  export * from "./doctor";
3
3
  export * from "./education";
4
+ export * from "./expertise";
4
5
  export * from "./faq";
5
6
  export * from "./language";
6
7
  export * from "./location";
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./base"), exports);
18
18
  __exportStar(require("./doctor"), exports);
19
19
  __exportStar(require("./education"), exports);
20
+ __exportStar(require("./expertise"), exports);
20
21
  __exportStar(require("./faq"), exports);
21
22
  __exportStar(require("./language"), exports);
22
23
  __exportStar(require("./location"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docta-package",
3
- "version": "1.2.36",
3
+ "version": "1.2.38",
4
4
  "description": "This package will contail all the required files to run the docta micro-service app",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",