tango-api-schema 2.6.44 → 2.6.46

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.
@@ -1,61 +1,61 @@
1
- import mongoose from 'mongoose';
2
-
3
- const paymentAccountSchema = new mongoose.Schema(
4
- {
5
- clientId: {
6
- type: String,
7
- required: true,
8
- unique: true,
9
- },
10
- customerId:{
11
- type: String,
12
- required: true,
13
- unique: true,
14
- },
15
- virtualAccId:{
16
- type: String,
17
- required: true,
18
- unique: true,
19
- },
20
- bankAccId:{
21
- type: String,
22
- required: true,
23
- unique: true,
24
- },
25
- accountNumber:{
26
- type: String,
27
- required: true,
28
- unique: true,
29
- },
30
- paymentType:{
31
- type: String,
32
- },
33
- status:{
34
- type: String,
35
- },
36
- ifsc: {
37
- type: String,
38
- },
39
- swiftCode:{
40
- type: String,
41
- },
42
- branch:{
43
- type: String,
44
- },
45
- credit:{
46
- type: Number,
47
- default:0
48
- },
49
- currency: {
50
- type: String,
51
- enum: [ 'dollar', 'inr', 'singaporedollar', 'euro', 'aed' ],
52
- },
53
- },
54
- {
55
- strict: true,
56
- versionKey: false,
57
- timestamps: true,
58
- },
59
- );
60
-
1
+ import mongoose from 'mongoose';
2
+
3
+ const paymentAccountSchema = new mongoose.Schema(
4
+ {
5
+ clientId: {
6
+ type: String,
7
+ required: true,
8
+ unique: true,
9
+ },
10
+ customerId:{
11
+ type: String,
12
+ required: true,
13
+ unique: true,
14
+ },
15
+ virtualAccId:{
16
+ type: String,
17
+ required: true,
18
+ unique: true,
19
+ },
20
+ bankAccId:{
21
+ type: String,
22
+ required: true,
23
+ unique: true,
24
+ },
25
+ accountNumber:{
26
+ type: String,
27
+ required: true,
28
+ unique: true,
29
+ },
30
+ paymentType:{
31
+ type: String,
32
+ },
33
+ status:{
34
+ type: String,
35
+ },
36
+ ifsc: {
37
+ type: String,
38
+ },
39
+ swiftCode:{
40
+ type: String,
41
+ },
42
+ branch:{
43
+ type: String,
44
+ },
45
+ credit:{
46
+ type: Number,
47
+ default:0
48
+ },
49
+ currency: {
50
+ type: String,
51
+ enum: [ 'dollar', 'inr', 'singaporedollar', 'euro', 'aed' ],
52
+ },
53
+ },
54
+ {
55
+ strict: true,
56
+ versionKey: false,
57
+ timestamps: true,
58
+ },
59
+ );
60
+
61
61
  export default mongoose.model( 'paymentAccount', paymentAccountSchema);
@@ -1,47 +1,47 @@
1
- import mongoose from 'mongoose';
2
-
3
- // Payment reminder configuration per client (brand). One document per
4
- // clientId, driving which reminder emails go out and to whom. Stored in its
5
- // own `paymentreminders` collection.
6
- const paymentReminderSchema = new mongoose.Schema(
7
- {
8
- clientId: {
9
- type: String,
10
- index: true,
11
- },
12
- // Recipients for all reminder emails on this brand.
13
- reminderEmails: {
14
- type: [ String ],
15
- default: [],
16
- },
17
- // Predefined reminder templates the team can toggle. preDue carries a
18
- // configurable lead time; the rest fire on fixed rules.
19
- templates: {
20
- preDue: {
21
- enabled: { type: Boolean, default: true },
22
- daysBefore: { type: Number, default: 3, min: 1, max: 365 },
23
- },
24
- onDue: {
25
- enabled: { type: Boolean, default: true },
26
- },
27
- onHold: {
28
- enabled: { type: Boolean, default: true },
29
- },
30
- suspend: {
31
- enabled: { type: Boolean, default: true },
32
- },
33
- deactivated: {
34
- enabled: { type: Boolean, default: false },
35
- },
36
- },
37
- updatedBy: {
38
- type: String,
39
- },
40
- }, {
41
- strict: true,
42
- versionKey: false,
43
- timestamps: true,
44
- }
45
- );
46
-
1
+ import mongoose from 'mongoose';
2
+
3
+ // Payment reminder configuration per client (brand). One document per
4
+ // clientId, driving which reminder emails go out and to whom. Stored in its
5
+ // own `paymentreminders` collection.
6
+ const paymentReminderSchema = new mongoose.Schema(
7
+ {
8
+ clientId: {
9
+ type: String,
10
+ index: true,
11
+ },
12
+ // Recipients for all reminder emails on this brand.
13
+ reminderEmails: {
14
+ type: [ String ],
15
+ default: [],
16
+ },
17
+ // Predefined reminder templates the team can toggle. preDue carries a
18
+ // configurable lead time; the rest fire on fixed rules.
19
+ templates: {
20
+ preDue: {
21
+ enabled: { type: Boolean, default: true },
22
+ daysBefore: { type: Number, default: 3, min: 1, max: 365 },
23
+ },
24
+ onDue: {
25
+ enabled: { type: Boolean, default: true },
26
+ },
27
+ onHold: {
28
+ enabled: { type: Boolean, default: true },
29
+ },
30
+ suspend: {
31
+ enabled: { type: Boolean, default: true },
32
+ },
33
+ deactivated: {
34
+ enabled: { type: Boolean, default: false },
35
+ },
36
+ },
37
+ updatedBy: {
38
+ type: String,
39
+ },
40
+ }, {
41
+ strict: true,
42
+ versionKey: false,
43
+ timestamps: true,
44
+ }
45
+ );
46
+
47
47
  export default mongoose.model( 'paymentreminder', paymentReminderSchema );
