Files
Aislo/resources/tester/print_frame/print_frame_entry.ts
T

16 lines
913 B
TypeScript

/* =============================================================================
* print_frame_entry.ts (PLAN 302-1 시험 진입)
* 원가계산 영역(`collectCostSheets` 몸통 `costSheetsOf`) → 인쇄 페이지와 같은 서버 몸(`pdfBody` · `xlsxBody`).
* vite `--ssr` 로 번들해 node 로 실행 — 인자 = payload JSON 경로 · 출력 = {pdf, xlsx} JSON.
* ========================================================================== */
import { readFileSync } from "node:fs";
import { costSheetsOf } from "../../../B09_Estimation/draft/B09_Draft_Print_Cost";
import { pdfBody, xlsxBody } from "../../../B09_Estimation/draft/B09_Draft_Print_Table";
const payload = JSON.parse(readFileSync(process.argv[2], "utf-8"));
const sheets = costSheetsOf(payload, payload.user ?? {});
console.log(
JSON.stringify({ pdf: pdfBody("원가계산", sheets), xlsx: xlsxBody("원가계산", sheets) }),
);