mypetbook-core 1.0.2 → 1.0.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mypetbook-core",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "This contain all the entity model for the mypetbook",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/index.js ADDED
@@ -0,0 +1,85 @@
1
+ const mongoose = require('mongoose');
2
+
3
+ const Schema = mongoose.Schema;
4
+
5
+
6
+ const cate = {
7
+ GOODS: 'GOODS',
8
+ SERVICE: 'SERVICE',
9
+ OTHER: 'OTHER'
10
+ };
11
+
12
+ const CategoryType = [
13
+ cate.GOODS,
14
+ cate.SERVICE,
15
+ cate.OTHER
16
+ ];
17
+
18
+
19
+ const AppointmentStatus = {
20
+ APPOINTMENT_BOOKED: 'APPOINTMENT_BOOKED',
21
+ CHECKED_INTO_CLINIC: 'CHECKED_INTO_CLINIC',
22
+ IN_PROGRESS: 'IN_PROGRESS',
23
+ TREATMENT_DONE: 'TREATMENT_DONE'
24
+ };
25
+ const AppointmentEnum = [
26
+ AppointmentStatus.APPOINTMENT_BOOKED,
27
+ AppointmentStatus.CHECKED_INTO_CLINIC,
28
+ AppointmentStatus.IN_PROGRESS,
29
+ AppointmentStatus.TREATMENT_DONE
30
+ ];
31
+
32
+
33
+ const appointmentSchema = new Schema({
34
+ sysCurrentDate: { type: Date, default: Date.now },
35
+ appointmentDate: Date,
36
+ checkedIntoClinic: Boolean,
37
+ status: {
38
+ type: String,
39
+ index: true,
40
+ enum : AppointmentEnum,
41
+ default : AppointmentStatus.APPOINTMENT_BOOKED,
42
+ required: true
43
+ },
44
+ timeslot: String,
45
+ doctorSlot: { type:mongoose.Schema.ObjectId,ref:'DoctorSlot',index: true,},
46
+ checkedIntoClinicTime: String,
47
+ treatmentDoneTime: String,
48
+ doctor:{type:mongoose.Schema.ObjectId,ref:'Doctor',
49
+ index: true,
50
+ required: true,
51
+ },
52
+ pets:[{type:mongoose.Schema.ObjectId,ref:'Pet'}],
53
+ parent:{type:mongoose.Schema.ObjectId,ref:'Parent',
54
+ index: true,
55
+ required: true,
56
+ },
57
+ treatment:{type:mongoose.Schema.ObjectId,ref:'Treatment',
58
+ index: true,
59
+ },
60
+
61
+ summary:{
62
+ address: String,
63
+ lastVisit: Date,
64
+ totalVisit: Number,
65
+ totalTransaction:Number,
66
+ averageTransaction:Number,
67
+ appointmentDraft:Boolean
68
+ }
69
+
70
+ });
71
+
72
+ appointmentSchema.methods.customeMethod = function (){
73
+ console.info("customeMethod")
74
+ }
75
+ appointmentSchema.statics.customeStatiscMethod= function (){
76
+ console.info("customeStatiscMethod")
77
+ }
78
+
79
+ const Appointment = mongoose.model("Appointment", appointmentSchema);
80
+
81
+
82
+ module.exports = {
83
+ Appointment,
84
+ AppointmentStatus
85
+ };
package/src/index.ts DELETED
File without changes