@bash-app/bash-common 30.65.3 → 30.65.4

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": "@bash-app/bash-common",
3
- "version": "30.65.3",
3
+ "version": "30.65.4",
4
4
  "description": "Common data and scripts to use on the frontend and backend",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1246,6 +1246,9 @@ model User {
1246
1246
  bashEventsTransferredFrom BashEvent[] @relation("TransferredFrom")
1247
1247
  transferRequestsFrom BashEventTransferRequest[] @relation("TransferRequestsFrom")
1248
1248
  transferRequestsTo BashEventTransferRequest[] @relation("TransferRequestsTo")
1249
+
1250
+ // Voucher relations
1251
+ redeemedVouchers Voucher[]
1249
1252
  }
1250
1253
 
1251
1254
  model UserPreferences {
@@ -3709,3 +3712,26 @@ enum ReferralTier {
3709
3712
  Influencer // 6-9 referrals: $20/referral
3710
3713
  Ambashador // 10+ referrals: $25/referral
3711
3714
  }
3715
+
3716
+ model Voucher {
3717
+ id String @id @default(cuid())
3718
+ codeHash String @unique // SHA-256 hash of the voucher code
3719
+ issuedToEmail String? // Email of the person who purchased the voucher
3720
+ shopifyOrderId String? // Reference to Shopify order if applicable
3721
+ stripePromotionCodeId String? // Stripe promotion code ID when redeemed
3722
+ status VoucherStatus @default(Active)
3723
+ createdAt DateTime @default(now())
3724
+ updatedAt DateTime @updatedAt
3725
+ redeemedAt DateTime? // When the voucher was redeemed
3726
+ redeemedByUserId String? // User who redeemed the voucher
3727
+ redeemedBy User? @relation(fields: [redeemedByUserId], references: [id], onDelete: SetNull)
3728
+
3729
+ @@map("vouchers")
3730
+ }
3731
+
3732
+ enum VoucherStatus {
3733
+ Active
3734
+ Redeemed
3735
+ Expired
3736
+ Cancelled
3737
+ }