/authorize/:account_id/:amount
- Starts a auth workflow
- Checks if the account exists and if the amount is available.
- Creates a pending transfer. This will reserve the funds for the transfer. TODO: Timeout is not working correctly
- Stores the transfer id in redis.
- Starts a void workflow
- Sleeps for the auth duration which is 10 seconds.
- Checks if the transfer is still pending. If it is, it will void the transfer.
- Starts a auth workflow
/present/:account_id/:amount
- Starts a present workflow
- Checks if the account exists.
- Gets the transfer id from redis.
- Checks if the transfer is still pending. If it is, it will present the transfer.
- Starts a present workflow
- Dockerize the app. Right now it is not possible to run the app without installing the dependencies.
- Investigate more on TigerBeetle timeout.
- More testing around timing issues. Right now there will be race conditions if the void and present workflows are started at the same time.
- Add tests.
- Start void as a child workflow instead of a separate workflow.
- Move DB queries to a separate service, and probably implement Sagas to coordinate the workflows.
- Install all the dependencies. Encore, temporal-lite and TigerBeetle.
- Start temporal-lite and TigerBeetle.
- Start the app with
encore run --debug
- Create accounts using
account
API. Also create a main treasury account which is assumed here to be of id1234567
. - Use
authorize
andpresent
APIs to test the app.