Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Challenge Bravo - Just a guy trying to have some fun #318

Open
wants to merge 99 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
0bf36d9
feat: initial setup
wesleyfebarretos Aug 30, 2024
45aad2f
feat: config and db connection
wesleyfebarretos Aug 31, 2024
6627c66
feat: currency entity and domain exceptions
wesleyfebarretos Aug 31, 2024
28e29bd
feat: user entity, enum and use cases
wesleyfebarretos Aug 31, 2024
ed9d6a9
feat: put connection pool max connections in config
wesleyfebarretos Aug 31, 2024
100bfff
feat: sqlc config
wesleyfebarretos Aug 31, 2024
6faab6a
feat: abstract db connection for can rollback transactions in future …
wesleyfebarretos Aug 31, 2024
119f213
fix: user entity metadata
wesleyfebarretos Aug 31, 2024
e543122
feat: add db driver to config
wesleyfebarretos Aug 31, 2024
e3e0cc6
feat: user and currency tables
wesleyfebarretos Aug 31, 2024
fb07d31
feat: improvements in makefile
wesleyfebarretos Aug 31, 2024
65083c7
fix: currency tables and entity
wesleyfebarretos Aug 31, 2024
1941a7a
feat: first user queries and override int32 sqlc default type to int
wesleyfebarretos Aug 31, 2024
575b8e9
feat: override pg_catalog.timestamp to time.Time
wesleyfebarretos Aug 31, 2024
dec46c3
feat: user repository
wesleyfebarretos Aug 31, 2024
7e54a98
feat: create and update user handler
wesleyfebarretos Aug 31, 2024
ae39697
fix: some fix in queries, handlers, and repositories
wesleyfebarretos Aug 31, 2024
87777cc
feat: start-services makef ile
wesleyfebarretos Aug 31, 2024
76e75c1
chore: remove unused config in docker compose
wesleyfebarretos Sep 3, 2024
905211e
feat: add transactional context to repositories
wesleyfebarretos Sep 3, 2024
67c384d
feat: exception handler
wesleyfebarretos Sep 3, 2024
659180e
feat: add utils pkg
wesleyfebarretos Sep 3, 2024
d5b65b8
feat: hashing in user password on create
wesleyfebarretos Sep 3, 2024
d46943c
feat: jwt service and middleware
wesleyfebarretos Sep 3, 2024
6d53b7d
WIP: get user by email
wesleyfebarretos Sep 3, 2024
cbd2530
feat: finish jwt middleware
wesleyfebarretos Sep 4, 2024
e9e7b55
fix: exception handler to abort request on panic
wesleyfebarretos Sep 4, 2024
20d544d
feat: sign in use case and fix in jwt
wesleyfebarretos Sep 4, 2024
2e86c06
feat: error response improvement
wesleyfebarretos Sep 4, 2024
232b3c2
feat: log middleware
wesleyfebarretos Sep 5, 2024
a839597
fix: interfaces
wesleyfebarretos Sep 5, 2024
0b75d70
fix: logger order params
wesleyfebarretos Sep 5, 2024
e405023
feat: currency queries
wesleyfebarretos Sep 5, 2024
4ccc95e
feat: override pg_catalog.numeric type to float64
wesleyfebarretos Sep 5, 2024
bbfeeb4
feat: currency repository
wesleyfebarretos Sep 5, 2024
3101a9b
feat: override some default values from sqlc
wesleyfebarretos Sep 5, 2024
bfc93e4
feat: currency use cases
wesleyfebarretos Sep 5, 2024
fa51708
fix: remove unnecessary column
wesleyfebarretos Sep 5, 2024
f4e0105
feat: create currency
wesleyfebarretos Sep 5, 2024
9164ce7
feat: currency handlers
wesleyfebarretos Sep 6, 2024
491dd58
feat: currency managment crud
wesleyfebarretos Sep 6, 2024
2011347
fix: get by code use case
wesleyfebarretos Sep 6, 2024
f82943a
feat: currency conversion service
wesleyfebarretos Sep 6, 2024
97cfd59
feat: add cron dependency
wesleyfebarretos Sep 6, 2024
8f829a8
feat: redis package
wesleyfebarretos Sep 10, 2024
add61f4
feat: add go mod
wesleyfebarretos Sep 10, 2024
383c210
refactor: go workspace
wesleyfebarretos Sep 10, 2024
bfb68ca
fix: makefile .env include
wesleyfebarretos Sep 10, 2024
323e957
fix: root path on init app
wesleyfebarretos Sep 11, 2024
f9d4e19
fix: docker compose context
wesleyfebarretos Sep 11, 2024
ffd77aa
chore: air log default file
wesleyfebarretos Sep 11, 2024
ed905c1
feat: add dependencies on pkg
wesleyfebarretos Sep 11, 2024
917d710
feat: scheduler
wesleyfebarretos Sep 11, 2024
e6ac95a
feat: job management by http requesitions
wesleyfebarretos Sep 12, 2024
d8a2335
build: app-job
wesleyfebarretos Sep 13, 2024
b5d3814
feat: dynamic response path to currencies search api's
wesleyfebarretos Sep 13, 2024
862e8e6
feat: default currencies updater based in usd value service
wesleyfebarretos Sep 13, 2024
0cef986
feat: job api currency updater task
wesleyfebarretos Sep 14, 2024
8818259
feat: add endpoint to run task immediately
wesleyfebarretos Sep 18, 2024
f500357
chore: remove unused package
wesleyfebarretos Sep 18, 2024
d8cd389
feat: add cache to currency rate map
wesleyfebarretos Sep 18, 2024
8988873
feat: update cache when create or update a currency
wesleyfebarretos Sep 18, 2024
23dd1bb
feat: automatic migrations on application start
wesleyfebarretos Sep 18, 2024
131d726
feat: abstract db get connection to rollback all queries maded to wor…
wesleyfebarretos Sep 18, 2024
7ce8582
feat: maximize default pool connection
wesleyfebarretos Sep 18, 2024
3926157
refactor: readability
wesleyfebarretos Sep 18, 2024
bf88124
feat: abstration in test tx enviroment
wesleyfebarretos Sep 18, 2024
b030a52
feat: test container pg setup
wesleyfebarretos Sep 24, 2024
619d9b2
feat: init setup to integration test
wesleyfebarretos Sep 24, 2024
46d7731
feat: keep develop integration test setup
wesleyfebarretos Sep 24, 2024
1aa942c
fix
wesleyfebarretos Sep 24, 2024
9014486
fix
wesleyfebarretos Sep 24, 2024
fbe6181
feat: abstraction in repositories to run in integration tests
wesleyfebarretos Sep 25, 2024
44108a7
feat: update tx without override repository connection pointer
wesleyfebarretos Sep 25, 2024
b81ecbe
chore: org
wesleyfebarretos Sep 25, 2024
a2a197d
feat: currency it test
wesleyfebarretos Sep 25, 2024
43a5545
fix
wesleyfebarretos Sep 25, 2024
93384f0
fix: integration tests
wesleyfebarretos Sep 25, 2024
d68c0fa
fix
wesleyfebarretos Sep 25, 2024
ca1f57f
feat: update user handler test
wesleyfebarretos Sep 25, 2024
14dc898
feat: update currency handler test
wesleyfebarretos Sep 25, 2024
56cd749
feat: delete currency handler test
wesleyfebarretos Sep 26, 2024
24ac616
feat: find currency by id handler test
wesleyfebarretos Sep 26, 2024
5a82935
feat: find all currency handler test
wesleyfebarretos Sep 26, 2024
f83c388
feat: find currency by code handler test
wesleyfebarretos Sep 26, 2024
5c252c0
feat: currency conversion handler test
wesleyfebarretos Sep 26, 2024
713feeb
docs: swagger implementation & create user
wesleyfebarretos Sep 26, 2024
e89c737
docs: currency conversion handler
wesleyfebarretos Sep 26, 2024
7795571
docs: delete currency handler
wesleyfebarretos Sep 26, 2024
3333c8d
docs: find all currencies handler
wesleyfebarretos Sep 26, 2024
c9cb04d
docs: find currency handlers
wesleyfebarretos Sep 26, 2024
6b317f9
docs: handlers & use cases
wesleyfebarretos Sep 26, 2024
85f8b52
fix
wesleyfebarretos Sep 26, 2024
f323658
chore: readme improvements
wesleyfebarretos Sep 26, 2024
f4617d5
chore: readme improvements
wesleyfebarretos Sep 26, 2024
9935ccb
feat: init swagger in jobs
wesleyfebarretos Sep 26, 2024
21fcda1
docs: job api swagger
wesleyfebarretos Sep 26, 2024
20b8e2f
docs: jobs api swagger
wesleyfebarretos Sep 26, 2024
f70c9a0
chore: write pull_request.txt
wesleyfebarretos Sep 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: first user queries and override int32 sqlc default type to int
wesleyfebarretos committed Aug 31, 2024
commit 1941a7acd0a0caa98da0195356196c81f36e43a8
6 changes: 6 additions & 0 deletions internal/infra/repository/queries/user/create.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- name: Create :one
INSERT INTO users
(role, email, first_name, last_name)
VALUES
($1,$2,$3,$4)
RETURNING *;
9 changes: 9 additions & 0 deletions internal/infra/repository/queries/user/update.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- name: Update :exec
UPDATE users
SET
role = $2,
email = $3,
first_name = $4,
last_name = $5
WHERE
id = $1;
47 changes: 47 additions & 0 deletions internal/infra/repository/sqlc/user_connection/create.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions internal/infra/repository/sqlc/user_connection/db.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

