careerty-prism 1.0.13 → 1.0.15
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/others/seeder.ts +874 -0
- package/package.json +9 -3
- package/prisma/schema.prisma +30 -16
package/others/seeder.ts
ADDED
|
@@ -0,0 +1,874 @@
|
|
|
1
|
+
import { PlanPerk, PrismaClient } from '@prisma/client';
|
|
2
|
+
const prisma = new PrismaClient()
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
async function getDefaultDocTemplte(tx: any, type: string) {
|
|
8
|
+
|
|
9
|
+
var result = await tx.template.findFirst({
|
|
10
|
+
where: {
|
|
11
|
+
isPaid: true,
|
|
12
|
+
isDeleted: false,
|
|
13
|
+
for: type
|
|
14
|
+
}
|
|
15
|
+
})
|
|
16
|
+
if (result)
|
|
17
|
+
return result.id;
|
|
18
|
+
|
|
19
|
+
return '1'
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async function getDefaultUserPlan(tx: any) {
|
|
24
|
+
var result = await tx.plan.findFirst({
|
|
25
|
+
where: {
|
|
26
|
+
name: 'Free Plan'
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
if (result)
|
|
30
|
+
return result.id
|
|
31
|
+
|
|
32
|
+
return '_'
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
async function plansPerks(tx: any) {
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
var planPerks = [
|
|
40
|
+
{
|
|
41
|
+
perk: {
|
|
42
|
+
key: 'num_of_cv',
|
|
43
|
+
name: 'num_of_cv',
|
|
44
|
+
description: 'num_of_cv',
|
|
45
|
+
value: '3',
|
|
46
|
+
},
|
|
47
|
+
translation: [
|
|
48
|
+
{
|
|
49
|
+
key: 'name',
|
|
50
|
+
value: "num of cv",
|
|
51
|
+
lang: "en"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
key: 'name',
|
|
55
|
+
value: "عدد مستندات السيرة الذاتية",
|
|
56
|
+
lang: "ar"
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
perk: {
|
|
62
|
+
key: 'gpt_points',
|
|
63
|
+
name: 'gpt_points',
|
|
64
|
+
description: 'gpt_points',
|
|
65
|
+
value: '5',
|
|
66
|
+
},
|
|
67
|
+
translation: [
|
|
68
|
+
{
|
|
69
|
+
key: 'name',
|
|
70
|
+
value: "GPT points",
|
|
71
|
+
lang: "en"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
key: 'name',
|
|
75
|
+
value: "نقاط GPT",
|
|
76
|
+
lang: "ar"
|
|
77
|
+
},
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
perk: {
|
|
82
|
+
key: 'num_of_cv_sections',
|
|
83
|
+
name: 'num_of_cv_sections',
|
|
84
|
+
description: 'num_of_cv_sections',
|
|
85
|
+
value: '3',
|
|
86
|
+
},
|
|
87
|
+
translation: [
|
|
88
|
+
{
|
|
89
|
+
key: 'name',
|
|
90
|
+
value: "Num of cv sections",
|
|
91
|
+
lang: "en"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
key: 'name',
|
|
95
|
+
value: "عدد عناصر السيرة الذاتية",
|
|
96
|
+
lang: "ar"
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
perk: {
|
|
106
|
+
key: 'price',
|
|
107
|
+
name: 'price',
|
|
108
|
+
description: 'price',
|
|
109
|
+
value: '0',
|
|
110
|
+
},
|
|
111
|
+
translation: [
|
|
112
|
+
{
|
|
113
|
+
key: 'name',
|
|
114
|
+
value: "price",
|
|
115
|
+
lang: "en"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
key: 'name',
|
|
119
|
+
value: "السعر",
|
|
120
|
+
lang: "ar"
|
|
121
|
+
},
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
perk: {
|
|
126
|
+
key: 'duration',
|
|
127
|
+
name: 'duration',
|
|
128
|
+
description: 'duration',
|
|
129
|
+
value: '0',
|
|
130
|
+
},
|
|
131
|
+
translation: [
|
|
132
|
+
{
|
|
133
|
+
key: 'name',
|
|
134
|
+
value: "duration",
|
|
135
|
+
lang: "en"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
key: 'name',
|
|
139
|
+
value: "المدة",
|
|
140
|
+
lang: "ar"
|
|
141
|
+
},
|
|
142
|
+
]
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
perk: {
|
|
146
|
+
key: 'num_of_cv_items',
|
|
147
|
+
name: 'num_of_cv_items',
|
|
148
|
+
description: 'num_of_cv_items',
|
|
149
|
+
value: '3',
|
|
150
|
+
},
|
|
151
|
+
translation: [
|
|
152
|
+
{
|
|
153
|
+
key: 'name',
|
|
154
|
+
value: "num_of_cv_items",
|
|
155
|
+
lang: "en"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
key: 'name',
|
|
159
|
+
value: "عدد عناصر اقسام السيرة الذاتية",
|
|
160
|
+
lang: "ar"
|
|
161
|
+
},
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
];
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
planPerks.forEach(async planPerk => {
|
|
171
|
+
var perk = await tx.planPerk.create({
|
|
172
|
+
data: {
|
|
173
|
+
key: planPerk.perk.key,
|
|
174
|
+
name: planPerk.perk.name,
|
|
175
|
+
description: planPerk.perk.description,
|
|
176
|
+
value: planPerk.perk.value,
|
|
177
|
+
status: true
|
|
178
|
+
}
|
|
179
|
+
})
|
|
180
|
+
|
|
181
|
+
planPerk.translation.forEach(async translation => {
|
|
182
|
+
await tx.planPerkTranlation.create({
|
|
183
|
+
data: {
|
|
184
|
+
key: translation.key,
|
|
185
|
+
value: translation.value,
|
|
186
|
+
lang: translation.lang,
|
|
187
|
+
planPerkId: perk.id
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
})
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
async function plans(tx: any) {
|
|
198
|
+
var plan = await tx.plan.create({
|
|
199
|
+
data: {
|
|
200
|
+
name: "Free Plan",
|
|
201
|
+
permalink: 'safdsad',
|
|
202
|
+
status: true,
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
await tx.planTranslation.createMany({
|
|
207
|
+
data: [
|
|
208
|
+
{
|
|
209
|
+
key: "name",
|
|
210
|
+
lang: "en",
|
|
211
|
+
planId: plan.id,
|
|
212
|
+
value: "Free plan"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
key: "name",
|
|
216
|
+
lang: "ar",
|
|
217
|
+
planId: plan.id,
|
|
218
|
+
value: "الخطة المجانية"
|
|
219
|
+
},
|
|
220
|
+
|
|
221
|
+
]
|
|
222
|
+
})
|
|
223
|
+
|
|
224
|
+
var perks: PlanPerk[] = await tx.planPerk.findMany();
|
|
225
|
+
for (const perk of perks) {
|
|
226
|
+
await tx.planPerkValue.create({
|
|
227
|
+
data: {
|
|
228
|
+
planId: plan.id,
|
|
229
|
+
planPerkId: perk.id,
|
|
230
|
+
value: perk.value,
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
async function mnPrograms() {
|
|
238
|
+
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
async function mentors() {
|
|
243
|
+
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
async function skillRepo(tx: any) {
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
var skills = [
|
|
250
|
+
{
|
|
251
|
+
skill: {
|
|
252
|
+
name: 'Html'
|
|
253
|
+
},
|
|
254
|
+
translation: [
|
|
255
|
+
{
|
|
256
|
+
key: 'name',
|
|
257
|
+
value: 'Html',
|
|
258
|
+
lang: "en"
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
key: 'name',
|
|
262
|
+
value: 'Html',
|
|
263
|
+
lang: "ar"
|
|
264
|
+
}
|
|
265
|
+
]
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
skill: {
|
|
269
|
+
name: 'PHP'
|
|
270
|
+
},
|
|
271
|
+
translation: [
|
|
272
|
+
{
|
|
273
|
+
key: 'name',
|
|
274
|
+
value: 'PHP',
|
|
275
|
+
lang: "en"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
key: 'name',
|
|
279
|
+
value: 'PHP',
|
|
280
|
+
lang: "ar"
|
|
281
|
+
}
|
|
282
|
+
]
|
|
283
|
+
},
|
|
284
|
+
];
|
|
285
|
+
|
|
286
|
+
for (const skill of skills) {
|
|
287
|
+
var savedSkill = await tx.skillRepo.create({
|
|
288
|
+
data: {
|
|
289
|
+
name: skill.skill.name, status: true,
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
for (const skillTranslation of skill.translation) {
|
|
295
|
+
await tx.skillRepoTranslation.create({
|
|
296
|
+
data: {
|
|
297
|
+
key: skillTranslation.key,
|
|
298
|
+
value: skillTranslation.value,
|
|
299
|
+
lang: skillTranslation.lang,
|
|
300
|
+
skillRepoId: savedSkill.id
|
|
301
|
+
}
|
|
302
|
+
})
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
async function colorRepo(tx: any) {
|
|
312
|
+
|
|
313
|
+
var colors = [
|
|
314
|
+
{
|
|
315
|
+
color: {
|
|
316
|
+
name: 'black',
|
|
317
|
+
hex: '#000000',
|
|
318
|
+
},
|
|
319
|
+
translation: [
|
|
320
|
+
{
|
|
321
|
+
value: 'الاسود',
|
|
322
|
+
lang: 'ar'
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
value: "black",
|
|
326
|
+
lang: "en"
|
|
327
|
+
}
|
|
328
|
+
]
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
color: {
|
|
332
|
+
name: 'red',
|
|
333
|
+
hex: '#FF0000',
|
|
334
|
+
},
|
|
335
|
+
translation: [
|
|
336
|
+
{
|
|
337
|
+
value: 'احمر',
|
|
338
|
+
lang: 'ar'
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
value: "red",
|
|
342
|
+
lang: "en"
|
|
343
|
+
}
|
|
344
|
+
]
|
|
345
|
+
},
|
|
346
|
+
];
|
|
347
|
+
|
|
348
|
+
for (const color of colors) {
|
|
349
|
+
var colorRepoItem = await tx.colorRepo.create({
|
|
350
|
+
data: {
|
|
351
|
+
name: color.color.name,
|
|
352
|
+
hex: color.color.hex,
|
|
353
|
+
status: true
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
|
|
357
|
+
for (const colorTranslatopn of color.translation) {
|
|
358
|
+
await tx.colorRepoTranslation.create({
|
|
359
|
+
data: {
|
|
360
|
+
key: 'name',
|
|
361
|
+
lang: colorTranslatopn.lang,
|
|
362
|
+
value: colorTranslatopn.value,
|
|
363
|
+
colorRepoId: colorRepoItem.id
|
|
364
|
+
}
|
|
365
|
+
})
|
|
366
|
+
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
async function fontsRepo(tx: any) {
|
|
373
|
+
|
|
374
|
+
var fonts = [
|
|
375
|
+
{
|
|
376
|
+
font: {
|
|
377
|
+
name: 'black',
|
|
378
|
+
},
|
|
379
|
+
translation: [
|
|
380
|
+
{
|
|
381
|
+
value: 'الاسود',
|
|
382
|
+
lang: 'ar'
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
value: "black",
|
|
386
|
+
lang: "en"
|
|
387
|
+
}
|
|
388
|
+
]
|
|
389
|
+
},
|
|
390
|
+
];
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
for (const font of fonts) {
|
|
394
|
+
var fontRepoItem = await tx.fontRepo.create({
|
|
395
|
+
data: {
|
|
396
|
+
name: font.font.name,
|
|
397
|
+
status: true
|
|
398
|
+
}
|
|
399
|
+
});
|
|
400
|
+
|
|
401
|
+
for (const fontTranslatopn of font.translation) {
|
|
402
|
+
await tx.fontRepoTranslation.create({
|
|
403
|
+
data: {
|
|
404
|
+
key: 'name',
|
|
405
|
+
lang: fontTranslatopn.lang,
|
|
406
|
+
value: fontTranslatopn.value,
|
|
407
|
+
fontRepoId: fontRepoItem.id
|
|
408
|
+
}
|
|
409
|
+
})
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
async function positionRepo(tx: any) {
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
async function cvTemplate(tx: any) {
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
var cvTemplateThumb = await tx.upload.create({
|
|
423
|
+
data: {
|
|
424
|
+
extention: 'png',
|
|
425
|
+
filename: 'test',
|
|
426
|
+
model: 'template',
|
|
427
|
+
modelId: 1,
|
|
428
|
+
path: '/test',
|
|
429
|
+
size: 22,
|
|
430
|
+
}
|
|
431
|
+
})
|
|
432
|
+
|
|
433
|
+
var cvTemplate = await tx.template.create({
|
|
434
|
+
data: {
|
|
435
|
+
name: "james",
|
|
436
|
+
description: 'lorem ipsun',
|
|
437
|
+
for: 'cv',
|
|
438
|
+
thumbnailId: cvTemplateThumb.id,
|
|
439
|
+
isPaid: false,
|
|
440
|
+
status: true,
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
var metas = [
|
|
447
|
+
{
|
|
448
|
+
key: 'font_color',
|
|
449
|
+
value: '1',
|
|
450
|
+
templateId: cvTemplate.id,
|
|
451
|
+
model: 'colorRepo'
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
key: 'font_type',
|
|
455
|
+
value: '1',
|
|
456
|
+
templateId: cvTemplate.id,
|
|
457
|
+
model: 'fontRepo'
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
key: 'background_color',
|
|
461
|
+
value: '1',
|
|
462
|
+
templateId: cvTemplate.id,
|
|
463
|
+
model: 'colorRepo'
|
|
464
|
+
}
|
|
465
|
+
];
|
|
466
|
+
|
|
467
|
+
await tx.templateMeta.createMany({
|
|
468
|
+
data: metas
|
|
469
|
+
})
|
|
470
|
+
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
async function clTemplate(tx: any) {
|
|
475
|
+
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
async function configs(tx: any) {
|
|
483
|
+
|
|
484
|
+
const defaultCvTemplate = await getDefaultDocTemplte(tx, 'cv');
|
|
485
|
+
const defaultClTemplate = await getDefaultDocTemplte(tx, 'cl');
|
|
486
|
+
const defaultUserPlan = await getDefaultUserPlan(tx);
|
|
487
|
+
|
|
488
|
+
var configs = [
|
|
489
|
+
{
|
|
490
|
+
configName: 'MaintenanceMode',
|
|
491
|
+
configValue: '1',
|
|
492
|
+
configType: 'general',
|
|
493
|
+
configStatus: 1,
|
|
494
|
+
configSubValue: '_',
|
|
495
|
+
configInput: 'switch',
|
|
496
|
+
configDesc: 'Maintenance Mode'
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
configName: 'DefaultUserPlan',
|
|
500
|
+
configValue: defaultUserPlan.toString(),
|
|
501
|
+
configType: 'general',
|
|
502
|
+
configStatus: 1,
|
|
503
|
+
configSubValue: '_',
|
|
504
|
+
configInput: 'select',
|
|
505
|
+
configDesc: 'Default User Plan'
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
configName: 'PayWithPayPal',
|
|
509
|
+
configValue: '1',
|
|
510
|
+
configType: 'general',
|
|
511
|
+
configStatus: 1,
|
|
512
|
+
configSubValue: '_',
|
|
513
|
+
configInput: 'switch',
|
|
514
|
+
configDesc: 'Enable Paypal Payment method'
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
configName: 'PaypalMode',
|
|
518
|
+
configValue: 'sandbox',
|
|
519
|
+
configType: 'general',
|
|
520
|
+
configStatus: 1,
|
|
521
|
+
configSubValue: '_',
|
|
522
|
+
configInput: 'switch',
|
|
523
|
+
configDesc: 'Paypal gateway Mode'
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
configName: 'PaypalCliID',
|
|
527
|
+
configValue: 'AQpSCYLR-kqiHBbfh6u71kVPFDXu0SxH2XtURgMKTdYx29L_t-0lbu2I9hvj-LONWt3hJAHh_8pojQsG',
|
|
528
|
+
configType: 'general',
|
|
529
|
+
configStatus: 1,
|
|
530
|
+
configSubValue: '_',
|
|
531
|
+
configInput: 'text',
|
|
532
|
+
configDesc: 'Paypal gateway client ID'
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
configName: 'PaypalSecID',
|
|
536
|
+
configValue: 'EHaUlC1JDqMwWKpML8Wtdl83w-JXER88s7TC9MnlYWGtADE7q_rQ4HBfU-1dFJkkKYFITA2udODQIrpU',
|
|
537
|
+
configType: 'general',
|
|
538
|
+
configStatus: 1,
|
|
539
|
+
configSubValue: '_',
|
|
540
|
+
configInput: 'text',
|
|
541
|
+
configDesc: 'Paypal gateway secret ID'
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
configName: 'PayWithStripe',
|
|
545
|
+
configValue: '1',
|
|
546
|
+
configType: 'general',
|
|
547
|
+
configStatus: 1,
|
|
548
|
+
configSubValue: '_',
|
|
549
|
+
configInput: 'switch',
|
|
550
|
+
configDesc: 'Enable Stripe payment method'
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
configName: 'StripeCliID',
|
|
554
|
+
configValue: 'pk_test_51KmOpKK1KBDoE0PiPulwQ4IkYzmDDxhOYKxDN4bIAf6JFp17oBBpmbFJ6WxA6qhUkhlUqmH3EuFCFLAaOSNwHACX009jVLnVoi',
|
|
555
|
+
configType: 'general',
|
|
556
|
+
configStatus: 1,
|
|
557
|
+
configSubValue: '_',
|
|
558
|
+
configInput: 'text',
|
|
559
|
+
configDesc: 'Stripe gateway client ID'
|
|
560
|
+
},
|
|
561
|
+
{
|
|
562
|
+
configName: 'StripeSecID',
|
|
563
|
+
configValue: 'sk_test_51KmOpKK1KBDoE0PiUd7Jte5VgPaC3cFXo2USZQj89GpLer0BVitWVaVf6bcHO7V74OAnX1VLh9diCkyNMI9OIlTD00Hf7kcsZV',
|
|
564
|
+
configType: 'general',
|
|
565
|
+
configStatus: 1,
|
|
566
|
+
configSubValue: '_',
|
|
567
|
+
configInput: 'text',
|
|
568
|
+
configDesc: 'Stripe gateway secret ID'
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
configName: 'PayWithSyriatel',
|
|
572
|
+
configValue: '1',
|
|
573
|
+
configType: 'general',
|
|
574
|
+
configStatus: 1,
|
|
575
|
+
configSubValue: '_',
|
|
576
|
+
configInput: 'switch',
|
|
577
|
+
configDesc: 'Enable Syriatel cash Payment method'
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
configName: 'PayWithMtn',
|
|
581
|
+
configValue: '1',
|
|
582
|
+
configType: 'general',
|
|
583
|
+
configStatus: 1,
|
|
584
|
+
configSubValue: '_',
|
|
585
|
+
configInput: 'switch',
|
|
586
|
+
configDesc: 'Enable Mtn cash Payment method'
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
configName: 'DefaultLanguage',
|
|
590
|
+
configValue: 'en',
|
|
591
|
+
configType: 'general',
|
|
592
|
+
configStatus: 1,
|
|
593
|
+
configSubValue: 'usd',
|
|
594
|
+
configInput: 'select',
|
|
595
|
+
configDesc: 'Default Front-end Display Language'
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
configName: 'DefaultCvTemplate',
|
|
599
|
+
configValue: defaultCvTemplate.toString(),
|
|
600
|
+
configType: 'general',
|
|
601
|
+
configStatus: 1,
|
|
602
|
+
configSubValue: '_',
|
|
603
|
+
configInput: 'select',
|
|
604
|
+
configDesc: 'Default Cv Template'
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
configName: 'DefaultClTemplate',
|
|
608
|
+
configValue: defaultClTemplate.toString(),
|
|
609
|
+
configType: 'general',
|
|
610
|
+
configStatus: 1,
|
|
611
|
+
configSubValue: '_',
|
|
612
|
+
configInput: 'select',
|
|
613
|
+
configDesc: 'Default Cover Letter Template'
|
|
614
|
+
},
|
|
615
|
+
{
|
|
616
|
+
configName: 'daysToMentorWithdraw',
|
|
617
|
+
configValue: '2',
|
|
618
|
+
configType: 'general',
|
|
619
|
+
configStatus: 1,
|
|
620
|
+
configSubValue: '_',
|
|
621
|
+
configInput: 'number',
|
|
622
|
+
configDesc: 'Mentor Withdraw Days Limit Peroid'
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
configName: 'MentorMinimumWithdrawAmount',
|
|
626
|
+
configValue: '20',
|
|
627
|
+
configType: 'general',
|
|
628
|
+
configStatus: 1,
|
|
629
|
+
configSubValue: '_',
|
|
630
|
+
configInput: 'number',
|
|
631
|
+
configDesc: 'Mentor Minimum withdraw amount'
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
configName: 'GoogleDriveCliID',
|
|
635
|
+
configValue: '460388232750-4ppr2ilvejsqjbaj5qvulajkd62l8fpb.apps.googleusercontent.com',
|
|
636
|
+
configType: 'general',
|
|
637
|
+
configStatus: 1,
|
|
638
|
+
configSubValue: '_',
|
|
639
|
+
configInput: 'text',
|
|
640
|
+
configDesc: 'Google Drive Client ID'
|
|
641
|
+
},
|
|
642
|
+
{
|
|
643
|
+
configName: 'GoogleDriveSecID',
|
|
644
|
+
configValue: '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',
|
|
645
|
+
configType: 'general',
|
|
646
|
+
configStatus: 1,
|
|
647
|
+
configSubValue: '_',
|
|
648
|
+
configInput: 'text',
|
|
649
|
+
configDesc: 'Google Drive Secret ID'
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
configName: 'GoogleDriveRefID',
|
|
653
|
+
configValue: '1//049ujCJrSfPlPCgYIARAAGAQSNwF-L9IrjNsdI-hyD8iCMH6bpCaIwBEjExntgJ9tjhfoMATJkJ0AgFiwkRpW9f6CE4Uuwxs92Co',
|
|
654
|
+
configType: 'general',
|
|
655
|
+
configStatus: 1,
|
|
656
|
+
configSubValue: '_',
|
|
657
|
+
configInput: 'text',
|
|
658
|
+
configDesc: 'Google Drive Refersh token'
|
|
659
|
+
},
|
|
660
|
+
{
|
|
661
|
+
configName: 'GoogleDriveRedirect',
|
|
662
|
+
configValue: 'https://developers.google.com/oauthplayground',
|
|
663
|
+
configType: 'general',
|
|
664
|
+
configStatus: 1,
|
|
665
|
+
configSubValue: '_',
|
|
666
|
+
configInput: 'text',
|
|
667
|
+
configDesc: 'Google Drive Refersh Redirect url'
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
configName: 'AuthenticateWithGithub',
|
|
671
|
+
configValue: '0',
|
|
672
|
+
configType: 'general',
|
|
673
|
+
configStatus: 1,
|
|
674
|
+
configSubValue: '_',
|
|
675
|
+
configInput: 'switch',
|
|
676
|
+
configDesc: 'Control User Authentication with Github'
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
configName: 'GitHubCliID',
|
|
680
|
+
configValue: 'aace6b14e72bc4b50b44',
|
|
681
|
+
configType: 'general',
|
|
682
|
+
configStatus: 1,
|
|
683
|
+
configSubValue: '_',
|
|
684
|
+
configInput: 'text',
|
|
685
|
+
configDesc: 'Github Authentication Client ID'
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
configName: 'GitHubSecID',
|
|
689
|
+
configValue: 'fd87cfd4ea0b9be2a04bf903e759ce2023b812b5',
|
|
690
|
+
configType: 'general',
|
|
691
|
+
configStatus: 1,
|
|
692
|
+
configSubValue: '_',
|
|
693
|
+
configInput: 'text',
|
|
694
|
+
configDesc: 'Github Authentication Secret ID'
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
configName: 'GitHubRedirect',
|
|
698
|
+
configValue: 'http://127.0.0.1:8080/login/github',
|
|
699
|
+
configType: 'general',
|
|
700
|
+
configStatus: 1,
|
|
701
|
+
configSubValue: '_',
|
|
702
|
+
configInput: 'text',
|
|
703
|
+
configDesc: 'Github Authentication Redirect url'
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
configName: 'AuthenticateWithGoogle',
|
|
707
|
+
configValue: '0',
|
|
708
|
+
configType: 'general',
|
|
709
|
+
configStatus: 1,
|
|
710
|
+
configSubValue: '_',
|
|
711
|
+
configInput: 'switch',
|
|
712
|
+
configDesc: 'Control User Authentication with Google'
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
configName: 'GoogleCliID',
|
|
716
|
+
configValue: '460388232750-j8p6acb6amiitmpic6qte5ibvcp9ikv5.apps.googleusercontent.com',
|
|
717
|
+
configType: 'general',
|
|
718
|
+
configStatus: 1,
|
|
719
|
+
configSubValue: '_',
|
|
720
|
+
configInput: 'text',
|
|
721
|
+
configDesc: 'Google Authentication Client ID'
|
|
722
|
+
},
|
|
723
|
+
{
|
|
724
|
+
configName: 'GoogleSecID',
|
|
725
|
+
configValue: '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',
|
|
726
|
+
configType: 'general',
|
|
727
|
+
configStatus: 1,
|
|
728
|
+
configSubValue: '_',
|
|
729
|
+
configInput: 'text',
|
|
730
|
+
configDesc: 'Google Authentication Secret ID'
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
configName: 'GoogleRedirect',
|
|
734
|
+
configValue: 'http://127.0.0.1:8080/login/google',
|
|
735
|
+
configType: 'general',
|
|
736
|
+
configStatus: 1,
|
|
737
|
+
configSubValue: '_',
|
|
738
|
+
configInput: 'text',
|
|
739
|
+
configDesc: 'Google Authentication Redirect url'
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
configName: 'AuthenticateWithLinkedin',
|
|
743
|
+
configValue: '0',
|
|
744
|
+
configType: 'general',
|
|
745
|
+
configStatus: 1,
|
|
746
|
+
configSubValue: '_',
|
|
747
|
+
configInput: 'switch',
|
|
748
|
+
configDesc: 'Control User Authentication with Linkedin'
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
configName: 'LinkedInCliID',
|
|
752
|
+
configValue: '86ztw48x0nrxb7',
|
|
753
|
+
configType: 'general',
|
|
754
|
+
configStatus: 1,
|
|
755
|
+
configSubValue: '_',
|
|
756
|
+
configInput: 'text',
|
|
757
|
+
configDesc: 'Linkedin Authentication Client ID'
|
|
758
|
+
},
|
|
759
|
+
{
|
|
760
|
+
configName: 'LinkedInSecID',
|
|
761
|
+
configValue: '5esor1Dw9biMq4lk',
|
|
762
|
+
configType: 'general',
|
|
763
|
+
configStatus: 1,
|
|
764
|
+
configSubValue: '_',
|
|
765
|
+
configInput: 'text',
|
|
766
|
+
configDesc: 'Linkedin Authentication Secret ID'
|
|
767
|
+
},
|
|
768
|
+
{
|
|
769
|
+
configName: 'LinkedInRedirect',
|
|
770
|
+
configValue: 'http://127.0.0.1:8080/login/linkedin',
|
|
771
|
+
configType: 'general',
|
|
772
|
+
configStatus: 1,
|
|
773
|
+
configSubValue: '_',
|
|
774
|
+
configInput: 'text',
|
|
775
|
+
configDesc: 'Linkedin Authentication Redirect url'
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
configName: 'PostDefaultThumbnail',
|
|
779
|
+
configValue: '1kEduqwKdqEgpe1bAlJEwN70WmZ6uivl4',
|
|
780
|
+
configType: 'drive',
|
|
781
|
+
configStatus: 1,
|
|
782
|
+
configSubValue: '_',
|
|
783
|
+
configInput: 'text',
|
|
784
|
+
configDesc: 'Post Default Thumbnail'
|
|
785
|
+
},
|
|
786
|
+
{
|
|
787
|
+
configName: 'ProgramDefaultThumbnail',
|
|
788
|
+
configValue: '1tJ9i5DDyfzEDPlamTyxGjuUHKNLMwJn0',
|
|
789
|
+
configType: 'drive',
|
|
790
|
+
configStatus: 1,
|
|
791
|
+
configSubValue: '_',
|
|
792
|
+
configInput: 'text',
|
|
793
|
+
configDesc: 'mentorships programs default thumbnails'
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
configName: 'TemplateDefaultThumbnail',
|
|
797
|
+
configValue: '1mUqMeMEVG8QBIOKlHDVH6oa50sHOXuTj',
|
|
798
|
+
configType: 'drive',
|
|
799
|
+
configStatus: 1,
|
|
800
|
+
configSubValue: '_',
|
|
801
|
+
configInput: 'text',
|
|
802
|
+
configDesc: 'templates default thumbnail'
|
|
803
|
+
},
|
|
804
|
+
{
|
|
805
|
+
configName: 'MentorDefaultThumbnail',
|
|
806
|
+
configValue: '1_yTOqQJUqdvnSYBy00kWYTh2xZEzWMnJ',
|
|
807
|
+
configType: 'drive',
|
|
808
|
+
configStatus: 1,
|
|
809
|
+
configSubValue: '_',
|
|
810
|
+
configInput: 'text',
|
|
811
|
+
configDesc: 'mentor default thumbnail'
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
configName: 'ServiceDefaultThumbnail',
|
|
815
|
+
configValue: '1_yTOqQJUqdvnSYBy00kWYTh2xZEzWMnJ',
|
|
816
|
+
configType: 'drive',
|
|
817
|
+
configStatus: 1,
|
|
818
|
+
configSubValue: '_',
|
|
819
|
+
configInput: 'text',
|
|
820
|
+
configDesc: 'service default thumbnail'
|
|
821
|
+
},
|
|
822
|
+
|
|
823
|
+
]
|
|
824
|
+
|
|
825
|
+
await tx.config.createMany({
|
|
826
|
+
data: configs
|
|
827
|
+
});
|
|
828
|
+
|
|
829
|
+
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
|
|
833
|
+
|
|
834
|
+
|
|
835
|
+
|
|
836
|
+
|
|
837
|
+
async function main() {
|
|
838
|
+
|
|
839
|
+
//configs seeder
|
|
840
|
+
try {
|
|
841
|
+
|
|
842
|
+
await prisma.$transaction(async (tx) => {
|
|
843
|
+
await plansPerks(tx);
|
|
844
|
+
await plans(tx);
|
|
845
|
+
await skillRepo(tx);
|
|
846
|
+
await colorRepo(tx);
|
|
847
|
+
await fontsRepo(tx);
|
|
848
|
+
await cvTemplate(tx);
|
|
849
|
+
await configs(tx);
|
|
850
|
+
});
|
|
851
|
+
console.error('done');
|
|
852
|
+
|
|
853
|
+
|
|
854
|
+
} catch (error) {
|
|
855
|
+
console.log(error);
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
main().catch((e) => {
|
|
862
|
+
console.error(e);
|
|
863
|
+
process.exit(1);
|
|
864
|
+
}).finally(async () => {
|
|
865
|
+
await prisma.$disconnect();
|
|
866
|
+
});
|
|
867
|
+
|
|
868
|
+
|
|
869
|
+
|
|
870
|
+
|
|
871
|
+
|
|
872
|
+
|
|
873
|
+
|
|
874
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "careerty-prism",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -8,14 +8,20 @@
|
|
|
8
8
|
"generate": "npx prisma generate",
|
|
9
9
|
"postinstall": "npm run generate"
|
|
10
10
|
},
|
|
11
|
+
"prisma": {
|
|
12
|
+
"seed": "ts-node others/seeder.ts"
|
|
13
|
+
},
|
|
11
14
|
"author": "",
|
|
12
15
|
"license": "ISC",
|
|
13
16
|
"devDependencies": {
|
|
14
|
-
"prisma": "^5.16.1",
|
|
15
17
|
"@prisma/client": "^5.16.1",
|
|
18
|
+
"prisma": "^5.16.1",
|
|
16
19
|
"typescript": "^5.5.3"
|
|
17
|
-
},
|
|
20
|
+
},
|
|
18
21
|
"peerDependencies": {
|
|
19
22
|
"@prisma/client": ">=5"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"ts-node": "^10.9.2"
|
|
20
26
|
}
|
|
21
27
|
}
|
package/prisma/schema.prisma
CHANGED
|
@@ -70,13 +70,13 @@ enum ApprovalRequestModel {
|
|
|
70
70
|
MENTOR
|
|
71
71
|
MNPROGRAM
|
|
72
72
|
}
|
|
73
|
+
|
|
73
74
|
enum ApprovalRequestState {
|
|
74
75
|
PENDING
|
|
75
76
|
APPROVED
|
|
76
77
|
REJECTED
|
|
77
78
|
}
|
|
78
79
|
|
|
79
|
-
|
|
80
80
|
model Config {
|
|
81
81
|
id Int @id @default(autoincrement())
|
|
82
82
|
configName String @unique
|
|
@@ -319,6 +319,7 @@ model CV {
|
|
|
319
319
|
references CvReference[]
|
|
320
320
|
contacts CvContact[]
|
|
321
321
|
metas CvMeta[]
|
|
322
|
+
CvCertificate CvCertificate[]
|
|
322
323
|
createdAt DateTime @default(now())
|
|
323
324
|
updatedAt DateTime @updatedAt
|
|
324
325
|
chat AiCvChat?
|
|
@@ -327,7 +328,7 @@ model CV {
|
|
|
327
328
|
model CvExperience {
|
|
328
329
|
id Int @id @default(autoincrement())
|
|
329
330
|
title String?
|
|
330
|
-
description String?
|
|
331
|
+
description String? @db.LongText
|
|
331
332
|
at String?
|
|
332
333
|
from DateTime?
|
|
333
334
|
to DateTime?
|
|
@@ -340,7 +341,7 @@ model CvExperience {
|
|
|
340
341
|
model CvEducation {
|
|
341
342
|
id Int @id @default(autoincrement())
|
|
342
343
|
title String?
|
|
343
|
-
description String?
|
|
344
|
+
description String? @db.LongText
|
|
344
345
|
at String?
|
|
345
346
|
from DateTime?
|
|
346
347
|
to DateTime?
|
|
@@ -364,7 +365,7 @@ model CvContact {
|
|
|
364
365
|
model CvSkill {
|
|
365
366
|
id Int @id @default(autoincrement())
|
|
366
367
|
title String?
|
|
367
|
-
description String?
|
|
368
|
+
description String? @db.LongText
|
|
368
369
|
value String?
|
|
369
370
|
color String
|
|
370
371
|
sort Int
|
|
@@ -375,7 +376,7 @@ model CvSkill {
|
|
|
375
376
|
model CvProject {
|
|
376
377
|
id Int @id @default(autoincrement())
|
|
377
378
|
title String?
|
|
378
|
-
description String?
|
|
379
|
+
description String? @db.LongText
|
|
379
380
|
job String?
|
|
380
381
|
date DateTime?
|
|
381
382
|
sort Int
|
|
@@ -386,7 +387,7 @@ model CvProject {
|
|
|
386
387
|
model CvOrganization {
|
|
387
388
|
id Int @id @default(autoincrement())
|
|
388
389
|
title String?
|
|
389
|
-
description String?
|
|
390
|
+
description String? @db.LongText
|
|
390
391
|
job String?
|
|
391
392
|
from DateTime?
|
|
392
393
|
to DateTime?
|
|
@@ -399,7 +400,7 @@ model CvOrganization {
|
|
|
399
400
|
model CvAward {
|
|
400
401
|
id Int @id @default(autoincrement())
|
|
401
402
|
title String?
|
|
402
|
-
description String?
|
|
403
|
+
description String? @db.LongText
|
|
403
404
|
job String?
|
|
404
405
|
date DateTime?
|
|
405
406
|
sort Int
|
|
@@ -421,6 +422,20 @@ model CvReference {
|
|
|
421
422
|
cvId Int
|
|
422
423
|
}
|
|
423
424
|
|
|
425
|
+
model CvCertificate {
|
|
426
|
+
id Int @id @default(autoincrement())
|
|
427
|
+
title String?
|
|
428
|
+
issuer String?
|
|
429
|
+
from DateTime?
|
|
430
|
+
to DateTime?
|
|
431
|
+
credentialId String?
|
|
432
|
+
credentialUrl String?
|
|
433
|
+
sort Int
|
|
434
|
+
status Int
|
|
435
|
+
CV CV @relation(fields: [cvId], references: [id])
|
|
436
|
+
cvId Int
|
|
437
|
+
}
|
|
438
|
+
|
|
424
439
|
model CvMeta {
|
|
425
440
|
id Int @id @default(autoincrement())
|
|
426
441
|
key String
|
|
@@ -548,7 +563,7 @@ model MentorAvailablitySlot {
|
|
|
548
563
|
model Service {
|
|
549
564
|
id Int @id @default(autoincrement())
|
|
550
565
|
name String
|
|
551
|
-
description String
|
|
566
|
+
description String @db.LongText
|
|
552
567
|
fullPrice Int
|
|
553
568
|
commission Int
|
|
554
569
|
status Boolean @default(false)
|
|
@@ -602,7 +617,7 @@ model ServiceRequest {
|
|
|
602
617
|
model MnProgram {
|
|
603
618
|
id Int @id @default(autoincrement())
|
|
604
619
|
name String
|
|
605
|
-
description String
|
|
620
|
+
description String @db.LongText
|
|
606
621
|
status Boolean @default(false)
|
|
607
622
|
folder String
|
|
608
623
|
meetCount Int
|
|
@@ -889,11 +904,10 @@ model SkillRepoTranslation {
|
|
|
889
904
|
SkillRepo SkillRepo @relation(fields: [skillRepoId], references: [id])
|
|
890
905
|
}
|
|
891
906
|
|
|
892
|
-
|
|
893
907
|
model ApprovalRequest {
|
|
894
|
-
id
|
|
895
|
-
model
|
|
896
|
-
modelId
|
|
897
|
-
stautus
|
|
898
|
-
changes
|
|
899
|
-
}
|
|
908
|
+
id Int @id @default(autoincrement())
|
|
909
|
+
model ApprovalRequestModel
|
|
910
|
+
modelId Int?
|
|
911
|
+
stautus ApprovalRequestState @default(PENDING)
|
|
912
|
+
changes String @db.LongText
|
|
913
|
+
}
|