Return category on /transactions #33

Closed
satprog wants to merge 2 commits from feature/26-get-transaction-category into main
Owner

Issue #26

Issue #26
satprog added 6 commits 2024-06-24 20:46:05 +00:00
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
Issue #26
satprog requested review from nunorosa 2024-06-24 20:46:10 +00:00
satprog force-pushed feature/26-get-transaction-category from 92aa51c664 to 467afae68f 2024-09-13 18:21:50 +00:00 Compare
satprog added a new dependency 2024-09-13 18:23:59 +00:00
Author
Owner

The PR will be squashed into the previous one.

The PR will be squashed into the previous one.
satprog removed a dependency 2024-09-13 18:37:50 +00:00
satprog closed this pull request 2024-09-13 18:38:09 +00:00
satprog deleted branch feature/26-get-transaction-category 2024-09-13 18:38:33 +00:00
Some checks are pending
Go / build (1.21) (pull_request) Successful in 12s
Go / build (1.22) (pull_request) Successful in 11s
Go / build
Required

Pull request closed

Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: personal-finance/datastore#33
No description provided.