82 changes: 82 additions & 0 deletions internal/infra/repository/sqlc/user_connection/models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions internal/infra/repository/sqlc/user_connection/update.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/migration/000001_users_table.up.sql
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ CREATE TABLE IF NOT EXISTS users (
last_name VARCHAR(50) NOT NULL,
email VARCHAR(255) NOT NULL UNIQUE,
role roles NOT NULL,
active BOOL NOT NULL DEFAULT FALSE,
active BOOL NOT NULL DEFAULT TRUE,
password VARCHAR(500) NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
27 changes: 17 additions & 10 deletions sqlc.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
version: "2"
sql:
overrides:
go:
overrides:
- db_type: "serial"
engine: "postgresql"
go_type:
type: "int"

sql:
- &schema
engine: "postgresql"
schema: "internal/migrations/*"
queries: "./internal/infra/repository/queries/user.sql"
schema: "internal/migration/*"
queries: "./internal/infra/repository/queries/user"
gen:
go: &default_configs
package: "user_connection"
@@ -18,10 +25,10 @@ sql:
emit_all_enum_values: true
omit_unused_structs: true

- <<: *schema
queries: "./internal/infra/repository/queries/currency.sql"
gen:
go:
<<: *default_configs
package: "currency_connection"
out: "./internal/infra/repository/sqlc/currency_connection"
# - <<: *schema
# queries: "./internal/infra/repository/queries/currency.sql"
# gen:
# go:
# <<: *default_configs
# package: "currency_connection"
# out: "./internal/infra/repository/sqlc/currency_connection"