payservedb 10.0.5 → 10.0.6

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
@@ -103,6 +103,7 @@ const models = {
103
103
  LevyContract: require("./src/models/levycontract"),
104
104
  ContractPaymentReceipt: require("./src/models/levy_payment_receipt"),
105
105
  DepositSchema: require("./src/models/levy_deposits"),
106
+ ReceiptCounter: require("./src/models/receipt_counter"),
106
107
  Invoice: require("./src/models/invoice"),
107
108
  CombinedInvoice: require("./src/models/combined_invoice"),
108
109
  InvoiceGeneration: require("./src/models/invoice_generation_approval"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "10.0.5",
3
+ "version": "10.0.6",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -0,0 +1,17 @@
1
+ const mongoose = require('mongoose');
2
+
3
+ // Per-facility sequence counters keyed by a string _id (e.g. 'receiptNumber').
4
+ // Stored in the shared 'counters' collection; documents here use a string _id,
5
+ // unlike the facility-keyed Counter model in counter_schema.js.
6
+ const ReceiptCounterSchema = new mongoose.Schema(
7
+ {
8
+ _id: { type: String, required: true },
9
+ seq: { type: Number, default: 0 }
10
+ },
11
+ { collection: 'counters' }
12
+ );
13
+
14
+ module.exports = {
15
+ schema: ReceiptCounterSchema,
16
+ name: 'ReceiptCounter'
17
+ };