Skip to content

Request status column should show "Pending" if request state is pending #97

@MantisClone

Description

@MantisClone

Problem

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

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
No labels

Type

Projects

Status

✅ Done

Relationships

None yet

Development

No branches or pull requests

Issue actions