docta-package 1.2.41 → 1.2.43
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.
|
@@ -12,6 +12,9 @@ export declare class PeriodOutputDto {
|
|
|
12
12
|
updatedAt: number;
|
|
13
13
|
constructor(period: IPeriodDocument);
|
|
14
14
|
}
|
|
15
|
+
export declare class PeriodDoctorOutputDto extends PeriodOutputDto {
|
|
16
|
+
constructor(period: IPeriodDocument);
|
|
17
|
+
}
|
|
15
18
|
export declare class PeriodAdminOutputDto extends PeriodOutputDto {
|
|
16
19
|
createdBy: UserOutputDto | null;
|
|
17
20
|
updatedBy: UserOutputDto | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PeriodAdminOutputDto = exports.PeriodOutputDto = void 0;
|
|
3
|
+
exports.PeriodAdminOutputDto = exports.PeriodDoctorOutputDto = exports.PeriodOutputDto = void 0;
|
|
4
4
|
const user_1 = require("./user");
|
|
5
5
|
// Base DTO for everyone
|
|
6
6
|
class PeriodOutputDto {
|
|
@@ -16,6 +16,17 @@ class PeriodOutputDto {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
exports.PeriodOutputDto = PeriodOutputDto;
|
|
19
|
+
// Extended DTO for doctor's responses
|
|
20
|
+
class PeriodDoctorOutputDto extends PeriodOutputDto {
|
|
21
|
+
// sessionInfo: SessionOutputDto | null;
|
|
22
|
+
constructor(period) {
|
|
23
|
+
super(period); // call base constructor
|
|
24
|
+
// this.createdBy = period.createdBy
|
|
25
|
+
// ? new UserOutputDto(period.createdBy)
|
|
26
|
+
// : null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.PeriodDoctorOutputDto = PeriodDoctorOutputDto;
|
|
19
30
|
// Extended DTO for admin responses
|
|
20
31
|
class PeriodAdminOutputDto extends PeriodOutputDto {
|
|
21
32
|
constructor(period) {
|
|
@@ -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;
|