@campus-labs/prisma-client 0.11.0 → 0.12.0
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/.claude/settings.local.json +11 -0
- package/package.json +1 -1
- package/prisma/schema.prisma +59 -25
- package/prisma/seed2.ts +30 -12
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(ls -la /Users/nunomatos/Desktop/SerMais/prisma/.env*)",
|
|
5
|
+
"Bash(git check-ignore -v /Users/nunomatos/Desktop/SerMais/prisma/.env.staging)",
|
|
6
|
+
"Bash(git check-ignore -v .env.staging)",
|
|
7
|
+
"Bash(ls -la /Users/nunomatos/Desktop/SerMais/prisma/*.ts /Users/nunomatos/Desktop/SerMais/prisma/*.js)",
|
|
8
|
+
"Bash(grep -r \"\\\\.password\" /Users/nunomatos/Desktop/SerMais --include=\"*.ts\" --include=\"*.js\" ! -path \"*/node_modules/*\" ! -path \"*/.next/*\" ! -path \"*/dist/*\")"
|
|
9
|
+
]
|
|
10
|
+
}
|
|
11
|
+
}
|
package/package.json
CHANGED
package/prisma/schema.prisma
CHANGED
|
@@ -122,9 +122,6 @@ model initiatives {
|
|
|
122
122
|
start_date DateTime @db.Timestamp(6)
|
|
123
123
|
end_date DateTime @db.Timestamp(6)
|
|
124
124
|
is_private Boolean @default(false)
|
|
125
|
-
is_draft Boolean @default(true)
|
|
126
|
-
is_model Boolean @default(false)
|
|
127
|
-
is_approved Boolean @default(false)
|
|
128
125
|
program_id Int?
|
|
129
126
|
area_id Int?
|
|
130
127
|
typology_id Int
|
|
@@ -369,6 +366,8 @@ model users {
|
|
|
369
366
|
wallet_passes wallet_passes[]
|
|
370
367
|
feedbackInitiatives feedback_initiative[]
|
|
371
368
|
power_up_instances power_up_instances[]
|
|
369
|
+
expelled_user_initiatives user_initiative[] @relation("UserInitiativeExpeller")
|
|
370
|
+
projects projects[]
|
|
372
371
|
|
|
373
372
|
@@index([role_platform_id], map: "idx_users_role")
|
|
374
373
|
@@index([points(sort: Desc)], map: "idx_users_points")
|
|
@@ -400,10 +399,14 @@ model user_initiative {
|
|
|
400
399
|
created_at DateTime @default(now()) @db.Timestamp(6)
|
|
401
400
|
updated_at DateTime @default(now()) @db.Timestamp(6)
|
|
402
401
|
deleted_at DateTime? @db.Timestamp(6)
|
|
402
|
+
expulsion_reason String? @db.VarChar(100)
|
|
403
|
+
expulsion_justification String? @db.VarChar(1000)
|
|
404
|
+
expelled_by_user_id String? @db.VarChar(50)
|
|
403
405
|
points Int @default(0)
|
|
404
406
|
initiatives initiatives @relation(fields: [initiative_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
405
407
|
roles_initiatives roles_initiatives @relation(fields: [role_initiative_id], references: [id], onDelete: Restrict, onUpdate: Cascade)
|
|
406
408
|
users users @relation(fields: [user_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
409
|
+
expelled_user_id users? @relation("UserInitiativeExpeller", fields: [expelled_by_user_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
407
410
|
|
|
408
411
|
@@id([user_id, initiative_id])
|
|
409
412
|
@@index([user_id, role_initiative_id], map: "idx_user_initiative_user_role")
|
|
@@ -568,20 +571,20 @@ model feedback_initiative {
|
|
|
568
571
|
}
|
|
569
572
|
|
|
570
573
|
model power_up_definitions {
|
|
571
|
-
id Int
|
|
572
|
-
slug String
|
|
573
|
-
title String
|
|
574
|
-
description String
|
|
574
|
+
id Int @id @default(autoincrement())
|
|
575
|
+
slug String @unique @db.VarChar(50)
|
|
576
|
+
title String @db.VarChar(100)
|
|
577
|
+
description String @db.VarChar(3000)
|
|
575
578
|
img Json
|
|
576
579
|
base_percentage Float
|
|
577
580
|
duration_days Int?
|
|
578
|
-
duration_type String
|
|
581
|
+
duration_type String @default("FIXED_DAYS") @db.VarChar(20)
|
|
579
582
|
conditions Json
|
|
580
583
|
bonus_rule Json?
|
|
581
|
-
is_active Boolean
|
|
582
|
-
created_at DateTime
|
|
583
|
-
updated_at DateTime
|
|
584
|
-
deleted_at DateTime?
|
|
584
|
+
is_active Boolean @default(true)
|
|
585
|
+
created_at DateTime @default(now()) @db.Timestamp(6)
|
|
586
|
+
updated_at DateTime @default(now()) @db.Timestamp(6)
|
|
587
|
+
deleted_at DateTime? @db.Timestamp(6)
|
|
585
588
|
|
|
586
589
|
instances power_up_instances[]
|
|
587
590
|
|
|
@@ -590,20 +593,20 @@ model power_up_definitions {
|
|
|
590
593
|
}
|
|
591
594
|
|
|
592
595
|
model power_up_instances {
|
|
593
|
-
id Int
|
|
594
|
-
user_id String
|
|
596
|
+
id Int @id @default(autoincrement())
|
|
597
|
+
user_id String @db.VarChar(50)
|
|
595
598
|
power_up_definition_id Int
|
|
596
|
-
status String
|
|
597
|
-
progress Json
|
|
598
|
-
bonus_value Float
|
|
599
|
-
effective_percentage Float
|
|
600
|
-
redeemed_at DateTime?
|
|
601
|
-
activated_at DateTime?
|
|
602
|
-
expires_at DateTime?
|
|
603
|
-
expired_at DateTime?
|
|
604
|
-
created_at DateTime
|
|
605
|
-
updated_at DateTime
|
|
606
|
-
deleted_at DateTime?
|
|
599
|
+
status String @default("TRACKING") @db.VarChar(20)
|
|
600
|
+
progress Json @default("{}")
|
|
601
|
+
bonus_value Float @default(0)
|
|
602
|
+
effective_percentage Float @default(0)
|
|
603
|
+
redeemed_at DateTime? @db.Timestamp(6)
|
|
604
|
+
activated_at DateTime? @db.Timestamp(6)
|
|
605
|
+
expires_at DateTime? @db.Timestamp(6)
|
|
606
|
+
expired_at DateTime? @db.Timestamp(6)
|
|
607
|
+
created_at DateTime @default(now()) @db.Timestamp(6)
|
|
608
|
+
updated_at DateTime @default(now()) @db.Timestamp(6)
|
|
609
|
+
deleted_at DateTime? @db.Timestamp(6)
|
|
607
610
|
|
|
608
611
|
users users @relation(fields: [user_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
609
612
|
power_up_definition power_up_definitions @relation(fields: [power_up_definition_id], references: [id], onDelete: Restrict, onUpdate: Cascade)
|
|
@@ -613,3 +616,34 @@ model power_up_instances {
|
|
|
613
616
|
@@index([status, expires_at], map: "idx_pui_expiration")
|
|
614
617
|
@@index([user_id, activated_at, expires_at], map: "idx_pui_user_active_window")
|
|
615
618
|
}
|
|
619
|
+
|
|
620
|
+
model projects {
|
|
621
|
+
id Int @id @default(autoincrement())
|
|
622
|
+
title String @db.VarChar(100)
|
|
623
|
+
is_draft Boolean @default(true)
|
|
624
|
+
is_pending Boolean @default(false)
|
|
625
|
+
is_published Boolean @default(false)
|
|
626
|
+
author_id String @db.VarChar(50)
|
|
627
|
+
created_at DateTime @default(now()) @db.Timestamp(6)
|
|
628
|
+
updated_at DateTime @default(now()) @db.Timestamp(6)
|
|
629
|
+
deleted_at DateTime? @db.Timestamp(6)
|
|
630
|
+
snapshots snapshots[]
|
|
631
|
+
|
|
632
|
+
users users @relation(fields: [author_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
633
|
+
|
|
634
|
+
@@index([author_id], map: "idx_projects_author")
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
model snapshots {
|
|
638
|
+
id Int @id @default(autoincrement())
|
|
639
|
+
project_id Int
|
|
640
|
+
data Json
|
|
641
|
+
accepted Boolean @default(false)
|
|
642
|
+
created_at DateTime @default(now()) @db.Timestamp(6)
|
|
643
|
+
updated_at DateTime @default(now()) @db.Timestamp(6)
|
|
644
|
+
deleted_at DateTime? @db.Timestamp(6)
|
|
645
|
+
|
|
646
|
+
projects projects @relation(fields: [project_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
647
|
+
|
|
648
|
+
@@index([project_id], map: "idx_snapshots_project")
|
|
649
|
+
}
|
package/prisma/seed2.ts
CHANGED
|
@@ -276,14 +276,32 @@ async function main() {
|
|
|
276
276
|
img_inactive: { url: "https://576wibblum.ufs.sh/f/l7y45I6Co8dLVsgHZObQ7DFMBvhIWUKNJjcu2an0Z6edqwVO", alt: "Raciocínio Crítico" },
|
|
277
277
|
description: 'Avaliar informação, argumentos e situações de forma reflexiva e fundamentada, questionando pressupostos e formulando julgamentos consistentes.',
|
|
278
278
|
}
|
|
279
|
-
})
|
|
279
|
+
}),
|
|
280
|
+
prisma.soft_skills.create({
|
|
281
|
+
data: {
|
|
282
|
+
title: 'Gestão de Tempo',
|
|
283
|
+
img_active: { url: "https://576wibblum.ufs.sh/f/l7y45I6Co8dLAdZIqbODtGBzZsiPklWLUproCwvJ5I6bRecx", alt: "Gestão de Tempo" },
|
|
284
|
+
img_achieved: { url: "https://576wibblum.ufs.sh/f/l7y45I6Co8dLAdZIqbODtGBzZsiPklWLUproCwvJ5I6bRecx", alt: "Gestão de Tempo" },
|
|
285
|
+
img_inactive: { url: "https://576wibblum.ufs.sh/f/l7y45I6Co8dLAdZIqbODtGBzZsiPklWLUproCwvJ5I6bRecx", alt: "Gestão de Tempo" },
|
|
286
|
+
description: 'Planear e organizar tarefas de forma eficiente, definindo prioridades, cumprindo prazos e equilibrando diferentes responsabilidades para alcançar objetivos com eficácia.',
|
|
287
|
+
}
|
|
288
|
+
}),
|
|
289
|
+
prisma.soft_skills.create({
|
|
290
|
+
data: {
|
|
291
|
+
title: 'Networking',
|
|
292
|
+
img_active: { url: "https://576wibblum.ufs.sh/f/l7y45I6Co8dLT1udAXsYq8yQgrMwbSZimeCR6nW9UEpuJdhN", alt: "Networking" },
|
|
293
|
+
img_achieved: { url: "https://576wibblum.ufs.sh/f/l7y45I6Co8dLT1udAXsYq8yQgrMwbSZimeCR6nW9UEpuJdhN", alt: "Networking" },
|
|
294
|
+
img_inactive: { url: "https://576wibblum.ufs.sh/f/l7y45I6Co8dLT1udAXsYq8yQgrMwbSZimeCR6nW9UEpuJdhN", alt: "Networking" },
|
|
295
|
+
description: 'Estabelecer e desenvolver relações profissionais de forma estratégica e colaborativa, promovendo a partilha de conhecimento, oportunidades e apoio mútuo entre pessoas e organizações.',
|
|
296
|
+
}
|
|
297
|
+
}),
|
|
280
298
|
]);
|
|
281
299
|
|
|
282
300
|
// Insert Badge Types
|
|
283
301
|
console.log('🏆 Creating badge types...');
|
|
284
302
|
const badgeTypes = await Promise.all([
|
|
285
|
-
prisma.type.create({ data: { id:1, type: 'Certificado' } }),
|
|
286
|
-
prisma.type.create({ data: { id:2, type: 'Desafio' } }),
|
|
303
|
+
prisma.type.create({ data: { id: 1, type: 'Certificado' } }),
|
|
304
|
+
prisma.type.create({ data: { id: 2, type: 'Desafio' } }),
|
|
287
305
|
]);
|
|
288
306
|
|
|
289
307
|
// Insert programs
|
|
@@ -2107,15 +2125,15 @@ As primeiras pistas estão nas próprias palavras escritas em cada momento. Cada
|
|
|
2107
2125
|
}
|
|
2108
2126
|
}),
|
|
2109
2127
|
prisma.badges.create({
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2128
|
+
data: {
|
|
2129
|
+
title: 'Participação no Pré-Piloto',
|
|
2130
|
+
condition: 'Completaste o Pré-Piloto do Ser+! Este certificado reconhece o teu empenho e participação ativa nesta fase crucial do projeto. Obrigado por fazeres parte desta jornada connosco.',
|
|
2131
|
+
img: { "id": "c0229a89-f1d9-4ee8-adf7-a3324b939fac", "url": "https://minio.sermaisapp-qa.ua.pt/badges/76/c0229a89-f1d9-4ee8-adf7-a3324b939fac.pdf", "size": 459032, "mimeType": "application/pdf", "uploadedAt": "2026-01-28T15:16:11.178Z", "originalName": "certificadosermais.pdf", "thumbnailUrl": "https://minio.sermaisapp-qa.ua.pt/badges/76/c0229a89-f1d9-4ee8-adf7-a3324b939fac_thumb.jpg" },
|
|
2132
|
+
points: 50,
|
|
2133
|
+
initiative_id: initiatives[7].id,
|
|
2134
|
+
type_id: badgeTypes[0].id,
|
|
2135
|
+
is_draft: false
|
|
2136
|
+
}
|
|
2119
2137
|
}),
|
|
2120
2138
|
|
|
2121
2139
|
//Moment 1 initiative 8
|