payservedb 4.5.2 → 4.5.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 +1 -1
- package/src/models/suppliers.js +16 -58
- package/src/models/units.js +47 -31
package/package.json
CHANGED
package/src/models/suppliers.js
CHANGED
|
@@ -24,50 +24,30 @@ const supplierSchema = new mongoose.Schema({
|
|
|
24
24
|
required: true,
|
|
25
25
|
trim: true
|
|
26
26
|
},
|
|
27
|
-
address: {
|
|
28
|
-
street: String,
|
|
29
|
-
city: String,
|
|
30
|
-
state: String,
|
|
31
|
-
country: String,
|
|
32
|
-
postalCode: String
|
|
33
|
-
},
|
|
34
27
|
contactPerson: {
|
|
35
28
|
name: String,
|
|
36
|
-
email: String,
|
|
37
|
-
phone: String,
|
|
38
|
-
position: String
|
|
39
|
-
},
|
|
40
|
-
taxIdentificationNumber: {
|
|
41
|
-
type: String,
|
|
42
29
|
trim: true
|
|
43
30
|
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
default: 'both'
|
|
48
|
-
},
|
|
49
|
-
preferredCurrency: {
|
|
50
|
-
type: String,
|
|
51
|
-
default: 'KES'
|
|
31
|
+
department: {
|
|
32
|
+
name: String,
|
|
33
|
+
trim: true
|
|
52
34
|
},
|
|
53
|
-
|
|
35
|
+
taxIdentificationNumber: {
|
|
54
36
|
type: String,
|
|
55
|
-
|
|
56
|
-
},
|
|
57
|
-
bankDetails: {
|
|
58
|
-
bankName: String,
|
|
59
|
-
accountName: String,
|
|
60
|
-
accountNumber: String,
|
|
61
|
-
branchCode: String,
|
|
62
|
-
swiftCode: String
|
|
37
|
+
trim: true
|
|
63
38
|
},
|
|
64
39
|
documents: [{
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
40
|
+
documentName: {
|
|
41
|
+
type: String,
|
|
42
|
+
required: true
|
|
43
|
+
},
|
|
44
|
+
documentType: {
|
|
45
|
+
type: String,
|
|
46
|
+
required: true
|
|
47
|
+
},
|
|
48
|
+
document: {
|
|
49
|
+
type: String,
|
|
50
|
+
required: true
|
|
71
51
|
}
|
|
72
52
|
}],
|
|
73
53
|
status: {
|
|
@@ -76,28 +56,6 @@ const supplierSchema = new mongoose.Schema({
|
|
|
76
56
|
default: 'active',
|
|
77
57
|
index: true
|
|
78
58
|
},
|
|
79
|
-
rating: {
|
|
80
|
-
type: Number,
|
|
81
|
-
min: 0,
|
|
82
|
-
max: 5,
|
|
83
|
-
default: 0
|
|
84
|
-
},
|
|
85
|
-
categories: [{
|
|
86
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
87
|
-
ref: 'SupplierCategory'
|
|
88
|
-
}],
|
|
89
|
-
notes: String,
|
|
90
|
-
purchaseHistory: [{
|
|
91
|
-
poNumber: String,
|
|
92
|
-
poDate: Date,
|
|
93
|
-
amount: Number,
|
|
94
|
-
currency: String,
|
|
95
|
-
status: {
|
|
96
|
-
type: String,
|
|
97
|
-
enum: ['pending', 'completed', 'cancelled'],
|
|
98
|
-
default: 'pending'
|
|
99
|
-
}
|
|
100
|
-
}]
|
|
101
59
|
}, {
|
|
102
60
|
timestamps: true
|
|
103
61
|
});
|
package/src/models/units.js
CHANGED
|
@@ -6,57 +6,73 @@ const unitSchema = new mongoose.Schema({
|
|
|
6
6
|
type: String,
|
|
7
7
|
required: true
|
|
8
8
|
},
|
|
9
|
-
unitType:{
|
|
10
|
-
type:String,
|
|
11
|
-
required:true
|
|
9
|
+
unitType: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: true
|
|
12
12
|
},
|
|
13
|
-
division:{
|
|
14
|
-
type:String,
|
|
15
|
-
required:true
|
|
13
|
+
division: {
|
|
14
|
+
type: String,
|
|
15
|
+
required: true
|
|
16
16
|
},
|
|
17
|
-
floorUnitNo:{
|
|
18
|
-
type:String,
|
|
19
|
-
required:true
|
|
17
|
+
floorUnitNo: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: true
|
|
20
20
|
},
|
|
21
|
-
lettableFloorArea:{
|
|
22
|
-
type:String,
|
|
23
|
-
required:false
|
|
21
|
+
lettableFloorArea: {
|
|
22
|
+
type: String,
|
|
23
|
+
required: false
|
|
24
24
|
},
|
|
25
|
-
landRateNumber:{
|
|
26
|
-
type:String,
|
|
27
|
-
required:false
|
|
25
|
+
landRateNumber: {
|
|
26
|
+
type: String,
|
|
27
|
+
required: false
|
|
28
28
|
},
|
|
29
|
-
grossArea:{
|
|
30
|
-
type:Number,
|
|
31
|
-
required:false
|
|
29
|
+
grossArea: {
|
|
30
|
+
type: Number,
|
|
31
|
+
required: false
|
|
32
32
|
},
|
|
33
|
-
netLettableArea:{
|
|
34
|
-
type:Number,
|
|
35
|
-
required:false
|
|
33
|
+
netLettableArea: {
|
|
34
|
+
type: Number,
|
|
35
|
+
required: false
|
|
36
36
|
},
|
|
37
|
-
status:{
|
|
38
|
-
type:String,
|
|
39
|
-
required:true
|
|
37
|
+
status: {
|
|
38
|
+
type: String,
|
|
39
|
+
required: true
|
|
40
40
|
},
|
|
41
|
-
facilityId:{
|
|
41
|
+
facilityId: {
|
|
42
42
|
type: mongoose.Schema.Types.ObjectId,
|
|
43
43
|
ref: 'Facility',
|
|
44
44
|
},
|
|
45
|
-
|
|
46
|
-
homeOwnerId:{
|
|
45
|
+
|
|
46
|
+
homeOwnerId: {
|
|
47
47
|
type: mongoose.Schema.Types.ObjectId,
|
|
48
48
|
ref: 'Customer',
|
|
49
49
|
},
|
|
50
|
-
|
|
50
|
+
unitDocuments: [
|
|
51
|
+
{
|
|
52
|
+
documentName: {
|
|
53
|
+
type: String,
|
|
54
|
+
required: true
|
|
55
|
+
},
|
|
56
|
+
documentType: {
|
|
57
|
+
type: String,
|
|
58
|
+
required: true
|
|
59
|
+
},
|
|
60
|
+
document: {
|
|
61
|
+
type: String,
|
|
62
|
+
required: true
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
tenantId: {
|
|
51
67
|
type: mongoose.Schema.Types.ObjectId,
|
|
52
68
|
ref: 'Customer',
|
|
53
69
|
},
|
|
54
|
-
residentId:{
|
|
70
|
+
residentId: {
|
|
55
71
|
type: mongoose.Schema.Types.ObjectId,
|
|
56
72
|
ref: 'Customer',
|
|
57
73
|
}
|
|
58
|
-
|
|
59
|
-
|
|
74
|
+
|
|
75
|
+
|
|
60
76
|
}, {
|
|
61
77
|
timestamps: true // Automatically add createdAt and updatedAt fields
|
|
62
78
|
});
|