iov-one / starnamed

Other
7 stars 13 forks source link

Fix REST endpoint for escrows lookup #218

Open xpt1x opened 1 year ago

xpt1x commented 1 year ago

Currently GET /escrow/escrows only care about state being OPEN | EXPIRED

Whereas actually escrow object supports Refunded and Completed as well and might be very handy for integrations with client applications, so they should be considered as well and REST needs to be fixed for this query

LeCodeurDuDimanche commented 1 year ago

We can only filter by open and expired states because no escrow with the Completed or Refunded state is actually persisted, they are deleted from the store. So no escrow would be returned if filtering by Completed or Refunded states was authorized. These states are actually only used for internal logic. IIRC, the idea was to use transaction events to deal with these completetion and refund action on escrows. I think we can persist the refunded and completed escrow to query them if needed, without too much hassle, but I cannot vouch for it.

xpt1x commented 1 year ago

Yes I too understood it by looking at implementation, but I believe for front-end clients, these status are somewhat essential for building a marketplace like application, so will be great if these are persisted for historic data