payservedb 3.7.6 → 3.7.8
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 +1 -0
- package/package.json +1 -1
- package/src/models/currency_settings.js +35 -0
package/index.js
CHANGED
|
@@ -122,6 +122,7 @@ const models = {
|
|
|
122
122
|
Account: require('./src/models/account'),
|
|
123
123
|
FacilityPaymentDetails: require('./src/models/facility_payment_details'),
|
|
124
124
|
DefaultPaymentDetails: require('./src/models/default_payment_details'),
|
|
125
|
+
Currency: require('./src/models/currency_settings'),
|
|
125
126
|
UserAccount: require('./src/models/user_account')
|
|
126
127
|
|
|
127
128
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const mongoose = require('mongoose');
|
|
2
|
+
|
|
3
|
+
// Define the schema for currency settings
|
|
4
|
+
const currencySchema = new mongoose.Schema({
|
|
5
|
+
facilityId: {
|
|
6
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
7
|
+
ref: 'Facility',
|
|
8
|
+
required: true
|
|
9
|
+
},
|
|
10
|
+
currencyName: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: [true, 'Currency name is required'],
|
|
13
|
+
trim: true,
|
|
14
|
+
},
|
|
15
|
+
currencyShortCode: {
|
|
16
|
+
type: String,
|
|
17
|
+
required: [true, 'Currency short code is required'],
|
|
18
|
+
trim: true,
|
|
19
|
+
uppercase: true,
|
|
20
|
+
minlength: [3, 'Currency short code must be 3 characters'],
|
|
21
|
+
maxlength: [3, 'Currency short code must be 3 characters']
|
|
22
|
+
},
|
|
23
|
+
isDefaultCurrency: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: false
|
|
26
|
+
}
|
|
27
|
+
}, {
|
|
28
|
+
timestamps: true
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// Add any indexes if needed
|
|
32
|
+
currencySchema.index({ currencyShortCode: 1 }, { unique: true });
|
|
33
|
+
|
|
34
|
+
const Currency = mongoose.model('Currency', currencySchema);
|
|
35
|
+
module.exports = Currency;
|