update
This commit is contained in:
@ -15,6 +15,7 @@ import { ServiceClass } from "../service_class";
|
|||||||
import { Service } from "../service";
|
import { Service } from "../service";
|
||||||
import { ServiceType } from "../service_type";
|
import { ServiceType } from "../service_type";
|
||||||
import { ItemType } from "../pharmacy/item_type";
|
import { ItemType } from "../pharmacy/item_type";
|
||||||
|
import { ItemMaster } from "../pharmacy/item_master";
|
||||||
|
|
||||||
@Entity("cashier_item", { schema: "cashier" })
|
@Entity("cashier_item", { schema: "cashier" })
|
||||||
export class CashierItem {
|
export class CashierItem {
|
||||||
@ -29,6 +30,10 @@ export class CashierItem {
|
|||||||
@JoinColumn()
|
@JoinColumn()
|
||||||
itemtype: ItemType;
|
itemtype: ItemType;
|
||||||
|
|
||||||
|
@ManyToOne(() => ItemMaster, { onDelete: "CASCADE" })
|
||||||
|
@JoinColumn()
|
||||||
|
itemmaster: ItemMaster;
|
||||||
|
|
||||||
@ManyToOne(() => ServiceType, { onDelete: "CASCADE" })
|
@ManyToOne(() => ServiceType, { onDelete: "CASCADE" })
|
||||||
@JoinColumn()
|
@JoinColumn()
|
||||||
servicetype: ServiceType;
|
servicetype: ServiceType;
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import {
|
|||||||
} from "typeorm";
|
} from "typeorm";
|
||||||
|
|
||||||
import { ItemGroup } from "./item_group";
|
import { ItemGroup } from "./item_group";
|
||||||
import { ItemTypeDetail } from "./item_type_detail"; // ✅ fix: import ItemTypeDetail
|
|
||||||
|
|
||||||
@Entity("pharmacy_item_type", { schema: "pharmacy" })
|
@Entity("pharmacy_item_type", { schema: "pharmacy" })
|
||||||
export class ItemType {
|
export class ItemType {
|
||||||
@ -24,9 +23,6 @@ export class ItemType {
|
|||||||
})
|
})
|
||||||
type_name!: string;
|
type_name!: string;
|
||||||
|
|
||||||
@OneToMany(() => ItemTypeDetail, (detail) => detail.item_type) // ✅ fix: relasi ke ItemTypeDetail
|
|
||||||
itemtypedetail!: ItemTypeDetail[]; // ✅ harus array karena OneToMany
|
|
||||||
|
|
||||||
@ManyToOne(() => ItemGroup, { nullable: false })
|
@ManyToOne(() => ItemGroup, { nullable: false })
|
||||||
@JoinColumn({ name: "item_group_id" })
|
@JoinColumn({ name: "item_group_id" })
|
||||||
item_group!: ItemGroup;
|
item_group!: ItemGroup;
|
||||||
|
|||||||
@ -11,15 +11,12 @@ import {
|
|||||||
} from "typeorm";
|
} from "typeorm";
|
||||||
|
|
||||||
import { ItemType } from "./item_type";
|
import { ItemType } from "./item_type";
|
||||||
import { ItemMaster } from "./item_master";
|
|
||||||
@Entity("pharmacy_item_type_detail", { schema: "pharmacy" })
|
@Entity("pharmacy_item_type_detail", { schema: "pharmacy" })
|
||||||
export class ItemTypeDetail {
|
export class ItemTypeDetail {
|
||||||
@PrimaryGeneratedColumn("uuid")
|
@PrimaryGeneratedColumn("uuid")
|
||||||
id!: string;
|
id!: string;
|
||||||
|
|
||||||
@OneToMany(() => ItemMaster, (detail) => detail.type_detail) // ✅ fix: relasi ke ItemTypeDetail
|
|
||||||
itemmaster!: ItemTypeDetail[];
|
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
type: "text",
|
type: "text",
|
||||||
nullable: false,
|
nullable: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user