backup page done
This commit is contained in:
@@ -27,8 +27,9 @@ model User {
|
||||
appointments Appointment[]
|
||||
claims Claim[]
|
||||
insuranceCredentials InsuranceCredential[]
|
||||
// reverse relations
|
||||
updatedPayments Payment[] @relation("PaymentUpdatedBy")
|
||||
backups DatabaseBackup[]
|
||||
notifications Notification[]
|
||||
}
|
||||
|
||||
model Patient {
|
||||
@@ -258,3 +259,35 @@ enum PaymentMethod {
|
||||
CARD
|
||||
OTHER
|
||||
}
|
||||
|
||||
model DatabaseBackup {
|
||||
id Int @id @default(autoincrement())
|
||||
userId Int
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([userId])
|
||||
@@index([createdAt])
|
||||
}
|
||||
|
||||
model Notification {
|
||||
id Int @id @default(autoincrement())
|
||||
userId Int
|
||||
type NotificationTypes
|
||||
message String
|
||||
createdAt DateTime @default(now())
|
||||
read Boolean @default(false)
|
||||
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([userId])
|
||||
@@index([createdAt])
|
||||
}
|
||||
|
||||
enum NotificationTypes {
|
||||
BACKUP
|
||||
CLAIM
|
||||
PAYMENT
|
||||
ETC
|
||||
}
|
||||
|
||||
6
packages/db/types/databaseBackup-types.ts
Normal file
6
packages/db/types/databaseBackup-types.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { DatabaseBackupUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
|
||||
import { z } from "zod";
|
||||
|
||||
export type DatabaseBackup = z.infer<
|
||||
typeof DatabaseBackupUncheckedCreateInputObjectSchema
|
||||
>;
|
||||
@@ -5,4 +5,6 @@ export * from "./patient-types";;
|
||||
export * from "./payment-types";
|
||||
export * from "./pdf-types";
|
||||
export * from "./staff-types";
|
||||
export * from "./user-types";
|
||||
export * from "./user-types";
|
||||
export * from "./databaseBackup-types";
|
||||
export * from "./notifications-types";
|
||||
|
||||
11
packages/db/types/notifications-types.ts
Normal file
11
packages/db/types/notifications-types.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import {
|
||||
NotificationTypesSchema,
|
||||
NotificationUncheckedCreateInputObjectSchema,
|
||||
} from "@repo/db/usedSchemas";
|
||||
import { z } from "zod";
|
||||
|
||||
export type Notification = z.infer<
|
||||
typeof NotificationUncheckedCreateInputObjectSchema
|
||||
>;
|
||||
|
||||
export type NotificationTypes = z.infer<typeof NotificationTypesSchema>;
|
||||
@@ -12,4 +12,7 @@ export * from '../shared/schemas/enums/ClaimStatus.schema'
|
||||
export * from '../shared/schemas/objects/PaymentUncheckedCreateInput.schema'
|
||||
export * from '../shared/schemas/objects/ServiceLineTransactionCreateInput.schema'
|
||||
export * from '../shared/schemas/enums/PaymentMethod.schema'
|
||||
export * from '../shared/schemas/enums/PaymentStatus.schema'
|
||||
export * from '../shared/schemas/enums/PaymentStatus.schema'
|
||||
export * from '../shared/schemas/enums/NotificationTypes.schema'
|
||||
export * from '../shared/schemas/objects/NotificationUncheckedCreateInput.schema'
|
||||
export * from '../shared/schemas/objects/DatabaseBackupUncheckedCreateInput.schema'
|
||||
|
||||
Reference in New Issue
Block a user