Problem
Pending requests show in the dashboard as "Created".

|
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?
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
Proposed Solution
Logic should check
request.stateafter 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
Considerations
What status to show for partially paid requests?