12 Commits

Author SHA1 Message Date
59f4546a81
Adds missing OpenAPI configuration file
Also locks the tools versions and launches them from the packages
installed by the go mod. Otherwise, they would have to be manually
installed beforehand.
2024-05-28 21:54:48 +01:00
e382609c9b
Log API/DAL methods
Also renames some variables, removes old comments and harmonizes unit
tests.
2024-05-18 23:50:30 +01:00
26302b78d4
Implements /bank/{id} GET method
The API had to change, the ID of a bank is its shortform name, so it's
a string.

Issue #15
2024-05-18 23:39:58 +01:00
18fc469637
API: fix no banks/transactions status code
No content on the GET response from the banks/tarnsactions methods
should be a 204.
2024-05-18 23:21:24 +01:00
c464247112
Implements /banks GET method
Issue #16
2024-05-18 23:18:30 +01:00
8839dea7f5
Implements /transaction/{id} GET method
Issue #14
2024-05-18 22:50:24 +01:00
a52bca5882
Adapt API implementation with DAL interface
Swap direct access to the DB on the API server with an data abstraction
layer.
Implement each API type converter separately and revert changes to the
auto-generated server implementation types.

Add error return to DAL methods. Implement `Transactions`.

Add tools.go with oapi-codegen and mockgen.
https://www.jvt.me/posts/2022/06/15/go-tools-dependency-management/

Update go packages.

Issues #5, #12
2024-05-12 22:16:24 +01:00
688a9dcaf2
Add DAL interface and mock
Also add entity package with domain types.
2024-04-27 20:42:11 +01:00
d162eeee3d
Reword method for retrieving single bank/transaction
Changed to the singular of the word.
Generated new server implementation.
2024-04-27 20:33:50 +01:00
86036afa4e
API server online and DB connection established
Introduces the api-server/main.go, which creates the echo server,
connects it to the implemented handlers and runs it.

Fix the SQL query to retrieved transactions w/ categories.

Issues #6 and #7
2024-03-23 16:51:07 +00:00
1aa6e28b69
Implement basic /transactions method
Issue #1
2024-03-23 16:51:00 +00:00
b2451fed66
OpenAPI RESTful API code generator
This patch includes and uses the oapi-codegen tool to auto-generate go
boilerplate code, based on the OpenAPI spec.

Issue #4
2024-03-23 16:50:42 +00:00