@@ -1,60 +1,60 @@
1
- import mongoose from 'mongoose';
2
-
3
- // Purchase Orders per brand (clientId). totalAmount is the original PO value and
4
- // never changes; remainingAmount decreases as invoices are mapped to this PO.
5
- // `usage` keeps an audit trail of which invoices consumed how much.
6
- const purchaseOrderSchema = new mongoose.Schema(
7
- {
8
- clientId: {
9
- type: String,
10
- index: true,
11
- },
12
- companyName: {
13
- type: String,
14
- },
15
- purchaseOrderNumber: {
16
- type: String,
17
- },
18
- // Original PO value (immutable once created).
19
- totalAmount: {
20
- type: Number,
21
- default: 0,
22
- },
23
- // Decreases as invoices are mapped; starts equal to totalAmount.
24
- remainingAmount: {
25
- type: Number,
26
- default: 0,
27
- },
28
- date: {
29
- type: Date,
30
- },
31
- // Stored S3 path (assets bucket) of the uploaded PO PDF, if any.
32
- pdfPath: {
33
- type: String,
34
- },
35
- // open -> partiallyUsed -> fullyUsed (derived from remainingAmount).
36
- status: {
37
- type: String,
38
- enum: [ 'open', 'partiallyUsed', 'fullyUsed' ],
39
- default: 'open',
40
- },
41
- // Invoices that consumed this PO. One entry per mapping.
42
- usage: [
43
- {
44
- invoice: { type: String },
45
- amount: { type: Number },
46
- mappedAt: { type: Date },
47
- mappedBy: { type: String },
48
- },
49
- ],
50
- createdBy: {
51
- type: String,
52
- },
53
- }, {
54
- strict: true,
55
- versionKey: false,
56
- timestamps: true,
57
- },
58
- );
59
-
1
+ import mongoose from 'mongoose';
2
+
3
+ // Purchase Orders per brand (clientId). totalAmount is the original PO value and
4
+ // never changes; remainingAmount decreases as invoices are mapped to this PO.
5
+ // `usage` keeps an audit trail of which invoices consumed how much.
6
+ const purchaseOrderSchema = new mongoose.Schema(
7
+ {
8
+ clientId: {
9
+ type: String,
10
+ index: true,
11
+ },
12
+ companyName: {
13
+ type: String,
14
+ },
15
+ purchaseOrderNumber: {
16
+ type: String,
17
+ },
18
+ // Original PO value (immutable once created).
19
+ totalAmount: {
20
+ type: Number,
21
+ default: 0,
22
+ },
23
+ // Decreases as invoices are mapped; starts equal to totalAmount.
24
+ remainingAmount: {
25
+ type: Number,
26
+ default: 0,
27
+ },
28
+ date: {
29
+ type: Date,
30
+ },
31
+ // Stored S3 path (assets bucket) of the uploaded PO PDF, if any.
32
+ pdfPath: {
33
+ type: String,
34
+ },
35
+ // open -> partiallyUsed -> fullyUsed (derived from remainingAmount).
36
+ status: {
37
+ type: String,
38
+ enum: [ 'open', 'partiallyUsed', 'fullyUsed' ],
39
+ default: 'open',
40
+ },
41
+ // Invoices that consumed this PO. One entry per mapping.
42
+ usage: [
43
+ {
44
+ invoice: { type: String },
45
+ amount: { type: Number },
46
+ mappedAt: { type: Date },
47
+ mappedBy: { type: String },
48
+ },
49
+ ],
50
+ createdBy: {
51
+ type: String,
52
+ },
53
+ }, {
54
+ strict: true,
55
+ versionKey: false,
56
+ timestamps: true,
57
+ },
58
+ );
59
+
60
60
  export default mongoose.model( 'purchaseorder', purchaseOrderSchema );
