tango-api-schema 2.6.28 → 2.6.30

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,130 +1,136 @@
1
- import mongoose from 'mongoose';
2
-
3
- const billingSchema = new mongoose.Schema(
4
- {
5
- clientId: {
6
- type: String,
7
- required: true,
8
- },
9
- groupName: {
10
- type: String,
11
- default:'Default Group'
12
- },
13
- groupTag: {
14
- type: String,
15
- enum: ['store','gst'],
16
- default: 'store'
17
- },
18
- registeredCompanyName: {
19
- type: String,
20
- },
21
- gst: {
22
- type: String,
23
- },
24
- addressLineOne: {
25
- type: String,
26
- },
27
- addressLineTwo: {
28
- type: String,
29
- },
30
- city: {
31
- type: String,
32
- },
33
- state: {
34
- type: String,
35
- },
36
- country: {
37
- type: String,
38
- },
39
- pinCode: {
40
- type: String,
41
- },
42
- placeOfSupply: {
43
- type: String,
44
- },
45
- po: {
46
- type: String,
47
- },
48
- stores: {
49
- type: Array,
50
- },
51
- proRata: {
52
- type: String,
53
- // 'prorate' = bill for actual working days.
54
- // 'flat' = bill for the full month regardless of working days.
55
- // Note: legacy values 'before15' / 'after15' were migrated out via
56
- // scripts/migrate-billing-prorata-pricing.js. Don't reintroduce them.
57
- enum: ['prorate','flat'],
58
- default: 'prorate'
59
- },
60
- paymentCategory: {
61
- type: String,
62
- enum: ['pre','post'],
63
- default: 'post'
64
- },
65
- currency: {
66
- type: String,
67
- enum: ['dollar','inr','singaporedollar','euro','aed'],
68
- },
69
- // Drives invoice-generation tax behavior. 'domestic' runs the
70
- // existing GST/IGST/CGST/SGST logic. 'international' suppresses
71
- // tax lines entirely (the tax array is left empty so totalAmount
72
- // equals subtotal). Defaults to 'domestic' so existing records
73
- // keep their current behavior on read.
74
- taxCalculationType: {
75
- type: String,
76
- enum: ['domestic','international'],
77
- default: 'domestic'
78
- },
79
- isInstallationOneTime: {
80
- type: Boolean,
81
- default: false
82
- },
83
- installationFee: {
84
- type: Number,
85
- },
86
- paymentCycle: {
87
- type: String,
88
- enum: ['monthly','quarter', 'halfYearly', 'yearly'],
89
- default: 'monthly'
90
- },
91
- paymentTerm: {
92
- type: Number,
93
- enum: [30, 45, 60, 90],
94
- default: 30
95
- },
96
- generateInvoiceTo: {
97
- type: Array,
98
- },
99
- attachAnnexure: {
100
- type: Boolean,
101
- default:false
102
- },
103
- isPrimary: {
104
- type: Boolean
105
- },
106
- advanceInvoice: {
107
- type: Boolean,
108
- default: false
109
- },
110
- products: [
111
- {
112
- productName: {
113
- type: String,
114
- },
115
- billingMethod: {
116
- type: String,
117
- enum: ['eachStore', 'overallStore'],
118
- default: 'overallStore'
119
- }
120
- }
121
- ]
122
- },
123
- {
124
- strict: true,
125
- versionKey: false,
126
- timestamps: true,
127
- },
128
- );
129
-
1
+ import mongoose from 'mongoose';
2
+
3
+ const billingSchema = new mongoose.Schema(
4
+ {
5
+ clientId: {
6
+ type: String,
7
+ required: true,
8
+ },
9
+ groupName: {
10
+ type: String,
11
+ default:'Default Group'
12
+ },
13
+ groupTag: {
14
+ type: String,
15
+ enum: ['store','gst'],
16
+ default: 'store'
17
+ },
18
+ registeredCompanyName: {
19
+ type: String,
20
+ },
21
+ gst: {
22
+ type: String,
23
+ },
24
+ addressLineOne: {
25
+ type: String,
26
+ },
27
+ addressLineTwo: {
28
+ type: String,
29
+ },
30
+ city: {
31
+ type: String,
32
+ },
33
+ state: {
34
+ type: String,
35
+ },
36
+ country: {
37
+ type: String,
38
+ },
39
+ pinCode: {
40
+ type: String,
41
+ },
42
+ placeOfSupply: {
43
+ type: String,
44
+ },
45
+ po: {
46
+ type: String,
47
+ },
48
+ stores: {
49
+ type: Array,
50
+ },
51
+ proRata: {
52
+ type: String,
53
+ // 'prorate' = bill for actual working days.
54
+ // 'flat' = bill for the full month regardless of working days.
55
+ // Note: legacy values 'before15' / 'after15' were migrated out via
56
+ // scripts/migrate-billing-prorata-pricing.js. Don't reintroduce them.
57
+ enum: ['prorate','flat'],
58
+ default: 'prorate'
59
+ },
60
+ paymentCategory: {
61
+ type: String,
62
+ enum: ['pre','post'],
63
+ default: 'post'
64
+ },
65
+ currency: {
66
+ type: String,
67
+ enum: ['dollar','inr','singaporedollar','euro','aed'],
68
+ },
69
+ // Drives invoice-generation tax behavior. 'domestic' runs the
70
+ // existing GST/IGST/CGST/SGST logic. 'international' suppresses
71
+ // tax lines entirely (the tax array is left empty so totalAmount
72
+ // equals subtotal). Defaults to 'domestic' so existing records
73
+ // keep their current behavior on read.
74
+ taxCalculationType: {
75
+ type: String,
76
+ enum: ['domestic','international'],
77
+ default: 'domestic'
78
+ },
79
+ isInstallationOneTime: {
80
+ type: Boolean,
81
+ default: false
82
+ },
83
+ installationFee: {
84
+ type: Number,
85
+ },
86
+ paymentCycle: {
87
+ type: String,
88
+ enum: ['monthly','quarter', 'halfYearly', 'yearly'],
89
+ default: 'monthly'
90
+ },
91
+ paymentTerm: {
92
+ type: Number,
93
+ enum: [30, 45, 60, 90],
94
+ default: 30
95
+ },
96
+ generateInvoiceTo: {
97
+ type: Array,
98
+ },
99
+ attachAnnexure: {
100
+ type: Boolean,
101
+ default:false
102
+ },
103
+ isPrimary: {
104
+ type: Boolean
105
+ },
106
+ advanceInvoice: {
107
+ type: Boolean,
108
+ default: false
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
+ },
116
+ products: [
117
+ {
118
+ productName: {
119
+ type: String,
120
+ },
121
+ billingMethod: {
122
+ type: String,
123
+ enum: ['eachStore', 'overallStore'],
124
+ default: 'overallStore'
125
+ }
126
+ }
127
+ ]
128
+ },
129
+ {
130
+ strict: true,
131
+ versionKey: false,
132
+ timestamps: true,
133
+ },
134
+ );
135
+
130
136
  export default mongoose.model( 'billing', billingSchema);
