dip-dobit-shared-model 1.0.11 → 1.0.12

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,37 @@
1
+ "use strict";
2
+
3
+ module.exports = {
4
+ up: async (queryInterface, Sequelize) => {
5
+ const tableDescription = await queryInterface.describeTable("DobitUsers");
6
+
7
+ if (!tableDescription.totpSecret) {
8
+ await queryInterface.addColumn("DobitUsers", "totpSecret", {
9
+ type: Sequelize.STRING,
10
+ allowNull: true,
11
+ after: "currency",
12
+ });
13
+ }
14
+
15
+ if (!tableDescription.totpSecretTemporary) {
16
+ await queryInterface.addColumn("DobitUsers", "totpSecretTemporary", {
17
+ type: Sequelize.STRING,
18
+ allowNull: true,
19
+ after: "totpSecret",
20
+ });
21
+ }
22
+
23
+ if (!tableDescription.totpEnabled) {
24
+ await queryInterface.addColumn("DobitUsers", "totpEnabled", {
25
+ type: Sequelize.BOOLEAN,
26
+ defaultValue: false,
27
+ after: "totpSecretTemporary",
28
+ });
29
+ }
30
+ },
31
+
32
+ down: async (queryInterface) => {
33
+ await queryInterface.removeColumn("DobitUsers", "totpSecret");
34
+ await queryInterface.removeColumn("DobitUsers", "totpSecretTemporary");
35
+ await queryInterface.removeColumn("DobitUsers", "totpEnabled");
36
+ },
37
+ };
@@ -123,6 +123,18 @@ module.exports = (sequelize) => {
123
123
  allowNull: false,
124
124
  defaultValue: "NGN",
125
125
  },
