@ordinatio/scheduling 0.2.1 → 0.4.0
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/CHANGELOG.md +54 -0
- package/README.md +233 -2
- package/dist/index.d.mts +817 -4
- package/dist/index.d.ts +817 -4
- package/dist/index.js +2332 -27
- package/dist/index.mjs +2253 -29
- package/package.json +1 -1
- package/prisma/migrations/20261027000000_webhooks/migration.sql +75 -0
- package/prisma/migrations/20261027100000_waitlist/migration.sql +51 -0
- package/prisma/migrations/20261027200000_routing_forms/migration.sql +26 -0
- package/prisma/migrations/20261027300000_privacy_requests/migration.sql +18 -0
- package/prisma/migrations/20261027400000_organization_brand/migration.sql +26 -0
- package/prisma/schema.prisma +158 -0
package/package.json
CHANGED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
-- CreateTable
|
|
2
|
+
CREATE TABLE "WebhookEndpoint" (
|
|
3
|
+
"id" TEXT NOT NULL,
|
|
4
|
+
"organizationId" TEXT NOT NULL,
|
|
5
|
+
"url" TEXT NOT NULL,
|
|
6
|
+
"description" TEXT,
|
|
7
|
+
"secret" TEXT NOT NULL,
|
|
8
|
+
"eventTypes" TEXT[],
|
|
9
|
+
"isActive" BOOLEAN NOT NULL DEFAULT true,
|
|
10
|
+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
11
|
+
|
|
12
|
+
CONSTRAINT "WebhookEndpoint_pkey" PRIMARY KEY ("id")
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
-- CreateTable
|
|
16
|
+
CREATE TABLE "WebhookDelivery" (
|
|
17
|
+
"id" TEXT NOT NULL,
|
|
18
|
+
"organizationId" TEXT NOT NULL,
|
|
19
|
+
"endpointId" TEXT NOT NULL,
|
|
20
|
+
"eventId" TEXT NOT NULL,
|
|
21
|
+
"eventType" TEXT NOT NULL,
|
|
22
|
+
"body" TEXT NOT NULL,
|
|
23
|
+
"status" TEXT NOT NULL DEFAULT 'PENDING',
|
|
24
|
+
"attempts" INTEGER NOT NULL DEFAULT 0,
|
|
25
|
+
"nextAttemptAt" TIMESTAMP(3) NOT NULL,
|
|
26
|
+
"lastStatusCode" INTEGER,
|
|
27
|
+
"lastError" TEXT,
|
|
28
|
+
"deliveredAt" TIMESTAMP(3),
|
|
29
|
+
"processingId" TEXT,
|
|
30
|
+
"claimedAt" TIMESTAMP(3),
|
|
31
|
+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
32
|
+
|
|
33
|
+
CONSTRAINT "WebhookDelivery_pkey" PRIMARY KEY ("id")
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
-- CreateTable
|
|
37
|
+
CREATE TABLE "WebhookAttempt" (
|
|
38
|
+
"id" TEXT NOT NULL,
|
|
39
|
+
"deliveryId" TEXT NOT NULL,
|
|
40
|
+
"attemptNumber" INTEGER NOT NULL,
|
|
41
|
+
"statusCode" INTEGER,
|
|
42
|
+
"error" TEXT,
|
|
43
|
+
"durationMs" INTEGER NOT NULL,
|
|
44
|
+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
45
|
+
|
|
46
|
+
CONSTRAINT "WebhookAttempt_pkey" PRIMARY KEY ("id")
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
-- CreateIndex
|
|
50
|
+
CREATE INDEX "WebhookEndpoint_organizationId_isActive_idx" ON "WebhookEndpoint"("organizationId", "isActive");
|
|
51
|
+
|
|
52
|
+
-- CreateIndex
|
|
53
|
+
CREATE INDEX "WebhookDelivery_status_nextAttemptAt_idx" ON "WebhookDelivery"("status", "nextAttemptAt");
|
|
54
|
+
|
|
55
|
+
-- CreateIndex
|
|
56
|
+
CREATE INDEX "WebhookDelivery_organizationId_createdAt_idx" ON "WebhookDelivery"("organizationId", "createdAt");
|
|
57
|
+
|
|
58
|
+
-- CreateIndex
|
|
59
|
+
CREATE INDEX "WebhookDelivery_endpointId_createdAt_idx" ON "WebhookDelivery"("endpointId", "createdAt");
|
|
60
|
+
|
|
61
|
+
-- CreateIndex
|
|
62
|
+
CREATE UNIQUE INDEX "WebhookDelivery_endpointId_eventId_key" ON "WebhookDelivery"("endpointId", "eventId");
|
|
63
|
+
|
|
64
|
+
-- CreateIndex
|
|
65
|
+
CREATE INDEX "WebhookAttempt_deliveryId_idx" ON "WebhookAttempt"("deliveryId");
|
|
66
|
+
|
|
67
|
+
-- AddForeignKey
|
|
68
|
+
ALTER TABLE "WebhookEndpoint" ADD CONSTRAINT "WebhookEndpoint_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES "Organization"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
69
|
+
|
|
70
|
+
-- AddForeignKey
|
|
71
|
+
ALTER TABLE "WebhookDelivery" ADD CONSTRAINT "WebhookDelivery_endpointId_fkey" FOREIGN KEY ("endpointId") REFERENCES "WebhookEndpoint"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
72
|
+
|
|
73
|
+
-- AddForeignKey
|
|
74
|
+
ALTER TABLE "WebhookAttempt" ADD CONSTRAINT "WebhookAttempt_deliveryId_fkey" FOREIGN KEY ("deliveryId") REFERENCES "WebhookDelivery"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
75
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
-- CreateTable
|
|
2
|
+
CREATE TABLE "WaitlistEntry" (
|
|
3
|
+
"id" TEXT NOT NULL,
|
|
4
|
+
"organizationId" TEXT NOT NULL,
|
|
5
|
+
"typeId" TEXT NOT NULL,
|
|
6
|
+
"calendarId" TEXT,
|
|
7
|
+
"day" TEXT NOT NULL,
|
|
8
|
+
"slotStart" TIMESTAMP(3),
|
|
9
|
+
"timezone" TEXT NOT NULL,
|
|
10
|
+
"clientName" TEXT NOT NULL,
|
|
11
|
+
"clientEmail" TEXT NOT NULL,
|
|
12
|
+
"clientPhone" TEXT,
|
|
13
|
+
"token" TEXT NOT NULL,
|
|
14
|
+
"status" TEXT NOT NULL DEFAULT 'WAITING',
|
|
15
|
+
"offerCalendarId" TEXT,
|
|
16
|
+
"offerSlotStart" TIMESTAMP(3),
|
|
17
|
+
"offerExpiresAt" TIMESTAMP(3),
|
|
18
|
+
"offeredAt" TIMESTAMP(3),
|
|
19
|
+
"acceptingAt" TIMESTAMP(3),
|
|
20
|
+
"bookedAppointmentId" TEXT,
|
|
21
|
+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
22
|
+
|
|
23
|
+
CONSTRAINT "WaitlistEntry_pkey" PRIMARY KEY ("id")
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
-- CreateIndex
|
|
27
|
+
CREATE UNIQUE INDEX "WaitlistEntry_token_key" ON "WaitlistEntry"("token");
|
|
28
|
+
|
|
29
|
+
-- CreateIndex
|
|
30
|
+
CREATE INDEX "WaitlistEntry_organizationId_status_createdAt_idx" ON "WaitlistEntry"("organizationId", "status", "createdAt");
|
|
31
|
+
|
|
32
|
+
-- CreateIndex
|
|
33
|
+
CREATE INDEX "WaitlistEntry_typeId_day_status_createdAt_idx" ON "WaitlistEntry"("typeId", "day", "status", "createdAt");
|
|
34
|
+
|
|
35
|
+
-- CreateIndex
|
|
36
|
+
CREATE INDEX "WaitlistEntry_status_offerExpiresAt_idx" ON "WaitlistEntry"("status", "offerExpiresAt");
|
|
37
|
+
|
|
38
|
+
-- CreateIndex
|
|
39
|
+
CREATE INDEX "WaitlistEntry_clientEmail_idx" ON "WaitlistEntry"("clientEmail");
|
|
40
|
+
|
|
41
|
+
-- AddForeignKey
|
|
42
|
+
ALTER TABLE "WaitlistEntry" ADD CONSTRAINT "WaitlistEntry_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES "Organization"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
43
|
+
|
|
44
|
+
-- AddForeignKey
|
|
45
|
+
ALTER TABLE "WaitlistEntry" ADD CONSTRAINT "WaitlistEntry_typeId_fkey" FOREIGN KEY ("typeId") REFERENCES "AppointmentType"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
-- One live offer holds a slot at a time: two cancellations that free the same slot cannot both offer it.
|
|
49
|
+
CREATE UNIQUE INDEX "waitlist_one_live_offer_per_slot"
|
|
50
|
+
ON "WaitlistEntry" ("offerCalendarId", "offerSlotStart")
|
|
51
|
+
WHERE status IN ('OFFERED', 'ACCEPTING');
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
-- CreateTable
|
|
2
|
+
CREATE TABLE "RoutingForm" (
|
|
3
|
+
"id" TEXT NOT NULL,
|
|
4
|
+
"organizationId" TEXT NOT NULL,
|
|
5
|
+
"name" TEXT NOT NULL,
|
|
6
|
+
"slug" TEXT NOT NULL,
|
|
7
|
+
"description" TEXT,
|
|
8
|
+
"isActive" BOOLEAN NOT NULL DEFAULT true,
|
|
9
|
+
"questions" JSONB NOT NULL,
|
|
10
|
+
"rules" JSONB NOT NULL,
|
|
11
|
+
"fallback" JSONB NOT NULL,
|
|
12
|
+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
13
|
+
"updatedAt" TIMESTAMP(3) NOT NULL,
|
|
14
|
+
|
|
15
|
+
CONSTRAINT "RoutingForm_pkey" PRIMARY KEY ("id")
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
-- CreateIndex
|
|
19
|
+
CREATE INDEX "RoutingForm_organizationId_isActive_idx" ON "RoutingForm"("organizationId", "isActive");
|
|
20
|
+
|
|
21
|
+
-- CreateIndex
|
|
22
|
+
CREATE UNIQUE INDEX "RoutingForm_organizationId_slug_key" ON "RoutingForm"("organizationId", "slug");
|
|
23
|
+
|
|
24
|
+
-- AddForeignKey
|
|
25
|
+
ALTER TABLE "RoutingForm" ADD CONSTRAINT "RoutingForm_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES "Organization"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
26
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
-- CreateTable
|
|
2
|
+
CREATE TABLE "DataSubjectRequest" (
|
|
3
|
+
"id" TEXT NOT NULL,
|
|
4
|
+
"organizationId" TEXT NOT NULL,
|
|
5
|
+
"kind" TEXT NOT NULL,
|
|
6
|
+
"subjectHashes" TEXT[],
|
|
7
|
+
"requestedBy" TEXT NOT NULL,
|
|
8
|
+
"counts" JSONB NOT NULL,
|
|
9
|
+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
10
|
+
|
|
11
|
+
CONSTRAINT "DataSubjectRequest_pkey" PRIMARY KEY ("id")
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
-- CreateIndex
|
|
15
|
+
CREATE INDEX "DataSubjectRequest_organizationId_createdAt_idx" ON "DataSubjectRequest"("organizationId", "createdAt");
|
|
16
|
+
|
|
17
|
+
-- AddForeignKey
|
|
18
|
+
ALTER TABLE "DataSubjectRequest" ADD CONSTRAINT "DataSubjectRequest_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES "Organization"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
-- CreateTable
|
|
2
|
+
CREATE TABLE "OrganizationBrand" (
|
|
3
|
+
"id" TEXT NOT NULL,
|
|
4
|
+
"organizationId" TEXT NOT NULL,
|
|
5
|
+
"displayName" TEXT NOT NULL,
|
|
6
|
+
"logoUrl" TEXT,
|
|
7
|
+
"primaryColor" TEXT,
|
|
8
|
+
"accentColor" TEXT,
|
|
9
|
+
"backgroundColor" TEXT,
|
|
10
|
+
"textColor" TEXT,
|
|
11
|
+
"fontFamily" TEXT,
|
|
12
|
+
"footerText" TEXT,
|
|
13
|
+
"replyToEmail" TEXT,
|
|
14
|
+
"fromName" TEXT,
|
|
15
|
+
"fromEmail" TEXT,
|
|
16
|
+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
17
|
+
"updatedAt" TIMESTAMP(3) NOT NULL,
|
|
18
|
+
|
|
19
|
+
CONSTRAINT "OrganizationBrand_pkey" PRIMARY KEY ("id")
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
-- CreateIndex
|
|
23
|
+
CREATE UNIQUE INDEX "OrganizationBrand_organizationId_key" ON "OrganizationBrand"("organizationId");
|
|
24
|
+
|
|
25
|
+
-- AddForeignKey
|
|
26
|
+
ALTER TABLE "OrganizationBrand" ADD CONSTRAINT "OrganizationBrand_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES "Organization"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
package/prisma/schema.prisma
CHANGED
|
@@ -27,6 +27,11 @@ model Organization {
|
|
|
27
27
|
couponCodes CouponCode[]
|
|
28
28
|
recurringSeries RecurringSeries[]
|
|
29
29
|
notificationTemplates NotificationTemplate[]
|
|
30
|
+
webhookEndpoints WebhookEndpoint[]
|
|
31
|
+
waitlistEntries WaitlistEntry[]
|
|
32
|
+
routingForms RoutingForm[]
|
|
33
|
+
dataSubjectRequests DataSubjectRequest[]
|
|
34
|
+
brand OrganizationBrand?
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
// ===== BEGIN SHARED SCHEDULING MODELS (copied verbatim into the host schema by packages/database/scripts/sync-scheduling-schema.ts) =====
|
|
@@ -184,6 +189,8 @@ model AppointmentType {
|
|
|
184
189
|
|
|
185
190
|
@@unique([organizationId, slug])
|
|
186
191
|
@@index([organizationId])
|
|
192
|
+
|
|
193
|
+
waitlistEntries WaitlistEntry[]
|
|
187
194
|
}
|
|
188
195
|
|
|
189
196
|
model AppointmentCategory {
|
|
@@ -381,6 +388,157 @@ model NotificationTemplate {
|
|
|
381
388
|
@@index([organizationId])
|
|
382
389
|
}
|
|
383
390
|
|
|
391
|
+
// A web address that is told about booking changes. Every delivery is signed with `secret`, so the secret
|
|
392
|
+
// must stay readable here; it is shown once when the endpoint is created and never returned again.
|
|
393
|
+
model WebhookEndpoint {
|
|
394
|
+
id String @id @default(cuid())
|
|
395
|
+
organizationId String
|
|
396
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
397
|
+
url String
|
|
398
|
+
description String?
|
|
399
|
+
secret String
|
|
400
|
+
eventTypes String[] // event names such as appointment.booked, or * for all of them
|
|
401
|
+
isActive Boolean @default(true)
|
|
402
|
+
createdAt DateTime @default(now())
|
|
403
|
+
|
|
404
|
+
deliveries WebhookDelivery[]
|
|
405
|
+
|
|
406
|
+
@@index([organizationId, isActive])
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
// One event waiting to be sent to one endpoint. `body` is the exact text that is signed and sent, so a retry
|
|
410
|
+
// sends the same bytes.
|
|
411
|
+
model WebhookDelivery {
|
|
412
|
+
id String @id @default(cuid())
|
|
413
|
+
organizationId String
|
|
414
|
+
endpointId String
|
|
415
|
+
endpoint WebhookEndpoint @relation(fields: [endpointId], references: [id], onDelete: Cascade)
|
|
416
|
+
eventId String
|
|
417
|
+
eventType String
|
|
418
|
+
body String @db.Text
|
|
419
|
+
status String @default("PENDING") // PENDING | PROCESSING | SUCCEEDED | DEAD_LETTER
|
|
420
|
+
attempts Int @default(0)
|
|
421
|
+
nextAttemptAt DateTime
|
|
422
|
+
lastStatusCode Int?
|
|
423
|
+
lastError String?
|
|
424
|
+
deliveredAt DateTime?
|
|
425
|
+
processingId String? // worker holding the claim; null = claimable
|
|
426
|
+
claimedAt DateTime? // rows claimed more than 5 minutes ago are reclaimable (crash recovery)
|
|
427
|
+
createdAt DateTime @default(now())
|
|
428
|
+
|
|
429
|
+
attemptLog WebhookAttempt[]
|
|
430
|
+
|
|
431
|
+
// The same event is queued once per endpoint, however many times the caller reports it.
|
|
432
|
+
@@unique([endpointId, eventId])
|
|
433
|
+
@@index([status, nextAttemptAt])
|
|
434
|
+
@@index([organizationId, createdAt])
|
|
435
|
+
@@index([endpointId, createdAt])
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
// The log: one row per try.
|
|
439
|
+
model WebhookAttempt {
|
|
440
|
+
id String @id @default(cuid())
|
|
441
|
+
deliveryId String
|
|
442
|
+
delivery WebhookDelivery @relation(fields: [deliveryId], references: [id], onDelete: Cascade)
|
|
443
|
+
attemptNumber Int
|
|
444
|
+
statusCode Int?
|
|
445
|
+
error String?
|
|
446
|
+
durationMs Int
|
|
447
|
+
createdAt DateTime @default(now())
|
|
448
|
+
|
|
449
|
+
@@index([deliveryId])
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
// A client waiting for a full slot or day. When a booking is cancelled the first matching WAITING entry is offered the
|
|
453
|
+
// freed slot (status OFFERED) until offerExpiresAt. `token` is the client's own handle: it opens the offer and leaves
|
|
454
|
+
// the list, so it is only ever given to that client. A partial unique index (see the waitlist migration) lets one
|
|
455
|
+
// live offer hold a slot at a time.
|
|
456
|
+
model WaitlistEntry {
|
|
457
|
+
id String @id @default(cuid())
|
|
458
|
+
organizationId String
|
|
459
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
460
|
+
typeId String
|
|
461
|
+
type AppointmentType @relation(fields: [typeId], references: [id], onDelete: Cascade)
|
|
462
|
+
calendarId String? // null = any calendar of the type
|
|
463
|
+
day String // YYYY-MM-DD in the calendar's timezone
|
|
464
|
+
slotStart DateTime? // null = any time that day
|
|
465
|
+
timezone String
|
|
466
|
+
clientName String
|
|
467
|
+
clientEmail String
|
|
468
|
+
clientPhone String?
|
|
469
|
+
token String @unique
|
|
470
|
+
status String @default("WAITING") // WAITING | OFFERED | ACCEPTING | BOOKED | EXPIRED
|
|
471
|
+
offerCalendarId String?
|
|
472
|
+
offerSlotStart DateTime?
|
|
473
|
+
offerExpiresAt DateTime?
|
|
474
|
+
offeredAt DateTime?
|
|
475
|
+
acceptingAt DateTime?
|
|
476
|
+
bookedAppointmentId String?
|
|
477
|
+
createdAt DateTime @default(now())
|
|
478
|
+
|
|
479
|
+
@@index([organizationId, status, createdAt])
|
|
480
|
+
@@index([typeId, day, status, createdAt])
|
|
481
|
+
@@index([status, offerExpiresAt])
|
|
482
|
+
@@index([clientEmail])
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
// A short form that sends a client to the right appointment type or calendar. `questions`, `rules` and `fallback` are
|
|
486
|
+
// checked when the form is saved (see routing/validate-structure), so what is stored is always well formed. Rules run in order and
|
|
487
|
+
// the first one whose conditions hold wins; when none does, `fallback` says where to send the client or what to tell them.
|
|
488
|
+
model RoutingForm {
|
|
489
|
+
id String @id @default(cuid())
|
|
490
|
+
organizationId String
|
|
491
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
492
|
+
name String
|
|
493
|
+
slug String
|
|
494
|
+
description String?
|
|
495
|
+
isActive Boolean @default(true)
|
|
496
|
+
questions Json
|
|
497
|
+
rules Json
|
|
498
|
+
fallback Json
|
|
499
|
+
createdAt DateTime @default(now())
|
|
500
|
+
updatedAt DateTime @updatedAt
|
|
501
|
+
|
|
502
|
+
@@unique([organizationId, slug])
|
|
503
|
+
@@index([organizationId, isActive])
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
// The record that a person's data was exported or erased. It holds no name or email: `subjectHashes` are SHA-256 digests of
|
|
507
|
+
// the identifiers (see privacy/subject), enough to show later that a request was made for a given address and nothing more.
|
|
508
|
+
model DataSubjectRequest {
|
|
509
|
+
id String @id @default(cuid())
|
|
510
|
+
organizationId String
|
|
511
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
512
|
+
kind String // EXPORT | ERASE
|
|
513
|
+
subjectHashes String[]
|
|
514
|
+
requestedBy String
|
|
515
|
+
counts Json
|
|
516
|
+
createdAt DateTime @default(now())
|
|
517
|
+
|
|
518
|
+
@@index([organizationId, createdAt])
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
// How an organization looks to its clients: the name, logo and colours on the booking page and in messages, and who
|
|
522
|
+
// messages come from. `fromEmail` is only accepted for a domain the host has confirmed it may send from (see brand/validate).
|
|
523
|
+
model OrganizationBrand {
|
|
524
|
+
id String @id @default(cuid())
|
|
525
|
+
organizationId String @unique
|
|
526
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
527
|
+
displayName String
|
|
528
|
+
logoUrl String?
|
|
529
|
+
primaryColor String?
|
|
530
|
+
accentColor String?
|
|
531
|
+
backgroundColor String?
|
|
532
|
+
textColor String?
|
|
533
|
+
fontFamily String?
|
|
534
|
+
footerText String?
|
|
535
|
+
replyToEmail String?
|
|
536
|
+
fromName String?
|
|
537
|
+
fromEmail String?
|
|
538
|
+
createdAt DateTime @default(now())
|
|
539
|
+
updatedAt DateTime @updatedAt
|
|
540
|
+
}
|
|
541
|
+
|
|
384
542
|
model ServicePackage {
|
|
385
543
|
id String @id @default(cuid())
|
|
386
544
|
name String
|