Interface CreditTransaction

The rows of one transaction. Every method reads or writes inside it.

interface CreditTransaction {
    lockAccount(scopeId): Promise<undefined | CreditAccountRow>;
    putAccount(row): Promise<void>;
    listLots(scopeId): Promise<CreditLotRow[]>;
    getLot(lotId): Promise<undefined | CreditLotRow>;
    findLotByFundingRef(scopeId, fundingRef): Promise<undefined | CreditLotRow>;
    putLot(row): Promise<void>;
    getHold(holdId): Promise<undefined | CreditHoldRow>;
    findHoldByOperation(scopeId, operationId): Promise<undefined | CreditHoldRow>;
    putHold(row): Promise<void>;
    listHolds(filter): Promise<CreditHoldRow[]>;
    listAllocations(holdId): Promise<CreditAllocationRow[]>;
    listAllocationsByLot(lotId): Promise<CreditAllocationRow[]>;
    putAllocation(row): Promise<void>;
    listAttempts(holdId): Promise<CreditAttemptRow[]>;
    putAttempt(row): Promise<void>;
    appendEntry(row): Promise<boolean>;
    getEntry(entryId): Promise<undefined | CreditEntryRow>;
    listEntries(filter): Promise<CreditEntryRow[]>;
    lockSupplierDay(day): Promise<SupplierDayRow>;
    putSupplierDay(row): Promise<void>;
    openSupplierMicro(scopeId?): Promise<number>;
    getDocument?(scopeId, documentId): Promise<undefined | CreditDocumentRow>;
    putDocument?(row): Promise<void>;
}

Methods

  • The open supplier liability: across every held or deferred hold, its supplier most less what settled; across every settled or released hold, its supplierOpenMicro. Scoped to one scope when scopeId is given, across the platform otherwise.

    Parameters

    • Optional scopeId: string

    Returns Promise<number>

  • Optional extension state, read while the scope account is locked. Both document methods are optional, so a store written before them still implements this interface; an allocator that needs them refuses a store without them.

    Parameters

    • scopeId: string
    • documentId: string

    Returns Promise<undefined | CreditDocumentRow>