126
+ totpSecret: {
127
+ type: DataTypes.STRING,
128
+ allowNull: true,
129
+ },
130
+ totpSecretTemporary: {
131
+ type: DataTypes.STRING,
132
+ allowNull: true,
133
+ },
134
+ totpEnabled: {
135
+ type: DataTypes.BOOLEAN,
136
+ defaultValue: false,
137
+ },
126
138
  userCreatedby: {
127
139
  type: DataTypes.INTEGER.UNSIGNED,
128
140
  allowNull: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dip-dobit-shared-model",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "main": "models/index.js",
5
5
  "scripts": {
6
6
  "migrate:up": "npx sequelize-cli db:migrate",
@@ -0,0 +1,239 @@
1
+ "use strict";
2
+
3
+ module.exports = {
4
+ async up(queryInterface) {
5
+ await queryInterface.bulkInsert("Transactions", [
6
+ // ─── User 19 (appUserId: 57409243714) ───
7
+ {
8
+ transactionRef: "TXN-20260101-001",
9
+ dobitUserId: 19,
10
+ appUserId: 57409243714,
11
+ serviceType: "airtime",
12
+ provider: "MTN",
13
+ recipient: "+2348045215464",
14
+ packageName: null,
15
+ amount: 500.0,
16
+ discount: 0.0,
17
+ amountCharged: 500.0,
18
+ gatewayRef: "GW-MTN-001",
19
+ gatewayResponse: "Transaction successful",
20
+ status: "successful",
21
+ token: null,
22
+ metadata: JSON.stringify({ bonus: "50MB data bonus" }),
23
+ deviceId: "device-jerry-001",
24
+ ipAddress: "102.89.45.12",
25
+ createdAt: new Date("2026-01-15T10:30:00"),
26
+ updatedAt: new Date("2026-01-15T10:30:00"),
27
+ },
28
+ {
29
+ transactionRef: "TXN-20260102-002",
30
+ dobitUserId: 19,
31
+ appUserId: 57409243714,
32
+ serviceType: "data",
33
+ provider: "MTN",
34
+ recipient: "+2348045215464",
35
+ packageName: "1GB Monthly",
36
+ amount: 1000.0,
37
+ discount: 0.0,
38
+ amountCharged: 1000.0,
39
+ gatewayRef: "GW-MTN-002",
40
+ gatewayResponse: "Transaction successful",
41
+ status: "successful",
42
+ token: null,
43
+ metadata: JSON.stringify({ validity: "30 days", dataMB: 1024 }),
44
+ deviceId: "device-jerry-001",
45
+ ipAddress: "102.89.45.12",
46
+ createdAt: new Date("2026-02-10T14:20:00"),
47
+ updatedAt: new Date("2026-02-10T14:20:00"),
48
+ },
49
+ {
50
+ transactionRef: "TXN-20260103-003",
51
+ dobitUserId: 19,
52
+ appUserId: 57409243714,
53
+ serviceType: "electricity",
54
+ provider: "EKEDC",
55
+ recipient: "45678901234",
56
+ packageName: null,
57
+ amount: 5000.0,
58
+ discount: 0.0,
59
+ amountCharged: 5000.0,
60
+ gatewayRef: "GW-EKEDC-001",
61
+ gatewayResponse: "Transaction successful",
62
+ status: "successful",
63
+ token: "4521-8734-9012-3456-7890",
64
+ metadata: JSON.stringify({
65
+ units: "45.2 kWh",
66
+ meterNumber: "45678901234",
67
+ }),
68
+ deviceId: "device-jerry-001",
69
+ ipAddress: "102.89.45.12",
70
+ createdAt: new Date("2026-03-05T09:15:00"),
71
+ updatedAt: new Date("2026-03-05T09:15:00"),
72
+ },
73
+ {
74
+ transactionRef: "TXN-20260104-004",
75
+ dobitUserId: 19,
76
+ appUserId: 57409243714,
77
+ serviceType: "cable_tv",
78
+ provider: "DSTV",
79
+ recipient: "7089123456",
80
+ packageName: "DStv Compact",
81
+ amount: 9000.0,
82
+ discount: 0.0,
83
+ amountCharged: 9000.0,
84
+ gatewayRef: "GW-DSTV-001",
85
+ gatewayResponse: "Subscription renewed",
86
+ status: "successful",
87
+ token: null,
88
+ metadata: JSON.stringify({
89
+ smartCardNumber: "7089123456",
90
+ expiryDate: "2026-04-05",
91
+ }),
92
+ deviceId: "device-jerry-001",
93
+ ipAddress: "102.89.45.12",
94
+ createdAt: new Date("2026-04-01T11:45:00"),
95
+ updatedAt: new Date("2026-04-01T11:45:00"),
96
+ },
97
+ {
98
+ transactionRef: "TXN-20260105-005",
99
+ dobitUserId: 19,
100
+ appUserId: 57409243714,
101
+ serviceType: "airtime",
102
+ provider: "Airtel",
103
+ recipient: "+2348045215464",
104
+ packageName: null,
105
+ amount: 200.0,
106
+ discount: 0.0,
107
+ amountCharged: 200.0,
108
+ gatewayRef: "GW-AIRTEL-001",
109
+ gatewayResponse: "Failed",
110
+ status: "failed",
111
+ token: null,
112
+ metadata: null,
113
+ deviceId: "device-jerry-001",
114
+ ipAddress: "102.89.45.12",
115
+ createdAt: new Date("2026-05-01T08:00:00"),
116
+ updatedAt: new Date("2026-05-01T08:00:00"),
117
+ },
118
+
119
+ // ─── User 21 (appUserId: 52877742831) ───
120
+ {
121
+ transactionRef: "TXN-20260201-006",
122
+ dobitUserId: 21,
123
+ appUserId: 52877742831,
124
+ serviceType: "airtime",
125
+ provider: "Glo",
126
+ recipient: "+2347031001396",
127
+ packageName: null,
128
+ amount: 1000.0,
129
+ discount: 0.0,
130
+ amountCharged: 1000.0,
131
+ gatewayRef: "GW-GLO-001",
132
+ gatewayResponse: "Transaction successful",
133
+ status: "successful",
134
+ token: null,
135
+ metadata: JSON.stringify({ bonus: "2x airtime bonus" }),
136
+ deviceId: "device-isaka-001",
137
+ ipAddress: "197.210.55.34",
138
+ createdAt: new Date("2026-01-20T16:00:00"),
139
+ updatedAt: new Date("2026-01-20T16:00:00"),
140
+ },
141
+ {
142
+ transactionRef: "TXN-20260202-007",
143
+ dobitUserId: 21,
144
+ appUserId: 52877742831,
145
+ serviceType: "data",
146
+ provider: "Airtel",
147
+ recipient: "+2347031001396",
148
+ packageName: "2GB Weekly",
149
+ amount: 500.0,
150
+ discount: 0.0,
151
+ amountCharged: 500.0,
152
+ gatewayRef: "GW-AIRTEL-002",
153
+ gatewayResponse: "Transaction successful",
154
+ status: "successful",
155
+ token: null,
156
+ metadata: JSON.stringify({ validity: "7 days", dataMB: 2048 }),
157
+ deviceId: "device-isaka-001",
158
+ ipAddress: "197.210.55.34",
159
+ createdAt: new Date("2026-02-14T12:30:00"),
160
+ updatedAt: new Date("2026-02-14T12:30:00"),
161
+ },
162
+ {
163
+ transactionRef: "TXN-20260203-008",
164
+ dobitUserId: 21,
165
+ appUserId: 52877742831,
166
+ serviceType: "electricity",
167
+ provider: "IKEDC",
168
+ recipient: "12345678901",
169
+ packageName: null,
170
+ amount: 10000.0,
171
+ discount: 0.0,
172
+ amountCharged: 10000.0,
173
+ gatewayRef: "GW-IKEDC-001",
174
+ gatewayResponse: "Transaction successful",
175
+ status: "successful",
176
+ token: "1234-5678-9012-3456-7890",
177
+ metadata: JSON.stringify({
178
+ units: "95.6 kWh",
179
+ meterNumber: "12345678901",
180
+ }),
181
+ deviceId: "device-isaka-001",
182
+ ipAddress: "197.210.55.34",
183
+ createdAt: new Date("2026-03-18T10:00:00"),
184
+ updatedAt: new Date("2026-03-18T10:00:00"),
185
+ },
186
+ {
187
+ transactionRef: "TXN-20260204-009",
188
+ dobitUserId: 21,
189
+ appUserId: 52877742831,
190
+ serviceType: "betting",
191
+ provider: "Bet9ja",
192
+ recipient: "izaya4real",
193
+ packageName: null,
194
+ amount: 2000.0,
195
+ discount: 0.0,
196
+ amountCharged: 2000.0,
197
+ gatewayRef: "GW-BET9JA-001",
198
+ gatewayResponse: "Wallet funded",
199
+ status: "successful",
200
+ token: null,
201
+ metadata: JSON.stringify({
202
+ platform: "Bet9ja",
203
+ accountId: "izaya4real",
204
+ }),
205
+ deviceId: "device-isaka-001",
206
+ ipAddress: "197.210.55.34",
207
+ createdAt: new Date("2026-04-22T20:15:00"),
208
+ updatedAt: new Date("2026-04-22T20:15:00"),
209
+ },
210
+ {
211
+ transactionRef: "TXN-20260205-010",
212
+ dobitUserId: 21,
213
+ appUserId: 52877742831,
214
+ serviceType: "data",
215
+ provider: "MTN",
216
+ recipient: "+2347031001396",
217
+ packageName: "5GB Monthly",
218
+ amount: 2000.0,
219
+ discount: 0.0,
220
+ amountCharged: 2000.0,
221
+ gatewayRef: "GW-MTN-003",
222
+ gatewayResponse: "Pending confirmation",
223
+ status: "pending",
224
+ token: null,
225
+ metadata: null,
226
+ deviceId: "device-isaka-001",
227
+ ipAddress: "197.210.55.34",
228
+ createdAt: new Date("2026-05-20T07:45:00"),
229
+ updatedAt: new Date("2026-05-20T07:45:00"),
230
+ },
231
+ ]);
232
+ },
233
+
234
+ async down(queryInterface) {
235
+ await queryInterface.bulkDelete("Transactions", {
236
+ appUserId: { [require("sequelize").Op.in]: [57409243714, 52877742831] },
237
+ });
238
+ },
239
+ };
@@ -0,0 +1,239 @@
1
+ "use strict";
2
+
3
+ module.exports = {
4
+ async up(queryInterface) {
5
+ await queryInterface.bulkInsert("Transactions", [
6
+ // ─── User 17 (appUserId: 96506854015) ───
7
+ {
8
+ transactionRef: "TXN-20260101-011",
9
+ dobitUserId: 17,
10
+ appUserId: 96506854015,
11
+ serviceType: "airtime",
12
+ provider: "MTN",
13
+ recipient: "+2348045215464",
14
+ packageName: null,
15
+ amount: 500.0,
16
+ discount: 0.0,
17
+ amountCharged: 500.0,
18
+ gatewayRef: "GW-MTN-001",
19
+ gatewayResponse: "Transaction successful",
20
+ status: "successful",
21
+ token: null,
22
+ metadata: JSON.stringify({ bonus: "50MB data bonus" }),
23
+ deviceId: "device-jerry-001",
24
+ ipAddress: "102.89.45.12",
25
+ createdAt: new Date("2026-01-15T10:30:00"),
26
+ updatedAt: new Date("2026-01-15T10:30:00"),
27
+ },
28
+ {
29
+ transactionRef: "TXN-20260102-012",
30
+ dobitUserId: 17,
31
+ appUserId: 96506854015,
32
+ serviceType: "data",
33
+ provider: "MTN",
34
+ recipient: "+2348045215464",
35
+ packageName: "1GB Monthly",
36
+ amount: 1000.0,
37
+ discount: 0.0,
38
+ amountCharged: 1000.0,
39
+ gatewayRef: "GW-MTN-002",
40
+ gatewayResponse: "Transaction successful",
41
+ status: "successful",
42
+ token: null,
43
+ metadata: JSON.stringify({ validity: "30 days", dataMB: 1024 }),
44
+ deviceId: "device-jerry-001",
45
+ ipAddress: "102.89.45.12",
46
+ createdAt: new Date("2026-02-10T14:20:00"),
47
+ updatedAt: new Date("2026-02-10T14:20:00"),
48
+ },
49
+ {
50
+ transactionRef: "TXN-20260103-013",
51
+ dobitUserId: 17,
52
+ appUserId: 96506854015,
53
+ serviceType: "electricity",
54
+ provider: "EKEDC",
55
+ recipient: "45678901234",
56
+ packageName: null,
57
+ amount: 5000.0,
58
+ discount: 0.0,
59
+ amountCharged: 5000.0,
60
+ gatewayRef: "GW-EKEDC-001",
61
+ gatewayResponse: "Transaction successful",
62
+ status: "successful",
63
+ token: "4521-8734-9012-3456-7890",
64
+ metadata: JSON.stringify({
65
+ units: "45.2 kWh",
66
+ meterNumber: "45678901234",
67
+ }),
68
+ deviceId: "device-jerry-001",
69
+ ipAddress: "102.89.45.12",
70
+ createdAt: new Date("2026-03-05T09:15:00"),
71
+ updatedAt: new Date("2026-03-05T09:15:00"),
72
+ },
73
+ {
74
+ transactionRef: "TXN-20260104-014",
75
+ dobitUserId: 17,
76
+ appUserId: 96506854015,
77
+ serviceType: "cable_tv",
78
+ provider: "DSTV",
79
+ recipient: "7089123456",
80
+ packageName: "DStv Compact",
81
+ amount: 9000.0,
82
+ discount: 0.0,
83
+ amountCharged: 9000.0,
84
+ gatewayRef: "GW-DSTV-001",
85
+ gatewayResponse: "Subscription renewed",
86
+ status: "successful",
87
+ token: null,
88
+ metadata: JSON.stringify({
89
+ smartCardNumber: "7089123456",
90
+ expiryDate: "2026-04-05",
91
+ }),
92
+ deviceId: "device-jerry-001",
93
+ ipAddress: "102.89.45.12",
94
+ createdAt: new Date("2026-04-01T11:45:00"),
95
+ updatedAt: new Date("2026-04-01T11:45:00"),
96
+ },
97
+ {
98
+ transactionRef: "TXN-20260105-015",
99
+ dobitUserId: 17,
100
+ appUserId: 96506854015,
101
+ serviceType: "airtime",
102
+ provider: "Airtel",
103
+ recipient: "+2348045215464",
104
+ packageName: null,
105
+ amount: 200.0,
106
+ discount: 0.0,
107
+ amountCharged: 200.0,
108
+ gatewayRef: "GW-AIRTEL-001",
109
+ gatewayResponse: "Failed",
110
+ status: "failed",
111
+ token: null,
112
+ metadata: null,
113
+ deviceId: "device-jerry-001",
114
+ ipAddress: "102.89.45.12",
115
+ createdAt: new Date("2026-05-01T08:00:00"),
116
+ updatedAt: new Date("2026-05-01T08:00:00"),
117
+ },
118
+
119
+ // ─── User 20 (appUserId: 69550908102) ───
120
+ {
121
+ transactionRef: "TXN-20260201-016",
122
+ dobitUserId: 20,
123
+ appUserId: 69550908102,
124
+ serviceType: "airtime",
125
+ provider: "Glo",
126
+ recipient: "+2347031001396",
127
+ packageName: null,
128
+ amount: 1000.0,
129
+ discount: 0.0,
130
+ amountCharged: 1000.0,
131
+ gatewayRef: "GW-GLO-001",
132
+ gatewayResponse: "Transaction successful",
133
+ status: "successful",
134
+ token: null,
135
+ metadata: JSON.stringify({ bonus: "2x airtime bonus" }),
136
+ deviceId: "device-isaka-001",
137
+ ipAddress: "197.210.55.34",
138
+ createdAt: new Date("2026-01-20T16:00:00"),
139
+ updatedAt: new Date("2026-01-20T16:00:00"),
140
+ },
141
+ {
142
+ transactionRef: "TXN-20260202-017",
143
+ dobitUserId: 20,
144
+ appUserId: 69550908102,
145
+ serviceType: "data",
146
+ provider: "Airtel",
147
+ recipient: "+2347031001396",
148
+ packageName: "2GB Weekly",
149
+ amount: 500.0,
150
+ discount: 0.0,
151
+ amountCharged: 500.0,
152
+ gatewayRef: "GW-AIRTEL-002",
153
+ gatewayResponse: "Transaction successful",
154
+ status: "successful",
155
+ token: null,
156
+ metadata: JSON.stringify({ validity: "7 days", dataMB: 2048 }),
157
+ deviceId: "device-isaka-001",
158
+ ipAddress: "197.210.55.34",
159
+ createdAt: new Date("2026-02-14T12:30:00"),
160
+ updatedAt: new Date("2026-02-14T12:30:00"),
161
+ },
162
+ {
163
+ transactionRef: "TXN-20260203-018",
164
+ dobitUserId: 20,
165
+ appUserId: 69550908102,
166
+ serviceType: "electricity",
167
+ provider: "IKEDC",
168
+ recipient: "12345678901",
169
+ packageName: null,
170
+ amount: 10000.0,
171
+ discount: 0.0,
172
+ amountCharged: 10000.0,
173
+ gatewayRef: "GW-IKEDC-001",
174
+ gatewayResponse: "Transaction successful",
175
+ status: "successful",
176
+ token: "1234-5678-9012-3456-7890",
177
+ metadata: JSON.stringify({
178
+ units: "95.6 kWh",
179
+ meterNumber: "12345678901",
180
+ }),
181
+ deviceId: "device-isaka-001",
182
+ ipAddress: "197.210.55.34",
183
+ createdAt: new Date("2026-03-18T10:00:00"),
184
+ updatedAt: new Date("2026-03-18T10:00:00"),
185
+ },
186
+ {
187
+ transactionRef: "TXN-20260204-019",
188
+ dobitUserId: 20,
189
+ appUserId: 69550908102,
190
+ serviceType: "betting",
191
+ provider: "Bet9ja",
192
+ recipient: "izaya4real",
193
+ packageName: null,
194
+ amount: 2000.0,
195
+ discount: 0.0,
196
+ amountCharged: 2000.0,
197
+ gatewayRef: "GW-BET9JA-001",
198
+ gatewayResponse: "Wallet funded",
199
+ status: "successful",
200
+ token: null,
201
+ metadata: JSON.stringify({
202
+ platform: "Bet9ja",
203
+ accountId: "izaya4real",
204
+ }),
205
+ deviceId: "device-isaka-001",
206
+ ipAddress: "197.210.55.34",
207
+ createdAt: new Date("2026-04-22T20:15:00"),
208
+ updatedAt: new Date("2026-04-22T20:15:00"),
209
+ },
210
+ {
211
+ transactionRef: "TXN-20260205-020",
212
+ dobitUserId: 20,
213
+ appUserId: 69550908102,
214
+ serviceType: "data",
215
+ provider: "MTN",
216
+ recipient: "+2347031001396",
217
+ packageName: "5GB Monthly",
218
+ amount: 2000.0,
219
+ discount: 0.0,
220
+ amountCharged: 2000.0,
221
+ gatewayRef: "GW-MTN-003",
222
+ gatewayResponse: "Pending confirmation",
223
+ status: "reversed",
224
+ token: null,
225
+ metadata: null,
226
+ deviceId: "device-isaka-001",
227
+ ipAddress: "197.210.55.34",
228
+ createdAt: new Date("2026-05-20T07:45:00"),
229
+ updatedAt: new Date("2026-05-20T07:45:00"),
230
+ },
231
+ ]);
232
+ },
233
+
234
+ async down(queryInterface) {
235
+ await queryInterface.bulkDelete("Transactions", {
236
+ appUserId: { [require("sequelize").Op.in]: [96506854015, 69550908102] },
237
+ });
238
+ },
239
+ };