vr-migrations 1.0.20 → 1.0.22
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,345 @@
|
|
|
1
|
+
// migrations/XXXXXXXXXXXXXX-create-app-specs.js
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
up: async (queryInterface, Sequelize) => {
|
|
6
|
+
// Create ENUM types
|
|
7
|
+
await queryInterface.sequelize
|
|
8
|
+
.query(
|
|
9
|
+
`
|
|
10
|
+
CREATE TYPE "enum_app_specs_theme" AS ENUM ('light', 'dark', 'system');
|
|
11
|
+
CREATE TYPE "enum_app_specs_buttonStyle" AS ENUM ('rounded', 'square', 'pill');
|
|
12
|
+
CREATE TYPE "enum_app_specs_fontFamily" AS ENUM ('system', 'roboto', 'poppins', 'inter', 'montserrat');
|
|
13
|
+
`
|
|
14
|
+
)
|
|
15
|
+
.catch(() => {});
|
|
16
|
+
|
|
17
|
+
await queryInterface.createTable("app_specs", {
|
|
18
|
+
id: {
|
|
19
|
+
type: Sequelize.UUID,
|
|
20
|
+
defaultValue: Sequelize.UUIDV4,
|
|
21
|
+
primaryKey: true,
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
// App Identity
|
|
25
|
+
appName: {
|
|
26
|
+
type: Sequelize.STRING(100),
|
|
27
|
+
allowNull: false,
|
|
28
|
+
defaultValue: "VR App",
|
|
29
|
+
},
|
|
30
|
+
appShortName: { type: Sequelize.STRING(50), allowNull: true },
|
|
31
|
+
appDescription: { type: Sequelize.TEXT, allowNull: true },
|
|
32
|
+
appIcon: { type: Sequelize.STRING(500), allowNull: true },
|
|
33
|
+
appLogo: { type: Sequelize.STRING(500), allowNull: true },
|
|
34
|
+
appFavicon: { type: Sequelize.STRING(500), allowNull: true },
|
|
35
|
+
appSplashScreen: { type: Sequelize.STRING(500), allowNull: true },
|
|
36
|
+
appDefaultLanguage: {
|
|
37
|
+
type: Sequelize.STRING(10),
|
|
38
|
+
allowNull: false,
|
|
39
|
+
defaultValue: "en",
|
|
40
|
+
},
|
|
41
|
+
appSupportedLanguages: {
|
|
42
|
+
type: Sequelize.ARRAY(Sequelize.STRING(10)),
|
|
43
|
+
allowNull: false,
|
|
44
|
+
defaultValue: ["en", "fr"],
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
// Branding & Colors
|
|
48
|
+
primaryColor: {
|
|
49
|
+
type: Sequelize.STRING(7),
|
|
50
|
+
allowNull: false,
|
|
51
|
+
defaultValue: "#3B82F6",
|
|
52
|
+
},
|
|
53
|
+
secondaryColor: {
|
|
54
|
+
type: Sequelize.STRING(7),
|
|
55
|
+
allowNull: false,
|
|
56
|
+
defaultValue: "#10B981",
|
|
57
|
+
},
|
|
58
|
+
accentColor: {
|
|
59
|
+
type: Sequelize.STRING(7),
|
|
60
|
+
allowNull: false,
|
|
61
|
+
defaultValue: "#F59E0B",
|
|
62
|
+
},
|
|
63
|
+
successColor: {
|
|
64
|
+
type: Sequelize.STRING(7),
|
|
65
|
+
allowNull: false,
|
|
66
|
+
defaultValue: "#10B981",
|
|
67
|
+
},
|
|
68
|
+
errorColor: {
|
|
69
|
+
type: Sequelize.STRING(7),
|
|
70
|
+
allowNull: false,
|
|
71
|
+
defaultValue: "#EF4444",
|
|
72
|
+
},
|
|
73
|
+
warningColor: {
|
|
74
|
+
type: Sequelize.STRING(7),
|
|
75
|
+
allowNull: false,
|
|
76
|
+
defaultValue: "#F59E0B",
|
|
77
|
+
},
|
|
78
|
+
infoColor: {
|
|
79
|
+
type: Sequelize.STRING(7),
|
|
80
|
+
allowNull: false,
|
|
81
|
+
defaultValue: "#3B82F6",
|
|
82
|
+
},
|
|
83
|
+
backgroundColor: {
|
|
84
|
+
type: Sequelize.STRING(7),
|
|
85
|
+
allowNull: false,
|
|
86
|
+
defaultValue: "#FFFFFF",
|
|
87
|
+
},
|
|
88
|
+
textColor: {
|
|
89
|
+
type: Sequelize.STRING(7),
|
|
90
|
+
allowNull: false,
|
|
91
|
+
defaultValue: "#1F2937",
|
|
92
|
+
},
|
|
93
|
+
buttonColor: {
|
|
94
|
+
type: Sequelize.STRING(7),
|
|
95
|
+
allowNull: false,
|
|
96
|
+
defaultValue: "#3B82F6",
|
|
97
|
+
},
|
|
98
|
+
buttonTextColor: {
|
|
99
|
+
type: Sequelize.STRING(7),
|
|
100
|
+
allowNull: false,
|
|
101
|
+
defaultValue: "#FFFFFF",
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
// UI/UX
|
|
105
|
+
theme: {
|
|
106
|
+
type: Sequelize.ENUM("light", "dark", "system"),
|
|
107
|
+
allowNull: false,
|
|
108
|
+
defaultValue: "system",
|
|
109
|
+
},
|
|
110
|
+
buttonStyle: {
|
|
111
|
+
type: Sequelize.ENUM("rounded", "square", "pill"),
|
|
112
|
+
allowNull: false,
|
|
113
|
+
defaultValue: "rounded",
|
|
114
|
+
},
|
|
115
|
+
fontFamily: {
|
|
116
|
+
type: Sequelize.ENUM(
|
|
117
|
+
"system",
|
|
118
|
+
"roboto",
|
|
119
|
+
"poppins",
|
|
120
|
+
"inter",
|
|
121
|
+
"montserrat"
|
|
122
|
+
),
|
|
123
|
+
allowNull: false,
|
|
124
|
+
defaultValue: "system",
|
|
125
|
+
},
|
|
126
|
+
borderRadius: {
|
|
127
|
+
type: Sequelize.INTEGER,
|
|
128
|
+
allowNull: false,
|
|
129
|
+
defaultValue: 8,
|
|
130
|
+
},
|
|
131
|
+
enableAnimations: {
|
|
132
|
+
type: Sequelize.BOOLEAN,
|
|
133
|
+
allowNull: false,
|
|
134
|
+
defaultValue: true,
|
|
135
|
+
},
|
|
136
|
+
enablePushNotifications: {
|
|
137
|
+
type: Sequelize.BOOLEAN,
|
|
138
|
+
allowNull: false,
|
|
139
|
+
defaultValue: true,
|
|
140
|
+
},
|
|
141
|
+
enableEmailNotifications: {
|
|
142
|
+
type: Sequelize.BOOLEAN,
|
|
143
|
+
allowNull: false,
|
|
144
|
+
defaultValue: true,
|
|
145
|
+
},
|
|
146
|
+
enableSmsNotifications: {
|
|
147
|
+
type: Sequelize.BOOLEAN,
|
|
148
|
+
allowNull: false,
|
|
149
|
+
defaultValue: true,
|
|
150
|
+
},
|
|
151
|
+
|
|
152
|
+
// Legal Documents
|
|
153
|
+
privacyPolicy: { type: Sequelize.TEXT, allowNull: true },
|
|
154
|
+
privacyPolicyVersion: { type: Sequelize.STRING(20), allowNull: true },
|
|
155
|
+
privacyPolicyUpdatedAt: { type: Sequelize.DATE, allowNull: true },
|
|
156
|
+
|
|
157
|
+
termsAndConditions: { type: Sequelize.TEXT, allowNull: true },
|
|
158
|
+
termsAndConditionsVersion: {
|
|
159
|
+
type: Sequelize.STRING(20),
|
|
160
|
+
allowNull: true,
|
|
161
|
+
},
|
|
162
|
+
termsAndConditionsUpdatedAt: { type: Sequelize.DATE, allowNull: true },
|
|
163
|
+
|
|
164
|
+
aboutUs: { type: Sequelize.TEXT, allowNull: true },
|
|
165
|
+
aboutUsUpdatedAt: { type: Sequelize.DATE, allowNull: true },
|
|
166
|
+
|
|
167
|
+
cookiePolicy: { type: Sequelize.TEXT, allowNull: true },
|
|
168
|
+
cookiePolicyVersion: { type: Sequelize.STRING(20), allowNull: true },
|
|
169
|
+
cookiePolicyUpdatedAt: { type: Sequelize.DATE, allowNull: true },
|
|
170
|
+
|
|
171
|
+
refundPolicy: { type: Sequelize.TEXT, allowNull: true },
|
|
172
|
+
refundPolicyVersion: { type: Sequelize.STRING(20), allowNull: true },
|
|
173
|
+
refundPolicyUpdatedAt: { type: Sequelize.DATE, allowNull: true },
|
|
174
|
+
|
|
175
|
+
// App Metadata
|
|
176
|
+
appVersion: { type: Sequelize.STRING(20), allowNull: true },
|
|
177
|
+
minimumSupportedVersion: { type: Sequelize.STRING(20), allowNull: true },
|
|
178
|
+
latestVersion: { type: Sequelize.STRING(20), allowNull: true },
|
|
179
|
+
forceUpdate: {
|
|
180
|
+
type: Sequelize.BOOLEAN,
|
|
181
|
+
allowNull: false,
|
|
182
|
+
defaultValue: false,
|
|
183
|
+
},
|
|
184
|
+
|
|
185
|
+
// Social Links
|
|
186
|
+
facebookUrl: { type: Sequelize.STRING(255), allowNull: true },
|
|
187
|
+
twitterUrl: { type: Sequelize.STRING(255), allowNull: true },
|
|
188
|
+
instagramUrl: { type: Sequelize.STRING(255), allowNull: true },
|
|
189
|
+
linkedinUrl: { type: Sequelize.STRING(255), allowNull: true },
|
|
190
|
+
youtubeUrl: { type: Sequelize.STRING(255), allowNull: true },
|
|
191
|
+
websiteUrl: { type: Sequelize.STRING(255), allowNull: true },
|
|
192
|
+
supportEmail: { type: Sequelize.STRING(100), allowNull: true },
|
|
193
|
+
supportPhone: { type: Sequelize.STRING(20), allowNull: true },
|
|
194
|
+
|
|
195
|
+
// Contact Info
|
|
196
|
+
companyName: { type: Sequelize.STRING(200), allowNull: true },
|
|
197
|
+
companyAddress: { type: Sequelize.TEXT, allowNull: true },
|
|
198
|
+
companyEmail: { type: Sequelize.STRING(100), allowNull: true },
|
|
199
|
+
companyPhone: { type: Sequelize.STRING(20), allowNull: true },
|
|
200
|
+
companyTaxId: { type: Sequelize.STRING(50), allowNull: true },
|
|
201
|
+
|
|
202
|
+
// Feature Flags
|
|
203
|
+
enableRiderApp: {
|
|
204
|
+
type: Sequelize.BOOLEAN,
|
|
205
|
+
allowNull: false,
|
|
206
|
+
defaultValue: true,
|
|
207
|
+
},
|
|
208
|
+
enablePassengerApp: {
|
|
209
|
+
type: Sequelize.BOOLEAN,
|
|
210
|
+
allowNull: false,
|
|
211
|
+
defaultValue: true,
|
|
212
|
+
},
|
|
213
|
+
enableAgentApp: {
|
|
214
|
+
type: Sequelize.BOOLEAN,
|
|
215
|
+
allowNull: false,
|
|
216
|
+
defaultValue: true,
|
|
217
|
+
},
|
|
218
|
+
enableAdminDashboard: {
|
|
219
|
+
type: Sequelize.BOOLEAN,
|
|
220
|
+
allowNull: false,
|
|
221
|
+
defaultValue: true,
|
|
222
|
+
},
|
|
223
|
+
enableGuestCheckout: {
|
|
224
|
+
type: Sequelize.BOOLEAN,
|
|
225
|
+
allowNull: false,
|
|
226
|
+
defaultValue: false,
|
|
227
|
+
},
|
|
228
|
+
enableReferrals: {
|
|
229
|
+
type: Sequelize.BOOLEAN,
|
|
230
|
+
allowNull: false,
|
|
231
|
+
defaultValue: true,
|
|
232
|
+
},
|
|
233
|
+
enableWallet: {
|
|
234
|
+
type: Sequelize.BOOLEAN,
|
|
235
|
+
allowNull: false,
|
|
236
|
+
defaultValue: true,
|
|
237
|
+
},
|
|
238
|
+
enablePromoCodes: {
|
|
239
|
+
type: Sequelize.BOOLEAN,
|
|
240
|
+
allowNull: false,
|
|
241
|
+
defaultValue: true,
|
|
242
|
+
},
|
|
243
|
+
enableReviews: {
|
|
244
|
+
type: Sequelize.BOOLEAN,
|
|
245
|
+
allowNull: false,
|
|
246
|
+
defaultValue: true,
|
|
247
|
+
},
|
|
248
|
+
enableChat: {
|
|
249
|
+
type: Sequelize.BOOLEAN,
|
|
250
|
+
allowNull: false,
|
|
251
|
+
defaultValue: true,
|
|
252
|
+
},
|
|
253
|
+
enableVoiceCall: {
|
|
254
|
+
type: Sequelize.BOOLEAN,
|
|
255
|
+
allowNull: false,
|
|
256
|
+
defaultValue: true,
|
|
257
|
+
},
|
|
258
|
+
enableMaps: {
|
|
259
|
+
type: Sequelize.BOOLEAN,
|
|
260
|
+
allowNull: false,
|
|
261
|
+
defaultValue: true,
|
|
262
|
+
},
|
|
263
|
+
enablePayment: {
|
|
264
|
+
type: Sequelize.BOOLEAN,
|
|
265
|
+
allowNull: false,
|
|
266
|
+
defaultValue: true,
|
|
267
|
+
},
|
|
268
|
+
|
|
269
|
+
// Maintenance
|
|
270
|
+
isUnderMaintenance: {
|
|
271
|
+
type: Sequelize.BOOLEAN,
|
|
272
|
+
allowNull: false,
|
|
273
|
+
defaultValue: false,
|
|
274
|
+
},
|
|
275
|
+
maintenanceMessage: { type: Sequelize.TEXT, allowNull: true },
|
|
276
|
+
maintenanceStartAt: { type: Sequelize.DATE, allowNull: true },
|
|
277
|
+
maintenanceEndAt: { type: Sequelize.DATE, allowNull: true },
|
|
278
|
+
|
|
279
|
+
// Analytics
|
|
280
|
+
googleAnalyticsId: { type: Sequelize.STRING(50), allowNull: true },
|
|
281
|
+
facebookPixelId: { type: Sequelize.STRING(50), allowNull: true },
|
|
282
|
+
sentryDsn: { type: Sequelize.STRING(255), allowNull: true },
|
|
283
|
+
|
|
284
|
+
// Admin Info
|
|
285
|
+
updatedBy: {
|
|
286
|
+
type: Sequelize.UUID,
|
|
287
|
+
allowNull: true,
|
|
288
|
+
references: { model: "users", key: "id" },
|
|
289
|
+
},
|
|
290
|
+
version: { type: Sequelize.INTEGER, allowNull: false, defaultValue: 1 },
|
|
291
|
+
isActive: {
|
|
292
|
+
type: Sequelize.BOOLEAN,
|
|
293
|
+
allowNull: false,
|
|
294
|
+
defaultValue: true,
|
|
295
|
+
},
|
|
296
|
+
|
|
297
|
+
createdAt: {
|
|
298
|
+
type: Sequelize.DATE,
|
|
299
|
+
allowNull: false,
|
|
300
|
+
defaultValue: Sequelize.NOW,
|
|
301
|
+
},
|
|
302
|
+
updatedAt: {
|
|
303
|
+
type: Sequelize.DATE,
|
|
304
|
+
allowNull: false,
|
|
305
|
+
defaultValue: Sequelize.NOW,
|
|
306
|
+
},
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
// Add indexes
|
|
310
|
+
await queryInterface.addIndex("app_specs", ["isActive"], {
|
|
311
|
+
name: "app_specs_is_active_idx",
|
|
312
|
+
});
|
|
313
|
+
await queryInterface.addIndex("app_specs", ["version"], {
|
|
314
|
+
name: "app_specs_version_idx",
|
|
315
|
+
});
|
|
316
|
+
await queryInterface.addIndex("app_specs", ["updatedBy"], {
|
|
317
|
+
name: "app_specs_updated_by_idx",
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
// Insert default active spec
|
|
321
|
+
await queryInterface.bulkInsert("app_specs", [
|
|
322
|
+
{
|
|
323
|
+
id: "11111111-1111-1111-1111-111111111111",
|
|
324
|
+
appName: "VR App",
|
|
325
|
+
isActive: true,
|
|
326
|
+
version: 1,
|
|
327
|
+
createdAt: new Date(),
|
|
328
|
+
updatedAt: new Date(),
|
|
329
|
+
},
|
|
330
|
+
]);
|
|
331
|
+
},
|
|
332
|
+
|
|
333
|
+
down: async (queryInterface) => {
|
|
334
|
+
await queryInterface.dropTable("app_specs");
|
|
335
|
+
await queryInterface.sequelize.query(
|
|
336
|
+
`DROP TYPE IF EXISTS "enum_app_specs_theme";`
|
|
337
|
+
);
|
|
338
|
+
await queryInterface.sequelize.query(
|
|
339
|
+
`DROP TYPE IF EXISTS "enum_app_specs_buttonStyle";`
|
|
340
|
+
);
|
|
341
|
+
await queryInterface.sequelize.query(
|
|
342
|
+
`DROP TYPE IF EXISTS "enum_app_specs_fontFamily";`
|
|
343
|
+
);
|
|
344
|
+
},
|
|
345
|
+
};
|