docta-package 1.2.87 → 1.2.88
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,4 +1,4 @@
|
|
|
1
|
-
import { ISessionDocument } from "../../models";
|
|
1
|
+
import { ISessionDocument, ISessionPayment } from "../../models";
|
|
2
2
|
import { PeriodOutputDto } from "./period";
|
|
3
3
|
import { UserOutputDto } from "./user";
|
|
4
4
|
interface ISessionConfigOutput {
|
|
@@ -41,6 +41,7 @@ export declare class SessionAdminOutputDto extends SessionOutputDto {
|
|
|
41
41
|
hasDoctorCollected: boolean;
|
|
42
42
|
hasPlatformCollected: boolean;
|
|
43
43
|
config: ISessionConfigOutput;
|
|
44
|
+
payment: ISessionPayment | null;
|
|
44
45
|
createdBy: UserOutputDto | null;
|
|
45
46
|
updatedBy: UserOutputDto | null;
|
|
46
47
|
deletedBy: UserOutputDto | null;
|
|
@@ -59,6 +59,7 @@ class SessionAdminOutputDto extends SessionOutputDto {
|
|
|
59
59
|
collectionPercentage: session.meta.collectionPercentage,
|
|
60
60
|
disbursementPercentage: session.meta.disbursementPercentage,
|
|
61
61
|
};
|
|
62
|
+
this.payment = session.payment || null;
|
|
62
63
|
this.createdBy = session.createdBy
|
|
63
64
|
? new user_1.UserOutputDto(session.createdBy)
|
|
64
65
|
: null;
|
|
@@ -4,6 +4,7 @@ import { IPeriodDocument } from "./period";
|
|
|
4
4
|
import { IPatientDocument } from "./patient";
|
|
5
5
|
import { SessionStatus } from "../enums/session.status";
|
|
6
6
|
import { IDoctorDocument } from "./doctor";
|
|
7
|
+
import { EnumTranzakPaymentStatus, EnumTranzakCurrency } from "../enums/tranzak";
|
|
7
8
|
/**
|
|
8
9
|
* Interface for session configuration percentages
|
|
9
10
|
*/
|
|
@@ -13,6 +14,17 @@ export interface ISessionConfig {
|
|
|
13
14
|
collectionPercentage: number;
|
|
14
15
|
disbursementPercentage: number;
|
|
15
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Interface for embedded payment data
|
|
19
|
+
*/
|
|
20
|
+
export interface ISessionPayment {
|
|
21
|
+
transactionId: string;
|
|
22
|
+
transactionTime: number;
|
|
23
|
+
webhookStatus: EnumTranzakPaymentStatus;
|
|
24
|
+
webhookId: string;
|
|
25
|
+
amount: number;
|
|
26
|
+
currency: EnumTranzakCurrency;
|
|
27
|
+
}
|
|
16
28
|
/**
|
|
17
29
|
* Session interface
|
|
18
30
|
*/
|
|
@@ -30,6 +42,7 @@ export interface ISession extends IBaseModel {
|
|
|
30
42
|
hasDoctorCollected: boolean;
|
|
31
43
|
hasPlatformCollected: boolean;
|
|
32
44
|
meta: ISessionConfig;
|
|
45
|
+
payment?: ISessionPayment;
|
|
33
46
|
}
|
|
34
47
|
/**
|
|
35
48
|
* Document + Model interfaces
|
package/build/models/session.js
CHANGED
|
@@ -7,6 +7,7 @@ const period_1 = require("./period");
|
|
|
7
7
|
const patient_1 = require("./patient");
|
|
8
8
|
const session_status_1 = require("../enums/session.status");
|
|
9
9
|
const doctor_1 = require("./doctor");
|
|
10
|
+
const tranzak_1 = require("../enums/tranzak");
|
|
10
11
|
/**
|
|
11
12
|
* Schema definition
|
|
12
13
|
*/
|
|
@@ -37,6 +38,21 @@ const SessionSchema = new mongoose_1.Schema(Object.assign(Object.assign({}, base
|
|
|
37
38
|
platformPercentage: { type: Number, required: true },
|
|
38
39
|
collectionPercentage: { type: Number, required: true },
|
|
39
40
|
disbursementPercentage: { type: Number, required: true },
|
|
40
|
-
}, hasDoctorCollected: { type: Boolean, required: true, default: false }, hasPlatformCollected: { type: Boolean, required: true, default: false }
|
|
41
|
+
}, hasDoctorCollected: { type: Boolean, required: true, default: false }, hasPlatformCollected: { type: Boolean, required: true, default: false }, payment: {
|
|
42
|
+
transactionId: { type: String, required: false },
|
|
43
|
+
transactionTime: { type: Number, required: false },
|
|
44
|
+
webhookStatus: {
|
|
45
|
+
type: String,
|
|
46
|
+
enum: Object.values(tranzak_1.EnumTranzakPaymentStatus),
|
|
47
|
+
required: false,
|
|
48
|
+
},
|
|
49
|
+
webhookId: { type: String, required: false },
|
|
50
|
+
amount: { type: Number, required: false },
|
|
51
|
+
currency: {
|
|
52
|
+
type: String,
|
|
53
|
+
enum: Object.values(tranzak_1.EnumTranzakCurrency),
|
|
54
|
+
required: false,
|
|
55
|
+
},
|
|
56
|
+
} }));
|
|
41
57
|
SessionSchema.plugin(base_1.BaseSchemaPlugin);
|
|
42
58
|
exports.SessionModel = (0, mongoose_1.model)("Session", SessionSchema);
|