- 
                Notifications
    You must be signed in to change notification settings 
- Fork 9
Milestone
Description
Problem
Pending requests show in the dashboard as "Created".

web-components/packages/invoice-dashboard/src/lib/view-requests.svelte
Lines 244 to 252 in f335da9
| const checkStatus = (request: any) => { | |
| switch (request?.balance?.balance >= request?.expectedAmount) { | |
| case true: | |
| return "Paid"; | |
| default: | |
| return "Created"; | |
| } | |
| }; | |
| </script> | 
Proposed Solution
Logic should check request.state after checking the balance. Support all possible states including Pending, Created, Accepted, and Canceled.
https://github.com/RequestNetwork/requestNetwork/blob/0320158c77b69f3255106df8ab0b649faac21f04/packages/types/src/request-logic-types.ts#L308-L315
/** States of a request */
export enum STATE {
  // use for upper layer (trick to avoid headache with retyping request in upper layer)
  PENDING = 'pending',
  CREATED = 'created',
  ACCEPTED = 'accepted',
  CANCELED = 'canceled',
}Considerations
What status to show for partially paid requests?
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
✅ Done