From 1c17a5e7da535fe10df19d2035f2614e562f4d8e Mon Sep 17 00:00:00 2001 From: avicenan Date: Fri, 27 Mar 2026 15:57:20 +0700 Subject: [PATCH 1/2] feat(db): card type payment method --- src/entity/card_type.ts | 35 +++++++++++++++++++++++++++++++++++ src/entity/payment_method.ts | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 src/entity/card_type.ts create mode 100644 src/entity/payment_method.ts diff --git a/src/entity/card_type.ts b/src/entity/card_type.ts new file mode 100644 index 0000000..5e5b708 --- /dev/null +++ b/src/entity/card_type.ts @@ -0,0 +1,35 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, + DeleteDateColumn, +} from "typeorm"; + +@Entity("card_type") +export class CardType { + @PrimaryGeneratedColumn("uuid") + id!: string; + + @Column({ type: "text", nullable: false }) + name!: string; + + @CreateDateColumn() + created_at!: Date; + + @Column({ nullable: true, length: 256 }) + created_by?: string; + + @UpdateDateColumn({ nullable: true }) + updated_at?: Date; + + @Column({ nullable: true, length: 256 }) + updated_by?: string; + + @DeleteDateColumn({ nullable: true }) + deleted_at?: Date; + + @Column({ nullable: true, length: 256 }) + deleted_by?: string; +} \ No newline at end of file diff --git a/src/entity/payment_method.ts b/src/entity/payment_method.ts new file mode 100644 index 0000000..6837dfc --- /dev/null +++ b/src/entity/payment_method.ts @@ -0,0 +1,35 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, + DeleteDateColumn, +} from "typeorm"; + +@Entity("payment_method") +export class PaymentMethod { + @PrimaryGeneratedColumn("uuid") + id!: string; + + @Column({ type: "text", nullable: false }) + name!: string; + + @CreateDateColumn() + created_at!: Date; + + @Column({ nullable: true, length: 256 }) + created_by?: string; + + @UpdateDateColumn({ nullable: true }) + updated_at?: Date; + + @Column({ nullable: true, length: 256 }) + updated_by?: string; + + @DeleteDateColumn({ nullable: true }) + deleted_at?: Date; + + @Column({ nullable: true, length: 256 }) + deleted_by?: string; +} \ No newline at end of file From ef0d4e58367a35d625bc426043625fa6252224fd Mon Sep 17 00:00:00 2001 From: avicenan Date: Fri, 27 Mar 2026 16:08:28 +0700 Subject: [PATCH 2/2] chore(schema): add card type and payment method --- src/schema/public.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/schema/public.ts b/src/schema/public.ts index c3db69c..5c53615 100644 --- a/src/schema/public.ts +++ b/src/schema/public.ts @@ -38,6 +38,8 @@ export * from "../entity/user_to_room" export * from "../entity/refferal_hospital" export * from "../entity/room_to_pharmacy" export * from "../entity/faretype" +export * from "../entity/card_type" +export * from "../entity/payment_method" export * from "../types/action"; export * from "../types/error";