@@ -1,31 +1,31 @@
1
- import mongoose from 'mongoose';
2
- import { randomUUID } from 'crypto';
3
-
4
- // schema
5
- const collection = new mongoose.Schema({
6
- apiKey: {
7
- type: String,
8
- required: true,
9
- unique: true,
10
- default: () => randomUUID()
11
- },
12
- countryName: {
13
- type: String,
14
- },
15
- countryCode: {
16
- type: String,
17
- },
18
- clientId: {
19
- type: String,
20
- },
21
- },
22
- {
23
- timestamps: true,
24
- strict: true,
25
- versionKey: false,
26
- });
27
-
28
-
29
- collection.index({ apiKey: 1 });
30
-
31
- export default mongoose.model('regionKey', collection, 'regionKey');
1
+ import mongoose from 'mongoose';
2
+ import { randomUUID } from 'crypto';
3
+
4
+ // schema
5
+ const collection = new mongoose.Schema({
6
+ apiKey: {
7
+ type: String,
8
+ required: true,
9
+ unique: true,
10
+ default: () => randomUUID()
11
+ },
12
+ countryName: {
13
+ type: String,
14
+ },
15
+ countryCode: {
16
+ type: String,
17
+ },
18
+ clientId: {
19
+ type: String,
20
+ },
21
+ },
22
+ {
23
+ timestamps: true,
24
+ strict: true,
25
+ versionKey: false,
26
+ });
27
+
28
+
29
+ collection.index({ apiKey: 1 });
30
+
31
+ export default mongoose.model('regionKey', collection, 'regionKey');
@@ -1,55 +1,55 @@
1
- import mongoose from 'mongoose';
2
-
3
- const transactionSchema = new mongoose.Schema(
4
- {
5
- clientId: {
6
- type: String
7
- },
8
- orderId: {
9
- type: String
10
- },
11
- paymentId: {
12
- type: String
13
- },
14
- debtType: {
15
- type: String,
16
- enum: [ 'wallet', 'razor' ],
17
- },
18
- billingDate: {
19
- type: Date
20
- },
21
- invoice: {
22
- type: String
23
- },
24
- groupName: {
25
- type: String
26
- },
27
- groupId: {
28
- type: mongoose.Types.ObjectId
29
- },
30
- amount: {
31
- type: Number
32
- },
33
- currency: {
34
- type: String,
35
- enum: [ 'dollar', 'inr', 'singaporedollar', 'euro', 'aed' ],
36
- },
37
- transactionType: {
38
- type: String,
39
- enum: [ 'credit', 'debt' ],
40
- },
41
- balanceCredit: {
42
- type: Number
43
- },
44
- balanceCreditCurrency: {
45
- type: String,
46
- enum: [ 'dollar', 'inr', 'singaporedollar', 'euro', 'aed' ],
47
- },
48
- }, {
49
- strict: true,
50
- versionKey: false,
51
- timestamps: true,
52
- }
53
- )
54
-
1
+ import mongoose from 'mongoose';
2
+
3
+ const transactionSchema = new mongoose.Schema(
4
+ {
5
+ clientId: {
6
+ type: String
7
+ },
8
+ orderId: {
9
+ type: String
10
+ },
11
+ paymentId: {
12
+ type: String
13
+ },
14
+ debtType: {
15
+ type: String,
16
+ enum: [ 'wallet', 'razor' ],
17
+ },
18
+ billingDate: {
19
+ type: Date
20
+ },
21
+ invoice: {
22
+ type: String
23
+ },
24
+ groupName: {
25
+ type: String
26
+ },
27
+ groupId: {
28
+ type: mongoose.Types.ObjectId
29
+ },
30
+ amount: {
31
+ type: Number
32
+ },
33
+ currency: {
34
+ type: String,
35
+ enum: [ 'dollar', 'inr', 'singaporedollar', 'euro', 'aed' ],
36
+ },
37
+ transactionType: {
38
+ type: String,
39
+ enum: [ 'credit', 'debt' ],
40
+ },
41
+ balanceCredit: {
42
+ type: Number
43
+ },
44
+ balanceCreditCurrency: {
45
+ type: String,
46
+ enum: [ 'dollar', 'inr', 'singaporedollar', 'euro', 'aed' ],
47
+ },
48
+ }, {
49
+ strict: true,
50
+ versionKey: false,
51
+ timestamps: true,
52
+ }
53
+ )
54
+
55
55
  export default mongoose.model('transaction', transactionSchema);