tango-api-schema 2.6.18 → 2.6.19
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/package.json +1 -1
- package/schema/bankTransaction.model.js +78 -73
package/package.json
CHANGED
|
@@ -1,74 +1,79 @@
|
|
|
1
|
-
import mongoose from 'mongoose';
|
|
2
|
-
|
|
3
|
-
// Bank-statement transactions uploaded from the billing "Transactions" tab.
|
|
4
|
-
// Separate from the existing `transaction` collection, which holds payment /
|
|
5
|
-
// wallet (Razorpay) entries. Each row is one statement line; `status` drives
|
|
6
|
-
// the reconciliation buckets shown in the UI.
|
|
7
|
-
const bankTransactionSchema = new mongoose.Schema(
|
|
8
|
-
{
|
|
9
|
-
date: {
|
|
10
|
-
type: Date
|
|
11
|
-
},
|
|
12
|
-
valueDate: {
|
|
13
|
-
type: Date
|
|
14
|
-
},
|
|
15
|
-
narration: {
|
|
16
|
-
type: String
|
|
17
|
-
},
|
|
18
|
-
refNo: {
|
|
19
|
-
type: String,
|
|
20
|
-
index: true
|
|
21
|
-
},
|
|
22
|
-
withdrawalAmt: {
|
|
23
|
-
type: Number,
|
|
24
|
-
default: 0
|
|
25
|
-
},
|
|
26
|
-
depositAmt: {
|
|
27
|
-
type: Number,
|
|
28
|
-
default: 0
|
|
29
|
-
},
|
|
30
|
-
// Signed convenience amount: deposit - withdrawal.
|
|
31
|
-
amount: {
|
|
32
|
-
type: Number
|
|
33
|
-
},
|
|
34
|
-
// Counterparty name extracted from the narration at upload time.
|
|
35
|
-
payer: {
|
|
36
|
-
type: String
|
|
37
|
-
},
|
|
38
|
-
source: {
|
|
39
|
-
type: String,
|
|
40
|
-
enum: [ 'bank', 'va', 'gateway' ],
|
|
41
|
-
default: 'bank',
|
|
42
|
-
},
|
|
43
|
-
status: {
|
|
44
|
-
type: String,
|
|
45
|
-
enum: [ 'reconciled', 'needs_review', 'unmatched', 'excluded' ],
|
|
46
|
-
default: 'unmatched',
|
|
47
|
-
},
|
|
48
|
-
// Filled by the (future) classification pass / manual resolve.
|
|
49
|
-
identifiedClientId: {
|
|
50
|
-
type: String
|
|
51
|
-
},
|
|
52
|
-
identifiedClientName: {
|
|
53
|
-
type: String
|
|
54
|
-
},
|
|
55
|
-
invoice: {
|
|
56
|
-
type: String
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
|
|
3
|
+
// Bank-statement transactions uploaded from the billing "Transactions" tab.
|
|
4
|
+
// Separate from the existing `transaction` collection, which holds payment /
|
|
5
|
+
// wallet (Razorpay) entries. Each row is one statement line; `status` drives
|
|
6
|
+
// the reconciliation buckets shown in the UI.
|
|
7
|
+
const bankTransactionSchema = new mongoose.Schema(
|
|
8
|
+
{
|
|
9
|
+
date: {
|
|
10
|
+
type: Date
|
|
11
|
+
},
|
|
12
|
+
valueDate: {
|
|
13
|
+
type: Date
|
|
14
|
+
},
|
|
15
|
+
narration: {
|
|
16
|
+
type: String
|
|
17
|
+
},
|
|
18
|
+
refNo: {
|
|
19
|
+
type: String,
|
|
20
|
+
index: true
|
|
21
|
+
},
|
|
22
|
+
withdrawalAmt: {
|
|
23
|
+
type: Number,
|
|
24
|
+
default: 0
|
|
25
|
+
},
|
|
26
|
+
depositAmt: {
|
|
27
|
+
type: Number,
|
|
28
|
+
default: 0
|
|
29
|
+
},
|
|
30
|
+
// Signed convenience amount: deposit - withdrawal.
|
|
31
|
+
amount: {
|
|
32
|
+
type: Number
|
|
33
|
+
},
|
|
34
|
+
// Counterparty name extracted from the narration at upload time.
|
|
35
|
+
payer: {
|
|
36
|
+
type: String
|
|
37
|
+
},
|
|
38
|
+
source: {
|
|
39
|
+
type: String,
|
|
40
|
+
enum: [ 'bank', 'va', 'gateway' ],
|
|
41
|
+
default: 'bank',
|
|
42
|
+
},
|
|
43
|
+
status: {
|
|
44
|
+
type: String,
|
|
45
|
+
enum: [ 'reconciled', 'needs_review', 'unmatched', 'excluded' ],
|
|
46
|
+
default: 'unmatched',
|
|
47
|
+
},
|
|
48
|
+
// Filled by the (future) classification pass / manual resolve.
|
|
49
|
+
identifiedClientId: {
|
|
50
|
+
type: String
|
|
51
|
+
},
|
|
52
|
+
identifiedClientName: {
|
|
53
|
+
type: String
|
|
54
|
+
},
|
|
55
|
+
invoice: {
|
|
56
|
+
type: String
|
|
57
|
+
},
|
|
58
|
+
// Mongo _id of the matched invoice — lets the UI open the invoice
|
|
59
|
+
// preview directly from a reconciled transaction.
|
|
60
|
+
invoiceId: {
|
|
61
|
+
type: String
|
|
62
|
+
},
|
|
63
|
+
resultNote: {
|
|
64
|
+
type: String
|
|
65
|
+
},
|
|
66
|
+
fileName: {
|
|
67
|
+
type: String
|
|
68
|
+
},
|
|
69
|
+
uploadedBy: {
|
|
70
|
+
type: String
|
|
71
|
+
},
|
|
72
|
+
}, {
|
|
73
|
+
strict: true,
|
|
74
|
+
versionKey: false,
|
|
75
|
+
timestamps: true,
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
|
|
74
79
|
export default mongoose.model('banktransaction', bankTransactionSchema);
|