pdf files db, backend route done
This commit is contained in:
@@ -7,107 +7,217 @@ const upload = multer({ storage: multer.memoryStorage() });
|
|||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
router.post("/claim-pdf/upload", upload.single("file"), async (req: Request, res: Response): Promise<any> => {
|
// ----------- PDF GROUPS ------------------
|
||||||
|
router.post(
|
||||||
|
"/pdf-groups",
|
||||||
|
async (req: Request, res: Response): Promise<any> => {
|
||||||
try {
|
try {
|
||||||
const { patientId, claimId } = req.body;
|
const { title, category, patientId } = req.body;
|
||||||
const file = req.file;
|
if (!title || !category || !patientId) {
|
||||||
|
return res
|
||||||
if (!patientId || !claimId) {
|
.status(400)
|
||||||
return res.status(400).json({ error: "Missing patientId, or claimId" });
|
.json({ error: "Missing title, category, or patientId" });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!file){
|
const group = await storage.createPdfGroup(
|
||||||
return res.status(400).json({ error: "Missing file" });
|
|
||||||
}
|
|
||||||
|
|
||||||
const created = await storage.createClaimPdf(
|
|
||||||
parseInt(patientId),
|
parseInt(patientId),
|
||||||
parseInt(claimId),
|
title,
|
||||||
|
category
|
||||||
|
);
|
||||||
|
|
||||||
|
res.json(group);
|
||||||
|
} catch (err) {
|
||||||
|
console.error("Error creating PDF group:", err);
|
||||||
|
res.status(500).json({ error: "Internal server error" });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
router.get(
|
||||||
|
"/pdf-groups/:id",
|
||||||
|
async (req: Request, res: Response): Promise<any> => {
|
||||||
|
try {
|
||||||
|
const idParam = req.params.id;
|
||||||
|
if (!idParam) {
|
||||||
|
return res.status(400).json({ error: "Missing ID" });
|
||||||
|
}
|
||||||
|
const id = parseInt(idParam);
|
||||||
|
const group = await storage.getPdfGroupById(id);
|
||||||
|
if (!group) return res.status(404).json({ error: "Group not found" });
|
||||||
|
res.json(group);
|
||||||
|
} catch (err) {
|
||||||
|
console.error("Error fetching PDF group:", err);
|
||||||
|
res.status(500).json({ error: "Internal server error" });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
router.get("/pdf-groups", async (req: Request, res: Response): Promise<any> => {
|
||||||
|
try {
|
||||||
|
const groups = await storage.getAllPdfGroups();
|
||||||
|
res.json(groups);
|
||||||
|
} catch (err) {
|
||||||
|
console.error("Error listing PDF groups:", err);
|
||||||
|
res.status(500).json({ error: "Internal server error" });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
router.put(
|
||||||
|
"/pdf-groups/:id",
|
||||||
|
async (req: Request, res: Response): Promise<any> => {
|
||||||
|
try {
|
||||||
|
const idParam = req.params.id;
|
||||||
|
if (!idParam) {
|
||||||
|
return res.status(400).json({ error: "Missing ID" });
|
||||||
|
}
|
||||||
|
const id = parseInt(idParam);
|
||||||
|
const { title, category } = req.body;
|
||||||
|
const updated = await storage.updatePdfGroup(id, { title, category });
|
||||||
|
if (!updated) return res.status(404).json({ error: "Group not found" });
|
||||||
|
res.json(updated);
|
||||||
|
} catch (err) {
|
||||||
|
console.error("Error updating PDF group:", err);
|
||||||
|
res.status(500).json({ error: "Internal server error" });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
router.delete(
|
||||||
|
"/pdf-groups/:id",
|
||||||
|
async (req: Request, res: Response): Promise<any> => {
|
||||||
|
try {
|
||||||
|
const idParam = req.params.id;
|
||||||
|
if (!idParam) {
|
||||||
|
return res.status(400).json({ error: "Missing ID" });
|
||||||
|
}
|
||||||
|
const id = parseInt(idParam);
|
||||||
|
const success = await storage.deletePdfGroup(id);
|
||||||
|
res.json({ success });
|
||||||
|
} catch (err) {
|
||||||
|
console.error("Error deleting PDF group:", err);
|
||||||
|
res.status(500).json({ error: "Internal server error" });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// ----------- PDF FILES ------------------
|
||||||
|
router.post(
|
||||||
|
"/pdf-files",
|
||||||
|
upload.single("file"),
|
||||||
|
async (req: Request, res: Response): Promise<any> => {
|
||||||
|
try {
|
||||||
|
const { groupId } = req.body;
|
||||||
|
const file = req.file;
|
||||||
|
if (!groupId || !file) {
|
||||||
|
return res.status(400).json({ error: "Missing groupId or file" });
|
||||||
|
}
|
||||||
|
|
||||||
|
const pdf = await storage.createPdfFile(
|
||||||
|
parseInt(groupId),
|
||||||
file.originalname,
|
file.originalname,
|
||||||
file.buffer
|
file.buffer
|
||||||
);
|
);
|
||||||
|
|
||||||
res.json(created);
|
res.json(pdf);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Error uploading claim PDF:", err);
|
console.error("Error uploading PDF file:", err);
|
||||||
res.status(500).json({ error: "Internal server error" });
|
res.status(500).json({ error: "Internal server error" });
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
router.get("/claim-pdf/recent", async (req: Request, res: Response): Promise<any> => {
|
|
||||||
try {
|
|
||||||
const limit = parseInt(req.query.limit as string) || 5;
|
|
||||||
const offset = parseInt(req.query.offset as string) || 0;
|
|
||||||
|
|
||||||
const recent = await storage.getRecentClaimPdfs(limit, offset);
|
|
||||||
res.json(recent);
|
|
||||||
} catch (err) {
|
|
||||||
console.error("Error fetching recent PDFs:", err);
|
|
||||||
res.status(500).json({ error: "Internal server error" });
|
|
||||||
}
|
}
|
||||||
});
|
);
|
||||||
|
|
||||||
router.get("/claim-pdf/:id", async (req: Request, res: Response): Promise<any> => {
|
router.get(
|
||||||
|
"/pdf-files/:id",
|
||||||
|
async (req: Request, res: Response): Promise<any> => {
|
||||||
try {
|
try {
|
||||||
const idParam = req.params.id;
|
const idParam = req.params.id;
|
||||||
if (!idParam) return res.status(400).json({ error: "Missing ID" });
|
if (!idParam) {
|
||||||
|
return res.status(400).json({ error: "Missing ID" });
|
||||||
|
}
|
||||||
const id = parseInt(idParam);
|
const id = parseInt(idParam);
|
||||||
const pdf = await storage.getClaimPdfById(id);
|
const pdf = await storage.getPdfFileById(id);
|
||||||
|
if (!pdf || !pdf.pdfData)
|
||||||
|
return res.status(404).json({ error: "PDF not found" });
|
||||||
|
|
||||||
if (!pdf || !pdf.pdfData) return res.status(404).json({ error: "PDF not found" });
|
|
||||||
|
|
||||||
// Fix bad objectified Buffer
|
|
||||||
if (!Buffer.isBuffer(pdf.pdfData)) {
|
if (!Buffer.isBuffer(pdf.pdfData)) {
|
||||||
pdf.pdfData = Buffer.from(Object.values(pdf.pdfData));
|
pdf.pdfData = Buffer.from(Object.values(pdf.pdfData));
|
||||||
}
|
}
|
||||||
|
|
||||||
res.setHeader("Content-Type", "application/pdf");
|
res.setHeader("Content-Type", "application/pdf");
|
||||||
res.setHeader(
|
res.setHeader(
|
||||||
"Content-Disposition",
|
"Content-Disposition",
|
||||||
`attachment; filename="${pdf.filename}"; filename*=UTF-8''${encodeURIComponent(pdf.filename)}`
|
`attachment; filename="${pdf.filename}"; filename*=UTF-8''${encodeURIComponent(pdf.filename)}`
|
||||||
);
|
);
|
||||||
res.send(pdf.pdfData);
|
res.send(pdf.pdfData);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Error fetching PDF by ID:", err);
|
console.error("Error downloading PDF file:", err);
|
||||||
res.status(500).json({ error: "Internal server error" });
|
res.status(500).json({ error: "Internal server error" });
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
router.delete("/claim-pdf/:id", async (req: Request, res: Response): Promise<any> => {
|
router.get(
|
||||||
|
"/pdf-files/recent",
|
||||||
|
async (req: Request, res: Response): Promise<any> => {
|
||||||
try {
|
try {
|
||||||
const idParam = req.params.id;
|
const limit = parseInt(req.query.limit as string) || 5;
|
||||||
if (!idParam) return res.status(400).json({ error: "Missing ID" });
|
const offset = parseInt(req.query.offset as string) || 0;
|
||||||
|
const files = await storage.getRecentPdfFiles(limit, offset);
|
||||||
const id = parseInt(idParam);
|
res.json(files);
|
||||||
const success = await storage.deleteClaimPdf(id);
|
|
||||||
|
|
||||||
res.json({ success });
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Error deleting PDF:", err);
|
console.error("Error getting recent PDF files:", err);
|
||||||
res.status(500).json({ error: "Internal server error" });
|
res.status(500).json({ error: "Internal server error" });
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
router.put("/claim-pdf/:id", upload.single("file"), async (req: Request, res: Response): Promise<any> => {
|
router.put(
|
||||||
|
"/pdf-files/:id",
|
||||||
|
upload.single("file"),
|
||||||
|
async (req: Request, res: Response): Promise<any> => {
|
||||||
try {
|
try {
|
||||||
const idParam = req.params.id;
|
const idParam = req.params.id;
|
||||||
if (!idParam) return res.status(400).json({ error: "Missing ID" });
|
if (!idParam) {
|
||||||
|
return res.status(400).json({ error: "Missing ID" });
|
||||||
|
}
|
||||||
const id = parseInt(idParam);
|
const id = parseInt(idParam);
|
||||||
const file = req.file;
|
const file = req.file;
|
||||||
|
|
||||||
const updated = await storage.updateClaimPdf(id, {
|
const updated = await storage.updatePdfFile(id, {
|
||||||
filename: file?.originalname,
|
filename: file?.originalname,
|
||||||
pdfData: file?.buffer,
|
pdfData: file?.buffer,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!updated) return res.status(404).json({ error: "PDF not found or update failed" });
|
if (!updated)
|
||||||
|
return res
|
||||||
|
.status(404)
|
||||||
|
.json({ error: "PDF not found or update failed" });
|
||||||
|
|
||||||
res.json(updated);
|
res.json(updated);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Error updating PDF:", err);
|
console.error("Error updating PDF file:", err);
|
||||||
res.status(500).json({ error: "Internal server error" });
|
res.status(500).json({ error: "Internal server error" });
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
router.delete(
|
||||||
|
"/pdf-files/:id",
|
||||||
|
async (req: Request, res: Response): Promise<any> => {
|
||||||
|
try {
|
||||||
|
const idParam = req.params.id;
|
||||||
|
if (!idParam) {
|
||||||
|
return res.status(400).json({ error: "Missing ID" });
|
||||||
|
}
|
||||||
|
const id = parseInt(idParam);
|
||||||
|
|
||||||
|
const success = await storage.deletePdfFile(id);
|
||||||
|
res.json({ success });
|
||||||
|
} catch (err) {
|
||||||
|
console.error("Error deleting PDF file:", err);
|
||||||
|
res.status(500).json({ error: "Internal server error" });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
export default router;
|
export default router;
|
||||||
|
|||||||
@@ -5,9 +5,7 @@ import { forwardToSeleniumInsuranceEligibilityAgent } from "../services/selenium
|
|||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
router.post(
|
router.post("/check", async (req: Request, res: Response): Promise<any> => {
|
||||||
"/check",
|
|
||||||
async (req: Request, res: Response): Promise<any> => {
|
|
||||||
if (!req.body.data) {
|
if (!req.body.data) {
|
||||||
return res
|
return res
|
||||||
.status(400)
|
.status(400)
|
||||||
@@ -41,6 +39,23 @@ router.post(
|
|||||||
const result =
|
const result =
|
||||||
await forwardToSeleniumInsuranceEligibilityAgent(enrichedData);
|
await forwardToSeleniumInsuranceEligibilityAgent(enrichedData);
|
||||||
|
|
||||||
|
// ✅ Step 1: Check result and update patient status
|
||||||
|
const patient = await storage.getPatientByInsuranceId(
|
||||||
|
insuranceEligibilityData.memberId
|
||||||
|
);
|
||||||
|
|
||||||
|
if (patient && patient.id !== undefined) {
|
||||||
|
const newStatus = result.eligibility === "Y" ? "active" : "inactive";
|
||||||
|
await storage.updatePatient(patient.id, { status: newStatus });
|
||||||
|
result.patientUpdateStatus = `Patient status updated to ${newStatus}`;
|
||||||
|
} else {
|
||||||
|
console.warn(
|
||||||
|
`No patient found with insuranceId: ${insuranceEligibilityData.memberId}`
|
||||||
|
);
|
||||||
|
result.patientUpdateStatus =
|
||||||
|
"Patient not found or missing ID; no update performed";
|
||||||
|
}
|
||||||
|
|
||||||
res.json(result);
|
res.json(result);
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
@@ -48,7 +63,6 @@ router.post(
|
|||||||
error: err.message || "Failed to forward to selenium agent",
|
error: err.message || "Failed to forward to selenium agent",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
export default router;
|
export default router;
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ import {
|
|||||||
StaffUncheckedCreateInputObjectSchema,
|
StaffUncheckedCreateInputObjectSchema,
|
||||||
ClaimUncheckedCreateInputObjectSchema,
|
ClaimUncheckedCreateInputObjectSchema,
|
||||||
InsuranceCredentialUncheckedCreateInputObjectSchema,
|
InsuranceCredentialUncheckedCreateInputObjectSchema,
|
||||||
ClaimPdfUncheckedCreateInputObjectSchema,
|
PdfFileUncheckedCreateInputObjectSchema,
|
||||||
|
PdfGroupUncheckedCreateInputObjectSchema,
|
||||||
|
PdfCategorySchema,
|
||||||
} from "@repo/db/usedSchemas";
|
} from "@repo/db/usedSchemas";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
@@ -146,8 +148,10 @@ type ClaimWithServiceLines = Claim & {
|
|||||||
}[];
|
}[];
|
||||||
};
|
};
|
||||||
|
|
||||||
// claim types:
|
// Pdf types:
|
||||||
type ClaimPdf = z.infer<typeof ClaimPdfUncheckedCreateInputObjectSchema>;
|
type PdfGroup = z.infer<typeof PdfGroupUncheckedCreateInputObjectSchema>;
|
||||||
|
type PdfFile = z.infer<typeof PdfFileUncheckedCreateInputObjectSchema>;
|
||||||
|
type PdfCategory = z.infer<typeof PdfCategorySchema>;
|
||||||
|
|
||||||
export interface ClaimPdfMetadata {
|
export interface ClaimPdfMetadata {
|
||||||
id: number;
|
id: number;
|
||||||
@@ -245,29 +249,36 @@ export interface IStorage {
|
|||||||
siteKey: string
|
siteKey: string
|
||||||
): Promise<InsuranceCredential | null>;
|
): Promise<InsuranceCredential | null>;
|
||||||
|
|
||||||
// Claim PDF Methods
|
// General PDF Methods
|
||||||
createClaimPdf(
|
createPdfFile(
|
||||||
patientId: number,
|
groupId: number,
|
||||||
claimId: number,
|
|
||||||
filename: string,
|
filename: string,
|
||||||
pdfData: Buffer
|
pdfData: Buffer
|
||||||
): Promise<ClaimPdf>;
|
): Promise<PdfFile>;
|
||||||
|
getPdfFileById(id: number): Promise<PdfFile | undefined>;
|
||||||
getClaimPdfById(id: number): Promise<ClaimPdf | undefined>;
|
getPdfFilesByGroupId(groupId: number): Promise<PdfFile[]>;
|
||||||
|
getRecentPdfFiles(limit: number, offset: number): Promise<PdfFile[]>;
|
||||||
getAllClaimPdfs(): Promise<ClaimPdfMetadata[]>;
|
deletePdfFile(id: number): Promise<boolean>;
|
||||||
|
updatePdfFile(
|
||||||
getRecentClaimPdfs(
|
|
||||||
limit: number,
|
|
||||||
offset: number
|
|
||||||
): Promise<ClaimPdfMetadata[]>;
|
|
||||||
|
|
||||||
deleteClaimPdf(id: number): Promise<boolean>;
|
|
||||||
|
|
||||||
updateClaimPdf(
|
|
||||||
id: number,
|
id: number,
|
||||||
updates: Partial<Pick<ClaimPdf, "filename" | "pdfData">>
|
updates: Partial<Pick<PdfFile, "filename" | "pdfData">>
|
||||||
): Promise<ClaimPdf | undefined>;
|
): Promise<PdfFile | undefined>;
|
||||||
|
|
||||||
|
// Group management
|
||||||
|
createPdfGroup(
|
||||||
|
patientId: number,
|
||||||
|
title: string,
|
||||||
|
category: PdfCategory
|
||||||
|
): Promise<PdfGroup>;
|
||||||
|
|
||||||
|
getAllPdfGroups(): Promise<PdfGroup[]>;
|
||||||
|
getPdfGroupById(id: number): Promise<PdfGroup | undefined>;
|
||||||
|
getPdfGroupsByPatientId(patientId: number): Promise<PdfGroup[]>;
|
||||||
|
updatePdfGroup(
|
||||||
|
id: number,
|
||||||
|
updates: Partial<Pick<PdfGroup, "title" | "category">>
|
||||||
|
): Promise<PdfGroup | undefined>;
|
||||||
|
deletePdfGroup(id: number): Promise<boolean>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const storage: IStorage = {
|
export const storage: IStorage = {
|
||||||
@@ -610,73 +621,107 @@ export const storage: IStorage = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// pdf claims
|
// PDF Files
|
||||||
async createClaimPdf(
|
async createPdfFile(groupId, filename, pdfData) {
|
||||||
patientId,
|
return db.pdfFile.create({
|
||||||
claimId,
|
|
||||||
filename,
|
|
||||||
pdfData
|
|
||||||
): Promise<ClaimPdf> {
|
|
||||||
return db.claimPdf.create({
|
|
||||||
data: {
|
data: {
|
||||||
patientId,
|
groupId,
|
||||||
claimId,
|
|
||||||
filename,
|
filename,
|
||||||
pdfData,
|
pdfData,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
async getClaimPdfById(id: number): Promise<ClaimPdf | undefined> {
|
async getAllPdfGroups(): Promise<PdfGroup[]> {
|
||||||
const pdf = await db.claimPdf.findUnique({ where: { id } });
|
return db.pdfGroup.findMany({
|
||||||
return pdf ?? undefined;
|
orderBy: {
|
||||||
|
createdAt: "desc",
|
||||||
|
},
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
async getAllClaimPdfs(): Promise<ClaimPdfMetadata[]> {
|
async getPdfFileById(id) {
|
||||||
return db.claimPdf.findMany({
|
return (await db.pdfFile.findUnique({ where: { id } })) ?? undefined;
|
||||||
select: { id: true, filename: true, uploadedAt: true },
|
},
|
||||||
|
|
||||||
|
async getPdfFilesByGroupId(groupId) {
|
||||||
|
return db.pdfFile.findMany({
|
||||||
|
where: { groupId },
|
||||||
orderBy: { uploadedAt: "desc" },
|
orderBy: { uploadedAt: "desc" },
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
async getRecentClaimPdfs(
|
async getRecentPdfFiles(limit: number, offset: number): Promise<PdfFile[]> {
|
||||||
limit: number,
|
return db.pdfFile.findMany({
|
||||||
offset: number
|
|
||||||
): Promise<ClaimPdfMetadata[]> {
|
|
||||||
return db.claimPdf.findMany({
|
|
||||||
skip: offset,
|
skip: offset,
|
||||||
take: limit,
|
take: limit,
|
||||||
orderBy: { uploadedAt: "desc" },
|
orderBy: { uploadedAt: "desc" },
|
||||||
select: {
|
include: { group: true },
|
||||||
id: true,
|
|
||||||
filename: true,
|
|
||||||
uploadedAt: true,
|
|
||||||
patient: true,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
async deleteClaimPdf(id: number): Promise<boolean> {
|
async updatePdfFile(id, updates) {
|
||||||
try {
|
try {
|
||||||
await db.claimPdf.delete({ where: { id } });
|
return await db.pdfFile.update({
|
||||||
|
where: { id },
|
||||||
|
data: updates,
|
||||||
|
});
|
||||||
|
} catch {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
async deletePdfFile(id) {
|
||||||
|
try {
|
||||||
|
await db.pdfFile.delete({ where: { id } });
|
||||||
return true;
|
return true;
|
||||||
} catch {
|
} catch {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
async updateClaimPdf(
|
// ----------------------
|
||||||
id: number,
|
// PdfGroup CRUD
|
||||||
updates: Partial<Pick<ClaimPdf, "filename" | "pdfData">>
|
// ----------------------
|
||||||
): Promise<ClaimPdf | undefined> {
|
|
||||||
|
async createPdfGroup(patientId, title, category) {
|
||||||
|
return db.pdfGroup.create({
|
||||||
|
data: {
|
||||||
|
patientId,
|
||||||
|
title,
|
||||||
|
category,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
async getPdfGroupById(id) {
|
||||||
|
return (await db.pdfGroup.findUnique({ where: { id } })) ?? undefined;
|
||||||
|
},
|
||||||
|
|
||||||
|
async getPdfGroupsByPatientId(patientId) {
|
||||||
|
return db.pdfGroup.findMany({
|
||||||
|
where: { patientId },
|
||||||
|
orderBy: { createdAt: "desc" },
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
async updatePdfGroup(id, updates) {
|
||||||
try {
|
try {
|
||||||
const updated = await db.claimPdf.update({
|
return await db.pdfGroup.update({
|
||||||
where: { id },
|
where: { id },
|
||||||
data: updates,
|
data: updates,
|
||||||
});
|
});
|
||||||
return updated;
|
|
||||||
} catch {
|
} catch {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
async deletePdfGroup(id) {
|
||||||
|
try {
|
||||||
|
await db.pdfGroup.delete({ where: { id } });
|
||||||
|
return true;
|
||||||
|
} catch {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ endobj
|
|||||||
4 0 obj
|
4 0 obj
|
||||||
<</Type /Font
|
<</Type /Font
|
||||||
/Subtype /Type0
|
/Subtype /Type0
|
||||||
/BaseFont /GZIEDK+Arial
|
/BaseFont /MFLEVF+Arial
|
||||||
/Name /F1
|
/Name /F1
|
||||||
/Encoding /Identity-H
|
/Encoding /Identity-H
|
||||||
/DescendantFonts [5 0 R]
|
/DescendantFonts [5 0 R]
|
||||||
@@ -34,7 +34,7 @@ endobj
|
|||||||
5 0 obj
|
5 0 obj
|
||||||
<</Type /Font
|
<</Type /Font
|
||||||
/Subtype /CIDFontType2
|
/Subtype /CIDFontType2
|
||||||
/BaseFont /GZIEDK+Arial
|
/BaseFont /MFLEVF+Arial
|
||||||
/CIDSystemInfo 6 0 R
|
/CIDSystemInfo 6 0 R
|
||||||
/CIDToGIDMap /Identity
|
/CIDToGIDMap /Identity
|
||||||
/FontDescriptor 7 0 R
|
/FontDescriptor 7 0 R
|
||||||
@@ -276,7 +276,7 @@ endobj
|
|||||||
|
|
||||||
7 0 obj
|
7 0 obj
|
||||||
<</Type /FontDescriptor
|
<</Type /FontDescriptor
|
||||||
/FontName /GZIEDK+Arial
|
/FontName /MFLEVF+Arial
|
||||||
/FontBBox [-664 -324 2000 1039]
|
/FontBBox [-664 -324 2000 1039]
|
||||||
/Ascent 905
|
/Ascent 905
|
||||||
/Descent -211
|
/Descent -211
|
||||||
@@ -498,8 +498,8 @@ endobj
|
|||||||
<EFBFBD>7C<> <20><><EFBFBD><EFBFBD><EFBFBD>I<EFBFBD>tr}<7D>rI<72><49>\9<>Q.<2E><>E<EFBFBD><45>S<1B><>ᄲ@8 O
|
<EFBFBD>7C<> <20><><EFBFBD><EFBFBD><EFBFBD>I<EFBFBD>tr}<7D>rI<72><49>\9<>Q.<2E><>E<EFBFBD><45>S<1B><>ᄲ@8 O
|
||||||
<EFBFBD>
|
<EFBFBD>
|
||||||
ȁF<EFBFBD>|<7C>WjCr<|K<>Y8<59><38>9qX<71>2<<3C>L<EFBFBD><4C><01>
|
ȁF<EFBFBD>|<7C>WjCr<|K<>Y8<59><38>9qX<71>2<<3C>L<EFBFBD><4C><01>
|
||||||
%^<5E><>\<5C>-'t;<3B>5<EFBFBD><35><><18><>(<28>w<EFBFBD>D<16><><EFBFBD>gٙ<67>τ<0B><>g<EFBFBD><67>f<EFBFBD>F<EFBFBD>6<EFBFBD>a<EFBFBD>&ۿ<05>۷<>c6<19>!<21>y<챾z`~ȃ<><C883><EFBFBD><0E><>;;z<><7A><EFBFBD><EFBFBD><EFBFBD>;3<><33><EFBFBD><EFBFBD>~<7E><>ռ& hJ
|
%^<5E><>\<5C>-'t;<3B>5<EFBFBD><35><><18><>(<28>w<EFBFBD>D<16><><EFBFBD>gٙ<67>τ<0B><>g<EFBFBD><67>f<EFBFBD>F<EFBFBD>6<EFBFBD>a<EFBFBD>&ۿ<05>۷<>c6<19>!<21>y<챾z`~ȃ<><C883><EFBFBD><0E><>;;z<><7A><EFBFBD><EFBFBD><EFBFBD>;3<><33><EFBFBD><EFBFBD>~<7E><>ռ& hJ
|
||||||
g<EFBFBD><a<><61><EFBFBD>_<EFBFBD>
|
g<EFBFBD><a<><61><EFBFBD>_<EFBFBD>
|
||||||
{<7B>dy<64><1E>hM<68>/Y<>=<3D><><EFBFBD><EFBFBD>=<3D>RGw<47>Vk<56><6B><EFBFBD><EFBFBD>><1D><0E><>j Ms<73>vq<76>`<60>{ۚ<><DB9A><EFBFBD><EFBFBD>|<7C><>nM<6E>><3E>+<2B>ϙ<EFBFBD>m<EFBFBD><16>y<EFBFBD>ƻn<C6BB>I<EFBFBD>}<7D><>-<2D>գ<EFBFBD>o<EFBFBD><6F>A<EFBFBD><41><EFBFBD>M<EFBFBD>L<EFBFBD><4C><EFBFBD>ҕ<EFBFBD>"<22>[<5B>^<5E>L<><4C>s<EFBFBD><73>o<EFBFBD><6F><EFBFBD><EFBFBD>G<EFBFBD><11><><11>S | |||||||