@campus-labs/prisma-client 0.11.1 → 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.
@@ -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.11.1",
3
+ "version": "0.12.0",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "",
@@ -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,8 @@ 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[] @relation("UserInitiativeExpeller")
369
+ expelled_user_initiatives user_initiative[] @relation("UserInitiativeExpeller")
370
+ projects projects[]
373
371
 
374
372
  @@index([role_platform_id], map: "idx_users_role")
375
373
  @@index([points(sort: Desc)], map: "idx_users_points")
@@ -408,8 +406,7 @@ model user_initiative {
408
406
  initiatives initiatives @relation(fields: [initiative_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
409
407
  roles_initiatives roles_initiatives @relation(fields: [role_initiative_id], references: [id], onDelete: Restrict, onUpdate: Cascade)
410
408
  users users @relation(fields: [user_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
411
- expelled_user_id users? @relation("UserInitiativeExpeller", fields: [expelled_by_user_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
412
-
409
+ expelled_user_id users? @relation("UserInitiativeExpeller", fields: [expelled_by_user_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
413
410
 
414
411
  @@id([user_id, initiative_id])
415
412
  @@index([user_id, role_initiative_id], map: "idx_user_initiative_user_role")
@@ -574,20 +571,20 @@ model feedback_initiative {
574
571
  }
575
572
 
576
573
  model power_up_definitions {
577
- id Int @id @default(autoincrement())
578
- slug String @unique @db.VarChar(50)
579
- title String @db.VarChar(100)
580
- description String @db.VarChar(3000)
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)
581
578
  img Json
582
579
  base_percentage Float
583
580
  duration_days Int?
584
- duration_type String @default("FIXED_DAYS") @db.VarChar(20)
581
+ duration_type String @default("FIXED_DAYS") @db.VarChar(20)
585
582
  conditions Json
586
583
  bonus_rule Json?
587
- is_active Boolean @default(true)
588
- created_at DateTime @default(now()) @db.Timestamp(6)
589
- updated_at DateTime @default(now()) @db.Timestamp(6)
590
- deleted_at DateTime? @db.Timestamp(6)
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)
591
588
 
592
589
  instances power_up_instances[]
593
590
 
@@ -596,20 +593,20 @@ model power_up_definitions {
596
593
  }
597
594
 
598
595
  model power_up_instances {
599
- id Int @id @default(autoincrement())
600
- user_id String @db.VarChar(50)
596
+ id Int @id @default(autoincrement())
597
+ user_id String @db.VarChar(50)
601
598
  power_up_definition_id Int
602
- status String @default("TRACKING") @db.VarChar(20)
603
- progress Json @default("{}")
604
- bonus_value Float @default(0)
605
- effective_percentage Float @default(0)
606
- redeemed_at DateTime? @db.Timestamp(6)
607
- activated_at DateTime? @db.Timestamp(6)
608
- expires_at DateTime? @db.Timestamp(6)
609
- expired_at DateTime? @db.Timestamp(6)
610
- created_at DateTime @default(now()) @db.Timestamp(6)
611
- updated_at DateTime @default(now()) @db.Timestamp(6)
612
- deleted_at DateTime? @db.Timestamp(6)
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)
613
610
 
614
611
  users users @relation(fields: [user_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
615
612
  power_up_definition power_up_definitions @relation(fields: [power_up_definition_id], references: [id], onDelete: Restrict, onUpdate: Cascade)
@@ -619,3 +616,34 @@ model power_up_instances {
619
616
  @@index([status, expires_at], map: "idx_pui_expiration")
620
617
  @@index([user_id, activated_at, expires_at], map: "idx_pui_user_active_window")
621
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
- data: {
2111
- title: 'Participação no Pré-Piloto',
2112
- 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.',
2113
- 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"},
2114
- points: 50,
2115
- initiative_id: initiatives[7].id,
2116
- type_id: badgeTypes[0].id,
2117
- is_draft: false
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