wip fix
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
node_modules
|
||||
# Keep environment variables out of version control
|
||||
.env
|
||||
@@ -0,0 +1 @@
|
||||
export * from "@prisma/client";
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "db",
|
||||
"dependencies": {
|
||||
"@prisma/client": "5.3.1",
|
||||
"prisma": "^5.3.1"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,487 @@
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "postgresql"
|
||||
url = env("DATABASE_URL")
|
||||
}
|
||||
|
||||
model m_academic_year {
|
||||
id Int @id @default(autoincrement())
|
||||
name String @db.VarChar
|
||||
is_active Boolean
|
||||
created_by Int
|
||||
created_date DateTime @db.Timestamptz(6)
|
||||
updated_by Int?
|
||||
updated_date DateTime? @db.Timestamptz(6)
|
||||
id_institution Int
|
||||
start_time DateTime? @db.Timestamptz(6)
|
||||
end_time DateTime? @db.Timestamptz(6)
|
||||
id_client Int?
|
||||
m_client m_client? @relation(fields: [id_client], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_user_m_user_id_yearTom_academic_year m_user[] @relation("m_user_id_yearTom_academic_year")
|
||||
t_logbook t_logbook[]
|
||||
}
|
||||
|
||||
/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
|
||||
model m_action {
|
||||
id Int @id @default(autoincrement())
|
||||
id_type Int
|
||||
name String @db.VarChar
|
||||
has_notes Boolean
|
||||
has_attachment Boolean
|
||||
has_category Boolean
|
||||
is_milestone Boolean
|
||||
show_on_milestone Boolean
|
||||
multiple_verification Boolean
|
||||
has_score Boolean
|
||||
has_presentation Boolean
|
||||
has_location Boolean
|
||||
has_emr Boolean
|
||||
has_another_role Boolean
|
||||
has_title Boolean
|
||||
id_client Int
|
||||
has_status Boolean @default(false)
|
||||
show_on_menu Boolean @default(true)
|
||||
has_hospital Boolean @default(false)
|
||||
attachment_name Json? @default("[]")
|
||||
has_score_option Boolean @default(false)
|
||||
is_schedule Boolean @default(false)
|
||||
max_entry_per_day Int @default(0)
|
||||
identifier String @default(" ") @db.VarChar
|
||||
is_grouped_by_category Boolean @default(false)
|
||||
has_operation_code Boolean @default(false)
|
||||
is_exam Boolean @default(false)
|
||||
m_client m_client @relation(fields: [id_client], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_action_type m_action_type @relation(fields: [id_type], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_action_category m_action_category[]
|
||||
m_action_rolemap m_action_rolemap[]
|
||||
m_action_semester m_action_semester[]
|
||||
m_asm_action m_asm_action[]
|
||||
m_score_option m_score_option[]
|
||||
m_user_action m_user_action[]
|
||||
t_logbook t_logbook[]
|
||||
}
|
||||
|
||||
model m_action_category {
|
||||
id Int @id(map: "m_action_sub_category_pkey") @default(autoincrement())
|
||||
name String @db.VarChar
|
||||
id_action Int
|
||||
id_client Int
|
||||
required_asm Boolean @default(false)
|
||||
m_action m_action @relation(fields: [id_action], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "m_action_sub_category_id_action_fkey")
|
||||
m_client m_client @relation(fields: [id_client], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "m_action_sub_category_id_client_fkey")
|
||||
m_user m_user[]
|
||||
t_logbook t_logbook[]
|
||||
}
|
||||
|
||||
model m_action_role {
|
||||
id Int @id(map: "m_logbook_role_pkey") @default(autoincrement())
|
||||
role String @db.VarChar
|
||||
id_client Int
|
||||
identifier String @default(" ") @db.VarChar
|
||||
m_client m_client @relation(fields: [id_client], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "m_logbook_role_id_client_fkey")
|
||||
m_action_rolemap m_action_rolemap[]
|
||||
t_logbook_status t_logbook_status[]
|
||||
}
|
||||
|
||||
/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
|
||||
model m_action_rolemap {
|
||||
id Int @id(map: "m_action_verificator_pkey") @default(autoincrement())
|
||||
id_action_role Int
|
||||
id_action Int
|
||||
id_client Int
|
||||
type String? @default("verificator") @db.VarChar
|
||||
is_required Boolean @default(true)
|
||||
m_action m_action @relation(fields: [id_action], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "m_action_verificator_id_action_fkey")
|
||||
m_client m_client @relation(fields: [id_client], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "m_action_verificator_id_client_fkey")
|
||||
m_action_role m_action_role @relation(fields: [id_action_role], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "m_action_verificator_id_logbook_role_fkey")
|
||||
}
|
||||
|
||||
model m_action_semester {
|
||||
id Int @id @default(autoincrement())
|
||||
id_semester Int
|
||||
id_action Int
|
||||
id_client Int
|
||||
m_action m_action @relation(fields: [id_action], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_semester m_semester @relation(fields: [id_semester], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
}
|
||||
|
||||
model m_action_status {
|
||||
id Int @id @default(autoincrement())
|
||||
status String @db.VarChar
|
||||
id_action Int
|
||||
id_client Int
|
||||
}
|
||||
|
||||
model m_action_type {
|
||||
id Int @id @default(autoincrement())
|
||||
name String @db.VarChar
|
||||
id_client Int
|
||||
m_action m_action[]
|
||||
m_client m_client @relation(fields: [id_client], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
}
|
||||
|
||||
model m_asm_action {
|
||||
id Int @id(map: "m_assesment_indicator_action_pkey") @default(autoincrement())
|
||||
id_action Int
|
||||
id_asm_param Int
|
||||
id_client Int
|
||||
m_client m_client @relation(fields: [id_client], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_action m_action @relation(fields: [id_action], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "m_assesment_indicator_action_id_action_fkey")
|
||||
m_asm_param m_asm_param @relation(fields: [id_asm_param], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "m_assesment_indicator_action_id_assesment_indicator_fkey")
|
||||
}
|
||||
|
||||
model m_asm_param {
|
||||
id Int @id(map: "m_assesment_indicator_pkey") @default(autoincrement())
|
||||
name String @db.VarChar
|
||||
min_score Float
|
||||
max_score Float
|
||||
id_client Int
|
||||
m_asm_action m_asm_action[]
|
||||
m_client m_client @relation(fields: [id_client], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "m_assessment_indicator_id_client_fkey")
|
||||
t_logbook_asm t_logbook_asm[]
|
||||
}
|
||||
|
||||
model m_client {
|
||||
id Int @id @default(autoincrement())
|
||||
name String @db.VarChar
|
||||
m_academic_year m_academic_year[]
|
||||
m_action m_action[]
|
||||
m_action_category m_action_category[]
|
||||
m_action_role m_action_role[]
|
||||
m_action_rolemap m_action_rolemap[]
|
||||
m_action_type m_action_type[]
|
||||
m_another_role m_another_role[]
|
||||
m_asm_action m_asm_action[]
|
||||
m_asm_param m_asm_param[]
|
||||
m_client_logo m_client_logo[]
|
||||
m_hospital m_hospital[]
|
||||
m_role m_role[]
|
||||
m_score_option m_score_option[]
|
||||
m_semester m_semester[]
|
||||
m_session m_session[]
|
||||
m_stage m_stage[]
|
||||
m_stase m_stase[]
|
||||
m_user_m_user_id_clientTom_client m_user[] @relation("m_user_id_clientTom_client")
|
||||
m_user_m_user_id_institutionTom_client m_user[] @relation("m_user_id_institutionTom_client")
|
||||
m_user_action m_user_action[]
|
||||
t_audit_trails t_audit_trails[]
|
||||
t_logbook t_logbook[]
|
||||
t_logbook_asm t_logbook_asm[]
|
||||
t_logbook_attachment t_logbook_attachment[]
|
||||
other_t_logbook_emr t_logbook_emr[] @relation("t_logbook_emrTot_logbook_emr")
|
||||
t_logbook_status t_logbook_status[]
|
||||
t_menu t_menu[]
|
||||
t_notif t_notif[]
|
||||
}
|
||||
|
||||
model m_client_logo {
|
||||
id Int @id @default(autoincrement())
|
||||
id_client Int
|
||||
file String
|
||||
m_client m_client @relation(fields: [id_client], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
}
|
||||
|
||||
model m_hospital {
|
||||
id Int @id @default(autoincrement())
|
||||
name String @db.VarChar
|
||||
address String? @db.VarChar
|
||||
notes String? @db.VarChar
|
||||
longitude String? @db.VarChar
|
||||
latitude String? @db.VarChar
|
||||
created_by Int
|
||||
created_date DateTime @db.Timestamptz(6)
|
||||
updated_date DateTime? @db.Timestamptz(6)
|
||||
updated_by Int?
|
||||
id_client Int
|
||||
code String? @db.VarChar
|
||||
m_user_m_hospital_created_byTom_user m_user @relation("m_hospital_created_byTom_user", fields: [created_by], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_client m_client @relation(fields: [id_client], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_user_m_hospital_updated_byTom_user m_user? @relation("m_hospital_updated_byTom_user", fields: [updated_by], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
t_logbook t_logbook[]
|
||||
}
|
||||
|
||||
model m_role {
|
||||
id Int @id(map: "mst_role_pkey") @default(autoincrement())
|
||||
name String @db.VarChar
|
||||
created_date DateTime @db.Timestamptz(6)
|
||||
created_by Int
|
||||
updated_date DateTime? @db.Timestamptz(6)
|
||||
updated_by Int?
|
||||
id_client Int
|
||||
m_client m_client @relation(fields: [id_client], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_user m_user[]
|
||||
}
|
||||
|
||||
/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
|
||||
model m_score_option {
|
||||
id Int @id(map: "m_score_dropdown_pkey") @default(autoincrement())
|
||||
score Float
|
||||
id_action Int?
|
||||
id_client Int
|
||||
m_action m_action? @relation(fields: [id_action], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "m_score_dropdown_id_action_fkey")
|
||||
m_client m_client @relation(fields: [id_client], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "m_score_dropdown_id_client_fkey")
|
||||
}
|
||||
|
||||
model m_semester {
|
||||
id Int @id @default(autoincrement())
|
||||
name String @db.VarChar
|
||||
id_stage Int
|
||||
id_client Int
|
||||
m_action_semester m_action_semester[]
|
||||
m_client m_client @relation(fields: [id_client], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_stage m_stage @relation(fields: [id_stage], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_user m_user[]
|
||||
t_logbook t_logbook[]
|
||||
}
|
||||
|
||||
model m_session {
|
||||
id_user Int?
|
||||
session_id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
||||
created_at DateTime? @db.Timestamptz(6)
|
||||
updated_at DateTime? @db.Timestamptz(6)
|
||||
id_client Int
|
||||
m_client m_client @relation(fields: [id_client], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_user m_user? @relation(fields: [id_user], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "m_user")
|
||||
}
|
||||
|
||||
/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
|
||||
model m_stage {
|
||||
id Int @id @default(autoincrement())
|
||||
name String @db.VarChar
|
||||
label_color String @db.VarChar
|
||||
id_institution Int
|
||||
created_date DateTime @db.Timestamptz(6)
|
||||
created_by Int
|
||||
updated_date DateTime? @db.Timestamptz(6)
|
||||
updated_by Int?
|
||||
code String? @db.VarChar(20)
|
||||
id_client Int
|
||||
m_semester m_semester[]
|
||||
m_client m_client @relation(fields: [id_client], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_stase m_stase[]
|
||||
}
|
||||
|
||||
model m_stase {
|
||||
id Int @id @default(autoincrement())
|
||||
name String @db.VarChar
|
||||
id_stage Int
|
||||
id_client Int
|
||||
sequence Int
|
||||
m_client m_client @relation(fields: [id_client], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_stage m_stage @relation(fields: [id_stage], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "m_stase_id_semester_fkey")
|
||||
m_user m_user[]
|
||||
t_logbook t_logbook[]
|
||||
}
|
||||
|
||||
/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
|
||||
model m_user {
|
||||
id Int @id(map: "mst_user_pkey") @default(autoincrement())
|
||||
display_name String @db.VarChar
|
||||
username String? @db.VarChar
|
||||
email String? @db.VarChar
|
||||
password String? @db.VarChar(255)
|
||||
id_role Int
|
||||
is_deleted Boolean @default(false)
|
||||
created_date DateTime @db.Timestamptz(6)
|
||||
created_by Int?
|
||||
updated_date DateTime? @db.Timestamptz(6)
|
||||
updated_by Int?
|
||||
phone String? @db.VarChar
|
||||
address String? @db.VarChar
|
||||
date_of_birth DateTime? @db.Timestamptz(6)
|
||||
code String? @db.VarChar
|
||||
picture String?
|
||||
id_institution Int?
|
||||
id_sub_category Int?
|
||||
id_semester Int?
|
||||
id_stase Int?
|
||||
id_client Int
|
||||
gender String? @db.VarChar
|
||||
id_year Int?
|
||||
status String @default("Active") @db.VarChar
|
||||
inisial_code String? @db.VarChar
|
||||
is_show Boolean @default(true)
|
||||
m_hospital_m_hospital_created_byTom_user m_hospital[] @relation("m_hospital_created_byTom_user")
|
||||
m_hospital_m_hospital_updated_byTom_user m_hospital[] @relation("m_hospital_updated_byTom_user")
|
||||
m_session m_session[]
|
||||
m_client_m_user_id_clientTom_client m_client @relation("m_user_id_clientTom_client", fields: [id_client], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_client_m_user_id_institutionTom_client m_client? @relation("m_user_id_institutionTom_client", fields: [id_institution], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_semester m_semester? @relation(fields: [id_semester], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_stase m_stase? @relation(fields: [id_stase], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_action_category m_action_category? @relation(fields: [id_sub_category], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_academic_year_m_user_id_yearTom_academic_year m_academic_year? @relation("m_user_id_yearTom_academic_year", fields: [id_year], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_user_m_user_created_byTom_user m_user? @relation("m_user_created_byTom_user", fields: [created_by], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "mst_user_created_by_fkey")
|
||||
other_m_user_m_user_created_byTom_user m_user[] @relation("m_user_created_byTom_user")
|
||||
m_role m_role @relation(fields: [id_role], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "mst_user_id_role_fkey")
|
||||
m_user_m_user_updated_byTom_user m_user? @relation("m_user_updated_byTom_user", fields: [updated_by], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "mst_user_updated_by_fkey")
|
||||
other_m_user_m_user_updated_byTom_user m_user[] @relation("m_user_updated_byTom_user")
|
||||
m_user_action m_user_action[]
|
||||
t_audit_trails t_audit_trails[]
|
||||
t_logbook t_logbook[]
|
||||
t_logbook_status t_logbook_status[]
|
||||
t_menu_t_menu_created_byTom_user t_menu[] @relation("t_menu_created_byTom_user")
|
||||
t_menu_t_menu_updated_byTom_user t_menu[] @relation("t_menu_updated_byTom_user")
|
||||
t_notif t_notif[]
|
||||
}
|
||||
|
||||
model m_user_action {
|
||||
id Int @id(map: "m_action_user_pkey") @default(autoincrement())
|
||||
id_action_hidden Int
|
||||
id_user Int
|
||||
id_client Int
|
||||
m_client m_client @relation(fields: [id_client], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "m_action_user_id_client_fkey")
|
||||
m_action m_action @relation(fields: [id_action_hidden], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_user m_user @relation(fields: [id_user], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
}
|
||||
|
||||
/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
|
||||
model t_audit_trails {
|
||||
id Int @id @default(autoincrement())
|
||||
activity String
|
||||
ip_user String? @db.VarChar
|
||||
id_user Int
|
||||
timestamp DateTime @db.Timestamptz(6)
|
||||
type String @default("visit") @db.VarChar
|
||||
meta Json?
|
||||
id_client Int
|
||||
m_client m_client @relation(fields: [id_client], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_user m_user @relation(fields: [id_user], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
}
|
||||
|
||||
/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
|
||||
model t_logbook {
|
||||
id Int @id @default(autoincrement())
|
||||
title String?
|
||||
notes String?
|
||||
date DateTime @db.Timestamptz(6)
|
||||
location String? @db.VarChar
|
||||
id_hospital Int?
|
||||
id_category Int?
|
||||
id_action Int
|
||||
is_presentation Boolean @default(false)
|
||||
created_by Int
|
||||
created_date DateTime @db.Timestamptz(6)
|
||||
updated_by Int?
|
||||
updated_date DateTime? @db.Timestamptz(6)
|
||||
id_user Int?
|
||||
id_client Int
|
||||
verified Boolean? @default(false)
|
||||
operation_code String? @db.VarChar
|
||||
id_another_role Int?
|
||||
id_semester Int?
|
||||
id_stase Int?
|
||||
schedule_status String @default("pending") @db.VarChar
|
||||
exam_result String @default("Lolos") @db.VarChar
|
||||
id_academic_year Int?
|
||||
verified_status String @default("pending") @db.VarChar
|
||||
m_academic_year m_academic_year? @relation(fields: [id_academic_year], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_action m_action @relation(fields: [id_action], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_action_category m_action_category? @relation(fields: [id_category], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_client m_client @relation(fields: [id_client], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_hospital m_hospital? @relation(fields: [id_hospital], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_another_role m_another_role? @relation(fields: [id_another_role], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "t_logbook_id_operation_type_fkey")
|
||||
m_semester m_semester? @relation(fields: [id_semester], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_stase m_stase? @relation(fields: [id_stase], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_user m_user? @relation(fields: [id_user], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
t_logbook_asm t_logbook_asm[]
|
||||
t_logbook_attachment t_logbook_attachment[]
|
||||
t_logbook_emr t_logbook_emr[]
|
||||
t_logbook_status t_logbook_status[]
|
||||
t_notif t_notif[]
|
||||
}
|
||||
|
||||
model t_logbook_asm {
|
||||
id Int @id(map: "t_logbook_assesment_pkey") @default(autoincrement())
|
||||
id_logbook Int
|
||||
id_asm_param Int
|
||||
score Float
|
||||
created_by DateTime @db.Timestamptz(6)
|
||||
created_date Int
|
||||
updated_date DateTime? @db.Timestamptz(6)
|
||||
updated_by Int?
|
||||
id_client Int
|
||||
m_client m_client @relation(fields: [id_client], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_asm_param m_asm_param @relation(fields: [id_asm_param], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "t_logbook_assesment_id_assesment_indicator_fkey")
|
||||
t_logbook t_logbook @relation(fields: [id_logbook], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "t_logbook_assesment_id_logbook_fkey")
|
||||
}
|
||||
|
||||
model t_logbook_attachment {
|
||||
id Int @id @default(autoincrement())
|
||||
id_logbook Int
|
||||
url_file String?
|
||||
name String? @db.VarChar
|
||||
id_client Int
|
||||
m_client m_client @relation(fields: [id_client], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
t_logbook t_logbook @relation(fields: [id_logbook], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
}
|
||||
|
||||
model t_logbook_emr {
|
||||
id Int @id(map: "t_logbook_medical_record_pkey") @default(autoincrement())
|
||||
id_logbook Int
|
||||
emr_number String? @db.VarChar
|
||||
diagnosis String? @db.VarChar
|
||||
treatment String? @db.VarChar
|
||||
age Int?
|
||||
gender String? @db.VarChar
|
||||
id_client Int?
|
||||
month Int?
|
||||
patient_name String? @db.VarChar
|
||||
t_logbook_emr m_client? @relation("t_logbook_emrTot_logbook_emr", fields: [id_client], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
t_logbook t_logbook @relation(fields: [id_logbook], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "t_logbook_medical_record_id_logbook_fkey")
|
||||
}
|
||||
|
||||
/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
|
||||
model t_logbook_status {
|
||||
id Int @id(map: "t_logbook_participants_pkey") @default(autoincrement())
|
||||
id_user Int
|
||||
id_logbook Int
|
||||
id_action_role Int
|
||||
status String @default("pending") @db.VarChar
|
||||
date_time DateTime? @db.Timestamptz(6)
|
||||
id_client Int
|
||||
m_user m_user @relation(fields: [id_user], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "t_logbook_participants_id_user_fkey")
|
||||
m_action_role m_action_role @relation(fields: [id_action_role], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_client m_client @relation(fields: [id_client], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
t_logbook t_logbook @relation(fields: [id_logbook], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "t_logbook_participants_id_logbook_fkey")
|
||||
}
|
||||
|
||||
model t_menu {
|
||||
id Int @id @default(autoincrement())
|
||||
id_user String @db.VarChar
|
||||
created_by Int
|
||||
updated_date DateTime? @db.Timestamptz(6)
|
||||
updated_by Int?
|
||||
id_action Int
|
||||
id_client Int
|
||||
m_user_t_menu_created_byTom_user m_user @relation("t_menu_created_byTom_user", fields: [created_by], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_client m_client @relation(fields: [id_client], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_user_t_menu_updated_byTom_user m_user? @relation("t_menu_updated_byTom_user", fields: [updated_by], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
}
|
||||
|
||||
/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
|
||||
model t_notif {
|
||||
id Int @id @default(autoincrement())
|
||||
message String
|
||||
date DateTime @db.Timestamptz(6)
|
||||
type String @db.VarChar
|
||||
id_user Int
|
||||
url String @db.VarChar
|
||||
id_role Int
|
||||
read Boolean @default(false)
|
||||
id_client Int
|
||||
id_logbook Int?
|
||||
m_client m_client @relation(fields: [id_client], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
t_logbook t_logbook? @relation(fields: [id_logbook], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
m_user m_user @relation(fields: [id_user], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
}
|
||||
|
||||
model m_another_role {
|
||||
id Int @id(map: "m_operation_type_pkey") @default(autoincrement())
|
||||
role_name String @db.VarChar
|
||||
id_client Int
|
||||
m_client m_client @relation(fields: [id_client], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "m_operation_type_id_client_fkey")
|
||||
t_logbook t_logbook[]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
import { PrismaClient } from "@prisma/client";
|
||||
Vendored
+292
@@ -0,0 +1,292 @@
|
||||
declare module "app/db/db" {
|
||||
|
||||
}
|
||||
declare module "pkgs/utils/global" {
|
||||
import { Logger } from "pino";
|
||||
import { RadixRouter } from "radix3";
|
||||
|
||||
import { Database } from "bun:sqlite";
|
||||
type SingleRoute = {
|
||||
url: string;
|
||||
args: string[];
|
||||
fn: (...arg: any[]) => Promise<any>;
|
||||
path: string;
|
||||
};
|
||||
export const g: {
|
||||
|
||||
dburl: string;
|
||||
datadir: string;
|
||||
mode: "dev" | "prod";
|
||||
|
||||
log: Logger;
|
||||
firebaseInit: boolean;
|
||||
firebase: admin.app.App;
|
||||
notif: {
|
||||
db: Database;
|
||||
};
|
||||
api: Record<string, SingleRoute>;
|
||||
domains: null | Record<string, string>;
|
||||
web: Record<string, {
|
||||
site_id: string;
|
||||
current: number;
|
||||
deploying: null | {
|
||||
status: string;
|
||||
received: number;
|
||||
total: number;
|
||||
};
|
||||
deploys: number[];
|
||||
domains: string[];
|
||||
router: null | RadixRouter<{
|
||||
id: string;
|
||||
}>;
|
||||
cacheKey: number;
|
||||
cache: null | {
|
||||
site: {
|
||||
id: string;
|
||||
name: string;
|
||||
favicon: string;
|
||||
domain: string;
|
||||
id_user: string;
|
||||
created_at: Date | null;
|
||||
id_org: string | null;
|
||||
updated_at: Date | null;
|
||||
responsive: string;
|
||||
} | null;
|
||||
pages: {
|
||||
id: string;
|
||||
name: string;
|
||||
url: string;
|
||||
content_tree: any;
|
||||
id_site: string;
|
||||
created_at: Date | null;
|
||||
js_compiled: string | null;
|
||||
js: string | null;
|
||||
updated_at: Date | null;
|
||||
id_folder: string | null;
|
||||
is_deleted: boolean;
|
||||
}[];
|
||||
npm: {
|
||||
site: Record<string, string>;
|
||||
pages: Record<string, Record<string, string>>;
|
||||
};
|
||||
comps: {
|
||||
id: string;
|
||||
name: string;
|
||||
content_tree: any;
|
||||
created_at: Date | null;
|
||||
updated_at: Date | null;
|
||||
type: string;
|
||||
id_component_group: string | null;
|
||||
props: any;
|
||||
}[];
|
||||
};
|
||||
}>;
|
||||
router: RadixRouter<SingleRoute>;
|
||||
port: number;
|
||||
frm: {
|
||||
js: string;
|
||||
etag: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
declare module "pkgs/server/serve-web" {
|
||||
export const serveWeb: (url: URL, req: Request) => Promise<false | string[] | Response>;
|
||||
export const generateIndexHtml: (base_url: string, site_id: string) => string;
|
||||
}
|
||||
declare module "pkgs/api/_file" {
|
||||
export const _: {
|
||||
url: string;
|
||||
api(): Promise<Response>;
|
||||
};
|
||||
}
|
||||
declare module "pkgs/utils/dir" {
|
||||
export const dir: (path: string) => string;
|
||||
}
|
||||
declare module "pkgs/server/load-web" {
|
||||
export const loadWeb: () => Promise<void>;
|
||||
export const loadWebCache: (site_id: string, ts: number | string) => Promise<void>;
|
||||
}
|
||||
declare module "pkgs/api/_deploy" {
|
||||
export const _: {
|
||||
url: string;
|
||||
api(action: ({
|
||||
type: "check";
|
||||
} | {
|
||||
type: "db-update";
|
||||
url: string;
|
||||
} | {
|
||||
type: "db-pull";
|
||||
} | {
|
||||
type: "restart";
|
||||
} | {
|
||||
type: "domain-add";
|
||||
domain: string;
|
||||
} | {
|
||||
type: "domain-del";
|
||||
domain: string;
|
||||
} | {
|
||||
type: "deploy-del";
|
||||
ts: string;
|
||||
} | {
|
||||
type: "deploy";
|
||||
dlurl: string;
|
||||
} | {
|
||||
type: "deploy-status";
|
||||
} | {
|
||||
type: "redeploy";
|
||||
ts: string;
|
||||
}) & {
|
||||
id_site: string;
|
||||
}): Promise<"ok" | {
|
||||
now: number;
|
||||
current: any;
|
||||
deploys: any;
|
||||
domains: any;
|
||||
db: {
|
||||
url: any;
|
||||
};
|
||||
} | {
|
||||
now: number;
|
||||
current: any;
|
||||
deploys: any;
|
||||
domains?: undefined;
|
||||
db?: undefined;
|
||||
}>;
|
||||
};
|
||||
export const downloadFile: (url: string, filePath: string, progress?: (rec: number, total: number) => void) => Promise<boolean>;
|
||||
}
|
||||
declare module "pkgs/api/_prasi" {
|
||||
export const _: {
|
||||
url: string;
|
||||
api(): Promise<void>;
|
||||
};
|
||||
export const getApiEntry: () => any;
|
||||
}
|
||||
declare module "pkgs/api/_notif" {
|
||||
export const _: {
|
||||
url: string;
|
||||
api(action: string, data: {
|
||||
type: "register";
|
||||
token: string;
|
||||
id: string;
|
||||
} | {
|
||||
type: "send";
|
||||
id: string;
|
||||
body: string;
|
||||
title: string;
|
||||
data?: any;
|
||||
}): Promise<{
|
||||
result: string;
|
||||
error?: undefined;
|
||||
totalDevice?: undefined;
|
||||
} | {
|
||||
error: string;
|
||||
result?: undefined;
|
||||
totalDevice?: undefined;
|
||||
} | {
|
||||
result: string;
|
||||
totalDevice: any;
|
||||
error?: undefined;
|
||||
}>;
|
||||
};
|
||||
}
|
||||
declare module "pkgs/api/_web" {
|
||||
export const _: {
|
||||
url: string;
|
||||
api(id: string, _: string): Promise<any>;
|
||||
};
|
||||
}
|
||||
declare module "pkgs/api/_proxy" {
|
||||
export const _: {
|
||||
url: string;
|
||||
api(arg: {
|
||||
url: string;
|
||||
method: "POST" | "GET";
|
||||
headers: any;
|
||||
body: any;
|
||||
}): Promise<Response>;
|
||||
};
|
||||
}
|
||||
declare module "pkgs/api/_upload" {
|
||||
export const _: {
|
||||
url: string;
|
||||
api(body: any): Promise<string>;
|
||||
};
|
||||
}
|
||||
declare module "pkgs/api/_dbs" {
|
||||
export const _: {
|
||||
url: string;
|
||||
api(dbName: any, action?: string): Promise<void>;
|
||||
};
|
||||
}
|
||||
declare module "pkgs/api/_api_frm" {
|
||||
export const _: {
|
||||
url: string;
|
||||
api(): Promise<void>;
|
||||
};
|
||||
}
|
||||
declare module "app/srv/exports" {
|
||||
export const _file: {
|
||||
name: string;
|
||||
url: string;
|
||||
path: string;
|
||||
args: any[];
|
||||
handler: Promise<typeof import("pkgs/api/_file")>;
|
||||
};
|
||||
export const _deploy: {
|
||||
name: string;
|
||||
url: string;
|
||||
path: string;
|
||||
args: string[];
|
||||
handler: Promise<typeof import("pkgs/api/_deploy")>;
|
||||
};
|
||||
export const _prasi: {
|
||||
name: string;
|
||||
url: string;
|
||||
path: string;
|
||||
args: any[];
|
||||
handler: Promise<typeof import("pkgs/api/_prasi")>;
|
||||
};
|
||||
export const _notif: {
|
||||
name: string;
|
||||
url: string;
|
||||
path: string;
|
||||
args: string[];
|
||||
handler: Promise<typeof import("pkgs/api/_notif")>;
|
||||
};
|
||||
export const _web: {
|
||||
name: string;
|
||||
url: string;
|
||||
path: string;
|
||||
args: string[];
|
||||
handler: Promise<typeof import("pkgs/api/_web")>;
|
||||
};
|
||||
export const _proxy: {
|
||||
name: string;
|
||||
url: string;
|
||||
path: string;
|
||||
args: string[];
|
||||
handler: Promise<typeof import("pkgs/api/_proxy")>;
|
||||
};
|
||||
export const _upload: {
|
||||
name: string;
|
||||
url: string;
|
||||
path: string;
|
||||
args: string[];
|
||||
handler: Promise<typeof import("pkgs/api/_upload")>;
|
||||
};
|
||||
export const _dbs: {
|
||||
name: string;
|
||||
url: string;
|
||||
path: string;
|
||||
args: string[];
|
||||
handler: Promise<typeof import("pkgs/api/_dbs")>;
|
||||
};
|
||||
export const _api_frm: {
|
||||
name: string;
|
||||
url: string;
|
||||
path: string;
|
||||
args: any[];
|
||||
handler: Promise<typeof import("pkgs/api/_api_frm")>;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
export const _file = {
|
||||
name: "_file",
|
||||
url: "/_file/**",
|
||||
path: "app/srv/api/_file.ts",
|
||||
args: [],
|
||||
handler: import("../../pkgs/api/_file")
|
||||
}
|
||||
export const _deploy = {
|
||||
name: "_deploy",
|
||||
url: "/_deploy",
|
||||
path: "app/srv/api/_deploy.ts",
|
||||
args: ["action"],
|
||||
handler: import("../../pkgs/api/_deploy")
|
||||
}
|
||||
export const _prasi = {
|
||||
name: "_prasi",
|
||||
url: "/_prasi/**",
|
||||
path: "app/srv/api/_prasi.ts",
|
||||
args: [],
|
||||
handler: import("../../pkgs/api/_prasi")
|
||||
}
|
||||
export const _notif = {
|
||||
name: "_notif",
|
||||
url: "/_notif/:action/:token",
|
||||
path: "app/srv/api/_notif.ts",
|
||||
args: ["action","data"],
|
||||
handler: import("../../pkgs/api/_notif")
|
||||
}
|
||||
export const _web = {
|
||||
name: "_web",
|
||||
url: "/_web/:id/**",
|
||||
path: "app/srv/api/_web.ts",
|
||||
args: ["id","_"],
|
||||
handler: import("../../pkgs/api/_web")
|
||||
}
|
||||
export const _proxy = {
|
||||
name: "_proxy",
|
||||
url: "/_proxy/*",
|
||||
path: "app/srv/api/_proxy.ts",
|
||||
args: ["arg"],
|
||||
handler: import("../../pkgs/api/_proxy")
|
||||
}
|
||||
export const _upload = {
|
||||
name: "_upload",
|
||||
url: "/_upload",
|
||||
path: "app/srv/api/_upload.ts",
|
||||
args: ["body"],
|
||||
handler: import("../../pkgs/api/_upload")
|
||||
}
|
||||
export const _dbs = {
|
||||
name: "_dbs",
|
||||
url: "/_dbs/:dbName/:action",
|
||||
path: "app/srv/api/_dbs.ts",
|
||||
args: ["dbName","action"],
|
||||
handler: import("../../pkgs/api/_dbs")
|
||||
}
|
||||
export const _api_frm = {
|
||||
name: "_api_frm",
|
||||
url: "/_api_frm",
|
||||
path: "app/srv/api/_api_frm.ts",
|
||||
args: [],
|
||||
handler: import("../../pkgs/api/_api_frm")
|
||||
}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
declare module "@surfy/multipart-parser";
|
||||
Reference in New Issue
Block a user