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.
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -7,3 +7,4 @@ export * from "./exchanges";
7
7
  export * from "./queues";
8
8
  export * from "./period.status";
9
9
  export * from "./notification.types";
10
+ export * from "./session.status";
@@ -23,3 +23,4 @@ __exportStar(require("./exchanges"), exports);
23
23
  __exportStar(require("./queues"), exports);
24
24
  __exportStar(require("./period.status"), exports);
25
25
  __exportStar(require("./notification.types"), exports);
26
+ __exportStar(require("./session.status"), exports);
@@ -0,0 +1,5 @@
1
+ export declare enum SessionStatus {
2
+ Created = "created",
3
+ Paid = "paid",
4
+ Cancelled = "cancelled"
5
+ }
@@ -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 = {}));
@@ -10,3 +10,4 @@ export * from "./period";
10
10
  export * from "./position";
11
11
  export * from "./specialty";
12
12
  export * from "./user";
13
+ export * from "./session";
@@ -26,3 +26,4 @@ __exportStar(require("./period"), exports);
26
26
  __exportStar(require("./position"), exports);
27
27
  __exportStar(require("./specialty"), exports);
28
28
  __exportStar(require("./user"), exports);
29
+ __exportStar(require("./session"), exports);
@@ -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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docta-package",
3
- "version": "1.2.43",
3
+ "version": "1.2.44",
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",