UNPKG

@accounter/server

Version:
18 lines (17 loc) 953 B
import { type Injector } from 'graphql-modules'; import type { IGetChargesByIdsResult } from '../../charges/types.js'; /** * Degrade the accountant approval status (APPROVED -> PENDING) for each of the * given charges, so a charge whose underlying data changed gets re-flagged for * accountant review. Charges in any other status (PENDING / UNAPPROVED) are left * untouched. * * The list is de-duplicated and empty / EMPTY_UUID ids are ignored. It is safe * to pass newly-generated charge ids: they are never APPROVED, so degrading them * is a no-op. * * Returns a map (keyed by charge id) of the charges that were actually degraded, * carrying their fresh (PENDING) state so callers can return an up-to-date charge * in their response instead of a stale one. */ export declare function degradeChargesAccountantApproval(injector: Injector, chargeIds: ReadonlyArray<string | null | undefined>): Promise<Map<string, IGetChargesByIdsResult>>;