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