You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(rctab-cli-py3.11) ➜ rctab-cli git:(main) rctab sub approve --subscription-id b6d9ddbc-5b78-4a25-8f6d-953f53e34d62 --ticket C2345-999 --amount -1200 --date-from 2024-04-02 --date-to 2024-09-30 --allocate
Failed with status code: 400. Details: {'detail': 'The amount of unallocated_budget budget (0.0) is less than the negative allocation (1200.0).'}
Aborted!
(rctab-cli-py3.11) ➜ rctab-cli git:(main) rctab sub allocate --subscription-id b6d9ddbc-5b78-4a25-8f6d-953f53e34d62 --ticket C2345-999 --amount -1200
{'status': 'success', 'detail': 'Allocated -1200.0 to -1200.0'}
(rctab-cli-py3.11) ➜ rctab-cli git:(main) rctab sub approve --subscription-id b6d9ddbc-5b78-4a25-8f6d-953f53e34d62 --ticket C2345-999 --amount -1200 --date-from 2024-04-02 --date-to 2024-09-30
{'status': 'success', 'detail': 'approval created'}
(rctab-cli-py3.11) ➜ rctab-cli git:(main)
I suspect the error with the first command combining approve and allocate for a negative amount fails because we usually approve the amount then allocate.
We should add a fix so that in the case of negative amounts, we run the allocate first THEN the approval.
Yes, absolutely agree that we should reverse the order for -ve approvals. There's an issue on the API repo for this because that's where the fix will have to be done (although it shows up when using the CLI).
I suspect the error with the first command combining approve and allocate for a negative amount fails because we usually approve the amount then allocate.
We should add a fix so that in the case of negative amounts, we run the allocate first THEN the approval.
Related to #12
The text was updated successfully, but these errors were encountered: