tango-api-schema 2.6.27 → 2.6.29

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-api-schema",
3
- "version": "2.6.27",
3
+ "version": "2.6.29",
4
4
  "description": "tangoEye model schema",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1,85 +1,95 @@
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
- // Set when the team chose "Reach out to customer" in the resolve
67
- // popup — the row stays in needs_review with a "Reaching out" badge.
68
- contacted: {
69
- type: Boolean,
70
- default: false
71
- },
72
- fileName: {
73
- type: String
74
- },
75
- uploadedBy: {
76
- type: String
77
- },
78
- }, {
79
- strict: true,
80
- versionKey: false,
81
- timestamps: true,
82
- }
83
- );
84
-
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', 'manual' ],
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
+ // When one payment settles MULTIPLE invoices, the exact amount applied
64
+ // to each is recorded here so an Edit/re-reconcile can reverse precisely
65
+ // what was applied. (Single-invoice reconciles also populate this.)
66
+ appliedInvoices: [
67
+ {
68
+ invoiceId: { type: String },
69
+ invoice: { type: String },
70
+ amount: { type: Number },
71
+ },
72
+ ],
73
+ resultNote: {
74
+ type: String
75
+ },
76
+ // Set when the team chose "Reach out to customer" in the resolve
77
+ // popup — the row stays in needs_review with a "Reaching out" badge.
78
+ contacted: {
79
+ type: Boolean,
80
+ default: false
81
+ },
82
+ fileName: {
83
+ type: String
84
+ },
85
+ uploadedBy: {
86
+ type: String
87
+ },
88
+ }, {
89
+ strict: true,
90
+ versionKey: false,
91
+ timestamps: true,
92
+ }
93
+ );
94
+
85
95
  export default mongoose.model('banktransaction', bankTransactionSchema);
@@ -107,6 +107,12 @@ const billingSchema = new mongoose.Schema(
107
107
  type: Boolean,
108
108
  default: false
109
109
  },
110
+ // How far ahead an advance invoice is generated when advanceInvoice is on.
111
+ advancePeriod: {
112
+ type: String,
113
+ enum: [ 'monthly', 'quarterly', 'halfyearly', 'yearly' ],
114
+ default: 'monthly'
115
+ },
110
116
  products: [
111
117
  {
112
118
  productName: {
@@ -58,8 +58,8 @@ const estimateSchema = new mongoose.Schema(
58
58
  },
59
59
  status: {
60
60
  type: String,
61
- default: 'draft',
62
- enum: [ 'draft', 'sent', 'accepted', 'declined', 'expired' ],
61
+ default: 'pending',
62
+ enum: [ 'pending', 'sent', 'accepted', 'declined', 'expired' ],
63
63
  },
64
64
  createdDate: {
65
65
  type: Date,