fix: companies

This commit is contained in:
2026-02-17 09:19:11 +03:30
parent f9f397e92a
commit 42d78e15ff
11 changed files with 79 additions and 80 deletions
+7 -8
View File
@@ -8,15 +8,14 @@ import { BillsRepository } from "../repositories/bill.repository";
@Entity({ repository: () => BillsRepository })
export class Bill extends BaseEntity {
@Enum({ items: () => BillType })
type: BillType;
@Enum({ items: () => BillType })
type: BillType;
@ManyToOne(() => Business, { nullable: false, deleteRule: "cascade" })
business!: Business;
@ManyToOne(() => Business, { nullable: false, deleteRule: "cascade" })
business!: Business;
@OneToMany(() => Invoice, (invoice) => invoice.bill, { cascade: [Cascade.PERSIST, Cascade.REMOVE], orphanRemoval: true })
invoices = new Collection<Invoice>(this);
@OneToMany(() => Invoice, (invoice) => invoice.bill, { cascade: [Cascade.PERSIST, Cascade.REMOVE], orphanRemoval: true })
invoices = new Collection<Invoice>(this);
[EntityRepositoryType]?: BillsRepository;
[EntityRepositoryType]?: BillsRepository;
}