From 7edc92fc30b72c8cc89771a032d043bce6b5d67f Mon Sep 17 00:00:00 2001 From: wayanrivan Date: Sun, 5 Apr 2026 11:38:13 +0700 Subject: [PATCH] update: service cashier done --- src/entity/cashier/cashier.ts | 10 ++++++++-- tsconfig.json | 30 ++++++++++++++++++++++++------ 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/src/entity/cashier/cashier.ts b/src/entity/cashier/cashier.ts index c005923..1974ce1 100644 --- a/src/entity/cashier/cashier.ts +++ b/src/entity/cashier/cashier.ts @@ -7,20 +7,26 @@ import { DeleteDateColumn, JoinColumn, OneToOne, + OneToMany, + ManyToOne } from "typeorm"; import { EmrRegistration } from "../emr/emr_registration"; import { Room } from "../room"; +import { CashierItem } from "./cashier_item"; @Entity("cashiers", { schema: "cashier" }) export class Cashier { @PrimaryGeneratedColumn("uuid") id: string; - @OneToOne(() => EmrRegistration, { onDelete: "CASCADE" }) + @ManyToOne(() => EmrRegistration, { onDelete: "CASCADE" }) @JoinColumn() emrregistration: EmrRegistration; - @OneToOne(() => Room, { onDelete: "CASCADE" }) + @OneToMany(() => CashierItem, (detail) => detail.cashier) + cashieritem: CashierItem[]; + + @ManyToOne(() => Room, { onDelete: "CASCADE" }) @JoinColumn() room: Room; diff --git a/tsconfig.json b/tsconfig.json index bfd8c92..1177b44 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,12 @@ "compilerOptions": { "target": "es6", "module": "commonjs", - "lib": ["dom", "es6", "es2017", "esnext.asynciterable"], + "lib": [ + "dom", + "es6", + "es2017", + "esnext.asynciterable" + ], "sourceMap": true, "outDir": "./dist", "rootDir": "./", @@ -13,15 +18,28 @@ "emitDecoratorMetadata": true, "experimentalDecorators": true, "resolveJsonModule": true, - "typeRoots": ["./src/types", "./node_modules/@types"], + "ignoreDeprecations": "5.0", + "typeRoots": [ + "./src/types", + "./node_modules/@types" + ], // "baseUrl": "src/", "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true + "noFallthroughCasesInSwitch": true, // "allowJs": true, // "declaration": true // "emitDeclarationOnly": true, // "declarationMap": true + "strictPropertyInitialization": false }, - "include": ["src/swagger-output.json", "src/langs/json/*.json", "./src/**/*.tsx", "./src/**/*.ts"], - "exclude": ["node_modules", "test/**/*.ts"] -} + "include": [ + "src/swagger-output.json", + "src/langs/json/*.json", + "./src/**/*.tsx", + "./src/**/*.ts" + ], + "exclude": [ + "node_modules", + "test/**/*.ts" + ] +} \ No newline at end of file