orbitx-core-models 5.0.4 → 6.0.0

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.
@@ -0,0 +1,10 @@
1
+ import { Types } from "mongoose";
2
+ export interface IWallet {
3
+ _id?: Types.ObjectId;
4
+ balance: number;
5
+ status: "active" | "suspended" | "closed";
6
+ partner: Types.ObjectId;
7
+ createdAt?: Date;
8
+ updatedAt?: Date;
9
+ }
10
+ //# sourceMappingURL=wallet.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wallet.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/wallet.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,MAAM,WAAW,OAAO;IACtB,GAAG,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,QAAQ,GAAG,WAAW,GAAG,QAAQ,CAAC;IAC1C,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC;IACxB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ import mongoose from "mongoose";
2
+ import { IWallet } from "../interfaces/wallet.interface";
3
+ export declare const Wallet: mongoose.Model<IWallet, {}, {}, {}, mongoose.Document<unknown, {}, IWallet, {}, {}> & IWallet & Required<{
4
+ _id: mongoose.Types.ObjectId;
5
+ }> & {
6
+ __v: number;
7
+ }, any>;
8
+ export default Wallet;
9
+ //# sourceMappingURL=wallet.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wallet.model.d.ts","sourceRoot":"","sources":["../../src/models/wallet.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AA6BzD,eAAO,MAAM,MAAM;;;;OAAkD,CAAC;AACtE,eAAe,MAAM,CAAC"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Wallet = void 0;
37
+ const mongoose_1 = __importStar(require("mongoose"));
38
+ const walletSchema = new mongoose_1.Schema({
39
+ balance: {
40
+ type: Number,
41
+ default: 0,
42
+ min: 0,
43
+ },
44
+ status: {
45
+ type: String,
46
+ enum: ["active", "suspended", "closed"],
47
+ default: "active",
48
+ },
49
+ partner: {
50
+ type: mongoose_1.Schema.Types.ObjectId,
51
+ ref: "Partner",
52
+ required: true,
53
+ unique: true,
54
+ },
55
+ }, {
56
+ timestamps: true,
57
+ });
58
+ // Index for efficient queries
59
+ walletSchema.index({ partner: 1 });
60
+ exports.Wallet = mongoose_1.default.model("Wallet", walletSchema);
61
+ exports.default = exports.Wallet;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orbitx-core-models",
3
- "version": "5.0.4",
3
+ "version": "6.0.0",
4
4
  "description": "Shared Mongoose models and interfaces for OrbitX services",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",