fix: bill

This commit is contained in:
2026-02-17 11:08:22 +03:30
parent 2cac3a4925
commit 00404c38d2
5 changed files with 126 additions and 29 deletions
+6 -1
View File
@@ -1,4 +1,4 @@
import { Cascade, Collection, Entity, EntityRepositoryType, Enum, ManyToOne, OneToMany } from "@mikro-orm/core";
import { Cascade, Collection, Entity, EntityRepositoryType, Enum, ManyToOne, OneToMany, Property } from "@mikro-orm/core";
import { BaseEntity } from "../../../common/entities/base.entity";
import { Business } from "../../businesses/entities/business.entity";
@@ -17,5 +17,10 @@ export class Bill extends BaseEntity {
@OneToMany(() => Invoice, (invoice) => invoice.bill, { cascade: [Cascade.PERSIST, Cascade.REMOVE], orphanRemoval: true })
invoices = new Collection<Invoice>(this);
/** Set by BillsRepository.getBillsList; not persisted. */
@Property({ persist: false })
invoiceCount?: number;
[EntityRepositoryType]?: BillsRepository;
}