docta-package 1.2.43 → 1.2.44
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.
- package/build/dto/output/session.d.ts +0 -0
- package/build/dto/output/session.js +1 -0
- package/build/enums/index.d.ts +1 -0
- package/build/enums/index.js +1 -0
- package/build/enums/session.status.d.ts +5 -0
- package/build/enums/session.status.js +9 -0
- package/build/models/index.d.ts +1 -0
- package/build/models/index.js +1 -0
- package/build/models/session.d.ts +33 -0
- package/build/models/session.js +30 -0
- package/package.json +1 -1
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/build/enums/index.d.ts
CHANGED
package/build/enums/index.js
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SessionStatus = void 0;
|
|
4
|
+
var SessionStatus;
|
|
5
|
+
(function (SessionStatus) {
|
|
6
|
+
SessionStatus["Created"] = "created";
|
|
7
|
+
SessionStatus["Paid"] = "paid";
|
|
8
|
+
SessionStatus["Cancelled"] = "cancelled";
|
|
9
|
+
})(SessionStatus || (exports.SessionStatus = SessionStatus = {}));
|
package/build/models/index.d.ts
CHANGED
package/build/models/index.js
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Document, Model } from "mongoose";
|
|
2
|
+
import { IBaseModel } from "./base";
|
|
3
|
+
import { IPeriodDocument } from "./period";
|
|
4
|
+
import { IPatientDocument } from "./patient";
|
|
5
|
+
import { SessionStatus } from "../enums/session.status";
|
|
6
|
+
/**
|
|
7
|
+
* Interface for session configuration percentages
|
|
8
|
+
*/
|
|
9
|
+
export interface ISessionConfig {
|
|
10
|
+
collectionPercentage: number;
|
|
11
|
+
distributionPercentage: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Session interface
|
|
15
|
+
*/
|
|
16
|
+
export interface ISession extends IBaseModel {
|
|
17
|
+
period: IPeriodDocument;
|
|
18
|
+
patient: IPatientDocument;
|
|
19
|
+
status: SessionStatus;
|
|
20
|
+
totalPrice: number;
|
|
21
|
+
doctorPrice: number;
|
|
22
|
+
paymentApiPrice: number;
|
|
23
|
+
platformPrice: number;
|
|
24
|
+
config: ISessionConfig;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Document + Model interfaces
|
|
28
|
+
*/
|
|
29
|
+
export interface ISessionDocument extends ISession, Document {
|
|
30
|
+
}
|
|
31
|
+
export interface ISessionModel extends Model<ISessionDocument> {
|
|
32
|
+
}
|
|
33
|
+
export declare const SessionModel: ISessionModel;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SessionModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const base_1 = require("./base");
|
|
6
|
+
const period_1 = require("./period");
|
|
7
|
+
const patient_1 = require("./patient");
|
|
8
|
+
const session_status_1 = require("../enums/session.status");
|
|
9
|
+
/**
|
|
10
|
+
* Schema definition
|
|
11
|
+
*/
|
|
12
|
+
const SessionSchema = new mongoose_1.Schema(Object.assign(Object.assign({}, base_1.BaseSchemaFields), { period: {
|
|
13
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
14
|
+
ref: period_1.PeriodModel.modelName,
|
|
15
|
+
required: true,
|
|
16
|
+
}, patient: {
|
|
17
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
18
|
+
ref: patient_1.PatientModel.modelName,
|
|
19
|
+
required: true,
|
|
20
|
+
}, status: {
|
|
21
|
+
type: String,
|
|
22
|
+
enum: Object.values(session_status_1.SessionStatus),
|
|
23
|
+
default: session_status_1.SessionStatus.Created,
|
|
24
|
+
required: true,
|
|
25
|
+
}, totalPrice: { type: Number, required: true }, doctorPrice: { type: Number, required: true }, platformPrice: { type: Number, required: true }, paymentApiPrice: { type: Number, required: true }, config: {
|
|
26
|
+
collectionPercentage: { type: Number, required: true },
|
|
27
|
+
distributionPercentage: { type: Number, required: true },
|
|
28
|
+
} }));
|
|
29
|
+
SessionSchema.plugin(base_1.BaseSchemaPlugin);
|
|
30
|
+
exports.SessionModel = (0, mongoose_1.model)("Session", SessionSchema);
|