@bash-app/bash-common 30.66.0 → 30.66.2
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 +1 -1
- package/prisma/schema.prisma +58 -0
- package/prisma/migrations/20250127_membershiptier_guest_to_basic/migration.sql +0 -5
- package/prisma/migrations/20250127_privacy_levels/migration.sql +0 -91
- package/prisma/migrations/20250127_promotion_marketing_subtype_add_model/migration.sql +0 -20
- package/prisma/migrations/20250127_voucher_table/migration.sql +0 -68
- package/prisma/migrations/20250721130031_add_membership_fields/migration.sql +0 -2825
- package/prisma/migrations/20250721131052_fix_volunteer_service_user_cascade/migration.sql +0 -1
- package/prisma/migrations/migration_lock.toml +0 -3
package/package.json
CHANGED
package/prisma/schema.prisma
CHANGED
|
@@ -393,6 +393,9 @@ model BashEvent {
|
|
|
393
393
|
|
|
394
394
|
// Event timing lock
|
|
395
395
|
startTimeLocked Boolean @default(false) // Prevents start time changes after event starts
|
|
396
|
+
|
|
397
|
+
// Vendor booking relations
|
|
398
|
+
vendorBookingRequests VendorBookingRequest[] @relation("VendorBookingEvent")
|
|
396
399
|
}
|
|
397
400
|
|
|
398
401
|
model Coordinates {
|
|
@@ -1257,6 +1260,9 @@ model User {
|
|
|
1257
1260
|
|
|
1258
1261
|
// Push notification relations
|
|
1259
1262
|
pushNotificationTokens PushNotificationToken[]
|
|
1263
|
+
|
|
1264
|
+
// Vendor booking relations
|
|
1265
|
+
vendorBookingRequestsAsHost VendorBookingRequest[] @relation("VendorBookingHost")
|
|
1260
1266
|
}
|
|
1261
1267
|
|
|
1262
1268
|
model UserPreferences {
|
|
@@ -1631,6 +1637,7 @@ model Service {
|
|
|
1631
1637
|
bookings ServiceBooking[]
|
|
1632
1638
|
notification Notification[]
|
|
1633
1639
|
favoritedBy UserFavorite[]
|
|
1640
|
+
vendorBookingRequests VendorBookingRequest[] @relation("VendorBookingService")
|
|
1634
1641
|
}
|
|
1635
1642
|
|
|
1636
1643
|
model StripeAccount {
|
|
@@ -1763,6 +1770,12 @@ model Vendor {
|
|
|
1763
1770
|
maxBoothFeeCents Int? @default(0)
|
|
1764
1771
|
preferredBoothFeeCents Int? @default(0)
|
|
1765
1772
|
|
|
1773
|
+
// Vendor requirements and preferences
|
|
1774
|
+
spaceRequirements Json? // Space, equipment, and utility requirements
|
|
1775
|
+
insurance Json? // Insurance coverage information
|
|
1776
|
+
permits Json? // Permits and licenses
|
|
1777
|
+
preferences Json? // Vendor preferences (indoor/outdoor, duration, social media, etc.)
|
|
1778
|
+
|
|
1766
1779
|
service Service?
|
|
1767
1780
|
vendorBids VendorBid[] // Relation to bids
|
|
1768
1781
|
}
|
|
@@ -3380,6 +3393,51 @@ model ServiceBooking {
|
|
|
3380
3393
|
@@index([forUserId])
|
|
3381
3394
|
}
|
|
3382
3395
|
|
|
3396
|
+
model VendorBookingRequest {
|
|
3397
|
+
id String @id @default(cuid())
|
|
3398
|
+
createdAt DateTime @default(now())
|
|
3399
|
+
updatedAt DateTime @updatedAt
|
|
3400
|
+
|
|
3401
|
+
// Relations
|
|
3402
|
+
hostUserId String
|
|
3403
|
+
hostUser User @relation("VendorBookingHost", fields: [hostUserId], references: [id], onDelete: Cascade)
|
|
3404
|
+
vendorServiceId String
|
|
3405
|
+
vendorService Service @relation("VendorBookingService", fields: [vendorServiceId], references: [id], onDelete: Cascade)
|
|
3406
|
+
bashEventId String?
|
|
3407
|
+
bashEvent BashEvent? @relation("VendorBookingEvent", fields: [bashEventId], references: [id], onDelete: SetNull)
|
|
3408
|
+
|
|
3409
|
+
// Request data (stored as JSON for flexibility)
|
|
3410
|
+
requestData Json // VendorBookingRequestData from frontend
|
|
3411
|
+
|
|
3412
|
+
// Status and workflow
|
|
3413
|
+
status VendorBookingStatus @default(PENDING)
|
|
3414
|
+
|
|
3415
|
+
// Payment information (populated when vendor accepts)
|
|
3416
|
+
paymentAmount Float?
|
|
3417
|
+
paymentStatus String?
|
|
3418
|
+
stripePaymentIntentId String?
|
|
3419
|
+
paidAt DateTime?
|
|
3420
|
+
|
|
3421
|
+
// Response from vendor
|
|
3422
|
+
vendorResponse String? // Vendor's message when accepting/rejecting
|
|
3423
|
+
respondedAt DateTime?
|
|
3424
|
+
|
|
3425
|
+
@@index([hostUserId])
|
|
3426
|
+
@@index([vendorServiceId])
|
|
3427
|
+
@@index([status])
|
|
3428
|
+
@@index([createdAt])
|
|
3429
|
+
}
|
|
3430
|
+
|
|
3431
|
+
enum VendorBookingStatus {
|
|
3432
|
+
PENDING // Initial request sent
|
|
3433
|
+
ACCEPTED // Vendor accepted, awaiting payment
|
|
3434
|
+
PAID // Vendor has paid host
|
|
3435
|
+
COMPLETED // Event completed successfully
|
|
3436
|
+
REJECTED // Vendor rejected request
|
|
3437
|
+
CANCELLED // Host or vendor cancelled
|
|
3438
|
+
EXPIRED // Request expired without response
|
|
3439
|
+
}
|
|
3440
|
+
|
|
3383
3441
|
enum VisibilityPreference {
|
|
3384
3442
|
Public
|
|
3385
3443
|
Private
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
-- Add new Privacy enum values and migrate ConnectionsOnly -> ContactsOnly
|
|
2
|
-
|
|
3
|
-
DO $
|
|
4
|
-
$
|
|
5
|
-
BEGIN
|
|
6
|
-
IF NOT EXISTS (
|
|
7
|
-
SELECT 1
|
|
8
|
-
FROM pg_enum
|
|
9
|
-
WHERE enumlabel = 'ContactsOnly'
|
|
10
|
-
AND enumtypid = (SELECT oid
|
|
11
|
-
FROM pg_type
|
|
12
|
-
WHERE typname = 'Privacy')
|
|
13
|
-
) THEN
|
|
14
|
-
ALTER TYPE "Privacy"
|
|
15
|
-
ADD VALUE 'ContactsOnly';
|
|
16
|
-
END
|
|
17
|
-
IF;
|
|
18
|
-
|
|
19
|
-
IF NOT EXISTS (
|
|
20
|
-
SELECT 1
|
|
21
|
-
FROM pg_enum
|
|
22
|
-
WHERE enumlabel = 'CreatorOnly'
|
|
23
|
-
AND enumtypid = (SELECT oid
|
|
24
|
-
FROM pg_type
|
|
25
|
-
WHERE typname = 'Privacy')
|
|
26
|
-
) THEN
|
|
27
|
-
ALTER TYPE "Privacy"
|
|
28
|
-
ADD VALUE 'CreatorOnly';
|
|
29
|
-
END
|
|
30
|
-
IF;
|
|
31
|
-
|
|
32
|
-
IF NOT EXISTS (
|
|
33
|
-
SELECT 1
|
|
34
|
-
FROM pg_enum
|
|
35
|
-
WHERE enumlabel = 'ProOnly'
|
|
36
|
-
AND enumtypid = (SELECT oid
|
|
37
|
-
FROM pg_type
|
|
38
|
-
WHERE typname = 'Privacy')
|
|
39
|
-
) THEN
|
|
40
|
-
ALTER TYPE "Privacy"
|
|
41
|
-
ADD VALUE 'ProOnly';
|
|
42
|
-
END
|
|
43
|
-
IF;
|
|
44
|
-
|
|
45
|
-
IF NOT EXISTS (
|
|
46
|
-
SELECT 1
|
|
47
|
-
FROM pg_enum
|
|
48
|
-
WHERE enumlabel = 'EliteOnly'
|
|
49
|
-
AND enumtypid = (SELECT oid
|
|
50
|
-
FROM pg_type
|
|
51
|
-
WHERE typname = 'Privacy')
|
|
52
|
-
) THEN
|
|
53
|
-
ALTER TYPE "Privacy"
|
|
54
|
-
ADD VALUE 'EliteOnly';
|
|
55
|
-
END
|
|
56
|
-
IF;
|
|
57
|
-
|
|
58
|
-
IF NOT EXISTS (
|
|
59
|
-
SELECT 1
|
|
60
|
-
FROM pg_enum
|
|
61
|
-
WHERE enumlabel = 'LegendOnly'
|
|
62
|
-
AND enumtypid = (SELECT oid
|
|
63
|
-
FROM pg_type
|
|
64
|
-
WHERE typname = 'Privacy')
|
|
65
|
-
) THEN
|
|
66
|
-
ALTER TYPE "Privacy"
|
|
67
|
-
ADD VALUE 'LegendOnly';
|
|
68
|
-
END
|
|
69
|
-
IF;
|
|
70
|
-
END $$;
|
|
71
|
-
|
|
72
|
-
-- Migrate ConnectionsOnly to ContactsOnly if present
|
|
73
|
-
DO $$
|
|
74
|
-
BEGIN
|
|
75
|
-
IF EXISTS (
|
|
76
|
-
SELECT 1
|
|
77
|
-
FROM pg_enum
|
|
78
|
-
WHERE enumlabel = 'ConnectionsOnly'
|
|
79
|
-
AND enumtypid = (SELECT oid
|
|
80
|
-
FROM pg_type
|
|
81
|
-
WHERE typname = 'Privacy')
|
|
82
|
-
) THEN
|
|
83
|
-
UPDATE "BashEvent"
|
|
84
|
-
SET "privacy" = 'ContactsOnly'
|
|
85
|
-
::"Privacy"
|
|
86
|
-
WHERE "privacy" = 'ConnectionsOnly'::"Privacy";
|
|
87
|
-
END
|
|
88
|
-
IF;
|
|
89
|
-
END $$;
|
|
90
|
-
|
|
91
|
-
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
-- Add 'Model' to PromotionAndMarketingSubType enum
|
|
2
|
-
|
|
3
|
-
DO $
|
|
4
|
-
$
|
|
5
|
-
BEGIN
|
|
6
|
-
IF NOT EXISTS (
|
|
7
|
-
SELECT 1
|
|
8
|
-
FROM pg_enum
|
|
9
|
-
WHERE enumlabel = 'Model'
|
|
10
|
-
AND enumtypid = (SELECT oid
|
|
11
|
-
FROM pg_type
|
|
12
|
-
WHERE typname = 'PromotionAndMarketingSubType')
|
|
13
|
-
) THEN
|
|
14
|
-
ALTER TYPE "PromotionAndMarketingSubType"
|
|
15
|
-
ADD VALUE 'Model';
|
|
16
|
-
END
|
|
17
|
-
IF;
|
|
18
|
-
END $$;
|
|
19
|
-
|
|
20
|
-
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
-- Create VoucherStatus enum and Voucher table
|
|
2
|
-
|
|
3
|
-
DO $
|
|
4
|
-
$
|
|
5
|
-
BEGIN
|
|
6
|
-
IF NOT EXISTS (SELECT 1
|
|
7
|
-
FROM pg_type
|
|
8
|
-
WHERE typname = 'VoucherStatus') THEN
|
|
9
|
-
CREATE TYPE "VoucherStatus" AS ENUM
|
|
10
|
-
('Active', 'Used', 'Cancelled');
|
|
11
|
-
END
|
|
12
|
-
IF;
|
|
13
|
-
END $$;
|
|
14
|
-
|
|
15
|
-
CREATE TABLE
|
|
16
|
-
IF NOT EXISTS "Voucher"
|
|
17
|
-
(
|
|
18
|
-
"id" TEXT NOT NULL,
|
|
19
|
-
"codeHash" TEXT NOT NULL,
|
|
20
|
-
"issuedToEmail" TEXT,
|
|
21
|
-
"shopifyOrderId" TEXT,
|
|
22
|
-
"createdAt" TIMESTAMP
|
|
23
|
-
(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
24
|
-
"redeemedAt" TIMESTAMP
|
|
25
|
-
(3),
|
|
26
|
-
"redeemedById" TEXT,
|
|
27
|
-
"status" "VoucherStatus" NOT NULL DEFAULT 'Active',
|
|
28
|
-
"stripePromotionCodeId" TEXT,
|
|
29
|
-
"stripeCouponId" TEXT,
|
|
30
|
-
CONSTRAINT "Voucher_pkey" PRIMARY KEY
|
|
31
|
-
("id")
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
CREATE UNIQUE INDEX
|
|
35
|
-
IF NOT EXISTS "Voucher_codeHash_key" ON "Voucher"
|
|
36
|
-
("codeHash");
|
|
37
|
-
CREATE INDEX
|
|
38
|
-
IF NOT EXISTS "Voucher_issuedToEmail_idx" ON "Voucher"
|
|
39
|
-
("issuedToEmail");
|
|
40
|
-
CREATE INDEX
|
|
41
|
-
IF NOT EXISTS "Voucher_shopifyOrderId_idx" ON "Voucher"
|
|
42
|
-
("shopifyOrderId");
|
|
43
|
-
CREATE INDEX
|
|
44
|
-
IF NOT EXISTS "Voucher_status_idx" ON "Voucher"
|
|
45
|
-
("status");
|
|
46
|
-
CREATE INDEX
|
|
47
|
-
IF NOT EXISTS "Voucher_createdAt_idx" ON "Voucher"
|
|
48
|
-
("createdAt");
|
|
49
|
-
|
|
50
|
-
DO $$
|
|
51
|
-
BEGIN
|
|
52
|
-
IF NOT EXISTS (
|
|
53
|
-
SELECT 1
|
|
54
|
-
FROM information_schema.table_constraints
|
|
55
|
-
WHERE constraint_name = 'Voucher_redeemedById_fkey'
|
|
56
|
-
AND table_name = 'Voucher'
|
|
57
|
-
) THEN
|
|
58
|
-
ALTER TABLE "Voucher"
|
|
59
|
-
ADD CONSTRAINT "Voucher_redeemedById_fkey"
|
|
60
|
-
FOREIGN KEY ("redeemedById")
|
|
61
|
-
REFERENCES "User"("id")
|
|
62
|
-
ON DELETE SET NULL
|
|
63
|
-
ON UPDATE CASCADE;
|
|
64
|
-
END
|
|
65
|
-
IF;
|
|
66
|
-
END $$;
|
|
67
|
-
|
|
68
|
-
|