payservedb 5.7.2 → 5.7.3

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/index.js CHANGED
@@ -176,7 +176,8 @@ const models = {
176
176
  UnitManagementTemplate: require("./src/models/unitManagementTemplate"),
177
177
  PropertyManagerRevenue: require("./src/models/propertyManagerRevenue"),
178
178
  PropertyManagerContract: require("./src/models/propertyManagerContract"),
179
- BillerAddress: require('./src/models/billerAddress')
179
+ BillerAddress: require('./src/models/billerAddress'),
180
+ AssetAssignment: require('./src/models/assetsAssignment')
180
181
  };
181
182
 
182
183
  // Function to get models dynamically from a specific database connection
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "5.7.2",
3
+ "version": "5.7.3",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -16,13 +16,8 @@ const assetAssignmentSchema = new mongoose.Schema({
16
16
  ref: 'Facility',
17
17
  required: true,
18
18
  },
19
- assignedDate: {
20
- type: Date,
21
- default: Date.now,
22
- required: true,
23
- },
24
- unassignedDate: {
25
- type: Date,
19
+ dates: {
20
+ type: [Date],
26
21
  },
27
22
  status: {
28
23
  type: String,
@@ -32,25 +27,25 @@ const assetAssignmentSchema = new mongoose.Schema({
32
27
  notes: {
33
28
  type: String,
34
29
  },
35
- priority: {
36
- type: String,
37
- enum: ['Low', 'Medium', 'High', 'Critical'],
38
- default: 'Medium',
39
- },
40
- serviceType: {
41
- type: String,
42
- enum: ['Maintenance', 'Repair', 'Installation', 'Inspection', 'Other'],
43
- },
44
- estimatedCompletionDate: {
45
- type: Date,
46
- },
47
- actualCompletionDate: {
48
- type: Date,
49
- },
50
30
  cost: {
51
31
  type: Number,
52
32
  min: 0,
53
33
  },
34
+ attachments: [{
35
+ fileName: {
36
+ type: String,
37
+ required: true,
38
+ trim: true,
39
+ },
40
+ filePath: {
41
+ type: String,
42
+ required: true,
43
+ },
44
+ uploadedAt: {
45
+ type: Date,
46
+ default: Date.now,
47
+ }
48
+ }],
54
49
  }, {
55
50
  timestamps: true,
56
51
  });
@@ -58,7 +53,7 @@ const assetAssignmentSchema = new mongoose.Schema({
58
53
  // Compound index to ensure unique active assignments per asset-vendor pair
59
54
  assetAssignmentSchema.index(
60
55
  { assetId: 1, serviceVendorId: 1, status: 1 },
61
- {
56
+ {
62
57
  unique: true,
63
58
  partialFilterExpression: { status: 'Active' }
64
59
  }
@@ -67,8 +62,4 @@ assetAssignmentSchema.index(
67
62
  // Index for efficient querying by facility
68
63
  assetAssignmentSchema.index({ facilityId: 1 });
69
64
 
70
- // Index for date-based queries
71
- assetAssignmentSchema.index({ assignedDate: 1 });
72
- assetAssignmentSchema.index({ estimatedCompletionDate: 1 });
73
-
74
65
  module.exports = mongoose.model('AssetAssignment', assetAssignmentSchema);
@@ -103,6 +103,10 @@ const ticketSchema = new mongoose.Schema({
103
103
  type: String,
104
104
  required: false,
105
105
  },
106
+ payerType: {
107
+ type: String,
108
+ required: false,
109
+ },
106
110
  reviewed: {
107
111
  type: Boolean,
108
112
  default: false,