41 create tenant twilio config (#62)
* add tenant config table * add encryption/decryption + env vars * generate secret and validate iv position is number * expect errors * remove TWILIO env vars * settings page impl * update schema definitions after Mostaphas Tenant impl * load user env * just return empty config * add Settings menu item * check if settings are present and provide warning if not * correct form item names * use correct locals value * ree * give twilio its own table * lock prisma version * event url is the correct param * load twilio config from db * commit migration * use test script not bun command
This commit is contained in:
parent
8006d523c7
commit
8270c53509
24 changed files with 515 additions and 57 deletions
|
|
@ -32,11 +32,39 @@ model User {
|
|||
}
|
||||
|
||||
model Tenant {
|
||||
id String @id @default(uuid())
|
||||
name String
|
||||
slug String @unique
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
clerkOrganizationId String @unique
|
||||
users User[]
|
||||
id String @id @default(uuid())
|
||||
clerkOrganizationId String @unique
|
||||
|
||||
users User[]
|
||||
tenantConfig TenantConfig?
|
||||
|
||||
name String
|
||||
slug String @unique
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model TenantConfig {
|
||||
id String @id @default(uuid())
|
||||
tenant Tenant @relation(fields: [tenantId], references: [id])
|
||||
tenantId String @unique
|
||||
|
||||
twilioConfig TwilioConfig?
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model TwilioConfig {
|
||||
id String @id @default(uuid())
|
||||
tenantConfig TenantConfig @relation(fields: [tenantConfigId], references: [id])
|
||||
tenantConfigId String @unique
|
||||
|
||||
accountSID String
|
||||
authToken String
|
||||
phoneNumber String
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue