Add Mellat e-payment, videos/instructions CMS, and legacy domain lookup.
Store gateway credentials per business, initiate/verify Mellat at checkout, and resolve old CMS ids from domains in the migrate modal. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
513673a7da
commit
d5e502cf77
@@ -38,6 +38,8 @@ model User {
|
||||
ordersCreated Order[] @relation("OrderCreator")
|
||||
orders Order[] @relation("OrderCustomer")
|
||||
authoredPortfolios portfolios[] @relation("PortfolioAuthor")
|
||||
authoredVideos videos[] @relation("VideoAuthor")
|
||||
authoredInstructions instructions[] @relation("InstructionAuthor")
|
||||
shoppingCardsCreated ShoppingCard[] @relation("ShoppingCardCreator")
|
||||
shoppingCards ShoppingCard[] @relation("ShoppingCardCustomer")
|
||||
transactionsCreated Transaction[] @relation("TransactionCreator")
|
||||
@@ -93,6 +95,8 @@ model Business {
|
||||
mediaAttachments MediaAttachment[]
|
||||
orders Order[]
|
||||
portfolios portfolios[]
|
||||
videos videos[]
|
||||
instructions instructions[]
|
||||
productTechnicalFieldValues ProductTechnicalFieldValue[]
|
||||
products Product[]
|
||||
shoppingCards ShoppingCard[]
|
||||
@@ -283,6 +287,8 @@ model Media {
|
||||
uploader User? @relation(fields: [uploadedBy], references: [id], onUpdate: NoAction)
|
||||
attachments MediaAttachment[]
|
||||
portfolios portfolios[]
|
||||
videos videos[]
|
||||
instructions instructions[]
|
||||
featuredProducts Product[] @relation("ProductFeaturedMedia")
|
||||
featuredUserProducts UserProduct[] @relation("UserProductFeaturedMedia")
|
||||
website_slider_slides website_slider_slides[]
|
||||
@@ -671,6 +677,68 @@ model portfolios {
|
||||
@@index([author_id], map: "idx_portfolios_author_id")
|
||||
}
|
||||
|
||||
model videos {
|
||||
id BigInt @id @default(autoincrement())
|
||||
business_id BigInt
|
||||
author_id BigInt?
|
||||
title String @db.VarChar(255)
|
||||
title_fa String? @db.VarChar(255)
|
||||
title_en String? @db.VarChar(255)
|
||||
slug String @db.VarChar(255)
|
||||
excerpt String?
|
||||
content Json @default("{}")
|
||||
video_provider VideoProvider
|
||||
embed_code String
|
||||
status ContentStatus @default(draft)
|
||||
featured_media_id BigInt?
|
||||
published_at DateTime? @db.Timestamptz(6)
|
||||
metadata Json @default("{}")
|
||||
created_at DateTime @default(now()) @db.Timestamptz(6)
|
||||
updated_at DateTime @default(now()) @db.Timestamptz(6)
|
||||
old_id BigInt?
|
||||
author User? @relation("VideoAuthor", fields: [author_id], references: [id], onUpdate: NoAction)
|
||||
businesses Business @relation(fields: [business_id], references: [id], onDelete: Cascade, onUpdate: NoAction)
|
||||
media Media? @relation(fields: [featured_media_id], references: [id], onUpdate: NoAction)
|
||||
|
||||
@@unique([business_id, slug], map: "videos_business_slug_unique")
|
||||
@@unique([business_id, old_id], map: "videos_business_old_id_unique")
|
||||
@@index([business_id], map: "idx_videos_business_id")
|
||||
@@index([business_id, published_at(sort: Desc)], map: "idx_videos_business_published")
|
||||
@@index([business_id, status], map: "idx_videos_business_status")
|
||||
@@index([author_id], map: "idx_videos_author_id")
|
||||
}
|
||||
|
||||
model instructions {
|
||||
id BigInt @id @default(autoincrement())
|
||||
business_id BigInt
|
||||
author_id BigInt?
|
||||
title String @db.VarChar(255)
|
||||
title_fa String? @db.VarChar(255)
|
||||
title_en String? @db.VarChar(255)
|
||||
slug String @db.VarChar(255)
|
||||
excerpt String?
|
||||
content Json @default("{}")
|
||||
video_provider VideoProvider?
|
||||
embed_code String?
|
||||
status ContentStatus @default(draft)
|
||||
featured_media_id BigInt?
|
||||
published_at DateTime? @db.Timestamptz(6)
|
||||
metadata Json @default("{}")
|
||||
old_id BigInt?
|
||||
created_at DateTime @default(now()) @db.Timestamptz(6)
|
||||
updated_at DateTime @default(now()) @db.Timestamptz(6)
|
||||
author User? @relation("InstructionAuthor", fields: [author_id], references: [id], onUpdate: NoAction)
|
||||
businesses Business @relation(fields: [business_id], references: [id], onDelete: Cascade, onUpdate: NoAction)
|
||||
media Media? @relation(fields: [featured_media_id], references: [id], onUpdate: NoAction)
|
||||
|
||||
@@unique([business_id, slug], map: "instructions_business_slug_unique")
|
||||
@@unique([business_id, old_id], map: "instructions_business_old_id_unique")
|
||||
@@index([business_id], map: "idx_instructions_business_id")
|
||||
@@index([business_id, published_at(sort: Desc)], map: "idx_instructions_business_published")
|
||||
@@index([business_id, status], map: "idx_instructions_business_status")
|
||||
@@index([author_id], map: "idx_instructions_author_id")
|
||||
}
|
||||
|
||||
/// This table contains check constraints and requires additional setup for migrations. Visit https://pris.ly/d/check-constraints for more info.
|
||||
model Address {
|
||||
id BigInt @id @default(autoincrement())
|
||||
@@ -938,6 +1006,9 @@ model Transaction {
|
||||
gatewayType String? @map("gateway_type") @db.VarChar(100)
|
||||
transferAccount String? @map("transfer_account") @db.VarChar(255)
|
||||
transferRefNumber String? @map("transfer_ref_number") @db.VarChar(100)
|
||||
gatewayRef String? @map("gateway_ref") @db.VarChar(255)
|
||||
gatewayTrackId String? @map("gateway_track_id") @db.VarChar(255)
|
||||
gatewayMeta Json? @map("gateway_meta")
|
||||
notes String?
|
||||
createdBy BigInt? @map("created_by")
|
||||
createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz(6)
|
||||
@@ -1340,10 +1411,19 @@ enum MediaEntityType {
|
||||
portfolio
|
||||
customer
|
||||
user_product
|
||||
video
|
||||
instruction
|
||||
|
||||
@@map("media_entity_type")
|
||||
}
|
||||
|
||||
enum VideoProvider {
|
||||
youtube
|
||||
aparat
|
||||
|
||||
@@map("video_provider")
|
||||
}
|
||||
|
||||
enum VariationType {
|
||||
color
|
||||
size
|
||||
|
||||
Reference in New Issue
Block a user