@campus-labs/prisma-client 0.11.1 → 0.12.1
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 +2 -2
- package/prisma/schema.prisma +59 -28
- 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@campus-labs/prisma-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"seed:dev": "npx prisma db seed",
|
|
16
16
|
"deploy:dev": "npx prisma migrate deploy",
|
|
17
17
|
"generate": "npx prisma@6.9.0 generate",
|
|
18
|
-
"deploy:staging": "dotenv -e .env.staging -- npx prisma migrate deploy",
|
|
18
|
+
"deploy:staging": "dotenv -e .env.staging -- npx prisma migrate deploy",
|
|
19
19
|
"reset:staging": "dotenv -e .env.staging -- npx prisma migrate reset",
|
|
20
20
|
"seed:staging": "dotenv -e .env.staging -- npx prisma db seed",
|
|
21
21
|
"deploy:prod": "dotenv -e .env.production -- npx prisma migrate deploy",
|
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,7 +366,9 @@ model users {
|
|
|
369
366
|
wallet_passes wallet_passes[]
|
|
370
367
|
feedbackInitiatives feedback_initiative[]
|
|
371
368
|
power_up_instances power_up_instances[]
|
|
372
|
-
expelled_user_initiatives user_initiative[]
|
|
369
|
+
expelled_user_initiatives user_initiative[] @relation("UserInitiativeExpeller")
|
|
370
|
+
projects projects[] @relation("ProjectAuthor")
|
|
371
|
+
designed_projects projects[] @relation("ProjectGamificationDesigner")
|
|
373
372
|
|
|
374
373
|
@@index([role_platform_id], map: "idx_users_role")
|
|
375
374
|
@@index([points(sort: Desc)], map: "idx_users_points")
|
|
@@ -408,8 +407,7 @@ model user_initiative {
|
|
|
408
407
|
initiatives initiatives @relation(fields: [initiative_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
409
408
|
roles_initiatives roles_initiatives @relation(fields: [role_initiative_id], references: [id], onDelete: Restrict, onUpdate: Cascade)
|
|
410
409
|
users users @relation(fields: [user_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
411
|
-
expelled_user_id
|
|
412
|
-
|
|
410
|
+
expelled_user_id users? @relation("UserInitiativeExpeller", fields: [expelled_by_user_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
413
411
|
|
|
414
412
|
@@id([user_id, initiative_id])
|
|
415
413
|
@@index([user_id, role_initiative_id], map: "idx_user_initiative_user_role")
|
|
@@ -574,20 +572,20 @@ model feedback_initiative {
|
|
|
574
572
|
}
|
|
575
573
|
|
|
576
574
|
model power_up_definitions {
|
|
577
|
-
id Int
|
|
578
|
-
slug String
|
|
579
|
-
title String
|
|
580
|
-
description String
|
|
575
|
+
id Int @id @default(autoincrement())
|
|
576
|
+
slug String @unique @db.VarChar(50)
|
|
577
|
+
title String @db.VarChar(100)
|
|
578
|
+
description String @db.VarChar(3000)
|
|
581
579
|
img Json
|
|
582
580
|
base_percentage Float
|
|
583
581
|
duration_days Int?
|
|
584
|
-
duration_type String
|
|
582
|
+
duration_type String @default("FIXED_DAYS") @db.VarChar(20)
|
|
585
583
|
conditions Json
|
|
586
584
|
bonus_rule Json?
|
|
587
|
-
is_active Boolean
|
|
588
|
-
created_at DateTime
|
|
589
|
-
updated_at DateTime
|
|
590
|
-
deleted_at DateTime?
|
|
585
|
+
is_active Boolean @default(true)
|
|
586
|
+
created_at DateTime @default(now()) @db.Timestamp(6)
|
|
587
|
+
updated_at DateTime @default(now()) @db.Timestamp(6)
|
|
588
|
+
deleted_at DateTime? @db.Timestamp(6)
|
|
591
589
|
|
|
592
590
|
instances power_up_instances[]
|
|
593
591
|
|
|
@@ -596,20 +594,20 @@ model power_up_definitions {
|
|
|
596
594
|
}
|
|
597
595
|
|
|
598
596
|
model power_up_instances {
|
|
599
|
-
id Int
|
|
600
|
-
user_id String
|
|
597
|
+
id Int @id @default(autoincrement())
|
|
598
|
+
user_id String @db.VarChar(50)
|
|
601
599
|
power_up_definition_id Int
|
|
602
|
-
status String
|
|
603
|
-
progress Json
|
|
604
|
-
bonus_value Float
|
|
605
|
-
effective_percentage Float
|
|
606
|
-
redeemed_at DateTime?
|
|
607
|
-
activated_at DateTime?
|
|
608
|
-
expires_at DateTime?
|
|
609
|
-
expired_at DateTime?
|
|
610
|
-
created_at DateTime
|
|
611
|
-
updated_at DateTime
|
|
612
|
-
deleted_at DateTime?
|
|
600
|
+
status String @default("TRACKING") @db.VarChar(20)
|
|
601
|
+
progress Json @default("{}")
|
|
602
|
+
bonus_value Float @default(0)
|
|
603
|
+
effective_percentage Float @default(0)
|
|
604
|
+
redeemed_at DateTime? @db.Timestamp(6)
|
|
605
|
+
activated_at DateTime? @db.Timestamp(6)
|
|
606
|
+
expires_at DateTime? @db.Timestamp(6)
|
|
607
|
+
expired_at DateTime? @db.Timestamp(6)
|
|
608
|
+
created_at DateTime @default(now()) @db.Timestamp(6)
|
|
609
|
+
updated_at DateTime @default(now()) @db.Timestamp(6)
|
|
610
|
+
deleted_at DateTime? @db.Timestamp(6)
|
|
613
611
|
|
|
614
612
|
users users @relation(fields: [user_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
615
613
|
power_up_definition power_up_definitions @relation(fields: [power_up_definition_id], references: [id], onDelete: Restrict, onUpdate: Cascade)
|
|
@@ -619,3 +617,36 @@ model power_up_instances {
|
|
|
619
617
|
@@index([status, expires_at], map: "idx_pui_expiration")
|
|
620
618
|
@@index([user_id, activated_at, expires_at], map: "idx_pui_user_active_window")
|
|
621
619
|
}
|
|
620
|
+
|
|
621
|
+
model projects {
|
|
622
|
+
id Int @id @default(autoincrement())
|
|
623
|
+
title String @db.VarChar(100)
|
|
624
|
+
is_draft Boolean @default(true)
|
|
625
|
+
is_pending Boolean @default(false)
|
|
626
|
+
is_published Boolean @default(false)
|
|
627
|
+
author_id String @db.VarChar(50)
|
|
628
|
+
gamification_designer_id String @db.VarChar(50)
|
|
629
|
+
created_at DateTime @default(now()) @db.Timestamp(6)
|
|
630
|
+
updated_at DateTime @default(now()) @db.Timestamp(6)
|
|
631
|
+
deleted_at DateTime? @db.Timestamp(6)
|
|
632
|
+
snapshots snapshots[]
|
|
633
|
+
|
|
634
|
+
users users @relation("ProjectAuthor", fields: [author_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
635
|
+
gamification_designer users @relation("ProjectGamificationDesigner", fields: [gamification_designer_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
|
|
636
|
+
|
|
637
|
+
@@index([author_id], map: "idx_projects_author")
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
model snapshots {
|
|
641
|
+
id Int @id @default(autoincrement())
|
|
642
|
+
project_id Int
|
|
643
|
+
data Json
|
|
644
|
+
accepted Boolean @default(false)
|
|
645
|
+
created_at DateTime @default(now()) @db.Timestamp(6)
|
|
646
|
+
updated_at DateTime @default(now()) @db.Timestamp(6)
|
|
647
|
+
deleted_at DateTime? @db.Timestamp(6)
|
|
648
|
+
|
|
649
|
+
projects projects @relation(fields: [project_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
650
|
+
|
|
651
|
+
@@index([project_id], map: "idx_snapshots_project")
|
|
652
|
+
}
|
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
|