Converts booking deletion to soft-delete + more robust cancellation (#581)
* Converts booking deletion to soft-delete + more robust cancellation * Update pages/api/cancel.ts infer type :) Co-authored-by: Alex Johansson <[email protected]> Co-authored-by: Alex Johansson <[email protected]> Co-authored-by: Bailey Pumfleet <[email protected]>
This commit is contained in:
4 files changed
+49
-19
No files matched your search
@@ -0,0 +1,5 @@
|
||||
-- CreateEnum
|
||||
CREATE TYPE "BookingStatus" AS ENUM ('cancelled', 'accepted', 'rejected', 'pending');
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "Booking" ADD COLUMN "status" "BookingStatus" NOT NULL DEFAULT E'accepted';
|
||||
@@ -136,6 +136,13 @@ model Attendee {
|
||||
bookingId Int?
|
||||
}
|
||||
|
||||
enum BookingStatus {
|
||||
CANCELLED @map("cancelled")
|
||||
ACCEPTED @map("accepted")
|
||||
REJECTED @map("rejected")
|
||||
PENDING @map("pending")
|
||||
}
|
||||
|
||||
model Booking {
|
||||
id Int @id @default(autoincrement())
|
||||
uid String @unique
|
||||
@@ -157,6 +164,7 @@ model Booking {
|
||||
updatedAt DateTime?
|
||||
confirmed Boolean @default(true)
|
||||
rejected Boolean @default(false)
|
||||
status BookingStatus @default(ACCEPTED)
|
||||
}
|
||||
|
||||
model Schedule {
|
||||
|
||||
Reference in new issue
Block a user