@danielcok17/prisma-db 1.13.4 → 1.13.6

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.13.4",
3
+ "version": "1.13.6",
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
@@ -54,7 +54,7 @@ model User {
54
54
  applicationText String? // Text žiadosti o prihlásenie
55
55
  // ✨ STRIPE FIELDS (B2C - len pre individuálnych používateľov)
56
56
  subscriptionTier SubscriptionTier @default(FREE) // Aktuálny subscription tier (cache)
57
- messageCount Int @default(10) // OPRAVENÉ z 100 na 10
57
+ messageCount Int @default(4) // Free tier default
58
58
  messageCountResetAt DateTime? // Kedy sa má resetovať message count
59
59
  adminGrantExpiresAt DateTime? // Kedy admin grant expiruje
60
60
  // ✨ COMPANY FIELDS (pre SZČO - samostatne zárobkovo činná osoba)
@@ -164,7 +164,7 @@ model Organization {
164
164
  // Subscription (B2B)
165
165
  subscriptionTier SubscriptionTier @default(FREE) // Tier organizácie (cache)
166
166
  messageCount Int @default(0) // Spoločný pool správ pre všetkých členov
167
- messageLimit Int @default(100) // Limit správ podľa tieru
167
+ messageLimit Int @default(4) // Free tier default
168
168
  messageCountResetAt DateTime? // Kedy sa má resetovať pool
169
169
  adminGrantExpiresAt DateTime? // Kedy admin grant expiruje
170
170
 
@@ -813,7 +813,7 @@ enum CustomerType {
813
813
 
814
814
  // Stripe: Tier predplatného
815
815
  enum SubscriptionTier {
816
- FREE // Free tier (10 messages/month)
816
+ FREE // Free tier (4 messages/month)
817
817
  LAWYER // Lawyer tier (1000 messages/month, €29/month, 1 user)
818
818
  LAWYER_PRO // Lawyer Pro tier (3000 messages/month, €49/month, 1 user) - RECOMMENDED
819
819
  LAW_FIRM // Law Firm tier (10000 messages/month, €129/month, up to 5 users)
@@ -0,0 +1,17 @@
1
+ -- Add LEGAL_OPINION to ReferenceType enum (if not exists)
2
+ DO $$
3
+ BEGIN
4
+ IF NOT EXISTS (
5
+ SELECT 1 FROM pg_enum
6
+ WHERE enumtypid = (SELECT oid FROM pg_type WHERE typname = 'ReferenceType')
7
+ AND enumlabel = 'LEGAL_OPINION'
8
+ ) THEN
9
+ ALTER TYPE "ReferenceType" ADD VALUE 'LEGAL_OPINION';
10
+ END IF;
11
+ END
12
+ $$;
13
+
14
+ -- AlterTable: Add new profile fields to User (if not exist)
15
+ ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "phone" TEXT;
16
+ ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "occupation" TEXT;
17
+ ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "preferredLanguage" TEXT DEFAULT 'sk';
@@ -0,0 +1,5 @@
1
+ -- AlterTable
2
+ ALTER TABLE "Organization" ALTER COLUMN "messageLimit" SET DEFAULT 4;
3
+
4
+ -- AlterTable
5
+ ALTER TABLE "User" ALTER COLUMN "messageCount" SET DEFAULT 4;