initial commit

This commit is contained in:
2026-04-04 22:13:55 -04:00
commit 5d77e207c9
10181 changed files with 522212 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
// ESM wrapper for browser environment
// This file re-exports the browser-safe parts of Prisma
const Prisma = {
prismaVersion: {
client: "7.4.1",
engine: "55ae170b1ced7fc6ed07a15f110549408c501bb3",
},
Decimal: class Decimal {
constructor(value) {
this.value = value;
}
toFixed = (digits, roundingMode) =>
Number(this.value).toFixed(digits, roundingMode);
toString = () => String(this.value);
toJSON = () => Number(this.value);
},
DecimalJsLike: {
d: [],
e: 0,
s: 1,
},
DbNull: Symbol.for("DbNull"),
JsonNull: Symbol.for("JsonNull"),
AnyNull: Symbol.for("AnyNull"),
NullTypes: {},
SortOrder: { asc: "asc", desc: "desc" },
QueryMode: { default: "default", insensitive: "insensitive" },
NullsOrder: { first: "first", last: "last" },
ModelName: {
User: "User",
Patient: "Patient",
Appointment: "Appointment",
Staff: "Staff",
NpiProvider: "NpiProvider",
AppointmentProcedure: "AppointmentProcedure",
Claim: "Claim",
ServiceLine: "ServiceLine",
ClaimFile: "ClaimFile",
InsuranceCredential: "InsuranceCredential",
PdfGroup: "PdfGroup",
PdfFile: "PdfFile",
Payment: "Payment",
ServiceLineTransaction: "ServiceLineTransaction",
DatabaseBackup: "DatabaseBackup",
BackupDestination: "BackupDestination",
Notification: "Notification",
CloudFolder: "CloudFolder",
CloudFile: "CloudFile",
CloudFileChunk: "CloudFileChunk",
Communication: "Communication",
PatientDocument: "PatientDocument",
},
TransactionIsolationLevel: {
ReadUncommitted: "ReadUncommitted",
ReadCommitted: "ReadCommitted",
RepeatableRead: "RepeatableRead",
Serializable: "Serializable",
},
validator: (
() => (x) =>
x
)(),
};
export { Prisma };
export default Prisma;

View File

@@ -0,0 +1 @@
export * from "./index"

View File

@@ -0,0 +1,5 @@
/* !!! This is code generated by Prisma. Do not edit directly. !!!
/* eslint-disable */
// biome-ignore-all lint: generated file
module.exports = { ...require('.') }

View File

@@ -0,0 +1 @@
export * from "./index"

View File

@@ -0,0 +1,5 @@
/* !!! This is code generated by Prisma. Do not edit directly. !!!
/* eslint-disable */
// biome-ignore-all lint: generated file
module.exports = { ...require('#main-entry-point') }

View File

