Table of Contents

Interface ICurrencyLedgerService

Namespace
FishMMO.Database.Npgsql.Services.Interfaces
Assembly
FishMMO-DB.dll

Records completed currency movements.

public interface ICurrencyLedgerService

Remarks

Append-only. A movement is recorded after its balance change has been persisted and its outcome is known, so there is nothing to settle afterwards and no state for a later pass to interpret. A lost row is a gap in reporting, never a gap in the economy.

Methods

RecordAsync(long, long, int, int, CancellationToken)

Appends one completed movement.

Task<DatabaseResult> RecordAsync(long characterID, long amount, int reason, int state, CancellationToken cancellationToken = default)

Parameters

characterID long

The character whose balance moved.

amount long

Amount moved. Must be positive.

reason int

Maps to FishMMO.Shared.CurrencyMovementReason.

state int

Maps to FishMMO.Shared.CurrencyMovementState. Absorbed or Returned.

cancellationToken CancellationToken

Returns

Task<DatabaseResult>