docta-package 1.2.62 → 1.2.63

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.
@@ -1,20 +1,28 @@
1
1
  import { Gender } from "../../enums";
2
2
  import { IPatientDocument } from "../../models";
3
- import { UserOutputDto } from "./user";
4
- export declare class PatientOutputDto {
3
+ import { UserOutputDto, UserPublicOutputDto } from "./user";
4
+ declare class BasePatientOutputDto {
5
5
  id: string;
6
- user: UserOutputDto;
7
6
  dob: number | null;
8
7
  phoneNumber: string | null;
9
8
  gender: Gender | null;
9
+ constructor(patient: IPatientDocument);
10
+ }
11
+ export declare class PatientOutputDto extends BasePatientOutputDto {
12
+ user: UserOutputDto;
10
13
  isDeleted: boolean;
11
14
  createdAt: number;
12
15
  updatedAt: number;
13
16
  constructor(patient: IPatientDocument);
14
17
  }
18
+ export declare class PatientPublicOutputDto extends BasePatientOutputDto {
19
+ user: UserPublicOutputDto;
20
+ constructor(patient: IPatientDocument);
21
+ }
15
22
  export declare class PatientAdminOutputDto extends PatientOutputDto {
16
23
  createdBy: UserOutputDto | null;
17
24
  updatedBy: UserOutputDto | null;
18
25
  deletedBy: UserOutputDto | null;
19
26
  constructor(patient: IPatientDocument);
20
27
  }
28
+ export {};
@@ -1,22 +1,35 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PatientAdminOutputDto = exports.PatientOutputDto = void 0;
3
+ exports.PatientAdminOutputDto = exports.PatientPublicOutputDto = exports.PatientOutputDto = void 0;
4
4
  const user_1 = require("./user");
5
- // Base DTO for everyone
6
- class PatientOutputDto {
5
+ class BasePatientOutputDto {
7
6
  constructor(patient) {
8
7
  var _a, _b;
9
8
  this.id = (_b = ((_a = patient.id) !== null && _a !== void 0 ? _a : patient._id)) === null || _b === void 0 ? void 0 : _b.toString();
10
- this.user = new user_1.UserOutputDto(patient.user);
11
9
  this.dob = patient.dob || null;
12
10
  this.phoneNumber = patient.phoneNumber || null;
13
11
  this.gender = patient.gender || null;
12
+ }
13
+ }
14
+ // Base DTO for everyone
15
+ class PatientOutputDto extends BasePatientOutputDto {
16
+ constructor(patient) {
17
+ super(patient);
18
+ this.user = new user_1.UserOutputDto(patient.user);
14
19
  this.isDeleted = patient.isDeleted;
15
20
  this.createdAt = patient.createdAt;
16
21
  this.updatedAt = patient.updatedAt;
17
22
  }
18
23
  }
19
24
  exports.PatientOutputDto = PatientOutputDto;
25
+ // Public patient DTO
26
+ class PatientPublicOutputDto extends BasePatientOutputDto {
27
+ constructor(patient) {
28
+ super(patient);
29
+ this.user = new user_1.UserPublicOutputDto(patient.user);
30
+ }
31
+ }
32
+ exports.PatientPublicOutputDto = PatientPublicOutputDto;
20
33
  // Extended DTO for admin responses
21
34
  class PatientAdminOutputDto extends PatientOutputDto {
22
35
  constructor(patient) {
@@ -11,9 +11,9 @@ class SessionOutputDto {
11
11
  this.period = new period_1.PeriodOutputDto(session.period);
12
12
  this.status = session.status;
13
13
  this.doctorId =
14
- ((_d = ((_c = session.doctor._id) !== null && _c !== void 0 ? _c : session.doctor._id)) === null || _d === void 0 ? void 0 : _d.toString()) || null;
14
+ ((_d = ((_c = session.doctor.id) !== null && _c !== void 0 ? _c : session.doctor._id)) === null || _d === void 0 ? void 0 : _d.toString()) || null;
15
15
  this.patientId =
16
- ((_f = ((_e = session.patient._id) !== null && _e !== void 0 ? _e : session.patient._id)) === null || _f === void 0 ? void 0 : _f.toString()) || null;
16
+ ((_f = ((_e = session.patient.id) !== null && _e !== void 0 ? _e : session.patient._id)) === null || _f === void 0 ? void 0 : _f.toString()) || null;
17
17
  this.isDeleted = session.isDeleted;
18
18
  this.createdAt = session.createdAt;
19
19
  this.updatedAt = session.updatedAt;
@@ -1,9 +1,12 @@
1
1
  import { IUserDocument } from "../../models";
2
- export declare class UserOutputDto {
2
+ export declare class UserPublicOutputDto {
3
3
  id: string;
4
4
  name: string;
5
5
  email: string;
6
6
  role: string;
7
+ constructor(user: IUserDocument);
8
+ }
9
+ export declare class UserOutputDto extends UserPublicOutputDto {
7
10
  isActive: boolean;
8
11
  timezone: string;
9
12
  isDeleted: boolean;
@@ -1,14 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LoggedInUserOutputDto = exports.UserAdminOutputDto = exports.UserOutputDto = void 0;
4
- // Base DTO for everyone
5
- class UserOutputDto {
3
+ exports.LoggedInUserOutputDto = exports.UserAdminOutputDto = exports.UserOutputDto = exports.UserPublicOutputDto = void 0;
4
+ class UserPublicOutputDto {
6
5
  constructor(user) {
7
6
  var _a, _b;
8
7
  this.id = (_b = ((_a = user.id) !== null && _a !== void 0 ? _a : user._id)) === null || _b === void 0 ? void 0 : _b.toString();
9
8
  this.name = user.name;
10
9
  this.email = user.email;
11
10
  this.role = user.role;
11
+ }
12
+ }
13
+ exports.UserPublicOutputDto = UserPublicOutputDto;
14
+ // Base DTO for everyone
15
+ class UserOutputDto extends UserPublicOutputDto {
16
+ constructor(user) {
17
+ super(user);
12
18
  this.isActive = user.isActive;
13
19
  this.timezone = user.timezone;
14
20
  this.isDeleted = user.isDeleted;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docta-package",
3
- "version": "1.2.62",
3
+ "version": "1.2.63",
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",