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,53 @@
import { AppointmentUncheckedCreateInputObjectSchema, AppointmentProcedureUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
import { z } from "zod";
export type Appointment = z.infer<typeof AppointmentUncheckedCreateInputObjectSchema>;
export declare const insertAppointmentSchema: z.ZodObject<Omit<any, "createdAt" | "id">, z.UnknownKeysParam, z.ZodTypeAny, {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
}, {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
}>;
export type InsertAppointment = z.infer<typeof insertAppointmentSchema>;
export declare const updateAppointmentSchema: z.ZodObject<{
[x: string]: z.ZodOptional<any>;
[x: number]: z.ZodOptional<any>;
[x: symbol]: z.ZodOptional<any>;
}, z.UnknownKeysParam, z.ZodTypeAny, {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
}, {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
}>;
export type UpdateAppointment = z.infer<typeof updateAppointmentSchema>;
export type AppointmentProcedure = z.infer<typeof AppointmentProcedureUncheckedCreateInputObjectSchema>;
export declare const insertAppointmentProcedureSchema: z.ZodObject<Omit<any, "createdAt" | "id">, z.UnknownKeysParam, z.ZodTypeAny, {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
}, {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
}>;
export type InsertAppointmentProcedure = z.infer<typeof insertAppointmentProcedureSchema>;
export declare const updateAppointmentProcedureSchema: z.ZodObject<{
[x: string]: z.ZodOptional<any>;
[x: number]: z.ZodOptional<any>;
[x: symbol]: z.ZodOptional<any>;
}, z.UnknownKeysParam, z.ZodTypeAny, {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
}, {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
}>;
export type UpdateAppointmentProcedure = z.infer<typeof updateAppointmentProcedureSchema>;
//# sourceMappingURL=appointment-types.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"appointment-types.d.ts","sourceRoot":"","sources":["appointment-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2CAA2C,EAAE,oDAAoD,EAAE,MAAM,sBAAsB,CAAC;AACzI,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2CAA2C,CAAC,CAAC;AAEtF,eAAO,MAAM,uBAAuB;;;;;;;;EAKlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;EAOxB,CAAC;AACb,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAKxE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CACxC,OAAO,oDAAoD,CAC5D,CAAC;AAEF,eAAO,MAAM,gCAAgC;;;;;;;;EAK3C,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,gCAAgC,CACxC,CAAC;AAEF,eAAO,MAAM,gCAAgC;;;;;;;;;;;;EAOjC,CAAC;AAEb,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,gCAAgC,CACxC,CAAC"}

View File

@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.updateAppointmentProcedureSchema = exports.insertAppointmentProcedureSchema = exports.updateAppointmentSchema = exports.insertAppointmentSchema = void 0;
const usedSchemas_1 = require("@repo/db/usedSchemas");
exports.insertAppointmentSchema = usedSchemas_1.AppointmentUncheckedCreateInputObjectSchema.omit({
id: true,
createdAt: true,
});
exports.updateAppointmentSchema = usedSchemas_1.AppointmentUncheckedCreateInputObjectSchema
.omit({
id: true,
createdAt: true,
})
.partial();
exports.insertAppointmentProcedureSchema = usedSchemas_1.AppointmentProcedureUncheckedCreateInputObjectSchema.omit({
id: true,
createdAt: true,
});
exports.updateAppointmentProcedureSchema = usedSchemas_1.AppointmentProcedureUncheckedCreateInputObjectSchema
.omit({
id: true,
createdAt: true,
})
.partial();

View File

@@ -0,0 +1,53 @@
import { AppointmentUncheckedCreateInputObjectSchema, AppointmentProcedureUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
import {z} from "zod";
export type Appointment = z.infer<typeof AppointmentUncheckedCreateInputObjectSchema>;
export const insertAppointmentSchema = (
AppointmentUncheckedCreateInputObjectSchema as unknown as z.ZodObject<any>
).omit({
id: true,
createdAt: true,
});
export type InsertAppointment = z.infer<typeof insertAppointmentSchema>;
export const updateAppointmentSchema = (
AppointmentUncheckedCreateInputObjectSchema as unknown as z.ZodObject<any>
)
.omit({
id: true,
createdAt: true,
})
.partial();
export type UpdateAppointment = z.infer<typeof updateAppointmentSchema>;
// Appointment Procedure Types.
export type AppointmentProcedure = z.infer<
typeof AppointmentProcedureUncheckedCreateInputObjectSchema
>;
export const insertAppointmentProcedureSchema = (
AppointmentProcedureUncheckedCreateInputObjectSchema as unknown as z.ZodObject<any>
).omit({
id: true,
createdAt: true,
});
export type InsertAppointmentProcedure = z.infer<
typeof insertAppointmentProcedureSchema
>;
export const updateAppointmentProcedureSchema = (
AppointmentProcedureUncheckedCreateInputObjectSchema as unknown as z.ZodObject<any>
)
.omit({
id: true,
createdAt: true,
})
.partial();
export type UpdateAppointmentProcedure = z.infer<
typeof updateAppointmentProcedureSchema
>;

127
packages/db/types/claim-types.d.ts vendored Normal file
View File

@@ -0,0 +1,127 @@
import { ClaimStatusSchema, ClaimUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
import { z } from "zod";
import { Decimal } from "decimal.js";
import { Staff } from "@repo/db/types";
export declare const insertClaimSchema: z.ZodObject<Omit<any, "createdAt" | "id" | "updatedAt">, z.UnknownKeysParam, z.ZodTypeAny, {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
}, {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
}>;
export type InsertClaim = z.infer<typeof insertClaimSchema>;
export declare const updateClaimSchema: z.ZodObject<{
[x: string]: z.ZodOptional<any>;
[x: number]: z.ZodOptional<any>;
[x: symbol]: z.ZodOptional<any>;
}, z.UnknownKeysParam, z.ZodTypeAny, {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
}, {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
}>;
export type UpdateClaim = z.infer<typeof updateClaimSchema>;
export declare const ExtendedClaimSchema: z.ZodObject<{
[x: string]: any;
} & {
userId: z.ZodNumber;
}, z.UnknownKeysParam, z.ZodTypeAny, {
[x: string]: any;
userId?: unknown;
}, {
[x: string]: any;
userId?: unknown;
}>;
export type Claim = z.infer<typeof ClaimUncheckedCreateInputObjectSchema>;
export type ClaimStatus = z.infer<typeof ClaimStatusSchema>;
export declare const claimStatusOptions: {
[x: string]: any;
};
export type ClaimStatusOptions = (typeof claimStatusOptions)[keyof typeof claimStatusOptions];
export type ClaimFileMeta = {
id?: number;
filename: string;
mimeType?: string | null;
};
export interface InputServiceLine {
procedureCode: string;
procedureDate: string;
quad?: string;
arch?: string;
toothNumber?: string;
toothSurface?: string;
quantity?: string;
totalBilled: Decimal;
totalPaid?: Decimal;
totalAdjusted?: Decimal;
}
export type ClaimWithServiceLines = Claim & {
claimNumber?: string | null;
serviceLines: {
id: number;
claimId: number | null;
procedureCode: string;
procedureDate: Date;
quad: string | null;
arch: string | null;
toothNumber: string | null;
toothSurface: string | null;
totalBilled: Decimal;
totalPaid: Decimal;
totalAdjusted: Decimal;
status: string;
}[];
staff?: Staff | null;
claimFiles?: ClaimFileMeta[] | null;
};
export type MissingTeethStatus = "No_missing" | "endentulous" | "Yes_missing";
export interface ClaimFormData {
patientId: number;
appointmentId: number;
userId: number;
staffId: number;
patientName: string;
memberId: string;
dateOfBirth: string;
remarks: string;
missingTeethStatus: MissingTeethStatus;
missingTeeth: Record<string, "X" | "O">;
serviceDate: string;
insuranceProvider: string;
insuranceSiteKey?: string;
npiProvider?: {
npiNumber: string;
providerName: string;
};
status: string;
serviceLines: InputServiceLine[];
claimId?: number;
claimFiles?: ClaimFileMeta[];
}
export interface ClaimPreAuthData {
patientId: number;
userId: number;
staffId: number;
patientName: string;
memberId: string;
dateOfBirth: string;
remarks: string;
missingTeethStatus: MissingTeethStatus;
missingTeeth: Record<string, "X" | "O">;
serviceDate: string;
insuranceProvider: string;
insuranceSiteKey?: string;
npiProvider?: {
npiNumber: string;
providerName: string;
};
status: string;
serviceLines: InputServiceLine[];
claimFiles?: ClaimFileMeta[];
}
//# sourceMappingURL=claim-types.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"claim-types.d.ts","sourceRoot":"","sources":["claim-types.ts"],"names":[],"mappings":"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"}

View File

@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.claimStatusOptions = exports.ExtendedClaimSchema = exports.updateClaimSchema = exports.insertClaimSchema = void 0;
const usedSchemas_1 = require("@repo/db/usedSchemas");
const zod_1 = require("zod");
const utils_1 = require("../utils");
exports.insertClaimSchema = usedSchemas_1.ClaimUncheckedCreateInputObjectSchema.omit({
id: true,
createdAt: true,
updatedAt: true,
});
exports.updateClaimSchema = usedSchemas_1.ClaimUncheckedCreateInputObjectSchema
.omit({
id: true,
createdAt: true,
updatedAt: true,
})
.partial();
// Extend the schema to inject `userId` manually (since it's not passed by the client)
exports.ExtendedClaimSchema = usedSchemas_1.ClaimUncheckedCreateInputObjectSchema.extend({
userId: zod_1.z.number(),
});
exports.claimStatusOptions = (0, utils_1.makeEnumOptions)(usedSchemas_1.ClaimStatusSchema);

136
packages/db/types/claim-types.ts Executable file
View File

@@ -0,0 +1,136 @@
import {
ClaimStatusSchema,
ClaimUncheckedCreateInputObjectSchema,
} from "@repo/db/usedSchemas";
import { z } from "zod";
import { Decimal } from "decimal.js";
import { Staff } from "@repo/db/types";
import { makeEnumOptions } from "../utils";
export const insertClaimSchema = (
ClaimUncheckedCreateInputObjectSchema as unknown as z.ZodObject<any>
).omit({
id: true,
createdAt: true,
updatedAt: true,
});
export type InsertClaim = z.infer<typeof insertClaimSchema>;
export const updateClaimSchema = (
ClaimUncheckedCreateInputObjectSchema as unknown as z.ZodObject<any>
)
.omit({
id: true,
createdAt: true,
updatedAt: true,
})
.partial();
export type UpdateClaim = z.infer<typeof updateClaimSchema>;
// Extend the schema to inject `userId` manually (since it's not passed by the client)
export const ExtendedClaimSchema = (
ClaimUncheckedCreateInputObjectSchema as unknown as z.ZodObject<any>
).extend({
userId: z.number(),
});
export type Claim = z.infer<typeof ClaimUncheckedCreateInputObjectSchema>;
export type ClaimStatus = z.infer<typeof ClaimStatusSchema>;
export const claimStatusOptions =
makeEnumOptions<
typeof ClaimStatusSchema extends z.ZodTypeAny
? z.infer<typeof ClaimStatusSchema>
: string
>(ClaimStatusSchema);
export type ClaimStatusOptions =
(typeof claimStatusOptions)[keyof typeof claimStatusOptions];
export type ClaimFileMeta = {
id?: number;
filename: string;
mimeType?: string | null;
};
//used in claim-form
export interface InputServiceLine {
procedureCode: string;
procedureDate: string; // YYYY-MM-DD
quad?: string;
arch?: string;
toothNumber?: string;
toothSurface?: string;
quantity?: string;
totalBilled: Decimal;
totalPaid?: Decimal;
totalAdjusted?: Decimal;
}
// Claim model with embedded service lines
export type ClaimWithServiceLines = Claim & {
claimNumber?: string | null;
serviceLines: {
id: number;
claimId: number | null;
procedureCode: string;
procedureDate: Date;
quad: string | null;
arch: string | null;
toothNumber: string | null;
toothSurface: string | null;
totalBilled: Decimal;
totalPaid: Decimal;
totalAdjusted: Decimal;
status: string;
}[];
staff?: Staff | null;
claimFiles?: ClaimFileMeta[] | null;
};
export type MissingTeethStatus = "No_missing" | "endentulous" | "Yes_missing";
export interface ClaimFormData {
patientId: number;
appointmentId: number;
userId: number;
staffId: number;
patientName: string;
memberId: string;
dateOfBirth: string;
remarks: string;
missingTeethStatus: MissingTeethStatus;
missingTeeth: Record<string, "X" | "O">; // keys: T_1..T_32, T_A..T_T
serviceDate: string; // YYYY-MM-DD
insuranceProvider: string;
insuranceSiteKey?: string;
npiProvider?: {
npiNumber: string;
providerName: string;
};
status: string; // default "pending"
serviceLines: InputServiceLine[];
claimId?: number;
claimFiles?: ClaimFileMeta[];
}
export interface ClaimPreAuthData {
patientId: number;
userId: number;
staffId: number;
patientName: string;
memberId: string;
dateOfBirth: string;
remarks: string;
missingTeethStatus: MissingTeethStatus;
missingTeeth: Record<string, "X" | "O">; // keys: T_1..T_32, T_A..T_T
serviceDate: string; // YYYY-MM-DD
insuranceProvider: string;
insuranceSiteKey?: string;
npiProvider?: {
npiNumber: string;
providerName: string;
};
status: string; // default "pending"
serviceLines: InputServiceLine[];
claimFiles?: ClaimFileMeta[];
}

View File

@@ -0,0 +1,5 @@
import { CloudFolderUncheckedCreateInputObjectSchema, CloudFileUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
import { z } from "zod";
export type CloudFolder = z.infer<typeof CloudFolderUncheckedCreateInputObjectSchema>;
export type CloudFile = z.infer<typeof CloudFileUncheckedCreateInputObjectSchema>;
//# sourceMappingURL=cloudStorage-types.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"cloudStorage-types.d.ts","sourceRoot":"","sources":["cloudStorage-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2CAA2C,EAAE,yCAAyC,EAAE,MAAM,sBAAsB,CAAC;AAC9H,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAQ,2CAA2C,CAAC,CAAC;AACvF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yCAAyC,CAAC,CAAC"}

View File

@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@@ -0,0 +1,7 @@
import { CloudFolderUncheckedCreateInputObjectSchema, CloudFileUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
import {z} from "zod";
export type CloudFolder = z.infer<typeof CloudFolderUncheckedCreateInputObjectSchema>;
export type CloudFile = z.infer<typeof CloudFileUncheckedCreateInputObjectSchema>;

View File

@@ -0,0 +1,5 @@
import { DatabaseBackupUncheckedCreateInputObjectSchema, BackupDestinationUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
import { z } from "zod";
export type DatabaseBackup = z.infer<typeof DatabaseBackupUncheckedCreateInputObjectSchema>;
export type BackupDestination = z.infer<typeof BackupDestinationUncheckedCreateInputObjectSchema>;
//# sourceMappingURL=databaseBackup-types.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"databaseBackup-types.d.ts","sourceRoot":"","sources":["databaseBackup-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8CAA8C,EAAE,iDAAiD,EAAE,MAAM,sBAAsB,CAAC;AACzI,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAClC,OAAO,8CAA8C,CACtD,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CACrC,OAAO,iDAAiD,CACzD,CAAC"}

View File

@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@@ -0,0 +1,10 @@
import { DatabaseBackupUncheckedCreateInputObjectSchema, BackupDestinationUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
import { z } from "zod";
export type DatabaseBackup = z.infer<
typeof DatabaseBackupUncheckedCreateInputObjectSchema
>;
export type BackupDestination = z.infer<
typeof BackupDestinationUncheckedCreateInputObjectSchema
>;

16
packages/db/types/index.d.ts vendored Normal file
View File

@@ -0,0 +1,16 @@
export * from "./appointment-types";
export * from "./claim-types";
export * from "./insurance-types";
export * from "./patient-types";
export * from "./payment-types";
export * from "./pdf-types";
export * from "./staff-types";
export * from "./user-types";
export * from "./databaseBackup-types";
export * from "./notifications-types";
export * from "./cloudStorage-types";
export * from "./payments-reports-types";
export * from "./patientConnection-types";
export * from "./npiProviders-types";
export * from "./patientDocument-types";
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC"}

View File

@@ -0,0 +1,32 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./appointment-types"), exports);
__exportStar(require("./claim-types"), exports);
__exportStar(require("./insurance-types"), exports);
__exportStar(require("./patient-types"), exports);
;
__exportStar(require("./payment-types"), exports);
__exportStar(require("./pdf-types"), exports);
__exportStar(require("./staff-types"), exports);
__exportStar(require("./user-types"), exports);
__exportStar(require("./databaseBackup-types"), exports);
__exportStar(require("./notifications-types"), exports);
__exportStar(require("./cloudStorage-types"), exports);
__exportStar(require("./payments-reports-types"), exports);
__exportStar(require("./patientConnection-types"), exports);
__exportStar(require("./npiProviders-types"), exports);
__exportStar(require("./patientDocument-types"), exports);

15
packages/db/types/index.ts Executable file
View File

@@ -0,0 +1,15 @@
export * from "./appointment-types";
export * from "./claim-types";
export * from "./insurance-types";
export * from "./patient-types";;
export * from "./payment-types";
export * from "./pdf-types";
export * from "./staff-types";
export * from "./user-types";
export * from "./databaseBackup-types";
export * from "./notifications-types";
export * from "./cloudStorage-types";
export * from "./payments-reports-types";
export * from "./patientConnection-types";
export * from "./npiProviders-types";
export * from "./patientDocument-types";

14
packages/db/types/insurance-types.d.ts vendored Normal file
View File

@@ -0,0 +1,14 @@
import { InsuranceCredentialUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
import { z } from "zod";
export type InsuranceCredential = z.infer<typeof InsuranceCredentialUncheckedCreateInputObjectSchema>;
export declare const insertInsuranceCredentialSchema: z.ZodObject<Omit<any, "id">, z.UnknownKeysParam, z.ZodTypeAny, {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
}, {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
}>;
export type InsertInsuranceCredential = z.infer<typeof insertInsuranceCredentialSchema>;
//# sourceMappingURL=insurance-types.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"insurance-types.d.ts","sourceRoot":"","sources":["insurance-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mDAAmD,EAAE,MAAM,sBAAsB,CAAC;AAC3F,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CACvC,OAAO,mDAAmD,CAC3D,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;EAExB,CAAC;AAErB,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAC"}

View File

@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.insertInsuranceCredentialSchema = void 0;
const usedSchemas_1 = require("@repo/db/usedSchemas");
exports.insertInsuranceCredentialSchema = usedSchemas_1.InsuranceCredentialUncheckedCreateInputObjectSchema.omit({ id: true });

View File

@@ -0,0 +1,14 @@
import { InsuranceCredentialUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
import {z} from "zod";
export type InsuranceCredential = z.infer<
typeof InsuranceCredentialUncheckedCreateInputObjectSchema
>;
export const insertInsuranceCredentialSchema = (
InsuranceCredentialUncheckedCreateInputObjectSchema as unknown as z.ZodObject<any>
).omit({ id: true });
export type InsertInsuranceCredential = z.infer<
typeof insertInsuranceCredentialSchema
>;

View File

@@ -0,0 +1,5 @@
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>;
//# sourceMappingURL=notifications-types.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"notifications-types.d.ts","sourceRoot":"","sources":["notifications-types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,4CAA4C,EAC7C,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAChC,OAAO,4CAA4C,CACpD,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}

View File

@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View 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>;

View File

@@ -0,0 +1,14 @@
import { z } from "zod";
import { NpiProviderUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
export type NpiProvider = z.infer<typeof NpiProviderUncheckedCreateInputObjectSchema>;
export declare const insertNpiProviderSchema: z.ZodObject<Omit<any, "id">, z.UnknownKeysParam, z.ZodTypeAny, {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
}, {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
}>;
export type InsertNpiProvider = z.infer<typeof insertNpiProviderSchema>;
//# sourceMappingURL=npiProviders-types.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"npiProviders-types.d.ts","sourceRoot":"","sources":["npiProviders-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,2CAA2C,EAAE,MAAM,sBAAsB,CAAC;AAEnF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAC/B,OAAO,2CAA2C,CACnD,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;EAEhB,CAAC;AAErB,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CACrC,OAAO,uBAAuB,CAC/B,CAAC"}

View File

@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.insertNpiProviderSchema = void 0;
const usedSchemas_1 = require("@repo/db/usedSchemas");
exports.insertNpiProviderSchema = usedSchemas_1.NpiProviderUncheckedCreateInputObjectSchema.omit({ id: true });

View File

@@ -0,0 +1,14 @@
import { z } from "zod";
import { NpiProviderUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
export type NpiProvider = z.infer<
typeof NpiProviderUncheckedCreateInputObjectSchema
>;
export const insertNpiProviderSchema = (
NpiProviderUncheckedCreateInputObjectSchema as unknown as z.ZodObject<any>
).omit({ id: true });
export type InsertNpiProvider = z.infer<
typeof insertNpiProviderSchema
>;

59
packages/db/types/patient-types.d.ts vendored Normal file
View File

@@ -0,0 +1,59 @@
import { PatientStatusSchema, PatientUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
import { z } from "zod";
export type Patient = z.infer<typeof PatientUncheckedCreateInputObjectSchema>;
export declare const insuranceIdSchema: z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodString>>, string | null | undefined, unknown>;
export type PatientStatus = z.infer<typeof PatientStatusSchema>;
export declare const patientStatusOptions: {
[x: string]: any;
};
export declare const insertPatientSchema: z.ZodObject<{
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
} & {
insuranceId: z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodString>>, string | null | undefined, unknown>;
}, z.UnknownKeysParam, z.ZodTypeAny, {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
insuranceId?: unknown;
}, {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
insuranceId?: unknown;
}>;
export type InsertPatient = z.infer<typeof insertPatientSchema>;
export declare const updatePatientSchema: z.ZodObject<{
[x: string]: z.ZodOptional<any>;
[x: number]: z.ZodOptional<any>;
[x: symbol]: z.ZodOptional<any>;
} & {
insuranceId: z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodString>>, string | null | undefined, unknown>;
}, z.UnknownKeysParam, z.ZodTypeAny, {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
insuranceId?: unknown;
}, {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
insuranceId?: unknown;
}>;
export type UpdatePatient = z.infer<typeof updatePatientSchema>;
export type FinancialRow = {
type: "CLAIM" | "PAYMENT";
id: number;
date: string | null;
createdAt: string | null;
status: string | null;
total_billed: number;
total_paid: number;
total_adjusted: number;
total_due: number;
patient_name: string | null;
service_lines: any[];
linked_payment_id?: number | null;
};
//# sourceMappingURL=patient-types.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"patient-types.d.ts","sourceRoot":"","sources":["patient-types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,uCAAuC,EACxC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uCAAuC,CAAC,CAAC;AAE9E,eAAO,MAAM,iBAAiB,6FAuB7B,CAAC;AAGF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAGhE,eAAO,MAAM,oBAAoB;;CAKT,CAAC;AAEzB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;EAS5B,CAAC;AAEL,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;EAW5B,CAAC;AAEL,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,aAAa,EAAE,GAAG,EAAE,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC,CAAC"}

View File

@@ -0,0 +1,49 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.updatePatientSchema = exports.insertPatientSchema = exports.patientStatusOptions = exports.insuranceIdSchema = void 0;
const usedSchemas_1 = require("@repo/db/usedSchemas");
const zod_1 = require("zod");
const utils_1 = require("../utils");
exports.insuranceIdSchema = zod_1.z.preprocess((val) => {
if (val === undefined || val === null)
return undefined;
// Accept numbers and strings
if (typeof val === "number") {
return String(val).replace(/\s+/g, "");
}
if (typeof val === "string") {
const cleaned = val.replace(/\s+/g, "");
if (cleaned === "")
return undefined;
return cleaned;
}
return val;
},
// After preprocess, require digits-only string (or optional nullable)
zod_1.z
.string()
.regex(/^\d+$/, { message: "Insurance ID must contain only digits" })
.min(1)
.max(32)
.optional()
.nullable());
// enum → select options
exports.patientStatusOptions = (0, utils_1.makeEnumOptions)(usedSchemas_1.PatientStatusSchema);
exports.insertPatientSchema = usedSchemas_1.PatientUncheckedCreateInputObjectSchema
.omit({
id: true,
createdAt: true,
})
.extend({
insuranceId: exports.insuranceIdSchema, // enforce numeric insuranceId
});
exports.updatePatientSchema = usedSchemas_1.PatientUncheckedCreateInputObjectSchema
.omit({
id: true,
createdAt: true,
userId: true,
})
.partial()
.extend({
insuranceId: exports.insuranceIdSchema, // enforce numeric insuranceId
});

View File

@@ -0,0 +1,87 @@
import {
PatientStatusSchema,
PatientUncheckedCreateInputObjectSchema,
} from "@repo/db/usedSchemas";
import { z } from "zod";
import { makeEnumOptions } from "../utils";
export type Patient = z.infer<typeof PatientUncheckedCreateInputObjectSchema>;
export const insuranceIdSchema = z.preprocess(
(val) => {
if (val === undefined || val === null) return undefined;
// Accept numbers and strings
if (typeof val === "number") {
return String(val).replace(/\s+/g, "");
}
if (typeof val === "string") {
const cleaned = val.replace(/\s+/g, "");
if (cleaned === "") return undefined;
return cleaned;
}
return val;
},
// After preprocess, require digits-only string (or optional nullable)
z
.string()
.regex(/^\d+$/, { message: "Insurance ID must contain only digits" })
.min(1)
.max(32)
.optional()
.nullable()
);
//patient status
export type PatientStatus = z.infer<typeof PatientStatusSchema>;
// enum → select options
export const patientStatusOptions =
makeEnumOptions<
typeof PatientStatusSchema extends z.ZodTypeAny
? z.infer<typeof PatientStatusSchema>
: string
>(PatientStatusSchema);
export const insertPatientSchema = (
PatientUncheckedCreateInputObjectSchema as unknown as z.ZodObject<any>
)
.omit({
id: true,
createdAt: true,
})
.extend({
insuranceId: insuranceIdSchema, // enforce numeric insuranceId
});
export type InsertPatient = z.infer<typeof insertPatientSchema>;
export const updatePatientSchema = (
PatientUncheckedCreateInputObjectSchema as unknown as z.ZodObject<any>
)
.omit({
id: true,
createdAt: true,
userId: true,
})
.partial()
.extend({
insuranceId: insuranceIdSchema, // enforce numeric insuranceId
});
export type UpdatePatient = z.infer<typeof updatePatientSchema>;
export type FinancialRow = {
type: "CLAIM" | "PAYMENT";
id: number;
date: string | null;
createdAt: string | null;
status: string | null;
total_billed: number;
total_paid: number;
total_adjusted: number;
total_due: number;
patient_name: string | null;
service_lines: any[];
linked_payment_id?: number | null;
};

View File

@@ -0,0 +1,40 @@
import { CommunicationUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
import { z } from "zod";
/**
* Full Communication type (Prisma unchecked create input)
*/
export type Communication = z.infer<typeof CommunicationUncheckedCreateInputObjectSchema>;
/**
* Insert Communication
* - excludes auto-generated fields
*/
export declare const insertCommunicationSchema: z.ZodObject<Omit<any, "createdAt" | "id">, z.UnknownKeysParam, z.ZodTypeAny, {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
}, {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
}>;
export type InsertCommunication = z.infer<typeof insertCommunicationSchema>;
/**
* Update Communication
* - excludes immutable fields
* - makes everything optional
*/
export declare const updateCommunicationSchema: z.ZodObject<{
[x: string]: z.ZodOptional<any>;
[x: number]: z.ZodOptional<any>;
[x: symbol]: z.ZodOptional<any>;
}, z.UnknownKeysParam, z.ZodTypeAny, {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
}, {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
}>;
export type UpdateCommunication = z.infer<typeof updateCommunicationSchema>;
//# sourceMappingURL=patientConnection-types.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"patientConnection-types.d.ts","sourceRoot":"","sources":["patientConnection-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6CAA6C,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CACjC,OAAO,6CAA6C,CACrD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;EAKpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CACvC,OAAO,yBAAyB,CACjC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;EAO1B,CAAC;AAEb,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CACvC,OAAO,yBAAyB,CACjC,CAAC"}

View File

@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.updateCommunicationSchema = exports.insertCommunicationSchema = void 0;
const usedSchemas_1 = require("@repo/db/usedSchemas");
/**
* Insert Communication
* - excludes auto-generated fields
*/
exports.insertCommunicationSchema = usedSchemas_1.CommunicationUncheckedCreateInputObjectSchema.omit({
id: true,
createdAt: true,
});
/**
* Update Communication
* - excludes immutable fields
* - makes everything optional
*/
exports.updateCommunicationSchema = usedSchemas_1.CommunicationUncheckedCreateInputObjectSchema
.omit({
id: true,
createdAt: true,
})
.partial();

View File

@@ -0,0 +1,42 @@
import { CommunicationUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
import { z } from "zod";
/**
* Full Communication type (Prisma unchecked create input)
*/
export type Communication = z.infer<
typeof CommunicationUncheckedCreateInputObjectSchema
>;
/**
* Insert Communication
* - excludes auto-generated fields
*/
export const insertCommunicationSchema = (
CommunicationUncheckedCreateInputObjectSchema as unknown as z.ZodObject<any>
).omit({
id: true,
createdAt: true,
});
export type InsertCommunication = z.infer<
typeof insertCommunicationSchema
>;
/**
* Update Communication
* - excludes immutable fields
* - makes everything optional
*/
export const updateCommunicationSchema = (
CommunicationUncheckedCreateInputObjectSchema as unknown as z.ZodObject<any>
)
.omit({
id: true,
createdAt: true,
})
.partial();
export type UpdateCommunication = z.infer<
typeof updateCommunicationSchema
>;

View File

@@ -0,0 +1,83 @@
import { z } from "zod";
export declare const PatientDocumentSchema: z.ZodObject<{
id: z.ZodNumber;
patientId: z.ZodNumber;
filename: z.ZodString;
originalName: z.ZodString;
mimeType: z.ZodString;
fileSize: z.ZodBigInt;
filePath: z.ZodString;
uploadedAt: z.ZodDate;
updatedAt: z.ZodDate;
}, "strip", z.ZodTypeAny, {
id: number;
filename: string;
uploadedAt: Date;
patientId: number;
mimeType: string;
updatedAt: Date;
originalName: string;
fileSize: bigint;
filePath: string;
}, {
id: number;
filename: string;
uploadedAt: Date;
patientId: number;
mimeType: string;
updatedAt: Date;
originalName: string;
fileSize: bigint;
filePath: string;
}>;
export declare const CreatePatientDocumentSchema: z.ZodObject<Omit<{
id: z.ZodNumber;
patientId: z.ZodNumber;
filename: z.ZodString;
originalName: z.ZodString;
mimeType: z.ZodString;
fileSize: z.ZodBigInt;
filePath: z.ZodString;
uploadedAt: z.ZodDate;
updatedAt: z.ZodDate;
}, "id" | "uploadedAt" | "updatedAt">, "strip", z.ZodTypeAny, {
filename: string;
patientId: number;
mimeType: string;
originalName: string;
fileSize: bigint;
filePath: string;
}, {
filename: string;
patientId: number;
mimeType: string;
originalName: string;
fileSize: bigint;
filePath: string;
}>;
export declare const UpdatePatientDocumentSchema: z.ZodObject<{
filename: z.ZodOptional<z.ZodString>;
patientId: z.ZodOptional<z.ZodNumber>;
mimeType: z.ZodOptional<z.ZodString>;
originalName: z.ZodOptional<z.ZodString>;
fileSize: z.ZodOptional<z.ZodBigInt>;
filePath: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
filename?: string | undefined;
patientId?: number | undefined;
mimeType?: string | undefined;
originalName?: string | undefined;
fileSize?: bigint | undefined;
filePath?: string | undefined;
}, {
filename?: string | undefined;
patientId?: number | undefined;
mimeType?: string | undefined;
originalName?: string | undefined;
fileSize?: bigint | undefined;
filePath?: string | undefined;
}>;
export type PatientDocument = z.infer<typeof PatientDocumentSchema>;
export type CreatePatientDocument = z.infer<typeof CreatePatientDocumentSchema>;
export type UpdatePatientDocument = z.infer<typeof UpdatePatientDocumentSchema>;
//# sourceMappingURL=patientDocument-types.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"patientDocument-types.d.ts","sourceRoot":"","sources":["patientDocument-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUhC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;EAItC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;EAAwC,CAAC;AAEjF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}

View File

@@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UpdatePatientDocumentSchema = exports.CreatePatientDocumentSchema = exports.PatientDocumentSchema = void 0;
const zod_1 = require("zod");
exports.PatientDocumentSchema = zod_1.z.object({
id: zod_1.z.number(),
patientId: zod_1.z.number(),
filename: zod_1.z.string(),
originalName: zod_1.z.string(),
mimeType: zod_1.z.string(),
fileSize: zod_1.z.bigint(),
filePath: zod_1.z.string(),
uploadedAt: zod_1.z.date(),
updatedAt: zod_1.z.date(),
});
exports.CreatePatientDocumentSchema = exports.PatientDocumentSchema.omit({
id: true,
uploadedAt: true,
updatedAt: true,
});
exports.UpdatePatientDocumentSchema = exports.CreatePatientDocumentSchema.partial();

View File

@@ -0,0 +1,25 @@
import { z } from "zod";
export const PatientDocumentSchema = z.object({
id: z.number(),
patientId: z.number(),
filename: z.string(),
originalName: z.string(),
mimeType: z.string(),
fileSize: z.bigint(),
filePath: z.string(),
uploadedAt: z.date(),
updatedAt: z.date(),
});
export const CreatePatientDocumentSchema = PatientDocumentSchema.omit({
id: true,
uploadedAt: true,
updatedAt: true,
});
export const UpdatePatientDocumentSchema = CreatePatientDocumentSchema.partial();
export type PatientDocument = z.infer<typeof PatientDocumentSchema>;
export type CreatePatientDocument = z.infer<typeof CreatePatientDocumentSchema>;
export type UpdatePatientDocument = z.infer<typeof UpdatePatientDocumentSchema>;

138
packages/db/types/payment-types.d.ts vendored Normal file
View File

@@ -0,0 +1,138 @@
import { PaymentUncheckedCreateInputObjectSchema, ServiceLineTransactionCreateInputObjectSchema, PaymentMethodSchema, PaymentStatusSchema } from "@repo/db/usedSchemas";
import { Prisma } from "@repo/db/generated/prisma";
import { z } from "zod";
export type Payment = z.infer<typeof PaymentUncheckedCreateInputObjectSchema>;
export type ServiceLineTransactionInput = z.infer<typeof ServiceLineTransactionCreateInputObjectSchema>;
export type ServiceLineTransactionRecord = Prisma.ServiceLineTransactionGetPayload<{
include: {
serviceLine: true;
};
}>;
export { PaymentStatusSchema };
export type PaymentStatus = z.infer<typeof PaymentStatusSchema>;
export type PaymentMethod = z.infer<typeof PaymentMethodSchema>;
export declare const paymentStatusOptions: {
[x: string]: any;
};
export type PaymentStatusOptions = (typeof paymentStatusOptions)[keyof typeof paymentStatusOptions];
export declare const paymentStatusArray: PaymentStatusOptions[];
export declare const paymentMethodOptions: {
[x: string]: any;
};
export type PaymentMethodOptions = (typeof paymentMethodOptions)[keyof typeof paymentMethodOptions];
export declare const paymentMethodArray: PaymentMethodOptions[];
export declare const insertPaymentSchema: z.ZodObject<Omit<any, "createdAt" | "id" | "updatedAt">, z.UnknownKeysParam, z.ZodTypeAny, {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
}, {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
}>;
export type InsertPayment = z.infer<typeof insertPaymentSchema>;
export declare const updatePaymentSchema: z.ZodObject<{
[x: string]: z.ZodOptional<any>;
[x: number]: z.ZodOptional<any>;
[x: symbol]: z.ZodOptional<any>;
}, z.UnknownKeysParam, z.ZodTypeAny, {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
}, {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
}>;
export type UpdatePayment = z.infer<typeof updatePaymentSchema>;
export type PaymentWithExtras = Prisma.PaymentGetPayload<{
include: {
claim: {
include: {
serviceLines: true;
};
};
serviceLines: true;
serviceLineTransactions: {
include: {
serviceLine: true;
};
};
updatedBy: true;
patient: true;
};
}> & {
patientName: string;
paymentDate: Date;
paymentMethod: string;
};
export declare const newTransactionPayloadSchema: z.ZodObject<{
paymentId: z.ZodNumber;
serviceLineTransactions: z.ZodArray<z.ZodObject<{
serviceLineId: z.ZodNumber;
transactionId: z.ZodOptional<z.ZodString>;
paidAmount: z.ZodNumber;
adjustedAmount: z.ZodOptional<z.ZodNumber>;
method: z.ZodEnum<["EFT", "CHECK", "CASH", "CARD", "OTHER"]>;
receivedDate: z.ZodDate;
payerName: z.ZodOptional<z.ZodString>;
notes: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
paidAmount: number;
method: "OTHER" | "EFT" | "CHECK" | "CASH" | "CARD";
receivedDate: Date;
serviceLineId: number;
notes?: string | undefined;
transactionId?: string | undefined;
adjustedAmount?: number | undefined;
payerName?: string | undefined;
}, {
paidAmount: number;
method: "OTHER" | "EFT" | "CHECK" | "CASH" | "CARD";
receivedDate: Date;
serviceLineId: number;
notes?: string | undefined;
transactionId?: string | undefined;
adjustedAmount?: number | undefined;
payerName?: string | undefined;
}>, "many">;
}, "strip", z.ZodTypeAny, {
paymentId: number;
serviceLineTransactions: {
paidAmount: number;
method: "OTHER" | "EFT" | "CHECK" | "CASH" | "CARD";
receivedDate: Date;
serviceLineId: number;
notes?: string | undefined;
transactionId?: string | undefined;
adjustedAmount?: number | undefined;
payerName?: string | undefined;
}[];
}, {
paymentId: number;
serviceLineTransactions: {
paidAmount: number;
method: "OTHER" | "EFT" | "CHECK" | "CASH" | "CARD";
receivedDate: Date;
serviceLineId: number;
notes?: string | undefined;
transactionId?: string | undefined;
adjustedAmount?: number | undefined;
payerName?: string | undefined;
}[];
}>;
export type NewTransactionPayload = z.infer<typeof newTransactionPayloadSchema>;
export interface OcrRow {
patientName: string;
insuranceId: string | number;
icn?: string | null;
procedureCode: string;
toothNumber?: string | null;
toothSurface?: string | null;
procedureDate: string | null;
totalBilled: number;
totalAllowed?: number;
totalPaid: number;
sourceFile?: string | null;
}
//# sourceMappingURL=payment-types.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"payment-types.d.ts","sourceRoot":"","sources":["payment-types.ts"],"names":[],"mappings":"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"}

View File

@@ -0,0 +1,39 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.newTransactionPayloadSchema = exports.updatePaymentSchema = exports.insertPaymentSchema = exports.paymentMethodArray = exports.paymentMethodOptions = exports.paymentStatusArray = exports.paymentStatusOptions = exports.PaymentStatusSchema = void 0;
const usedSchemas_1 = require("@repo/db/usedSchemas");
Object.defineProperty(exports, "PaymentStatusSchema", { enumerable: true, get: function () { return usedSchemas_1.PaymentStatusSchema; } });
const zod_1 = require("zod");
const utils_1 = require("../utils");
// ✅ Runtime arrays (used in code logic / map / select options)
exports.paymentStatusOptions = (0, utils_1.makeEnumOptions)(usedSchemas_1.PaymentStatusSchema);
exports.paymentStatusArray = Object.values(exports.paymentStatusOptions);
exports.paymentMethodOptions = (0, utils_1.makeEnumOptions)(usedSchemas_1.PaymentMethodSchema);
exports.paymentMethodArray = Object.values(exports.paymentMethodOptions);
// ========== INPUT TYPES ==========
// For creating a new payment
exports.insertPaymentSchema = usedSchemas_1.PaymentUncheckedCreateInputObjectSchema.omit({
id: true,
createdAt: true,
updatedAt: true,
});
// For updating an existing payment (partial updates)
exports.updatePaymentSchema = usedSchemas_1.PaymentUncheckedCreateInputObjectSchema
.omit({
id: true,
createdAt: true,
})
.partial();
exports.newTransactionPayloadSchema = zod_1.z.object({
paymentId: zod_1.z.number(),
serviceLineTransactions: zod_1.z.array(zod_1.z.object({
serviceLineId: zod_1.z.number(),
transactionId: zod_1.z.string().optional(),
paidAmount: zod_1.z.number(),
adjustedAmount: zod_1.z.number().optional(),
method: usedSchemas_1.PaymentMethodSchema,
receivedDate: zod_1.z.coerce.date(),
payerName: zod_1.z.string().optional(),
notes: zod_1.z.string().optional(),
})),
});

View File

@@ -0,0 +1,138 @@
import {
PaymentUncheckedCreateInputObjectSchema,
ServiceLineTransactionCreateInputObjectSchema,
PaymentMethodSchema,
PaymentStatusSchema,
} from "@repo/db/usedSchemas";
import { Prisma } from "@repo/db/generated/prisma";
import { z } from "zod";
import { makeEnumOptions } from "../utils";
// ========== BASIC TYPES ==========
// Payment basic type from Zod
export type Payment = z.infer<typeof PaymentUncheckedCreateInputObjectSchema>;
// Zod input type for creating a transaction
export type ServiceLineTransactionInput = z.infer<
typeof ServiceLineTransactionCreateInputObjectSchema
>;
// Prisma output type for single transaction (fetched with includes)
export type ServiceLineTransactionRecord =
Prisma.ServiceLineTransactionGetPayload<{
include: {
serviceLine: true;
};
}>;
// Enum for payment
export { PaymentStatusSchema };
export type PaymentStatus = z.infer<typeof PaymentStatusSchema>;
export type PaymentMethod = z.infer<typeof PaymentMethodSchema>;
// ✅ Runtime arrays (used in code logic / map / select options)
export const paymentStatusOptions =
makeEnumOptions<
typeof PaymentStatusSchema extends z.ZodTypeAny
? z.infer<typeof PaymentStatusSchema>
: string
>(PaymentStatusSchema);
export type PaymentStatusOptions =
(typeof paymentStatusOptions)[keyof typeof paymentStatusOptions];
export const paymentStatusArray = Object.values(
paymentStatusOptions
) as PaymentStatusOptions[];
export const paymentMethodOptions =
makeEnumOptions<
typeof PaymentMethodSchema extends z.ZodTypeAny
? z.infer<typeof PaymentMethodSchema>
: string
>(PaymentMethodSchema);
export type PaymentMethodOptions =
(typeof paymentMethodOptions)[keyof typeof paymentMethodOptions];
export const paymentMethodArray = Object.values(
paymentMethodOptions
) as PaymentMethodOptions[];
// ========== INPUT TYPES ==========
// For creating a new payment
export const insertPaymentSchema = (
PaymentUncheckedCreateInputObjectSchema as unknown as z.ZodObject<any>
).omit({
id: true,
createdAt: true,
updatedAt: true,
});
export type InsertPayment = z.infer<typeof insertPaymentSchema>;
// For updating an existing payment (partial updates)
export const updatePaymentSchema = (
PaymentUncheckedCreateInputObjectSchema as unknown as z.ZodObject<any>
)
.omit({
id: true,
createdAt: true,
})
.partial();
export type UpdatePayment = z.infer<typeof updatePaymentSchema>;
// ========== EXTENDED TYPES ==========
// Payment with full nested data
export type PaymentWithExtras = Prisma.PaymentGetPayload<{
include: {
claim: {
include: {
serviceLines: true;
};
};
serviceLines: true; // ✅ OCR-only service lines directly under Payment
serviceLineTransactions: {
include: {
serviceLine: true;
};
};
updatedBy: true;
patient: true;
};
}> & {
patientName: string;
paymentDate: Date;
paymentMethod: string;
};
export const newTransactionPayloadSchema = z.object({
paymentId: z.number(),
serviceLineTransactions: z.array(
z.object({
serviceLineId: z.number(),
transactionId: z.string().optional(),
paidAmount: z.number(),
adjustedAmount: z.number().optional(),
method: PaymentMethodSchema,
receivedDate: z.coerce.date(),
payerName: z.string().optional(),
notes: z.string().optional(),
})
),
});
export type NewTransactionPayload = z.infer<typeof newTransactionPayloadSchema>;
// OCR Payment - row
export interface OcrRow {
patientName: string;
insuranceId: string | number;
icn?: string | null;
procedureCode: string;
toothNumber?: string | null;
toothSurface?: string | null;
procedureDate: string | null;
totalBilled: number;
totalAllowed?: number;
totalPaid: number;
sourceFile?: string | null;
}

View File

@@ -0,0 +1,18 @@
export interface PatientBalanceRow {
patientId: number;
firstName: string | null;
lastName: string | null;
totalCharges: number;
totalPayments: number;
totalAdjusted: number;
currentBalance: number;
lastPaymentDate: string | null;
lastAppointmentDate: string | null;
}
export interface GetPatientBalancesResult {
balances: PatientBalanceRow[];
totalCount: number;
nextCursor: string | null;
hasMore: boolean;
}
//# sourceMappingURL=payments-reports-types.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"payments-reports-types.d.ts","sourceRoot":"","sources":["payments-reports-types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;CAClB"}

View File

@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@@ -0,0 +1,18 @@
export interface PatientBalanceRow {
patientId: number;
firstName: string | null;
lastName: string | null;
totalCharges: number;
totalPayments: number;
totalAdjusted: number;
currentBalance: number;
lastPaymentDate: string | null;
lastAppointmentDate: string | null;
}
export interface GetPatientBalancesResult {
balances: PatientBalanceRow[];
totalCount: number;
nextCursor: string | null;
hasMore: boolean;
}

10
packages/db/types/pdf-types.d.ts vendored Normal file
View File

@@ -0,0 +1,10 @@
import { PdfFileUncheckedCreateInputObjectSchema, PdfGroupUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
import { z } from "zod";
export type PdfGroup = z.infer<typeof PdfGroupUncheckedCreateInputObjectSchema>;
export type PdfFile = z.infer<typeof PdfFileUncheckedCreateInputObjectSchema>;
export interface ClaimPdfMetadata {
id: number;
filename: string;
uploadedAt: Date;
}
//# sourceMappingURL=pdf-types.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"pdf-types.d.ts","sourceRoot":"","sources":["pdf-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uCAAuC,EAAE,wCAAwC,EAAE,MAAM,sBAAsB,CAAC;AACzH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wCAAwC,CAAC,CAAC;AAChF,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uCAAuC,CAAC,CAAC;AAE9E,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;CAClB"}

View File

@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

11
packages/db/types/pdf-types.ts Executable file
View File

@@ -0,0 +1,11 @@
import { PdfFileUncheckedCreateInputObjectSchema, PdfGroupUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
import {z} from "zod";
export type PdfGroup = z.infer<typeof PdfGroupUncheckedCreateInputObjectSchema>;
export type PdfFile = z.infer<typeof PdfFileUncheckedCreateInputObjectSchema>;
export interface ClaimPdfMetadata {
id: number;
filename: string;
uploadedAt: Date;
}

4
packages/db/types/staff-types.d.ts vendored Normal file
View File

@@ -0,0 +1,4 @@
import { StaffUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
import { z } from "zod";
export type Staff = z.infer<typeof StaffUncheckedCreateInputObjectSchema>;
//# sourceMappingURL=staff-types.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"staff-types.d.ts","sourceRoot":"","sources":["staff-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qCAAqC,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC"}

View File

@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@@ -0,0 +1,4 @@
import { StaffUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
import {z} from "zod";
export type Staff = z.infer<typeof StaffUncheckedCreateInputObjectSchema>;

41
packages/db/types/user-types.d.ts vendored Normal file
View File

@@ -0,0 +1,41 @@
import { UserUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
import { z } from "zod";
export type User = z.infer<typeof UserUncheckedCreateInputObjectSchema>;
export declare const insertUserSchema: z.ZodObject<Pick<any, never>, z.UnknownKeysParam, z.ZodTypeAny, {}, {}>;
export declare const loginSchema: z.ZodObject<{
[x: string]: any;
} & {
rememberMe: z.ZodOptional<z.ZodBoolean>;
}, z.UnknownKeysParam, z.ZodTypeAny, {
[x: string]: any;
rememberMe?: unknown;
}, {
[x: string]: any;
rememberMe?: unknown;
}>;
export declare const registerSchema: z.ZodEffects<z.ZodObject<{
[x: string]: any;
} & {
confirmPassword: z.ZodString;
agreeTerms: z.ZodLiteral<true>;
}, z.UnknownKeysParam, z.ZodTypeAny, {
[x: string]: any;
confirmPassword?: unknown;
agreeTerms?: unknown;
}, {
[x: string]: any;
confirmPassword?: unknown;
agreeTerms?: unknown;
}>, {
[x: string]: any;
confirmPassword?: unknown;
agreeTerms?: unknown;
}, {
[x: string]: any;
confirmPassword?: unknown;
agreeTerms?: unknown;
}>;
export type InsertUser = z.infer<typeof insertUserSchema>;
export type LoginFormValues = z.infer<typeof loginSchema>;
export type RegisterFormValues = z.infer<typeof registerSchema>;
//# sourceMappingURL=user-types.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"user-types.d.ts","sourceRoot":"","sources":["user-types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oCAAoC,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAExE,eAAO,MAAM,gBAAgB,yEAK3B,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;EAEtB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;EAcvB,CAAC;AAEL,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAC1D,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}

View File

@@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.registerSchema = exports.loginSchema = exports.insertUserSchema = void 0;
const usedSchemas_1 = require("@repo/db/usedSchemas");
const zod_1 = require("zod");
exports.insertUserSchema = usedSchemas_1.UserUncheckedCreateInputObjectSchema.pick({
username: true,
password: true,
});
exports.loginSchema = exports.insertUserSchema.extend({
rememberMe: zod_1.z.boolean().optional(),
});
exports.registerSchema = exports.insertUserSchema
.extend({
confirmPassword: zod_1.z.string().min(6, {
message: "Password must be at least 6 characters long",
}),
agreeTerms: zod_1.z.literal(true, {
errorMap: () => ({
message: "You must agree to the terms and conditions",
}),
}),
})
.refine((data) => data.password === data.confirmPassword, {
message: "Passwords don't match",
path: ["confirmPassword"],
});

36
packages/db/types/user-types.ts Executable file
View File

@@ -0,0 +1,36 @@
import { UserUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
import {z} from "zod";
export type User = z.infer<typeof UserUncheckedCreateInputObjectSchema>;
export const insertUserSchema = (
UserUncheckedCreateInputObjectSchema as unknown as z.ZodObject<any>
).pick({
username: true,
password: true,
});
export const loginSchema = (insertUserSchema as unknown as z.ZodObject<any>).extend({
rememberMe: z.boolean().optional(),
});
export const registerSchema = (insertUserSchema as unknown as z.ZodObject<any>)
.extend({
confirmPassword: z.string().min(6, {
message: "Password must be at least 6 characters long",
}),
agreeTerms: z.literal(true, {
errorMap: () => ({
message: "You must agree to the terms and conditions",
}),
}),
})
.refine((data: any) => data.password === data.confirmPassword, {
message: "Passwords don't match",
path: ["confirmPassword"],
});
export type InsertUser = z.infer<typeof insertUserSchema>;
export type LoginFormValues = z.infer<typeof loginSchema>;
export type RegisterFormValues = z.infer<typeof registerSchema>;