Built merchant management, activity history, and the pipeline
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
ALTER TABLE "Merchant" ADD COLUMN "publicSubmissionKey" TEXT,
|
||||
ADD COLUMN "publicSubmissionHash" TEXT;
|
||||
CREATE UNIQUE INDEX "Merchant_publicSubmissionKey_key" ON "Merchant"("publicSubmissionKey");
|
||||
ALTER TABLE "Activity" ALTER COLUMN "actorId" DROP NOT NULL;
|
||||
ALTER TABLE "StatusEvent" ALTER COLUMN "actorId" DROP NOT NULL;
|
||||
@@ -0,0 +1,3 @@
|
||||
ALTER TABLE "Merchant" ALTER COLUMN "website" DROP NOT NULL;
|
||||
ALTER TABLE "Merchant" ALTER COLUMN "country" DROP NOT NULL;
|
||||
ALTER TABLE "Merchant" ALTER COLUMN "industry" DROP NOT NULL;
|
||||
@@ -86,9 +86,9 @@ model Session {
|
||||
model Merchant {
|
||||
id String @id @default(uuid())
|
||||
name String
|
||||
website String
|
||||
industry String
|
||||
country String
|
||||
website String?
|
||||
industry String?
|
||||
country String?
|
||||
contactName String
|
||||
contactEmail String
|
||||
legalName String?
|
||||
@@ -98,6 +98,8 @@ model Merchant {
|
||||
contactTitle String?
|
||||
estimatedMonthlyVolumeUsd Decimal? @db.Decimal(18, 2)
|
||||
source String?
|
||||
publicSubmissionKey String? @unique
|
||||
publicSubmissionHash String?
|
||||
status MerchantStatus @default(NEW_LEAD)
|
||||
ownerId String?
|
||||
createdAt DateTime @default(now())
|
||||
@@ -118,13 +120,13 @@ model Merchant {
|
||||
model StatusEvent {
|
||||
id String @id @default(uuid())
|
||||
merchantId String
|
||||
actorId String
|
||||
actorId String?
|
||||
fromStatus MerchantStatus?
|
||||
toStatus MerchantStatus
|
||||
occurredAt DateTime @default(now())
|
||||
note String?
|
||||
merchant Merchant @relation(fields: [merchantId], references: [id], onDelete: Cascade)
|
||||
actor User @relation(fields: [actorId], references: [id])
|
||||
actor User? @relation(fields: [actorId], references: [id], onDelete: Restrict)
|
||||
@@index([merchantId, occurredAt])
|
||||
@@index([occurredAt])
|
||||
}
|
||||
@@ -173,14 +175,14 @@ model Task {
|
||||
model Activity {
|
||||
id String @id @default(uuid())
|
||||
merchantId String
|
||||
actorId String
|
||||
actorId String?
|
||||
kind ActivityKind
|
||||
text String
|
||||
occurredAt DateTime @default(now())
|
||||
updatedAt DateTime @default(now()) @updatedAt
|
||||
metadata Json?
|
||||
merchant Merchant @relation(fields: [merchantId], references: [id], onDelete: Cascade)
|
||||
actor User @relation(fields: [actorId], references: [id])
|
||||
actor User? @relation(fields: [actorId], references: [id], onDelete: Restrict)
|
||||
@@index([merchantId, occurredAt])
|
||||
@@index([occurredAt])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user