-
Couldn't load subscription status.
- Fork 1.9k
Description
fossasia/open-event-attendee-android#2032
As a client, I should never be able to create a wrong status on an order.
For example, if the starting state of an order is 'initializing', client should not be able to set it as 'pending', or 'confirmed'. In fact, client should have minimal control over the order status, it should be automatically changed on backend depending on if the order is created, updated, free paid, etc. Giving this control to client is asking for errors and bugs to happen and as the system will be used by more users, it'll create security and monetary problems
Ensure that error is thrown in case the status of order is wrong and ensure that a status transition of the order is enforced.
For example, it should not be possible for an order to go from status 'pending' to 'intializing', or 'expired' to 'initializing'.
Ensure this behaviour with tests