- Refactor user existence check.
- Use a common error message for errors of the same type.
- Manage stock items:
- Decrease stock when an order is placed/created.
- Increase sold items.
- Manage orders or sales by checking stock (item quantity):
- Ensure only available items in stock are sold.
- Decrease Stock When Order Is Cancelled
- Payment Gateway