@managesome/eposmatic-toolkit 0.2.652 → 0.2.653

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.
@@ -75,3 +75,35 @@ export declare const WalletTransactionsSchema: Schema<any, import("mongoose").Mo
75
75
  __v: number;
76
76
  }>;
77
77
  export declare const WALLET_TRANSACTIONS_COLLECTION_NAME = "wallet_transactions";
78
+ /**
79
+ * Describes the indexes for `wallet_transactions`. Values are Mongo key
80
+ * patterns that can be passed straight to `.hint()`.
81
+ * - `_id`: unique primary key.
82
+ * - `tenant_id__createdAt`: per-tenant wallet transactions newest first.
83
+ * - `tenant_id__payment_id__transaction_category__transaction_type__transaction_status`:
84
+ * per-tenant wallet transaction lookups by payment, scoped by category,
85
+ * type and status.
86
+ * - `tenant_id__order_id__payment_id`: per-tenant wallet transaction lookups by
87
+ * order and payment.
88
+ */
89
+ export declare const WALLET_TRANSACTIONS_COLLECTION_INDEXES: {
90
+ _id: {
91
+ _id: number;
92
+ };
93
+ tenant_id__createdAt: {
94
+ tenant_id: number;
95
+ createdAt: number;
96
+ };
97
+ tenant_id__payment_id__transaction_category__transaction_type__transaction_status: {
98
+ tenant_id: number;
99
+ payment_id: number;
100
+ transaction_category: number;
101
+ transaction_type: number;
102
+ transaction_status: number;
103
+ };
104
+ tenant_id__order_id__payment_id: {
105
+ tenant_id: number;
106
+ order_id: number;
107
+ payment_id: number;
108
+ };
109
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WALLET_TRANSACTIONS_COLLECTION_NAME = exports.WalletTransactionsSchema = void 0;
3
+ exports.WALLET_TRANSACTIONS_COLLECTION_INDEXES = exports.WALLET_TRANSACTIONS_COLLECTION_NAME = exports.WalletTransactionsSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const constants_1 = require("../../constants");
6
6
  exports.WalletTransactionsSchema = new mongoose_1.Schema({
@@ -99,3 +99,33 @@ exports.WalletTransactionsSchema = new mongoose_1.Schema({
99
99
  minimize: false,
100
100
  });
101
101
  exports.WALLET_TRANSACTIONS_COLLECTION_NAME = 'wallet_transactions';
102
+ /**
103
+ * Describes the indexes for `wallet_transactions`. Values are Mongo key
104
+ * patterns that can be passed straight to `.hint()`.
105
+ * - `_id`: unique primary key.
106
+ * - `tenant_id__createdAt`: per-tenant wallet transactions newest first.
107
+ * - `tenant_id__payment_id__transaction_category__transaction_type__transaction_status`:
108
+ * per-tenant wallet transaction lookups by payment, scoped by category,
109
+ * type and status.
110
+ * - `tenant_id__order_id__payment_id`: per-tenant wallet transaction lookups by
111
+ * order and payment.
112
+ */
113
+ exports.WALLET_TRANSACTIONS_COLLECTION_INDEXES = {
114
+ _id: { _id: 1 }, // Unique Index
115
+ tenant_id__createdAt: {
116
+ tenant_id: 1,
117
+ createdAt: -1,
118
+ }, // per-tenant wallet transactions newest first
119
+ tenant_id__payment_id__transaction_category__transaction_type__transaction_status: {
120
+ tenant_id: 1,
121
+ payment_id: 1,
122
+ transaction_category: 1,
123
+ transaction_type: 1,
124
+ transaction_status: 1,
125
+ }, // per-tenant wallet transaction lookups by payment, scoped by category, type and status
126
+ tenant_id__order_id__payment_id: {
127
+ tenant_id: 1,
128
+ order_id: 1,
129
+ payment_id: 1,
130
+ }, // per-tenant wallet transaction lookups by order and payment
131
+ };
@@ -36,3 +36,17 @@ export declare const WalletSchema: Schema<any, import("mongoose").Model<any, any
36
36
  __v: number;
37
37
  }>;
38
38
  export declare const WALLET_COLLECTION_NAME = "wallets";
39
+ /**
40
+ * Describes the indexes for `wallets`. Values are Mongo key patterns that can
41
+ * be passed straight to `.hint()`.
42
+ * - `_id`: unique primary key.
43
+ * - `tenant_id`: UNIQUE per tenant — one wallet per tenant.
44
+ */
45
+ export declare const WALLET_COLLECTION_INDEXES: {
46
+ _id: {
47
+ _id: number;
48
+ };
49
+ tenant_id: {
50
+ tenant_id: number;
51
+ };
52
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WALLET_COLLECTION_NAME = exports.WalletSchema = void 0;
3
+ exports.WALLET_COLLECTION_INDEXES = exports.WALLET_COLLECTION_NAME = exports.WalletSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  exports.WalletSchema = new mongoose_1.Schema({
6
6
  _id: {
@@ -35,3 +35,13 @@ exports.WalletSchema = new mongoose_1.Schema({
35
35
  minimize: false,
36
36
  });
37
37
  exports.WALLET_COLLECTION_NAME = 'wallets';
38
+ /**
39
+ * Describes the indexes for `wallets`. Values are Mongo key patterns that can
40
+ * be passed straight to `.hint()`.
41
+ * - `_id`: unique primary key.
42
+ * - `tenant_id`: UNIQUE per tenant — one wallet per tenant.
43
+ */
44
+ exports.WALLET_COLLECTION_INDEXES = {
45
+ _id: { _id: 1 }, // Unique Index
46
+ tenant_id: { tenant_id: 1 }, // UNIQUE per tenant — one wallet per tenant
47
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managesome/eposmatic-toolkit",
3
- "version": "0.2.652",
3
+ "version": "0.2.653",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",