update relation from request order with goods id

This commit is contained in:
fadlydev
2025-01-09 14:22:49 +07:00
parent 7ab5e04eff
commit 1305dbf89e

View File

@ -8,12 +8,10 @@ import {
Index, Index,
ManyToOne, ManyToOne,
JoinColumn, JoinColumn,
OneToMany,
} from 'typeorm'; } from 'typeorm';
import { User } from './users'; import { User } from './users';
import { Supplier } from './supplier'; import { Supplier } from './supplier';
import { Goods } from './goods';
export enum PurchasingMethod { export enum PurchasingMethod {
PO = 'PO', // Purchase Order PO = 'PO', // Purchase Order
@ -66,9 +64,12 @@ export class RequestOrder {
}) })
requested_by: string; requested_by: string;
@OneToMany(() => Goods, (goods) => goods.id, { nullable: false }) @Column({
@JoinColumn({ name: 'goods_ids' }) nullable: false,
goods: Goods[]; type: 'uuid',
array: true,
})
goods_ids: string[];
@Column({ @Column({
nullable: true, nullable: true,