@@ -0,0 +1 @@
export * from "./default"

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,545 @@
/* !!! This is code generated by Prisma. Do not edit directly. !!!
/* eslint-disable */
// biome-ignore-all lint: generated file
Object.defineProperty(exports, "__esModule", { value: true });
const {
Decimal,
DbNull,
JsonNull,
AnyNull,
NullTypes,
makeStrictEnum,
Public,
getRuntime,
skip
} = require('./runtime/index-browser.js')
const Prisma = {}
exports.Prisma = Prisma
exports.$Enums = {}
/**
* Prisma Client JS version: 7.4.1
* Query Engine version: 55ae170b1ced7fc6ed07a15f110549408c501bb3
*/
Prisma.prismaVersion = {
client: "7.4.1",
engine: "55ae170b1ced7fc6ed07a15f110549408c501bb3"
}
Prisma.PrismaClientKnownRequestError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)};
Prisma.PrismaClientUnknownRequestError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.PrismaClientRustPanicError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.PrismaClientInitializationError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.PrismaClientValidationError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.Decimal = Decimal
/**
* Re-export of sql-template-tag
*/
Prisma.sql = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.empty = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.join = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.raw = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.validator = Public.validator
/**
* Extensions
*/
Prisma.getExtensionContext = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.defineExtension = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
/**
* Shorthand utilities for JSON filtering
*/
Prisma.DbNull = DbNull
Prisma.JsonNull = JsonNull
Prisma.AnyNull = AnyNull
Prisma.NullTypes = NullTypes
/**
* Enums
*/
exports.Prisma.TransactionIsolationLevel = makeStrictEnum({
ReadUncommitted: 'ReadUncommitted',
ReadCommitted: 'ReadCommitted',
RepeatableRead: 'RepeatableRead',
Serializable: 'Serializable'
});
exports.Prisma.UserScalarFieldEnum = {
id: 'id',
username: 'username',
password: 'password'
};
exports.Prisma.PatientScalarFieldEnum = {
id: 'id',
firstName: 'firstName',
lastName: 'lastName',
dateOfBirth: 'dateOfBirth',
gender: 'gender',
phone: 'phone',
email: 'email',
address: 'address',
city: 'city',
zipCode: 'zipCode',
insuranceProvider: 'insuranceProvider',
insuranceId: 'insuranceId',
groupNumber: 'groupNumber',
policyHolder: 'policyHolder',
allergies: 'allergies',
medicalConditions: 'medicalConditions',
status: 'status',
userId: 'userId',
createdAt: 'createdAt'
};
exports.Prisma.AppointmentScalarFieldEnum = {
id: 'id',
patientId: 'patientId',
userId: 'userId',
staffId: 'staffId',
title: 'title',
date: 'date',
startTime: 'startTime',
endTime: 'endTime',
type: 'type',
notes: 'notes',
procedureCodeNotes: 'procedureCodeNotes',
status: 'status',
createdAt: 'createdAt',
eligibilityStatus: 'eligibilityStatus'
};
exports.Prisma.StaffScalarFieldEnum = {
id: 'id',
userId: 'userId',
name: 'name',
email: 'email',
role: 'role',
phone: 'phone',
createdAt: 'createdAt'
};
exports.Prisma.NpiProviderScalarFieldEnum = {
id: 'id',
userId: 'userId',
npiNumber: 'npiNumber',
providerName: 'providerName',
createdAt: 'createdAt'
};
exports.Prisma.AppointmentProcedureScalarFieldEnum = {
id: 'id',
appointmentId: 'appointmentId',
patientId: 'patientId',
procedureCode: 'procedureCode',
procedureLabel: 'procedureLabel',
fee: 'fee',
category: 'category',
toothNumber: 'toothNumber',
toothSurface: 'toothSurface',
oralCavityArea: 'oralCavityArea',
source: 'source',
comboKey: 'comboKey',
createdAt: 'createdAt'
};
exports.Prisma.ClaimScalarFieldEnum = {
id: 'id',
patientId: 'patientId',
appointmentId: 'appointmentId',
userId: 'userId',
staffId: 'staffId',
patientName: 'patientName',
memberId: 'memberId',
dateOfBirth: 'dateOfBirth',
remarks: 'remarks',
missingTeethStatus: 'missingTeethStatus',
missingTeeth: 'missingTeeth',
serviceDate: 'serviceDate',
insuranceProvider: 'insuranceProvider',
createdAt: 'createdAt',
updatedAt: 'updatedAt',
status: 'status',
claimNumber: 'claimNumber'
};
exports.Prisma.ServiceLineScalarFieldEnum = {
id: 'id',
claimId: 'claimId',
paymentId: 'paymentId',
procedureCode: 'procedureCode',
procedureDate: 'procedureDate',
quad: 'quad',
arch: 'arch',
toothNumber: 'toothNumber',
toothSurface: 'toothSurface',
totalBilled: 'totalBilled',
totalPaid: 'totalPaid',
totalAdjusted: 'totalAdjusted',
totalDue: 'totalDue',
status: 'status'
};
exports.Prisma.ClaimFileScalarFieldEnum = {
id: 'id',
claimId: 'claimId',
filename: 'filename',
mimeType: 'mimeType'
};
exports.Prisma.InsuranceCredentialScalarFieldEnum = {
id: 'id',
userId: 'userId',
siteKey: 'siteKey',
username: 'username',
password: 'password'
};
exports.Prisma.PdfGroupScalarFieldEnum = {
id: 'id',
title: 'title',
titleKey: 'titleKey',
createdAt: 'createdAt',
patientId: 'patientId'
};
exports.Prisma.PdfFileScalarFieldEnum = {
id: 'id',
filename: 'filename',
pdfData: 'pdfData',
uploadedAt: 'uploadedAt',
groupId: 'groupId'
};
exports.Prisma.PaymentScalarFieldEnum = {
id: 'id',
claimId: 'claimId',
patientId: 'patientId',
userId: 'userId',
updatedById: 'updatedById',
totalBilled: 'totalBilled',
totalPaid: 'totalPaid',
totalAdjusted: 'totalAdjusted',
totalDue: 'totalDue',
status: 'status',
notes: 'notes',
icn: 'icn',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.ServiceLineTransactionScalarFieldEnum = {
id: 'id',
paymentId: 'paymentId',
serviceLineId: 'serviceLineId',
transactionId: 'transactionId',
paidAmount: 'paidAmount',
adjustedAmount: 'adjustedAmount',
method: 'method',
receivedDate: 'receivedDate',
payerName: 'payerName',
notes: 'notes',
createdAt: 'createdAt'
};
exports.Prisma.DatabaseBackupScalarFieldEnum = {
id: 'id',
userId: 'userId',
createdAt: 'createdAt'
};
exports.Prisma.BackupDestinationScalarFieldEnum = {
id: 'id',
userId: 'userId',
path: 'path',
isActive: 'isActive',
createdAt: 'createdAt'
};
exports.Prisma.NotificationScalarFieldEnum = {
id: 'id',
userId: 'userId',
type: 'type',
message: 'message',
createdAt: 'createdAt',
read: 'read'
};
exports.Prisma.CloudFolderScalarFieldEnum = {
id: 'id',
userId: 'userId',
name: 'name',
parentId: 'parentId',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.CloudFileScalarFieldEnum = {
id: 'id',
userId: 'userId',
name: 'name',
mimeType: 'mimeType',
fileSize: 'fileSize',
folderId: 'folderId',
isComplete: 'isComplete',
totalChunks: 'totalChunks',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.CloudFileChunkScalarFieldEnum = {
id: 'id',
fileId: 'fileId',
seq: 'seq',
data: 'data',
createdAt: 'createdAt'
};
exports.Prisma.CommunicationScalarFieldEnum = {
id: 'id',
patientId: 'patientId',
userId: 'userId',
channel: 'channel',
direction: 'direction',
status: 'status',
body: 'body',
callDuration: 'callDuration',
twilioSid: 'twilioSid',
createdAt: 'createdAt'
};
exports.Prisma.PatientDocumentScalarFieldEnum = {
id: 'id',
patientId: 'patientId',
filename: 'filename',
originalName: 'originalName',
mimeType: 'mimeType',
fileSize: 'fileSize',
filePath: 'filePath',
uploadedAt: 'uploadedAt',
updatedAt: 'updatedAt'
};
exports.Prisma.SortOrder = {
asc: 'asc',
desc: 'desc'
};
exports.Prisma.NullableJsonNullValueInput = {
DbNull: Prisma.DbNull,
JsonNull: Prisma.JsonNull
};
exports.Prisma.QueryMode = {
default: 'default',
insensitive: 'insensitive'
};
exports.Prisma.NullsOrder = {
first: 'first',
last: 'last'
};
exports.Prisma.JsonNullValueFilter = {
DbNull: Prisma.DbNull,
JsonNull: Prisma.JsonNull,
AnyNull: Prisma.AnyNull
};
exports.PatientStatus = exports.$Enums.PatientStatus = {
ACTIVE: 'ACTIVE',
INACTIVE: 'INACTIVE',
UNKNOWN: 'UNKNOWN'
};
exports.ProcedureSource = exports.$Enums.ProcedureSource = {
COMBO: 'COMBO',
MANUAL: 'MANUAL'
};
exports.MissingTeethStatus = exports.$Enums.MissingTeethStatus = {
No_missing: 'No_missing',
endentulous: 'endentulous',
Yes_missing: 'Yes_missing'
};
exports.ClaimStatus = exports.$Enums.ClaimStatus = {
PENDING: 'PENDING',
APPROVED: 'APPROVED',
CANCELLED: 'CANCELLED',
REVIEW: 'REVIEW',
VOID: 'VOID'
};
exports.ServiceLineStatus = exports.$Enums.ServiceLineStatus = {
PENDING: 'PENDING',
PARTIALLY_PAID: 'PARTIALLY_PAID',
PAID: 'PAID',
UNPAID: 'UNPAID',
ADJUSTED: 'ADJUSTED',
OVERPAID: 'OVERPAID',
DENIED: 'DENIED'
};
exports.PdfTitleKey = exports.$Enums.PdfTitleKey = {
INSURANCE_CLAIM: 'INSURANCE_CLAIM',
INSURANCE_CLAIM_PREAUTH: 'INSURANCE_CLAIM_PREAUTH',
ELIGIBILITY_STATUS: 'ELIGIBILITY_STATUS',
CLAIM_STATUS: 'CLAIM_STATUS',
OTHER: 'OTHER'
};
exports.PaymentStatus = exports.$Enums.PaymentStatus = {
PENDING: 'PENDING',
PARTIALLY_PAID: 'PARTIALLY_PAID',
PAID: 'PAID',
OVERPAID: 'OVERPAID',
DENIED: 'DENIED',
VOID: 'VOID'
};
exports.PaymentMethod = exports.$Enums.PaymentMethod = {
EFT: 'EFT',
CHECK: 'CHECK',
CASH: 'CASH',
CARD: 'CARD',
OTHER: 'OTHER'
};
exports.NotificationTypes = exports.$Enums.NotificationTypes = {
BACKUP: 'BACKUP',
CLAIM: 'CLAIM',
PAYMENT: 'PAYMENT',
ETC: 'ETC'
};
exports.CommunicationChannel = exports.$Enums.CommunicationChannel = {
sms: 'sms',
voice: 'voice'
};
exports.CommunicationDirection = exports.$Enums.CommunicationDirection = {
outbound: 'outbound',
inbound: 'inbound'
};
exports.CommunicationStatus = exports.$Enums.CommunicationStatus = {
queued: 'queued',
sent: 'sent',
delivered: 'delivered',
failed: 'failed',
completed: 'completed',
busy: 'busy',
no_answer: 'no_answer'
};
exports.Prisma.ModelName = {
User: 'User',
Patient: 'Patient',
Appointment: 'Appointment',
Staff: 'Staff',
NpiProvider: 'NpiProvider',
AppointmentProcedure: 'AppointmentProcedure',
Claim: 'Claim',
ServiceLine: 'ServiceLine',
ClaimFile: 'ClaimFile',
InsuranceCredential: 'InsuranceCredential',
PdfGroup: 'PdfGroup',
PdfFile: 'PdfFile',
Payment: 'Payment',
ServiceLineTransaction: 'ServiceLineTransaction',
DatabaseBackup: 'DatabaseBackup',
BackupDestination: 'BackupDestination',
Notification: 'Notification',
CloudFolder: 'CloudFolder',
CloudFile: 'CloudFile',
CloudFileChunk: 'CloudFileChunk',
Communication: 'Communication',
PatientDocument: 'PatientDocument'
};
/**
* This is a stub Prisma Client that will error at runtime if called.
*/
class PrismaClient {
constructor() {
return new Proxy(this, {
get(target, prop) {
let message
const runtime = getRuntime()
if (runtime.isEdge) {
message = `PrismaClient is not configured to run in ${runtime.prettyName}. In order to run Prisma Client on edge runtime, either:
- Use Prisma Accelerate: https://pris.ly/d/accelerate
- Use Driver Adapters: https://pris.ly/d/driver-adapters
`;
} else {
message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `' + runtime.prettyName + '`).'
}
message += `
If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report`
throw new Error(message)
}
})
}
}
exports.PrismaClient = PrismaClient
Object.assign(exports, Prisma)

45562
packages/db/generated/prisma/index.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,144 @@
{
"name": "prisma-client-84f25235762dfea7319ce0b6c4ad7d94238d35906c50310bacb4ba6f7e4b8e30",
"main": "index.js",
"types": "index.d.ts",
"browser": "default.js",
"exports": {
"./client": {
"require": {
"node": "./index.js",
"edge-light": "./edge.js",
"workerd": "./edge.js",
"worker": "./edge.js",
"browser": "./index-browser.js",
"default": "./index.js"
},
"import": {
"node": "./index.js",
"edge-light": "./edge.js",
"workerd": "./edge.js",
"worker": "./edge.js",
"browser": "./index-browser.js",
"default": "./index.js"
},
"default": "./index.js"
},
"./package.json": "./package.json",
".": {
"require": {
"node": "./index.js",
"edge-light": "./edge.js",
"workerd": "./edge.js",
"worker": "./edge.js",
"browser": "./index-browser.js",
"default": "./index.js"
},
"import": {
"node": "./index.js",
"edge-light": "./edge.js",
"workerd": "./edge.js",
"worker": "./edge.js",
"browser": "./index-browser.js",
"default": "./index.js"
},
"default": "./index.js"
},
"./extension": {
"types": "./extension.d.ts",
"require": "./extension.js",
"import": "./extension.js",
"default": "./extension.js"
},
"./index-browser": {
"types": "./index.d.ts",
"require": "./index-browser.js",
"import": "./index-browser.js",
"default": "./index-browser.js"
},
"./index": {
"types": "./index.d.ts",
"require": "./index.js",
"import": "./index.js",
"default": "./index.js"
},
"./edge": {
"types": "./edge.d.ts",
"require": "./edge.js",
"import": "./edge.js",
"default": "./edge.js"
},
"./runtime/client": {
"types": "./runtime/client.d.ts",
"node": {
"require": "./runtime/client.js",
"default": "./runtime/client.js"
},
"require": "./runtime/client.js",
"import": "./runtime/client.mjs",
"default": "./runtime/client.mjs"
},
"./runtime/wasm-compiler-edge": {
"types": "./runtime/wasm-compiler-edge.d.ts",
"require": "./runtime/wasm-compiler-edge.js",
"import": "./runtime/wasm-compiler-edge.mjs",
"default": "./runtime/wasm-compiler-edge.mjs"
},
"./runtime/index-browser": {
"types": "./runtime/index-browser.d.ts",
"require": "./runtime/index-browser.js",
"import": "./runtime/index-browser.mjs",
"default": "./runtime/index-browser.mjs"
},
"./generator-build": {
"require": "./generator-build/index.js",
"import": "./generator-build/index.js",
"default": "./generator-build/index.js"
},
"./sql": {
"require": {
"types": "./sql.d.ts",
"node": "./sql.js",
"default": "./sql.js"
},
"import": {
"types": "./sql.d.ts",
"node": "./sql.mjs",
"default": "./sql.mjs"
},
"default": "./sql.js"
},
"./*": "./*"
},
"version": "7.4.1",
"sideEffects": false,
"dependencies": {
"@prisma/client-runtime-utils": "7.4.1"
},
"imports": {
"#wasm-compiler-loader": {
"edge-light": "./wasm-edge-light-loader.mjs",
"workerd": "./wasm-worker-loader.mjs",
"worker": "./wasm-worker-loader.mjs",
"default": "./wasm-worker-loader.mjs"
},
"#main-entry-point": {
"require": {
"node": "./index.js",
"edge-light": "./edge.js",
"workerd": "./edge.js",
"worker": "./edge.js",
"browser": "./index-browser.js",
"default": "./index.js"
},
"import": {
"node": "./index.js",
"edge-light": "./edge.js",
"workerd": "./edge.js",
"worker": "./edge.js",
"browser": "./index-browser.js",
"default": "./index.js"
},
"default": "./index.js"
}
}
}

View File

@@ -0,0 +1,2 @@
"use strict";var h=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var j=Object.prototype.hasOwnProperty;var D=(e,t)=>{for(var n in t)h(e,n,{get:t[n],enumerable:!0})},O=(e,t,n,_)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of M(t))!j.call(e,r)&&r!==n&&h(e,r,{get:()=>t[r],enumerable:!(_=T(t,r))||_.enumerable});return e};var B=e=>O(h({},"__esModule",{value:!0}),e);var xe={};D(xe,{QueryCompiler:()=>F,__wbg_Error_e83987f665cf5504:()=>q,__wbg_Number_bb48ca12f395cd08:()=>C,__wbg_String_8f0eb39a4a4c2f66:()=>k,__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68:()=>W,__wbg___wbindgen_debug_string_df47ffb5e35e6763:()=>V,__wbg___wbindgen_in_bb933bd9e1b3bc0f:()=>z,__wbg___wbindgen_is_object_c818261d21f283a4:()=>L,__wbg___wbindgen_is_string_fbb76cb2940daafd:()=>P,__wbg___wbindgen_is_undefined_2d472862bd29a478:()=>Q,__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147:()=>Y,__wbg___wbindgen_number_get_a20bf9b85341449d:()=>G,__wbg___wbindgen_string_get_e4f06c90489ad01b:()=>J,__wbg___wbindgen_throw_b855445ff6a94295:()=>X,__wbg_entries_e171b586f8f6bdbf:()=>H,__wbg_getTime_14776bfb48a1bff9:()=>K,__wbg_get_7bed016f185add81:()=>Z,__wbg_get_with_ref_key_1dc361bd10053bfe:()=>v,__wbg_instanceof_ArrayBuffer_70beb1189ca63b38:()=>ee,__wbg_instanceof_Uint8Array_20c8e73002f7af98:()=>te,__wbg_isSafeInteger_d216eda7911dde36:()=>ne,__wbg_length_69bca3cb64fc8748:()=>re,__wbg_length_cdd215e10d9dd507:()=>_e,__wbg_new_0_f9740686d739025c:()=>oe,__wbg_new_1acc0b6eea89d040:()=>ce,__wbg_new_5a79be3ab53b8aa5:()=>ie,__wbg_new_68651c719dcda04e:()=>se,__wbg_new_e17d9f43105b08be:()=>ue,__wbg_prototypesetcall_2a6620b6922694b2:()=>fe,__wbg_set_3f1d0b984ed272ed:()=>be,__wbg_set_907fb406c34a251d:()=>de,__wbg_set_c213c871859d6500:()=>ae,__wbg_set_message_82ae475bb413aa5c:()=>ge,__wbg_set_wasm:()=>N,__wbindgen_cast_2241b6af4c4b2941:()=>le,__wbindgen_cast_4625c577ab2ec9ee:()=>we,__wbindgen_cast_9ae0607507abb057:()=>pe,__wbindgen_cast_d6cd19b81560fd6e:()=>ye,__wbindgen_init_externref_table:()=>me});module.exports=B(xe);var A=()=>{};A.prototype=A;let o;function N(e){o=e}let p=null;function a(){return(p===null||p.byteLength===0)&&(p=new Uint8Array(o.memory.buffer)),p}let y=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});y.decode();const U=2146435072;let S=0;function R(e,t){return S+=t,S>=U&&(y=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),y.decode(),S=t),y.decode(a().subarray(e,e+t))}function m(e,t){return e=e>>>0,R(e,t)}let f=0;const g=new TextEncoder;"encodeInto"in g||(g.encodeInto=function(e,t){const n=g.encode(e);return t.set(n),{read:e.length,written:n.length}});function l(e,t,n){if(n===void 0){const i=g.encode(e),d=t(i.length,1)>>>0;return a().subarray(d,d+i.length).set(i),f=i.length,d}let _=e.length,r=t(_,1)>>>0;const s=a();let c=0;for(;c<_;c++){const i=e.charCodeAt(c);if(i>127)break;s[r+c]=i}if(c!==_){c!==0&&(e=e.slice(c)),r=n(r,_,_=c+e.length*3,1)>>>0;const i=a().subarray(r+c,r+_),d=g.encodeInto(e,i);c+=d.written,r=n(r,_,c,1)>>>0}return f=c,r}let b=null;function u(){return(b===null||b.buffer.detached===!0||b.buffer.detached===void 0&&b.buffer!==o.memory.buffer)&&(b=new DataView(o.memory.buffer)),b}function x(e){return e==null}function I(e){const t=typeof e;if(t=="number"||t=="boolean"||e==null)return`${e}`;if(t=="string")return`"${e}"`;if(t=="symbol"){const r=e.description;return r==null?"Symbol":`Symbol(${r})`}if(t=="function"){const r=e.name;return typeof r=="string"&&r.length>0?`Function(${r})`:"Function"}if(Array.isArray(e)){const r=e.length;let s="[";r>0&&(s+=I(e[0]));for(let c=1;c<r;c++)s+=", "+I(e[c]);return s+="]",s}const n=/\[object ([^\]]+)\]/.exec(toString.call(e));let _;if(n&&n.length>1)_=n[1];else return toString.call(e);if(_=="Object")try{return"Object("+JSON.stringify(e)+")"}catch{return"Object"}return e instanceof Error?`${e.name}: ${e.message}
${e.stack}`:_}function $(e,t){return e=e>>>0,a().subarray(e/1,e/1+t)}function w(e){const t=o.__wbindgen_externrefs.get(e);return o.__externref_table_dealloc(e),t}const E=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>o.__wbg_querycompiler_free(e>>>0,1));class F{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,E.unregister(this),t}free(){const t=this.__destroy_into_raw();o.__wbg_querycompiler_free(t,0)}compileBatch(t){const n=l(t,o.__wbindgen_malloc,o.__wbindgen_realloc),_=f,r=o.querycompiler_compileBatch(this.__wbg_ptr,n,_);if(r[2])throw w(r[1]);return w(r[0])}constructor(t){const n=o.querycompiler_new(t);if(n[2])throw w(n[1]);return this.__wbg_ptr=n[0]>>>0,E.register(this,this.__wbg_ptr,this),this}compile(t){const n=l(t,o.__wbindgen_malloc,o.__wbindgen_realloc),_=f,r=o.querycompiler_compile(this.__wbg_ptr,n,_);if(r[2])throw w(r[1]);return w(r[0])}}Symbol.dispose&&(F.prototype[Symbol.dispose]=F.prototype.free);function q(e,t){return Error(m(e,t))}function C(e){return Number(e)}function k(e,t){const n=String(t),_=l(n,o.__wbindgen_malloc,o.__wbindgen_realloc),r=f;u().setInt32(e+4*1,r,!0),u().setInt32(e+4*0,_,!0)}function W(e){const t=e,n=typeof t=="boolean"?t:void 0;return x(n)?16777215:n?1:0}function V(e,t){const n=I(t),_=l(n,o.__wbindgen_malloc,o.__wbindgen_realloc),r=f;u().setInt32(e+4*1,r,!0),u().setInt32(e+4*0,_,!0)}function z(e,t){return e in t}function L(e){const t=e;return typeof t=="object"&&t!==null}function P(e){return typeof e=="string"}function Q(e){return e===void 0}function Y(e,t){return e==t}function G(e,t){const n=t,_=typeof n=="number"?n:void 0;u().setFloat64(e+8*1,x(_)?0:_,!0),u().setInt32(e+4*0,!x(_),!0)}function J(e,t){const n=t,_=typeof n=="string"?n:void 0;var r=x(_)?0:l(_,o.__wbindgen_malloc,o.__wbindgen_realloc),s=f;u().setInt32(e+4*1,s,!0),u().setInt32(e+4*0,r,!0)}function X(e,t){throw new Error(m(e,t))}function H(e){return Object.entries(e)}function K(e){return e.getTime()}function Z(e,t){return e[t>>>0]}function v(e,t){return e[t]}function ee(e){let t;try{t=e instanceof ArrayBuffer}catch{t=!1}return t}function te(e){let t;try{t=e instanceof Uint8Array}catch{t=!1}return t}function ne(e){return Number.isSafeInteger(e)}function re(e){return e.length}function _e(e){return e.length}function oe(){return new Date}function ce(){return new Object}function ie(e){return new Uint8Array(e)}function se(){return new Map}function ue(){return new Array}function fe(e,t,n){Uint8Array.prototype.set.call($(e,t),n)}function be(e,t,n){e[t]=n}function de(e,t,n){return e.set(t,n)}function ae(e,t,n){e[t>>>0]=n}function ge(e,t){global.PRISMA_WASM_PANIC_REGISTRY.set_message(m(e,t))}function le(e,t){return m(e,t)}function we(e){return BigInt.asUintN(64,e)}function pe(e){return e}function ye(e){return e}function me(){const e=o.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}0&&(module.exports={QueryCompiler,__wbg_Error_e83987f665cf5504,__wbg_Number_bb48ca12f395cd08,__wbg_String_8f0eb39a4a4c2f66,__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68,__wbg___wbindgen_debug_string_df47ffb5e35e6763,__wbg___wbindgen_in_bb933bd9e1b3bc0f,__wbg___wbindgen_is_object_c818261d21f283a4,__wbg___wbindgen_is_string_fbb76cb2940daafd,__wbg___wbindgen_is_undefined_2d472862bd29a478,__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147,__wbg___wbindgen_number_get_a20bf9b85341449d,__wbg___wbindgen_string_get_e4f06c90489ad01b,__wbg___wbindgen_throw_b855445ff6a94295,__wbg_entries_e171b586f8f6bdbf,__wbg_getTime_14776bfb48a1bff9,__wbg_get_7bed016f185add81,__wbg_get_with_ref_key_1dc361bd10053bfe,__wbg_instanceof_ArrayBuffer_70beb1189ca63b38,__wbg_instanceof_Uint8Array_20c8e73002f7af98,__wbg_isSafeInteger_d216eda7911dde36,__wbg_length_69bca3cb64fc8748,__wbg_length_cdd215e10d9dd507,__wbg_new_0_f9740686d739025c,__wbg_new_1acc0b6eea89d040,__wbg_new_5a79be3ab53b8aa5,__wbg_new_68651c719dcda04e,__wbg_new_e17d9f43105b08be,__wbg_prototypesetcall_2a6620b6922694b2,__wbg_set_3f1d0b984ed272ed,__wbg_set_907fb406c34a251d,__wbg_set_c213c871859d6500,__wbg_set_message_82ae475bb413aa5c,__wbg_set_wasm,__wbindgen_cast_2241b6af4c4b2941,__wbindgen_cast_4625c577ab2ec9ee,__wbindgen_cast_9ae0607507abb057,__wbindgen_cast_d6cd19b81560fd6e,__wbindgen_init_externref_table});

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,87 @@
import { AnyNull } from '@prisma/client-runtime-utils';
import { DbNull } from '@prisma/client-runtime-utils';
import { Decimal } from '@prisma/client-runtime-utils';
import { isAnyNull } from '@prisma/client-runtime-utils';
import { isDbNull } from '@prisma/client-runtime-utils';
import { isJsonNull } from '@prisma/client-runtime-utils';
import { JsonNull } from '@prisma/client-runtime-utils';
import { NullTypes } from '@prisma/client-runtime-utils';
export { AnyNull }
declare type Args<T, F extends Operation> = T extends {
[K: symbol]: {
types: {
operations: {
[K in F]: {
args: any;
};
};
};
};
} ? T[symbol]['types']['operations'][F]['args'] : any;
export { DbNull }
export { Decimal }
declare type Exact<A, W> = (A extends unknown ? (W extends A ? {
[K in keyof A]: Exact<A[K], W[K]>;
} : W) : never) | (A extends Narrowable ? A : never);
export declare function getRuntime(): GetRuntimeOutput;
declare type GetRuntimeOutput = {
id: RuntimeName;
prettyName: string;
isEdge: boolean;
};
export { isAnyNull }
export { isDbNull }
export { isJsonNull }
export { JsonNull }
/**
* Generates more strict variant of an enum which, unlike regular enum,
* throws on non-existing property access. This can be useful in following situations:
* - we have an API, that accepts both `undefined` and `SomeEnumType` as an input
* - enum values are generated dynamically from DMMF.
*
* In that case, if using normal enums and no compile-time typechecking, using non-existing property
* will result in `undefined` value being used, which will be accepted. Using strict enum
* in this case will help to have a runtime exception, telling you that you are probably doing something wrong.
*
* Note: if you need to check for existence of a value in the enum you can still use either
* `in` operator or `hasOwnProperty` function.
*
* @param definition
* @returns
*/
export declare function makeStrictEnum<T extends Record<PropertyKey, string | number>>(definition: T): T;
declare type Narrowable = string | number | bigint | boolean | [];
export { NullTypes }
declare type Operation = 'findFirst' | 'findFirstOrThrow' | 'findUnique' | 'findUniqueOrThrow' | 'findMany' | 'create' | 'createMany' | 'createManyAndReturn' | 'update' | 'updateMany' | 'updateManyAndReturn' | 'upsert' | 'delete' | 'deleteMany' | 'aggregate' | 'count' | 'groupBy' | '$queryRaw' | '$executeRaw' | '$queryRawUnsafe' | '$executeRawUnsafe' | 'findRaw' | 'aggregateRaw' | '$runCommandRaw';
declare namespace Public {
export {
validator
}
}
export { Public }
declare type RuntimeName = 'workerd' | 'deno' | 'netlify' | 'node' | 'bun' | 'edge-light' | '';
declare function validator<V>(): <S>(select: Exact<S, V>) => S;
declare function validator<C, M extends Exclude<keyof C, `$${string}`>, O extends keyof C[M] & Operation>(client: C, model: M, operation: O): <S>(select: Exact<S, Args<C[M], O>>) => S;
declare function validator<C, M extends Exclude<keyof C, `$${string}`>, O extends keyof C[M] & Operation, P extends keyof Args<C[M], O>>(client: C, model: M, operation: O, prop: P): <S>(select: Exact<S, Args<C[M], O>[P]>) => S;
export { }

