Webhooks to support event type association (#1889)

* --init database and queries

* fixed type check

* added webhook api for event types

* added webhook list in team event

* delete, edit webhook in team event

* updated webhook subtext for event type

* added discord integration to event type webhook

* check fix

* consistency

* minor code improvement

* lint fix

* Adds missing zod schemas

* requested changes pt1 --WIP

* requested changes pt2 --WIP

Co-authored-by: zomars <zomars@me.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Syed Ali Shahbaz
2022-03-02 21:00:13 +05:30
committed by GitHub
parent af793e9e81
commit d338504856
16 changed files with 1448 additions and 1173 deletions

View File

@@ -46,6 +46,7 @@ model EventType {
teamId Int?
bookings Booking[]
availability Availability[]
webhooks Webhook[]
destinationCalendar DestinationCalendar?
eventName String?
customInputs EventTypeCustomInput[]
@@ -345,11 +346,13 @@ enum WebhookTriggerEvents {
model Webhook {
id String @id @unique
userId Int
userId Int?
eventTypeId Int?
subscriberUrl String
payloadTemplate String?
createdAt DateTime @default(now())
active Boolean @default(true)
eventTriggers WebhookTriggerEvents[]
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
eventType EventType? @relation(fields: [eventTypeId], references: [id], onDelete: Cascade)
}