@danielcok17/prisma-db 1.8.1 → 1.9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielcok17/prisma-db",
3
- "version": "1.8.1",
3
+ "version": "1.9.0",
4
4
  "description": "Shared Prisma schema for Legal AI applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/prisma/app.prisma CHANGED
@@ -57,6 +57,16 @@ model User {
57
57
  messageCount Int @default(10) // ✅ OPRAVENÉ z 100 na 10
58
58
  messageCountResetAt DateTime? // Kedy sa má resetovať message count
59
59
  adminGrantExpiresAt DateTime? // Kedy admin grant expiruje
60
+ // ✨ COMPANY FIELDS (pre SZČO - samostatne zárobkovo činná osoba)
61
+ customerType CustomerType @default(INDIVIDUAL) // Typ zákazníka: fyzická osoba alebo SZČO
62
+ companyName String? // Obchodné meno (pre SZČO)
63
+ companyNumber String? // IČO (povinné pre SZČO, 8 číslic)
64
+ vatNumber String? // IČ DPH (SK + 10 číslic, nepovinné)
65
+ taxNumber String? // DIČ (10 číslic, nepovinné)
66
+ companyStreet String? // Ulica a číslo (pre SZČO)
67
+ companyCity String? // Mesto (pre SZČO)
68
+ companyPostalCode String? // PSČ (pre SZČO, formát: XXX XX)
69
+ companyCountry String? @default("SK") // Krajina (ISO kód, default SK)
60
70
  // Relations
61
71
  approvalRequest UserApprovalRequest?
62
72
  stripeCustomer StripeCustomer? // ✨ B2C Stripe customer
@@ -80,6 +90,10 @@ model User {
80
90
  folderActivities FolderActivity[] @relation("FolderActivityUser")
81
91
  folderSharesReceived FolderShare[] @relation("FolderShareUser")
82
92
  createdFolderShares FolderShare[] @relation("FolderShareCreator")
93
+
94
+ @@index([customerType])
95
+ @@index([companyNumber])
96
+ @@index([email, customerType])
83
97
  }
84
98
 
85
99
  // Nový model pre žiadosti o schválenie
@@ -555,6 +569,12 @@ enum SubscriptionStatus {
555
569
  PAUSED // Predplatné pozastavené (Stripe feature)
556
570
  }
557
571
 
572
+ // Customer type: Individuálny vs SZČO
573
+ enum CustomerType {
574
+ INDIVIDUAL // Fyzická osoba (bez IČO)
575
+ SELF_EMPLOYED // SZČO - Samostatne zárobkovo činná osoba (s IČO)
576
+ }
577
+
558
578
  // Stripe: Tier predplatného
559
579
  enum SubscriptionTier {
560
580
  FREE // Free tier (10 messages/month)