Skip to content

[Request Invoicing] Refactor payment state logic to use State Machine. Improve error handling #292

@MantisClone

Description

@MantisClone

Problem

The Invoice Dashboard: Invoice View and Single Invoice components contain messy state logic with many booleans. This makes the state logic very difficult to reason about and maintain. There is a strong suspicion that it doesn't handle errors or deviations from the happy path in the approval and payment workflow.

Proposed Solution

Refactor the state logic to use a State Machine - where all states are defined in a single enumeration. This will simplify reasoning and maintenance - it makes it obvious what code will need to update when adding new states or changing existing ones.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    🎫 Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions