import { EntityManager } from 'typeorm'; /** * **A ledger row is not deleted while another row is tied to it** (2026-10-23, user: 「원장 삭제의 경우에는 기존에 * 연결되어있던 관계를 모두 클리어시켜야 한다. 혹은 관계가 이어진 상태에서는 삭제할 수 없어야 한다」). * * Tied is a live row of any ledger that names it in a field - a repayment its loan, a contract its counterparty, a * forecast line the recurring item it was made from - or names it by kind and id (§`registerKindTie`). The person * unlinks or deletes that first, and the refusal says what it is and how many. Nothing is unlinked unseen: clearing the * link would change a collected amount or a contract's party where nobody looked. * * Read from the entities as they are declared, so a ledger added later - in any module - is held by the same rule. * Not counted: the versions a history table keeps of a row (its past, not a row naming it), the rows being deleted * together, and rows already deleted. A row's own parts go with it: the caller deletes them first, in the same * transaction. * * ── Why it lives in the shell ───────────────────────────────────────────── * operato-office wrote it first for its own ledgers; the ledgers it shows from biz-base and accounting (counterparties, * accounts, bank accounts, transactions) are deleted by their own packages, and a counterparty is named by rows of * modules biz-base does not know. Everything it needs is TypeORM's metadata, which every module's entities are in. * * The sentence is `error.row-tied` here; what is tied reads `label.row-tie-`, declared by the module that owns * that entity. An entity without one reads its class name. */ export declare function refuseTiedRows(tx: EntityManager, entity: Function, ids: string[]): Promise; /** * Declare a ledger that names rows by kind and id - accounting's payment (`targetType`, `targetId`) - so a row it * names is held as one named by a key is. Its owner declares it once, where the entity is. */ export declare function registerKindTie(entity: Function, fields: { kind: string; id: string; }): void;