This commit is contained in:
wayanrivan
2026-04-16 09:24:25 +07:00
parent 7cb2e85397
commit 2f9a78994a
2 changed files with 10 additions and 1 deletions

View File

@ -7,9 +7,11 @@ import {
DeleteDateColumn,
ManyToOne,
JoinColumn,
OneToMany
} from "typeorm";
import { ItemGroup } from "./item_group";
import { ItemTypeDetail } from "./item_type_detail"; // ✅ fix: import ItemTypeDetail
@Entity("pharmacy_item_type", { schema: "pharmacy" })
export class ItemType {
@ -22,6 +24,9 @@ export class ItemType {
})
type_name!: string;
@OneToMany(() => ItemTypeDetail, (detail) => detail.item_type) // ✅ fix: relasi ke ItemTypeDetail
itemtypedetail!: ItemTypeDetail[]; // ✅ harus array karena OneToMany
@ManyToOne(() => ItemGroup, { nullable: false })
@JoinColumn({ name: "item_group_id" })
item_group!: ItemGroup;

View File

@ -7,15 +7,19 @@ import {
DeleteDateColumn,
ManyToOne,
JoinColumn,
OneToMany
} from "typeorm";
import { ItemType } from "./item_type";
import { ItemMaster } from "./item_master";
@Entity("pharmacy_item_type_detail", { schema: "pharmacy" })
export class ItemTypeDetail {
@PrimaryGeneratedColumn("uuid")
id!: string;
@OneToMany(() => ItemMaster, (detail) => detail.type_detail) // ✅ fix: relasi ke ItemTypeDetail
itemmaster!: ItemTypeDetail[];
@Column({
type: "text",
nullable: false,