View File

@@ -0,0 +1,6 @@
/* !!! This is code generated by Prisma. Do not edit directly. !!!
/* eslint-disable */
// biome-ignore-all lint: generated file
"use strict";var s=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var a=(e,t)=>{for(var n in t)s(e,n,{get:t[n],enumerable:!0})},y=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of p(t))!f.call(e,i)&&i!==n&&s(e,i,{get:()=>t[i],enumerable:!(r=g(t,i))||r.enumerable});return e};var x=e=>y(s({},"__esModule",{value:!0}),e);var O={};a(O,{AnyNull:()=>o.AnyNull,DbNull:()=>o.DbNull,Decimal:()=>m.Decimal,JsonNull:()=>o.JsonNull,NullTypes:()=>o.NullTypes,Public:()=>l,getRuntime:()=>c,isAnyNull:()=>o.isAnyNull,isDbNull:()=>o.isDbNull,isJsonNull:()=>o.isJsonNull,makeStrictEnum:()=>u});module.exports=x(O);var l={};a(l,{validator:()=>d});function d(...e){return t=>t}var b=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function u(e){return new Proxy(e,{get(t,n){if(n in t)return t[n];if(!b.has(n))throw new TypeError("Invalid enum value: ".concat(String(n)))}})}var N=()=>{var e,t;return((t=(e=globalThis.process)==null?void 0:e.release)==null?void 0:t.name)==="node"},S=()=>{var e,t;return!!globalThis.Bun||!!((t=(e=globalThis.process)==null?void 0:e.versions)!=null&&t.bun)},E=()=>!!globalThis.Deno,R=()=>typeof globalThis.Netlify=="object",h=()=>typeof globalThis.EdgeRuntime=="object",C=()=>{var e;return((e=globalThis.navigator)==null?void 0:e.userAgent)==="Cloudflare-Workers"};function k(){var n;return(n=[[R,"netlify"],[h,"edge-light"],[C,"workerd"],[E,"deno"],[S,"bun"],[N,"node"]].flatMap(r=>r[0]()?[r[1]]:[]).at(0))!=null?n:""}var M={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function c(){let e=k();return{id:e,prettyName:M[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}var o=require("@prisma/client-runtime-utils"),m=require("@prisma/client-runtime-utils");0&&(module.exports={AnyNull,DbNull,Decimal,JsonNull,NullTypes,Public,getRuntime,isAnyNull,isDbNull,isJsonNull,makeStrictEnum});
//# sourceMappingURL=index-browser.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,505 @@
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
generator client {
provider = "prisma-client-js"
output = "../generated/prisma"
}
generator zod {
provider = "prisma-zod-generator"
output = "../shared/" // Zod schemas will be generated here inside `db/shared`
}
datasource db {
provider = "postgresql"
}
model User {
id Int @id @default(autoincrement())
username String @unique
password String
patients Patient[]
appointments Appointment[]
staff Staff[]
npiProviders NpiProvider[]
claims Claim[]
insuranceCredentials InsuranceCredential[]
updatedPayments Payment[] @relation("PaymentUpdatedBy")
backups DatabaseBackup[]
backupDestinations BackupDestination[]
notifications Notification[]
cloudFolders CloudFolder[]
cloudFiles CloudFile[]
communications Communication[]
}
model Patient {
id Int @id @default(autoincrement())
firstName String
lastName String
dateOfBirth DateTime @db.Date
gender String
phone String
email String?
address String?
city String?
zipCode String?
insuranceProvider String?
insuranceId String?
groupNumber String?
policyHolder String?
allergies String?
medicalConditions String?
status PatientStatus @default(UNKNOWN)
userId Int
createdAt DateTime @default(now())
user User @relation(fields: [userId], references: [id])
appointments Appointment[]
procedures AppointmentProcedure[]
claims Claim[]
groups PdfGroup[]
payment Payment[]
communications Communication[]
documents PatientDocument[]
@@index([insuranceId])
@@index([createdAt])
}
enum PatientStatus {
ACTIVE
INACTIVE
UNKNOWN
}
model Appointment {
id Int @id @default(autoincrement())
patientId Int
userId Int
staffId Int
title String
date DateTime @db.Date
startTime String // Store time as "hh:mm"
endTime String // Store time as "hh:mm"
type String // e.g., "checkup", "cleaning", "filling", etc.
notes String?
procedureCodeNotes String?
status String @default("scheduled") // "scheduled", "completed", "cancelled", "no-show"
createdAt DateTime @default(now())
eligibilityStatus PatientStatus @default(UNKNOWN)
patient Patient @relation(fields: [patientId], references: [id], onDelete: Cascade)
user User @relation(fields: [userId], references: [id])
staff Staff? @relation(fields: [staffId], references: [id])
procedures AppointmentProcedure[]
claims Claim[]
@@index([patientId])
@@index([date])
}
model Staff {
id Int @id @default(autoincrement())
userId Int
name String
email String?
role String // e.g., "Dentist", "Hygienist", "Assistant"
phone String?
createdAt DateTime @default(now())
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
appointments Appointment[]
claims Claim[] @relation("ClaimStaff")
}
model NpiProvider {
id Int @id @default(autoincrement())
userId Int
npiNumber String
providerName String
createdAt DateTime @default(now())
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@unique([userId, npiNumber])
@@index([userId])
}
enum ProcedureSource {
COMBO
MANUAL
}
model AppointmentProcedure {
id Int @id @default(autoincrement())
appointmentId Int
patientId Int
procedureCode String
procedureLabel String?
fee Decimal? @db.Decimal(10, 2)
category String?
toothNumber String?
toothSurface String?
oralCavityArea String?
source ProcedureSource @default(MANUAL)
comboKey String?
createdAt DateTime @default(now())
appointment Appointment @relation(fields: [appointmentId], references: [id], onDelete: Cascade)
patient Patient @relation(fields: [patientId], references: [id], onDelete: Cascade)
@@index([appointmentId])
@@index([patientId])
}
model Claim {
id Int @id @default(autoincrement())
patientId Int
appointmentId Int
userId Int
staffId Int
patientName String
memberId String
dateOfBirth DateTime @db.Date
remarks String
missingTeethStatus MissingTeethStatus @default(No_missing)
missingTeeth Json? // { "T_14": "X", "T_G": "O", ... }
serviceDate DateTime
insuranceProvider String // e.g., "Delta MA"
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
status ClaimStatus @default(PENDING)
claimNumber String?
patient Patient @relation(fields: [patientId], references: [id], onDelete: Cascade)
appointment Appointment @relation(fields: [appointmentId], references: [id], onDelete: Cascade)
user User? @relation(fields: [userId], references: [id])
staff Staff? @relation("ClaimStaff", fields: [staffId], references: [id])
serviceLines ServiceLine[]
claimFiles ClaimFile[]
payment Payment?
}
enum ClaimStatus {
PENDING
APPROVED
CANCELLED
REVIEW
VOID
}
enum MissingTeethStatus {
No_missing
endentulous
Yes_missing
}
model ServiceLine {
id Int @id @default(autoincrement())
claimId Int?
paymentId Int?
procedureCode String
procedureDate DateTime @db.Date
quad String?
arch String?
toothNumber String?
toothSurface String?
totalBilled Decimal @db.Decimal(10, 2)
totalPaid Decimal @default(0.00) @db.Decimal(10, 2)
totalAdjusted Decimal @default(0.00) @db.Decimal(10, 2)
totalDue Decimal @default(0.00) @db.Decimal(10, 2)
status ServiceLineStatus @default(UNPAID)
claim Claim? @relation(fields: [claimId], references: [id], onDelete: Cascade)
payment Payment? @relation(fields: [paymentId], references: [id], onDelete: Cascade)
serviceLineTransactions ServiceLineTransaction[]
}
enum ServiceLineStatus {
PENDING
PARTIALLY_PAID
PAID
UNPAID
ADJUSTED
OVERPAID
DENIED
}
model ClaimFile {
id Int @id @default(autoincrement())
claimId Int
filename String
mimeType String
claim Claim @relation(fields: [claimId], references: [id], onDelete: Cascade)
}
model InsuranceCredential {
id Int @id @default(autoincrement())
userId Int
siteKey String
username String
password String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@unique([userId, siteKey])
@@index([userId])
}
model PdfGroup {
id Int @id @default(autoincrement())
title String
titleKey PdfTitleKey @default(OTHER)
createdAt DateTime @default(now())
patientId Int
patient Patient @relation(fields: [patientId], references: [id], onDelete: Cascade)
pdfs PdfFile[]
@@index([patientId])
@@index([titleKey])
}
model PdfFile {
id Int @id @default(autoincrement())
filename String
pdfData Bytes
uploadedAt DateTime @default(now())
groupId Int
group PdfGroup @relation(fields: [groupId], references: [id], onDelete: Cascade)
@@index([groupId])
}
enum PdfTitleKey {
INSURANCE_CLAIM
INSURANCE_CLAIM_PREAUTH
ELIGIBILITY_STATUS
CLAIM_STATUS
OTHER
}
model Payment {
id Int @id @default(autoincrement())
claimId Int? @unique
patientId Int
userId Int
updatedById Int?
totalBilled Decimal @db.Decimal(10, 2)
totalPaid Decimal @default(0.00) @db.Decimal(10, 2)
totalAdjusted Decimal @default(0.00) @db.Decimal(10, 2)
totalDue Decimal @db.Decimal(10, 2)
status PaymentStatus @default(PENDING)
notes String?
icn String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
claim Claim? @relation(fields: [claimId], references: [id], onDelete: Cascade)
patient Patient @relation(fields: [patientId], references: [id], onDelete: Cascade)
updatedBy User? @relation("PaymentUpdatedBy", fields: [updatedById], references: [id])
serviceLineTransactions ServiceLineTransaction[]
serviceLines ServiceLine[]
@@index([claimId])
@@index([patientId])
@@index([createdAt])
}
model ServiceLineTransaction {
id Int @id @default(autoincrement())
paymentId Int
serviceLineId Int
transactionId String?
paidAmount Decimal @db.Decimal(10, 2)
adjustedAmount Decimal @default(0.00) @db.Decimal(10, 2)
method PaymentMethod
receivedDate DateTime
payerName String?
notes String?
createdAt DateTime @default(now())
payment Payment @relation(fields: [paymentId], references: [id], onDelete: Cascade)
serviceLine ServiceLine @relation(fields: [serviceLineId], references: [id], onDelete: Cascade)
@@index([paymentId])
@@index([serviceLineId])
}
enum PaymentStatus {
PENDING
PARTIALLY_PAID
PAID
OVERPAID
DENIED
VOID
}
enum PaymentMethod {
EFT
CHECK
CASH
CARD
OTHER
}
// Database management page
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 BackupDestination {
id Int @id @default(autoincrement())
userId Int
path String
isActive Boolean @default(true)
createdAt DateTime @default(now())
user User @relation(fields: [userId], references: [id])
}
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
}
model CloudFolder {
id Int @id @default(autoincrement())
userId Int
name String
parentId Int?
parent CloudFolder? @relation("FolderChildren", fields: [parentId], references: [id], onDelete: Cascade)
children CloudFolder[] @relation("FolderChildren")
user User @relation(fields: [userId], references: [id])
files CloudFile[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([userId, parentId, name]) // prevents sibling folder name duplicates
@@index([parentId])
}
model CloudFile {
id Int @id @default(autoincrement())
userId Int
name String
mimeType String?
fileSize BigInt @db.BigInt
folderId Int? // optional: null => root
isComplete Boolean @default(false) // upload completed?
totalChunks Int? // optional: expected number of chunks
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
user User @relation(fields: [userId], references: [id])
folder CloudFolder? @relation(fields: [folderId], references: [id], onDelete: SetNull)
chunks CloudFileChunk[]
@@index([folderId])
}
model CloudFileChunk {
id Int @id @default(autoincrement())
fileId Int
seq Int
data Bytes
createdAt DateTime @default(now())
file CloudFile @relation(fields: [fileId], references: [id], onDelete: Cascade)
@@unique([fileId, seq])
@@index([fileId, seq])
}
// patient-connection-
enum CommunicationChannel {
sms
voice
}
enum CommunicationDirection {
outbound
inbound
}
enum CommunicationStatus {
queued
sent
delivered
failed
completed
busy
no_answer
}
model Communication {
id Int @id @default(autoincrement())
patientId Int
userId Int?
channel CommunicationChannel
direction CommunicationDirection
status CommunicationStatus
body String?
callDuration Int?
twilioSid String?
createdAt DateTime @default(now())
// Relations
patient Patient @relation(fields: [patientId], references: [id])
user User? @relation(fields: [userId], references: [id])
@@map("communications")
}
model PatientDocument {
id Int @id @default(autoincrement())
patientId Int
filename String
originalName String
mimeType String
fileSize BigInt
filePath String
uploadedAt DateTime @default(now())
updatedAt DateTime @updatedAt
patient Patient @relation(fields: [patientId], references: [id], onDelete: Cascade)
@@index([patientId])
@@index([uploadedAt])
}

View File

@@ -0,0 +1,5 @@
/* !!! This is code generated by Prisma. Do not edit directly. !!!
/* eslint-disable */
// biome-ignore-all lint: generated file
export default import('./query_compiler_fast_bg.wasm?module')

View File

@@ -0,0 +1,5 @@
/* !!! This is code generated by Prisma. Do not edit directly. !!!
/* eslint-disable */
// biome-ignore-all lint: generated file
export default import('./query_compiler_fast_bg.wasm')