@@ -121,8 +121,7 @@ const checklistconfigSchema = new mongoose.Schema({
121
121
  },
122
122
  checkListType: {
123
123
  type: String,
124
- default: "custom",
125
- enum: ["storeopenandclose", "mobileusagedetection", "uniformdetection", "custom", "customerunattended", "staffleftinthemiddle", 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'unauthorisedentry', 'backroommonitoring', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'staffgrouping','employeeCount','unattendeddetection',"employeemonitoring","activitymonitoring"]
124
+ default: "custom"
126
125
  },
127
126
  createdAt: {
128
127
  type: Date,
@@ -1,87 +1,87 @@
1
- import mongoose from 'mongoose';
2
-
3
- // Estimates (quotations) — generated before an invoice to share projected
4
- // billing with a client. Mirrors the invoice shape but carries an estimate
5
- // lifecycle (draft → sent → accepted/declined/expired) and a validity date
6
- // instead of a due date.
7
- const estimateSchema = new mongoose.Schema(
8
- {
9
- clientId: {
10
- type: String,
11
- },
12
- estimate: {
13
- type: String, // EST-26-27-00031
14
- },
15
- estimateIndex: {
16
- type: String,
17
- },
18
- companyName: {
19
- type: String,
20
- },
21
- companyAddress: {
22
- type: String,
23
- },
24
- PlaceOfSupply: {
25
- type: String,
26
- },
27
- GSTNumber: {
28
- type: String,
29
- },
30
- groupId: {
31
- type: mongoose.Types.ObjectId,
32
- },
33
- groupName: {
34
- type: String,
35
- },
36
- period: {
37
- type: String, // e.g. "Jun 2026"
38
- },
39
- stores: {
40
- type: Number,
41
- },
42
- products: {
43
- type: Array,
44
- },
45
- tax: {
46
- type: Array,
47
- },
48
- amount: {
49
- type: Number, // excl. GST
50
- },
51
- totalAmount: {
52
- type: Number, // incl. GST
53
- },
54
- currency: {
55
- type: String,
56
- enum: [ 'dollar', 'inr', 'singaporedollar', 'euro', 'aed' ],
57
- default: 'inr',
58
- },
59
- status: {
60
- type: String,
61
- default: 'pending',
62
- enum: [ 'pending', 'sent', 'accepted', 'declined', 'expired' ],
63
- },
64
- createdDate: {
65
- type: Date,
66
- },
67
- validTill: {
68
- type: Date,
69
- },
70
- // Set when an accepted estimate is turned into an invoice.
71
- convertedInvoice: {
72
- type: String,
73
- },
74
- createdBy: {
75
- type: String,
76
- },
77
- notes: {
78
- type: String,
79
- },
80
- }, {
81
- strict: true,
82
- versionKey: false,
83
- timestamps: true,
84
- }
85
- );
86
-
1
+ import mongoose from 'mongoose';
2
+
3
+ // Estimates (quotations) — generated before an invoice to share projected
4
+ // billing with a client. Mirrors the invoice shape but carries an estimate
5
+ // lifecycle (draft → sent → accepted/declined/expired) and a validity date
6
+ // instead of a due date.
7
+ const estimateSchema = new mongoose.Schema(
8
+ {
9
+ clientId: {
10
+ type: String,
11
+ },
12
+ estimate: {
13
+ type: String, // EST-26-27-00031
14
+ },
15
+ estimateIndex: {
16
+ type: String,
17
+ },
18
+ companyName: {
19
+ type: String,
20
+ },
21
+ companyAddress: {
22
+ type: String,
23
+ },
24
+ PlaceOfSupply: {
25
+ type: String,
26
+ },
27
+ GSTNumber: {
28
+ type: String,
29
+ },
30
+ groupId: {
31
+ type: mongoose.Types.ObjectId,
32
+ },
33
+ groupName: {
34
+ type: String,
35
+ },
36
+ period: {
37
+ type: String, // e.g. "Jun 2026"
38
+ },
39
+ stores: {
40
+ type: Number,
41
+ },
42
+ products: {
43
+ type: Array,
44
+ },
45
+ tax: {
46
+ type: Array,
47
+ },
48
+ amount: {
49
+ type: Number, // excl. GST
50
+ },
51
+ totalAmount: {
52
+ type: Number, // incl. GST
53
+ },
54
+ currency: {
55
+ type: String,
56
+ enum: [ 'dollar', 'inr', 'singaporedollar', 'euro', 'aed' ],
57
+ default: 'inr',
58
+ },
59
+ status: {
60
+ type: String,
61
+ default: 'pending',
62
+ enum: [ 'pending', 'sent', 'accepted', 'declined', 'expired' ],
63
+ },
64
+ createdDate: {
65
+ type: Date,
66
+ },
67
+ validTill: {
68
+ type: Date,
69
+ },
70
+ // Set when an accepted estimate is turned into an invoice.
71
+ convertedInvoice: {
72
+ type: String,
73
+ },
74
+ createdBy: {
75
+ type: String,
76
+ },
77
+ notes: {
78
+ type: String,
79
+ },
80
+ }, {
81
+ strict: true,
82
+ versionKey: false,
83
+ timestamps: true,
84
+ }
85
+ );
86
+
87
87
  export default mongoose.model( 'estimate', estimateSchema );
@@ -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 );
@@ -80,8 +80,7 @@ const processedchecklistSchema = new mongoose.Schema({
80
80
  },
81
81
  checkListType: {
82
82
  type: String,
83
- default: "custom",
84
- enum: ["storeopenandclose","mobileusagedetection","uniformdetection","custom","customerunattended","staffleftinthemiddle",'eyetest', 'remoteoptometrist', 'storehygienemonitoring','queuealert','cleaning','scrum','suspiciousactivity','boxalert','suspiciousfootfall','drinking','bagdetection','inventorycount','carsattended','numberplateinfo','vehicle_check_in','unauthorisedentry','backroommonitoring','outsidebusinesshoursqueuetracking','halfshutter','tvcompliance','cameratampering','staffgrouping','employeeCount','employeemonitoring','activitymonitoring']
83
+ default: "custom"
85
84
  },
86
85
  store_id: {
87
86
  type: String,