Fix resources naming scheme #25

Merged
satprog merged 1 commit from bugfix/resource-naming into main 2024-08-03 22:25:15 +00:00
Owner

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.

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.
satprog added this to the /transactions milestone 2024-06-22 21:38:13 +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.
satprog removed this from the /transactions milestone 2024-06-23 19:52:25 +00:00
nunorosa approved these changes 2024-06-25 21:48:24 +00:00
Dismissed
nunorosa left a comment

Nada a dizer aqui! Parece-me fazer tudo sentido, desde a alteração da versão (suspeito que esteja correcto) para a alteração ao alterar o "path" do PUT e a correção dos testes

Nada a dizer aqui! Parece-me fazer tudo sentido, desde a alteração da versão (suspeito que esteja correcto) para a alteração ao alterar o "path" do PUT e a correção dos testes ⭐⭐⭐⭐⭐
Author
Owner

Nada a dizer aqui! Parece-me fazer tudo sentido, desde a alteração da versão (suspeito que esteja correcto) para a alteração ao alterar o "path" do PUT e a correção dos testes

A versão é suporto ser semver, e devia ter logo começado em 0.1.0

> Nada a dizer aqui! Parece-me fazer tudo sentido, desde a alteração da versão (suspeito que esteja correcto) para a alteração ao alterar o "path" do PUT e a correção dos testes ⭐⭐⭐⭐⭐ A versão é suporto ser [semver](https://semver.org/), e devia ter logo começado em 0.1.0
nunorosa approved these changes 2024-07-26 10:28:01 +00:00
satprog force-pushed bugfix/resource-naming from 18c93b6c0f to 24b7fc3254
All checks were successful
Go / build (1.21) (pull_request) Successful in 11s
Go / build (1.22) (pull_request) Successful in 11s
Go / build (1.21) (push) Successful in 11s
Go / build (1.22) (push) Successful in 11s
2024-08-03 22:24:44 +00:00
Compare
satprog deleted branch bugfix/resource-naming 2024-08-03 22:25:15 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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
Reference
personal-finance/datastore!25
No description provided.