Support modifying a transaction category #32

Merged
satprog merged 1 commit from feature/26-add-category into main 2025-03-19 21:36:31 +00:00
Owner

through the PUT /transactions/{transactionId} method.

Restrict the PUT to changing only the category. The other existing
attributes should remain immutable.
Remove the body of the PUT response, it isn't required, and it was
returning a 204, which shouldn't have it.

This patch also extracts the CategoryName as a separate component on the
OpenAPI spec, so that it can be reused on the Transaction.

Issues #26 and #23

through the PUT /transactions/{transactionId} method. Restrict the PUT to changing only the category. The other existing attributes should remain immutable. Remove the body of the PUT response, it isn't required, and it was returning a 204, which shouldn't have it. This patch also extracts the CategoryName as a separate component on the OpenAPI spec, so that it can be reused on the Transaction. Issues #26 and #23
It adds the method to the OpenAPI spec and generates a new server
config. The requirement for the ID on the Transaction component is
removed, so that it can be reused for insertions.
It also adds two new middlewares, a logging and a spec validator. If a
request does not follow the spec, a 400 is returned immediately.

Issue: #18
Adds PUT method to OpenAPI spec.

Given that the transaction IDs are generated on server-side, for the PUT
method to remain idempotent, it can only update existing transactions.

It also adds a TransactionExists method on the DAL.

Issue: #20
The accepted practice is to retain the collection name even for a single
resource operation, like getting a specific transaction.

Also moves the PUT /transactions to /transactions/{id} which makes it
clearer that it can only be applied to an already created transaction.
Adds type to OpenAPI. Feature done and tested E2E.
Adds common utilities package named "golang" to overcome language
deficiencies.

Issue #27
through the PUT /transactions/{transactionId} method.

Restrict the PUT to changing only the category. The other existing
attributes should remain immutable.
Remove the body of the PUT response, it isn't required, and it was
returning a 204, which shouldn't have it.

This patch also extracts the CategoryName as a separate component on the
OpenAPI spec, so that it can be reused on the Transaction.

Issues #26 and #23
satprog force-pushed feature/26-add-category from 13d752e69a to 9e58641001
Some checks failed
Go / build (1.21) (pull_request) Failing after 11s
Go / build (1.22) (pull_request) Failing after 9s
2024-09-13 18:21:29 +00:00
Compare
Return category on /transactions
All checks were successful
Go / build (1.21) (pull_request) Successful in 12s
Go / build (1.22) (pull_request) Successful in 11s
467afae68f
Issue #26
satprog force-pushed feature/26-add-category from 467afae68f
All checks were successful
Go / build (1.21) (pull_request) Successful in 12s
Go / build (1.22) (pull_request) Successful in 11s
to ca692e9aaf
All checks were successful
Go / build (1.21) (pull_request) Successful in 11s
Go / build (1.22) (pull_request) Successful in 11s
2024-09-13 18:36:44 +00:00
Compare
satprog force-pushed feature/26-add-category from ca692e9aaf
All checks were successful
Go / build (1.21) (pull_request) Successful in 11s
Go / build (1.22) (pull_request) Successful in 11s
to 50e8269120
All checks were successful
Go / build (1.22) (pull_request) Successful in 11s
Go / build (1.21) (pull_request) Successful in 11s
Go / build (1.22) (push) Successful in 1m32s
Go / build (1.21) (push) Successful in 1m35s
2024-09-13 18:40:01 +00:00
Compare
satprog deleted branch feature/26-add-category 2025-03-19 21:36:31 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Depends on
#28 Implements GET /categories
personal-finance/datastore
Reference
personal-finance/datastore!32
No description provided.