update: patient_guarantor.ts add faretype relation and update swagger builder

This commit is contained in:
wayanrivan
2026-03-30 09:40:20 +07:00
parent ab64ca370a
commit b00bd08565

View File

@ -1,74 +1,79 @@
import { import {
Entity, Entity,
PrimaryGeneratedColumn, PrimaryGeneratedColumn,
Column, Column,
ManyToOne, ManyToOne,
JoinColumn, JoinColumn,
CreateDateColumn, CreateDateColumn,
UpdateDateColumn, UpdateDateColumn,
DeleteDateColumn, DeleteDateColumn,
} from "typeorm"; } from "typeorm";
import { PatientGroup } from "./patient_group"; // Import entity PatientGroup import { PatientGroup } from "./patient_group"; // Import entity PatientGroup
import { FareType } from "./faretype";
@Entity("patient_guarantor") @Entity("patient_guarantor")
export class PatientGuarantor { export class PatientGuarantor {
@PrimaryGeneratedColumn("uuid") @PrimaryGeneratedColumn("uuid")
id!: string; id!: string;
// Nama penjamin pasien // Nama penjamin pasien
@Column({ type: "text", nullable: false }) @Column({ type: "text", nullable: false })
guarantor_name!: string; guarantor_name!: string;
// Nomor telepon penjamin pasien // Nomor telepon penjamin pasien
@Column({ type: "text", nullable: false }) @Column({ type: "text", nullable: false })
phone!: string; phone!: string;
// Provinsi tempat tinggal penjamin pasien // Provinsi tempat tinggal penjamin pasien
@Column({ type: "text", nullable: false }) @Column({ type: "text", nullable: false })
province!: string; province!: string;
// Kota tempat tinggal penjamin pasien // Kota tempat tinggal penjamin pasien
@Column({ type: "text", nullable: false }) @Column({ type: "text", nullable: false })
city!: string; city!: string;
// Kode pos tempat tinggal penjamin pasien // Kode pos tempat tinggal penjamin pasien
@Column({ type: "text", nullable: false }) @Column({ type: "text", nullable: false })
zip_code!: string; zip_code!: string;
// Nomor perjanjian atau kontrak // Nomor perjanjian atau kontrak
@Column({ type: "text", nullable: false }) @Column({ type: "text", nullable: false })
agreement_no!: string; agreement_no!: string;
// Deskripsi perjanjian atau kontrak // Deskripsi perjanjian atau kontrak
@Column({ type: "text", nullable: true }) @Column({ type: "text", nullable: true })
agreement_desc?: string; agreement_desc?: string;
// Relasi ke PatientGroup, setiap penjamin dapat terhubung dengan satu grup pasien // Relasi ke PatientGroup, setiap penjamin dapat terhubung dengan satu grup pasien
@ManyToOne(() => PatientGroup, { nullable: false }) @ManyToOne(() => PatientGroup, { nullable: false })
@JoinColumn({ name: "patient_group_id" }) @JoinColumn({ name: "patient_group_id" })
patient_group!: PatientGroup; patient_group!: PatientGroup;
// Tanggal pembuatan @ManyToOne(() => FareType, { nullable: false })
@CreateDateColumn() @JoinColumn()
created_at!: Date; faretype!: FareType;
// Kolom untuk tracking siapa yang membuat // Tanggal pembuatan
@Column({ nullable: true, length: 256 }) @CreateDateColumn()
created_by?: string; created_at!: Date;
// Tanggal pembaruan // Kolom untuk tracking siapa yang membuat
@UpdateDateColumn({ nullable: true }) @Column({ nullable: true, length: 256 })
updated_at?: Date; created_by?: string;
// Kolom untuk tracking siapa yang memperbarui // Tanggal pembaruan
@Column({ nullable: true, length: 256 }) @UpdateDateColumn({ nullable: true })
updated_by?: string; updated_at?: Date;
// Tanggal penghapusan // Kolom untuk tracking siapa yang memperbarui
@DeleteDateColumn({ nullable: true }) @Column({ nullable: true, length: 256 })
deleted_at?: Date; updated_by?: string;
// Kolom untuk tracking siapa yang menghapus // Tanggal penghapusan
@Column({ nullable: true, length: 256 }) @DeleteDateColumn({ nullable: true })
deleted_by?: string; deleted_at?: Date;
}
// Kolom untuk tracking siapa yang menghapus
@Column({ nullable: true, length: 256 })
deleted_by?: string;
}