refactor(vacay): the leave days a moved trip drops go in one delete

This commit is contained in:
Maurice
2026-10-12 19:56:44 +00:00
parent 5baa1c2c69
commit 43677ec80b
2 changed files with 13 additions and 7 deletions
@@ -203,6 +203,12 @@ export class VacayEntriesRepository extends TrekRepository<VacayEntries> {
await this.nativeDelete({ id });
}
/** `DELETE FROM vacay_entries WHERE id IN (dynamic)`, the leave days `shiftOwnerEntriesForTripWindow` drops in one statement; a bound list. */
async deleteByIds(ids: number[]): Promise<void> {
if (ids.length === 0) return;
await this.nativeDelete({ id: { $in: ids } });
}
/** VC116 — `UPDATE vacay_entries SET fraction = ?, kind = ? WHERE id = ?` (`toggleEntry`'s in-place conversion). */
async updateFractionKind(id: number, fraction: number, kind: string): Promise<void> {
await this.nativeUpdate({ id }, { fraction, kind });