docta-package 1.2.40 → 1.2.42

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.
@@ -9,6 +9,7 @@ export declare class CreateDoctorDto {
9
9
  specialtyId: string;
10
10
  biography?: string;
11
11
  consultationFee?: number;
12
+ timezone: string;
12
13
  }
13
14
  export declare class ActivateDoctorAccountDto {
14
15
  token: string;
@@ -25,6 +26,7 @@ export declare class UpdateDoctorDto {
25
26
  faqs?: FaqInputDto[];
26
27
  expertises?: string[];
27
28
  location?: LocationInputDto;
29
+ timezone?: string;
28
30
  }
29
31
  export declare class DoctorFilterDto {
30
32
  name?: string;
@@ -46,6 +46,11 @@ __decorate([
46
46
  (0, class_validator_1.Min)(0),
47
47
  __metadata("design:type", Number)
48
48
  ], CreateDoctorDto.prototype, "consultationFee", void 0);
49
+ __decorate([
50
+ (0, class_validator_1.IsString)(),
51
+ (0, class_validator_1.IsNotEmpty)(),
52
+ __metadata("design:type", String)
53
+ ], CreateDoctorDto.prototype, "timezone", void 0);
49
54
  class ActivateDoctorAccountDto {
50
55
  }
51
56
  exports.ActivateDoctorAccountDto = ActivateDoctorAccountDto;
@@ -129,6 +134,11 @@ __decorate([
129
134
  (0, class_transformer_1.Type)(() => location_1.LocationInputDto),
130
135
  __metadata("design:type", location_1.LocationInputDto)
131
136
  ], UpdateDoctorDto.prototype, "location", void 0);
137
+ __decorate([
138
+ (0, class_validator_1.IsOptional)(),
139
+ (0, class_validator_1.IsString)(),
140
+ __metadata("design:type", String)
141
+ ], UpdateDoctorDto.prototype, "timezone", void 0);
132
142
  class DoctorFilterDto {
133
143
  }
134
144
  exports.DoctorFilterDto = DoctorFilterDto;
@@ -2,6 +2,7 @@ export declare class CreateUserDto {
2
2
  name: string;
3
3
  email: string;
4
4
  password: string;
5
+ timezone: string;
5
6
  }
6
7
  export declare class LoginDto {
7
8
  email: string;
@@ -22,6 +23,7 @@ export declare class ResetPasswordDto {
22
23
  }
23
24
  export declare class UpdateUserDto {
24
25
  name: string;
26
+ timezone?: string;
25
27
  }
26
28
  export declare class UpdatePasswordDto {
27
29
  oldPassword: string;
@@ -31,6 +31,11 @@ __decorate([
31
31
  (0, class_validator_1.IsStrongPassword)(),
32
32
  __metadata("design:type", String)
33
33
  ], CreateUserDto.prototype, "password", void 0);
34
+ __decorate([
35
+ (0, class_validator_1.IsString)(),
36
+ (0, class_validator_1.IsNotEmpty)(),
37
+ __metadata("design:type", String)
38
+ ], CreateUserDto.prototype, "timezone", void 0);
34
39
  class LoginDto {
35
40
  }
36
41
  exports.LoginDto = LoginDto;
@@ -93,6 +98,11 @@ __decorate([
93
98
  (0, class_validator_1.MaxLength)(50),
94
99
  __metadata("design:type", String)
95
100
  ], UpdateUserDto.prototype, "name", void 0);
101
+ __decorate([
102
+ (0, class_validator_1.IsOptional)(),
103
+ (0, class_validator_1.IsString)(),
104
+ __metadata("design:type", String)
105
+ ], UpdateUserDto.prototype, "timezone", void 0);
96
106
  class UpdatePasswordDto {
97
107
  }
98
108
  exports.UpdatePasswordDto = UpdatePasswordDto;
@@ -5,6 +5,7 @@ export declare class UserOutputDto {
5
5
  email: string;
6
6
  role: string;
7
7
  isActive: boolean;
8
+ timezone: string;
8
9
  isDeleted: boolean;
9
10
  createdAt: number;
10
11
  updatedAt: number;
@@ -9,6 +9,7 @@ class UserOutputDto {
9
9
  this.email = user.email;
10
10
  this.role = user.role;
11
11
  this.isActive = user.isActive;
12
+ this.timezone = user.timezone;
12
13
  this.isDeleted = user.isDeleted;
13
14
  this.createdAt = user.createdAt;
14
15
  this.updatedAt = user.updatedAt;
@@ -10,6 +10,7 @@ export interface IUser extends IBaseModel {
10
10
  forgotPasswordToken?: string | null;
11
11
  token?: string | null;
12
12
  isActive: boolean;
13
+ timezone: string;
13
14
  }
14
15
  export interface IUserDocument extends IUser, Document {
15
16
  comparePassword(candidatePassword: string): Promise<boolean>;
@@ -14,7 +14,7 @@ const mongoose_1 = require("mongoose");
14
14
  const enums_1 = require("../enums");
15
15
  const bcrypt = require("bcryptjs");
16
16
  const base_1 = require("./base");
17
- const UserSchema = new mongoose_1.Schema(Object.assign(Object.assign({}, base_1.BaseSchemaFields), { name: { type: String, required: true }, email: { type: String, required: true, unique: true, trim: true }, password: { type: String, required: false, default: null }, activationToken: { type: String, default: null }, forgotPasswordToken: { type: String, default: null }, token: { type: String, default: null }, isActive: { type: Boolean, default: false }, role: {
17
+ const UserSchema = new mongoose_1.Schema(Object.assign(Object.assign({}, base_1.BaseSchemaFields), { name: { type: String, required: true }, email: { type: String, required: true, unique: true, trim: true }, password: { type: String, required: false, default: null }, activationToken: { type: String, default: null }, forgotPasswordToken: { type: String, default: null }, token: { type: String, default: null }, isActive: { type: Boolean, default: false }, timezone: { type: String, required: true }, role: {
18
18
  type: String,
19
19
  enum: Object.values(enums_1.EnumUserRole),
20
20
  default: enums_1.EnumUserRole.PATIENT,
@@ -3,6 +3,20 @@ export type ErrorResult = {
3
3
  code: EnumStatusCode;
4
4
  message: string;
5
5
  };
6
+ export type SimpleItemResult<T> = {
7
+ code: EnumStatusCode;
8
+ message: string;
9
+ data: {
10
+ item: T;
11
+ } | undefined;
12
+ };
13
+ export type SimpleListResult<T> = {
14
+ code: EnumStatusCode;
15
+ message: string;
16
+ data: {
17
+ items: T[];
18
+ };
19
+ };
6
20
  export type PaginatedResult<T> = {
7
21
  code: EnumStatusCode;
8
22
  message: string;
@@ -14,13 +28,6 @@ export type PaginatedResult<T> = {
14
28
  totalPages: number;
15
29
  };
16
30
  };
17
- export type SimpleItemResult<T> = {
18
- code: EnumStatusCode;
19
- message: string;
20
- data: {
21
- item: T;
22
- } | undefined;
23
- };
24
31
  export declare class OrchestrationResult {
25
32
  static paginated<T>({ data, totalItems, itemsPerPage, page, code, message, }: {
26
33
  data: T[];
@@ -35,4 +42,9 @@ export declare class OrchestrationResult {
35
42
  message: string;
36
43
  data?: T;
37
44
  }): SimpleItemResult<T>;
45
+ static list<T>({ code, data, message, }: {
46
+ code: EnumStatusCode;
47
+ message: string;
48
+ data: T[];
49
+ }): SimpleListResult<T>;
38
50
  }
@@ -22,5 +22,12 @@ class OrchestrationResult {
22
22
  data: data === undefined ? undefined : { item: data },
23
23
  };
24
24
  }
25
+ static list({ code, data, message, }) {
26
+ return {
27
+ code,
28
+ message,
29
+ data: { items: data },
30
+ };
31
+ }
25
32
  }
26
33
  exports.OrchestrationResult = OrchestrationResult;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docta-package",
3
- "version": "1.2.40",
3
+ "version": "1.2.42",
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",