Compare commits

...
Sign in to create a new pull request.

66 commits

Author SHA1 Message Date
b9e48b8ada
Merge pull request 'refactor: throw and handle user not found exceptions' (!143) from refactor-user-not-found into main
All checks were successful
Release / Release (push) Successful in 58s
Release / Build Frontend Image (push) Successful in 25s
Release / Build Backend Image (push) Successful in 59s
Reviewed-on: #143
Reviewed-by: Jan K9f <jan@kjan.email>
2025-04-24 12:38:07 +00:00
ad5228ce27
Merge branch 'main' into refactor-user-not-found
All checks were successful
CI / Get Changed Files (pull_request) Successful in 9s
CI / eslint (pull_request) Has been skipped
CI / prettier (pull_request) Has been skipped
CI / test-build (pull_request) Has been skipped
CI / Checkstyle Main (pull_request) Successful in 25s
2025-04-24 12:34:57 +00:00
Phan Huy Tran
1f4256124f refactor: throw and handle user not found exceptions
All checks were successful
CI / Get Changed Files (pull_request) Successful in 8s
CI / eslint (pull_request) Has been skipped
CI / prettier (pull_request) Has been skipped
CI / test-build (pull_request) Has been skipped
CI / Checkstyle Main (pull_request) Successful in 39s
2025-04-24 14:33:38 +02:00
69b0289ce4
Merge pull request 'feat(deployment): add deployment for frontend' (!142) from feat/deployment into main
All checks were successful
Release / Release (push) Successful in 1m1s
Release / Build Backend Image (push) Successful in 23s
Release / Build Frontend Image (push) Successful in 1m6s
Reviewed-on: #142
2025-04-24 12:29:36 +00:00
csimonis
27473ef5b5 ci: update job name in release workflow configuration
All checks were successful
CI / Get Changed Files (pull_request) Successful in 17s
CI / prettier (pull_request) Successful in 34s
CI / eslint (pull_request) Successful in 36s
CI / Checkstyle Main (pull_request) Successful in 49s
CI / test-build (pull_request) Successful in 45s
2025-04-24 14:28:19 +02:00
csimonis
40e1ae5f87 chore(workflow): rename build-image and add frontend build
All checks were successful
CI / Get Changed Files (pull_request) Successful in 50s
CI / prettier (pull_request) Successful in 1m3s
CI / eslint (pull_request) Successful in 1m10s
CI / Checkstyle Main (pull_request) Successful in 1m18s
CI / test-build (pull_request) Successful in 1m16s
2025-04-24 14:25:10 +02:00
csimonis
36237874f7 feat(docker): add Docker configuration for frontend app 2025-04-24 14:23:17 +02:00
676473cfad
Merge pull request 'fix: improve docker pushing with version' (!141) from improve-docker-a-bit into main
All checks were successful
Release / Release (push) Successful in 59s
Release / Build Docker Image (push) Successful in 24s
Reviewed-on: #141
Reviewed-by: Constantin Simonis <constantin@simonis.lol>
2025-04-24 10:42:28 +00:00
d2560c6049
chore: remove deploy workflow configuration file
All checks were successful
CI / Get Changed Files (pull_request) Successful in 9s
CI / prettier (pull_request) Successful in 31s
CI / eslint (pull_request) Successful in 37s
CI / test-build (pull_request) Successful in 46s
CI / Checkstyle Main (pull_request) Successful in 52s
2025-04-24 12:24:27 +02:00
d9324ee7f0
build(workflow): update Docker build and push actions
All checks were successful
CI / Get Changed Files (pull_request) Successful in 6s
CI / prettier (pull_request) Successful in 33s
CI / eslint (pull_request) Successful in 36s
CI / Checkstyle Main (pull_request) Successful in 49s
CI / test-build (pull_request) Successful in 48s
2025-04-24 12:23:31 +02:00
0f96b284db
feat(ci): add build-image job to release workflow 2025-04-24 12:19:55 +02:00
ef069d7d18
Merge pull request 'feat: implement api route for slots (CAS-4 CAS-58)' (!140) from feature-slots into main
All checks were successful
Deploy / Build Docker Image (push) Successful in 49s
Release / Release (push) Successful in 1m0s
Reviewed-on: #140
Reviewed-by: Jan K9f <jan@kjan.email>
2025-04-24 10:16:18 +00:00
Phan Huy Tran
f01f6f6477 chore: rebase
All checks were successful
CI / Get Changed Files (pull_request) Successful in 6s
CI / eslint (pull_request) Has been skipped
CI / prettier (pull_request) Has been skipped
CI / test-build (pull_request) Has been skipped
CI / Checkstyle Main (pull_request) Successful in 26s
2025-04-24 10:15:23 +00:00
Phan Huy Tran
c93c386469 style: bruh 2025-04-24 10:15:23 +00:00
Phan Huy Tran
29732e63b9 refactor: balance in favor of the house 2025-04-24 10:15:23 +00:00
Phan Huy Tran
a26aeab86a feat: refactor and balance winnings 2025-04-24 10:15:23 +00:00
Phan Huy Tran
7a0dd0593b feat: implement slots api route 2025-04-24 10:15:23 +00:00
934e60e80d
Merge pull request 'feat(ci): add deployment workflow for backend' (!139) from feat/deployment into main
All checks were successful
Deploy / Build Docker Image (push) Successful in 14s
Release / Release (push) Successful in 1m3s
Reviewed-on: #139
Reviewed-by: Jan K9f <jan@kjan.email>
2025-04-24 10:14:27 +00:00
csimonis
41124af20e ci: update deployment workflow for main branch
All checks were successful
CI / Get Changed Files (pull_request) Successful in 10s
CI / eslint (pull_request) Successful in 37s
CI / prettier (pull_request) Successful in 31s
CI / Checkstyle Main (pull_request) Successful in 55s
CI / test-build (pull_request) Successful in 32s
2025-04-24 12:11:06 +02:00
csimonis
af005ce019 ci: update login action to use secrets for credentials
All checks were successful
CI / Get Changed Files (pull_request) Successful in 7s
Deploy / Build Docker Image (push) Successful in 40s
CI / eslint (pull_request) Successful in 35s
CI / Checkstyle Main (pull_request) Successful in 53s
CI / prettier (pull_request) Successful in 29s
CI / test-build (pull_request) Successful in 44s
2025-04-24 12:10:19 +02:00
csimonis
3b2ce7e772 chore: test
Some checks failed
Deploy / Build Docker Image (push) Failing after 3s
CI / Get Changed Files (pull_request) Successful in 6s
CI / Checkstyle Main (pull_request) Successful in 42s
CI / prettier (pull_request) Successful in 59s
CI / eslint (pull_request) Successful in 1m7s
CI / test-build (pull_request) Successful in 42s
2025-04-24 12:08:34 +02:00
csimonis
44b68528e3 ci: fix casing in deploy workflow for image tags
Some checks failed
CI / Get Changed Files (pull_request) Successful in 8s
CI / eslint (pull_request) Successful in 36s
CI / prettier (pull_request) Successful in 32s
CI / Checkstyle Main (pull_request) Successful in 58s
CI / test-build (pull_request) Successful in 40s
Deploy / Build Docker Image (push) Failing after 7s
2025-04-23 14:38:30 +02:00
csimonis
1c58db60d3 style(deploy.yml): fix indentation in deploy workflow steps
Some checks failed
Deploy / Build Docker Image (push) Failing after 5s
CI / Get Changed Files (pull_request) Successful in 6s
CI / prettier (pull_request) Successful in 29s
CI / eslint (pull_request) Successful in 33s
CI / Checkstyle Main (pull_request) Successful in 52s
CI / test-build (pull_request) Successful in 55s
2025-04-23 14:37:58 +02:00
csimonis
25b7e90517 build: update Dockerfile path in deploy workflow
All checks were successful
CI / Get Changed Files (pull_request) Successful in 6s
CI / eslint (pull_request) Successful in 33s
CI / prettier (pull_request) Successful in 35s
CI / Checkstyle Main (pull_request) Successful in 48s
CI / test-build (pull_request) Successful in 45s
2025-04-23 14:33:11 +02:00
csimonis
4f377e1e87 feat(ci): add deployment workflow and update Dockerfile
All checks were successful
CI / Get Changed Files (pull_request) Successful in 23s
CI / eslint (pull_request) Successful in 31s
CI / prettier (pull_request) Successful in 30s
CI / Checkstyle Main (pull_request) Successful in 48s
CI / test-build (pull_request) Successful in 38s
2025-04-23 14:29:36 +02:00
b07a3a935a
Merge pull request 'refactor: remove unused imports and clean up code' (!138) from refactor/imports into main
All checks were successful
Release / Release (push) Successful in 1m1s
Reviewed-on: #138
Reviewed-by: lziemke <lea.z4@schule.bremen.de>
2025-04-23 11:44:22 +00:00
csimonis
0cc8ff50aa style: format import statements for readability
All checks were successful
CI / Get Changed Files (pull_request) Successful in 6s
CI / prettier (pull_request) Successful in 30s
CI / eslint (pull_request) Successful in 35s
CI / Checkstyle Main (pull_request) Successful in 49s
CI / test-build (pull_request) Successful in 45s
2025-04-23 13:43:12 +02:00
csimonis
6f3f3791c3 refactor: remove unused imports and clean up code
Some checks failed
CI / Get Changed Files (pull_request) Successful in 6s
CI / prettier (pull_request) Failing after 29s
CI / eslint (pull_request) Successful in 36s
CI / test-build (pull_request) Successful in 44s
CI / Checkstyle Main (pull_request) Successful in 59s
2025-04-23 13:39:55 +02:00
csimonis
66e5d730dd refactor: reorganize import statements and clean up code 2025-04-23 13:39:49 +02:00
a677b1fbdb
Merge pull request 'feat: add transaction history to homepage (CAS-56)' (!137) from feature/transaction-history into main
All checks were successful
Release / Release (push) Successful in 58s
Reviewed-on: #137
Reviewed-by: Phan Huy Tran <ptran@noreply.localhost>
2025-04-23 10:38:30 +00:00
csimonis
070be95928 style(transaction-history): Adjust heading and paragraph styles
All checks were successful
CI / Get Changed Files (pull_request) Successful in 6s
CI / prettier (pull_request) Successful in 34s
CI / eslint (pull_request) Successful in 36s
CI / Checkstyle Main (pull_request) Successful in 50s
CI / test-build (pull_request) Successful in 46s
2025-04-23 12:32:23 +02:00
csimonis
d46ec45f4a style: format HTML and TypeScript files for consistency
All checks were successful
CI / Get Changed Files (pull_request) Successful in 32s
CI / prettier (pull_request) Successful in 31s
CI / eslint (pull_request) Successful in 37s
CI / test-build (pull_request) Successful in 44s
CI / Checkstyle Main (pull_request) Successful in 1m12s
2025-04-23 12:30:10 +02:00
csimonis
0eaccb4453 style(transaction-history): adjust button icon size and spacing
Some checks failed
CI / Get Changed Files (pull_request) Successful in 10s
CI / prettier (pull_request) Failing after 31s
CI / eslint (pull_request) Failing after 33s
CI / Checkstyle Main (pull_request) Successful in 47s
CI / test-build (pull_request) Successful in 45s
2025-04-23 12:27:38 +02:00
csimonis
35184807c0 feat(transactions): add pagination support for user transactions
Some checks failed
CI / Get Changed Files (pull_request) Successful in 6s
CI / Checkstyle Main (pull_request) Successful in 50s
CI / prettier (pull_request) Failing after 52s
CI / eslint (pull_request) Failing after 57s
CI / test-build (pull_request) Successful in 1m3s
2025-04-23 12:26:41 +02:00
csimonis
157e774e86 feat(transaction-history): add disabled state styling for buttons
Some checks failed
CI / Get Changed Files (pull_request) Successful in 6s
CI / Checkstyle Main (pull_request) Successful in 46s
CI / prettier (pull_request) Failing after 52s
CI / eslint (pull_request) Failing after 58s
CI / test-build (pull_request) Successful in 1m1s
2025-04-23 11:54:54 +02:00
csimonis
03d67ef362 feat: add pagination support for user transactions retrieval 2025-04-23 11:54:54 +02:00
csimonis
9817fb95db feat(transaction-history): add transaction history feature with modal 2025-04-23 11:54:54 +02:00
csimonis
d6077645d9 feat(transaction): add transaction retrieval and DTO mapping 2025-04-23 11:54:54 +02:00
5575955440
Merge pull request 'feat: add create and delete routes for lootboxes, remove initial creation of lootboxes' (!136) from feature-lootbox-handling into main
All checks were successful
Release / Release (push) Successful in 56s
Reviewed-on: #136
Reviewed-by: Jan K9f <jan@kjan.email>
2025-04-23 09:12:10 +00:00
Phan Huy Tran
389018af85 feat: add create and delete routes for lootboxes, remove initial creation of lootboxes
All checks were successful
CI / Get Changed Files (pull_request) Successful in 25s
CI / eslint (pull_request) Has been skipped
CI / prettier (pull_request) Has been skipped
CI / test-build (pull_request) Has been skipped
CI / Checkstyle Main (pull_request) Successful in 38s
2025-04-23 11:09:14 +02:00
5a207dd5d3
Merge pull request 'chore: update images' (!134) from update-some-images into main
All checks were successful
Release / Release (push) Successful in 52s
Reviewed-on: https://git.kballsjan.de/SZUT/casino/pulls/134
Reviewed-by: Constantin Simonis <constantin@simonis.lol>
2025-04-23 08:22:26 +00:00
2f022784a5
Merge pull request 'chore: delete sadly deceased http requests' (!135) from chore-remove-http-requests into main
All checks were successful
Release / Release (push) Successful in 1m0s
Reviewed-on: #135
Reviewed-by: Jan K9f <jan@kjan.email>
2025-04-23 08:21:13 +00:00
Phan Huy Tran
cf9a5c6dbe chore: delete sadly deceased http requests
All checks were successful
CI / Get Changed Files (pull_request) Successful in 6s
CI / eslint (pull_request) Has been skipped
CI / prettier (pull_request) Has been skipped
CI / test-build (pull_request) Has been skipped
CI / Checkstyle Main (pull_request) Successful in 27s
2025-04-23 10:20:07 +02:00
db43b69e2a
chore: update image assets for frontend
All checks were successful
CI / Get Changed Files (pull_request) Successful in 7s
CI / Checkstyle Main (pull_request) Has been skipped
CI / prettier (pull_request) Successful in 25s
CI / eslint (pull_request) Successful in 28s
CI / test-build (pull_request) Successful in 33s
2025-04-23 10:18:51 +02:00
e19de2d57b
chore: update poker.webp asset file
All checks were successful
CI / Get Changed Files (pull_request) Successful in 28s
CI / Checkstyle Main (pull_request) Has been skipped
CI / prettier (pull_request) Successful in 29s
CI / eslint (pull_request) Successful in 34s
CI / test-build (pull_request) Successful in 41s
2025-04-23 10:04:26 +02:00
7244bab007
Merge pull request 'chore(deps): update dependency typescript-eslint to v8.31.0' (!127) from renovate/devdependencies-(non-major) into main
All checks were successful
Release / Release (push) Successful in 57s
Reviewed-on: #127
Reviewed-by: Jan K9f <jan@kjan.email>
2025-04-23 07:55:12 +00:00
c78abe5bab
chore(deps): update dependency typescript-eslint to v8.31.0
All checks were successful
CI / Get Changed Files (pull_request) Successful in 6s
CI / Checkstyle Main (pull_request) Has been skipped
CI / prettier (pull_request) Successful in 25s
CI / eslint (pull_request) Successful in 30s
CI / test-build (pull_request) Successful in 36s
2025-04-23 07:53:44 +00:00
a6bf4f3f73
Merge pull request 'fix: fix release pipeline' (!133) from fix-pipeline2 into main
All checks were successful
Release / Release (push) Successful in 59s
Reviewed-on: #133
Reviewed-by: Phan Huy Tran <ptran@noreply.localhost>
2025-04-23 07:45:59 +00:00
ed2d512cb0
ci: remove eslint installation from CI workflow
All checks were successful
CI / Get Changed Files (pull_request) Successful in 6s
CI / eslint (pull_request) Successful in 29s
CI / Checkstyle Main (pull_request) Successful in 44s
CI / prettier (pull_request) Successful in 42s
CI / test-build (pull_request) Successful in 44s
2025-04-23 09:43:45 +02:00
465967ce73
chore: update eslint version and remove package.json
All checks were successful
CI / Get Changed Files (pull_request) Successful in 6s
CI / prettier (pull_request) Successful in 25s
CI / Checkstyle Main (pull_request) Successful in 37s
CI / test-build (pull_request) Successful in 36s
CI / eslint (pull_request) Successful in 22s
2025-04-23 09:41:36 +02:00
1bd0de1737
ci: add eslint installation to CI workflow
Some checks failed
CI / Get Changed Files (pull_request) Successful in 6s
CI / eslint (pull_request) Failing after 28s
CI / prettier (pull_request) Successful in 30s
CI / Checkstyle Main (pull_request) Successful in 43s
CI / test-build (pull_request) Successful in 43s
2025-04-23 09:37:24 +02:00
ddb772e7fc
chore: update .gitignore and add package.json for eslint
Some checks failed
CI / Get Changed Files (pull_request) Successful in 6s
CI / eslint (pull_request) Failing after 26s
CI / prettier (pull_request) Successful in 28s
CI / Checkstyle Main (pull_request) Successful in 42s
CI / test-build (pull_request) Successful in 41s
2025-04-23 09:35:08 +02:00
f6dd50dc44
Merge branch 'main' into fix-pipeline2
Some checks failed
CI / Get Changed Files (pull_request) Successful in 8s
CI / prettier (pull_request) Successful in 28s
CI / Checkstyle Main (pull_request) Successful in 48s
CI / test-build (pull_request) Successful in 36s
CI / eslint (pull_request) Failing after 37s
2025-04-23 07:16:50 +00:00
eda1fc8417
Merge pull request 'refactor: replace switch statement with if statement' (!132) from refactor-webhook into main
Some checks are pending
Release / Release (push) Waiting to run
Reviewed-on: #132
Reviewed-by: Constantin Simonis <constantin@simonis.lol>
2025-04-23 07:16:24 +00:00
17bc204029
style(workflow): standardize quotes and formatting in YAML
Some checks failed
CI / Get Changed Files (pull_request) Successful in 6s
CI / eslint (pull_request) Failing after 29s
CI / prettier (pull_request) Successful in 33s
CI / Checkstyle Main (pull_request) Successful in 52s
CI / test-build (pull_request) Successful in 50s
2025-04-23 09:15:15 +02:00
Phan Huy Tran
94ca93e510 refactor: replace switch statement with ugly a if statement (no go idiomatic btw)
All checks were successful
CI / Get Changed Files (pull_request) Successful in 6s
CI / eslint (pull_request) Has been skipped
CI / prettier (pull_request) Has been skipped
CI / test-build (pull_request) Has been skipped
CI / Checkstyle Main (pull_request) Successful in 37s
2025-04-23 09:14:19 +02:00
1fe3148019
Merge pull request 'fix: avoid serialization error, remove debug statement' (!131) from fix-stripe into main
Some checks are pending
Release / Release (push) Waiting to run
Reviewed-on: #131
Reviewed-by: Jan K9f <jan@kjan.email>
2025-04-23 07:07:12 +00:00
Phan Huy Tran
93dc3f9f10 fix: avoid serialization error, remove debug statement
All checks were successful
CI / Get Changed Files (pull_request) Successful in 6s
CI / eslint (pull_request) Has been skipped
CI / prettier (pull_request) Has been skipped
CI / test-build (pull_request) Has been skipped
CI / Checkstyle Main (pull_request) Successful in 38s
2025-04-23 09:05:44 +02:00
0291450eb9
Merge pull request 'feat(security): allow access to webhook endpoint' (!128) from bugfix/deposit into main
Some checks are pending
Release / Release (push) Waiting to run
Reviewed-on: #128
Reviewed-by: Jan K9f <jan@kjan.email>
Reviewed-by: Phan Huy Tran <ptran@noreply.localhost>
Reviewed-by: Jan-Marlon Leibl <jleibl@proton.me>
2025-04-23 06:59:50 +00:00
0b6bf37921
Merge branch 'main' into bugfix/deposit
All checks were successful
CI / Get Changed Files (pull_request) Successful in 6s
CI / eslint (pull_request) Has been skipped
CI / prettier (pull_request) Has been skipped
CI / test-build (pull_request) Has been skipped
CI / Checkstyle Main (pull_request) Successful in 36s
2025-04-23 06:59:00 +00:00
2aaf79410d
Merge pull request 'ci: add ubuntu-latest to workflow jobs configuration' (!130) from fix-pipelines into main
Reviewed-on: #130
2025-04-23 06:58:54 +00:00
24d2a93c7f
ci: add ubuntu-latest to workflow jobs configuration
All checks were successful
CI / Get Changed Files (pull_request) Successful in 5s
CI / prettier (pull_request) Successful in 1m51s
CI / eslint (pull_request) Successful in 1m59s
CI / test-build (pull_request) Successful in 2m7s
CI / Checkstyle Main (pull_request) Successful in 2m47s
2025-04-23 08:52:55 +02:00
csimonis
aa78ccc630 feat(security): allow access to webhook endpoint
Some checks failed
CI / Get Changed Files (pull_request) Successful in 5s
CI / Checkstyle Main (pull_request) Has been cancelled
CI / eslint (pull_request) Has been cancelled
CI / prettier (pull_request) Has been cancelled
CI / test-build (pull_request) Has been cancelled
2025-04-23 08:42:27 +02:00
9ec6d8f413
Merge pull request 'chore(deps): update dependency typescript-eslint to v8.29.1' (!126) from renovate/devdependencies-(non-major) into main
All checks were successful
Release / Release (push) Successful in 58s
Reviewed-on: #126
Reviewed-by: Jan K9f <jan@kjan.email>
2025-04-07 20:25:36 +00:00
f680a8829c
chore(deps): update dependency typescript-eslint to v8.29.1
All checks were successful
CI / Get Changed Files (pull_request) Successful in 6s
CI / Checkstyle Main (pull_request) Has been skipped
CI / prettier (pull_request) Successful in 41s
CI / eslint (pull_request) Successful in 1m37s
CI / test-build (pull_request) Successful in 1m42s
2025-04-07 18:02:33 +00:00
b803055307
Merge pull request 'feat: add authentik for authentication' (!58) from feature/authentik into main
All checks were successful
Release / Release (push) Successful in 1m7s
Reviewed-on: #58
Reviewed-by: Phan Huy Tran <ptran@noreply.localhost>
2025-04-04 13:26:02 +00:00
76 changed files with 1056 additions and 381 deletions

View file

@ -26,6 +26,7 @@ jobs:
- '.gitea/workflows/**' - '.gitea/workflows/**'
checkstyle: checkstyle:
runs-on: ubuntu-latest
name: "Checkstyle Main" name: "Checkstyle Main"
needs: changed_files needs: changed_files
if: ${{ needs.changed_files.outputs.backend == 'true' || needs.changed_files.outputs.workflow == 'true' }} if: ${{ needs.changed_files.outputs.backend == 'true' || needs.changed_files.outputs.workflow == 'true' }}
@ -74,6 +75,7 @@ jobs:
run: gradle --stop run: gradle --stop
eslint: eslint:
runs-on: ubuntu-latest
name: eslint name: eslint
needs: changed_files needs: changed_files
if: ${{ needs.changed_files.outputs.frontend == 'true' || needs.changed_files.outputs.workflow == 'true' }} if: ${{ needs.changed_files.outputs.frontend == 'true' || needs.changed_files.outputs.workflow == 'true' }}
@ -102,6 +104,7 @@ jobs:
bun run lint bun run lint
prettier: prettier:
runs-on: ubuntu-latest
name: prettier name: prettier
needs: changed_files needs: changed_files
if: ${{ needs.changed_files.outputs.frontend == 'true' || needs.changed_files.outputs.workflow == 'true' }} if: ${{ needs.changed_files.outputs.frontend == 'true' || needs.changed_files.outputs.workflow == 'true' }}
@ -130,6 +133,7 @@ jobs:
bun run format:check bun run format:check
test-build: test-build:
runs-on: ubuntu-latest
name: test-build name: test-build
needs: changed_files needs: changed_files
if: ${{ needs.changed_files.outputs.frontend == 'true' || needs.changed_files.outputs.workflow == 'true' }} if: ${{ needs.changed_files.outputs.frontend == 'true' || needs.changed_files.outputs.workflow == 'true' }}

View file

@ -4,10 +4,10 @@ on:
branches: branches:
- "main" - "main"
paths: paths:
- 'backend/**' - "backend/**"
- 'frontend/**' - "frontend/**"
- '.gitea/workflows/release.yml' - ".gitea/workflows/release.yml"
- 'release.config.cjs' - "release.config.cjs"
env: env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
@ -17,6 +17,7 @@ permissions:
jobs: jobs:
release: release:
runs-on: ubuntu-latest
name: Release name: Release
permissions: permissions:
contents: write contents: write
@ -29,3 +30,65 @@ jobs:
with: with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
build-backend-image:
needs: release
runs-on: ubuntu-latest
name: Build Backend Image
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Ensure full history is available
- name: Extract tag
run: |
TAG=$(git describe --tags --abbrev=0)
echo "TAG=$TAG" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
- name: Login
uses: docker/login-action@v3
with:
registry: git.kjan.de
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: backend/
file: backend/.docker/Dockerfile
push: true
tags: |
git.kjan.de/szut/casino-backend:latest
git.kjan.de/szut/casino-backend:${{ env.TAG }}
build-frontend-image:
needs: release
runs-on: ubuntu-latest
name: Build Frontend Image
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Ensure full history is available
- name: Extract tag
run: |
TAG=$(git describe --tags --abbrev=0)
echo "TAG=$TAG" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
- name: Login
uses: docker/login-action@v3
with:
registry: git.kjan.de
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: frontend/
file: frontend/.docker/Dockerfile
push: true
tags: |
git.kjan.de/szut/casino-frontend:latest
git.kjan.de/szut/casino-frontend:${{ env.TAG }}

View file

@ -1,17 +1,17 @@
FROM gradle:jdk22 AS builder FROM gradle:jdk23 AS builder
WORKDIR /app WORKDIR /app
COPY gradlew build.gradle.kts settings.gradle.kts ./ COPY gradlew build.gradle.kts settings.gradle.kts config ./
COPY gradle gradle COPY gradle gradle
RUN chmod +x gradlew RUN chmod +x gradlew
RUN ./gradlew dependencies RUN gradle dependencies
COPY src src COPY src src
RUN ./gradlew clean build -x test RUN gradle clean build -x test -x checkstyleMain -x checkstyleTest -x compileTestJava
FROM openjdk:22-jdk-slim FROM openjdk:23-jdk-slim AS runtime
WORKDIR /app WORKDIR /app
COPY --from=builder /app/build/libs/*.jar app.jar COPY --from=builder /app/build/libs/*.jar app.jar

View file

@ -1,20 +0,0 @@
POST http://localhost:8080/blackjack/start
Authorization: Bearer {{token}}
Content-Type: application/json
{
"betAmount": 1.01
}
###
POST http://localhost:8080/blackjack/54/hit
Authorization: Bearer {{token}}
###
POST http://localhost:8080/blackjack/202/stand
Authorization: Bearer {{token}}
###
GET http://localhost:8080/blackjack/202
Authorization: Bearer {{token}}

View file

@ -1,6 +0,0 @@
POST http://localhost:9090/realms/LF12/protocol/openid-connect/token
Content-Type: application/x-www-form-urlencoded
grant_type=password&client_id=lf12&username=lf12_test_user&password=secret&scope=openid
> {% client.global.set("token", response.body.access_token); %}

View file

@ -1 +0,0 @@
GET localhost:8080/health

View file

@ -1,9 +0,0 @@
GET http://localhost:8080/lootboxes
Authorization: Bearer {{token}}
Content-Type: application/json
###
POST http://localhost:8080/lootboxes/2
Authorization: Bearer {{token}}
Content-Type: application/json

View file

@ -1,27 +0,0 @@
### Get User by ID
GET http://localhost:8080/user/52cc0208-a3bd-4367-94c5-0404b016a003
Authorization: Bearer {{token}}
### Get current user with token
GET http://localhost:8080/user
Authorization: Bearer {{token}}
### Create User
POST http://localhost:8080/user
Content-Type: application/json
Authorization: Bearer {{token}}
{
"authentikId": "52cc0208-a3bd-4367-94c5-0404b016a003",
"username": "john.doe"
}
### Deposit
POST http://localhost:8080/deposit/checkout
Content-Type: application/json
Origin: http://localhost:8080
Authorization: Bearer {{token}}
{
"amount": 60.12
}

View file

@ -1 +0,0 @@
POST localhost:8080/webhook

View file

@ -1,20 +1,10 @@
package de.szut.casino; package de.szut.casino;
import de.szut.casino.lootboxes.LootBoxEntity;
import de.szut.casino.lootboxes.LootBoxRepository;
import de.szut.casino.lootboxes.RewardEntity;
import de.szut.casino.lootboxes.RewardRepository;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@SpringBootApplication @SpringBootApplication
public class CasinoApplication { public class CasinoApplication {
@ -26,65 +16,4 @@ public class CasinoApplication {
public static RestTemplate restTemplate() { public static RestTemplate restTemplate() {
return new RestTemplate(); return new RestTemplate();
} }
@Bean
public CommandLineRunner initData(LootBoxRepository lootBoxRepository, RewardRepository rewardRepository) {
return _ -> {
if (lootBoxRepository.count() == 0) {
LootBoxEntity basicLootBox = new LootBoxEntity();
basicLootBox.setName("Basic LootBox");
basicLootBox.setPrice(new BigDecimal("2"));
basicLootBox.setRewards(new ArrayList<>()); // Initialize the list
LootBoxEntity premiumLootBox = new LootBoxEntity();
premiumLootBox.setName("Premium LootBox");
premiumLootBox.setPrice(new BigDecimal("5"));
premiumLootBox.setRewards(new ArrayList<>()); // Initialize the list
lootBoxRepository.saveAll(Arrays.asList(basicLootBox, premiumLootBox));
RewardEntity commonReward = new RewardEntity();
commonReward.setValue(new BigDecimal("0.50"));
commonReward.setProbability(new BigDecimal("0.7"));
RewardEntity rareReward = new RewardEntity();
rareReward.setValue(new BigDecimal("2.00"));
rareReward.setProbability(new BigDecimal("0.25"));
RewardEntity epicReward = new RewardEntity();
epicReward.setValue(new BigDecimal("5.00"));
epicReward.setProbability(new BigDecimal("0.5"));
RewardEntity premiumCommon = new RewardEntity();
premiumCommon.setValue(new BigDecimal("2.00"));
premiumCommon.setProbability(new BigDecimal("0.6"));
RewardEntity premiumRare = new RewardEntity();
premiumRare.setValue(new BigDecimal("5.00"));
premiumRare.setProbability(new BigDecimal("0.3"));
RewardEntity legendaryReward = new RewardEntity();
legendaryReward.setValue(new BigDecimal("15.00"));
legendaryReward.setProbability(new BigDecimal("0.10"));
rewardRepository.saveAll(Arrays.asList(
commonReward, rareReward, epicReward,
premiumCommon, premiumRare, legendaryReward
));
basicLootBox.getRewards().add(commonReward);
basicLootBox.getRewards().add(premiumRare);
premiumLootBox.getRewards().add(premiumCommon);
premiumLootBox.getRewards().add(premiumRare);
premiumLootBox.getRewards().add(legendaryReward);
lootBoxRepository.saveAll(Arrays.asList(basicLootBox, premiumLootBox));
System.out.println("Initial LootBoxes and rewards created successfully");
} else {
System.out.println("LootBoxes already exist, skipping initialization");
}
};
}
} }

View file

@ -1,6 +1,8 @@
package de.szut.casino.blackjack; package de.szut.casino.blackjack;
import de.szut.casino.blackjack.dto.CreateBlackJackGameDto; import de.szut.casino.exceptionHandling.exceptions.UserNotFoundException;
import de.szut.casino.shared.dto.BetDto;
import de.szut.casino.shared.service.BalanceService;
import de.szut.casino.user.UserEntity; import de.szut.casino.user.UserEntity;
import de.szut.casino.user.UserService; import de.szut.casino.user.UserService;
import jakarta.validation.Valid; import jakarta.validation.Valid;
@ -9,19 +11,18 @@ import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.HashMap; import java.util.*;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
@Slf4j @Slf4j
@RestController @RestController
public class BlackJackGameController { public class BlackJackGameController {
private final BalanceService balanceService;
private final UserService userService; private final UserService userService;
private final BlackJackService blackJackService; private final BlackJackService blackJackService;
public BlackJackGameController(UserService userService, BlackJackService blackJackService) { public BlackJackGameController(BalanceService balanceService, UserService userService, BlackJackService blackJackService) {
this.balanceService = balanceService;
this.blackJackService = blackJackService; this.blackJackService = blackJackService;
this.userService = userService; this.userService = userService;
} }
@ -31,7 +32,7 @@ public class BlackJackGameController {
Optional<UserEntity> optionalUser = userService.getCurrentUser(token); Optional<UserEntity> optionalUser = userService.getCurrentUser(token);
if (optionalUser.isEmpty()) { if (optionalUser.isEmpty()) {
return ResponseEntity.notFound().build(); throw new UserNotFoundException();
} }
UserEntity user = optionalUser.get(); UserEntity user = optionalUser.get();
@ -48,7 +49,7 @@ public class BlackJackGameController {
Optional<UserEntity> optionalUser = userService.getCurrentUser(token); Optional<UserEntity> optionalUser = userService.getCurrentUser(token);
if (optionalUser.isEmpty()) { if (optionalUser.isEmpty()) {
return ResponseEntity.notFound().build(); throw new UserNotFoundException();
} }
UserEntity user = optionalUser.get(); UserEntity user = optionalUser.get();
@ -65,7 +66,7 @@ public class BlackJackGameController {
Optional<UserEntity> optionalUser = userService.getCurrentUser(token); Optional<UserEntity> optionalUser = userService.getCurrentUser(token);
if (optionalUser.isEmpty()) { if (optionalUser.isEmpty()) {
return ResponseEntity.notFound().build(); throw new UserNotFoundException();
} }
UserEntity user = optionalUser.get(); UserEntity user = optionalUser.get();
@ -82,7 +83,7 @@ public class BlackJackGameController {
Optional<UserEntity> optionalUser = userService.getCurrentUser(token); Optional<UserEntity> optionalUser = userService.getCurrentUser(token);
if (optionalUser.isEmpty()) { if (optionalUser.isEmpty()) {
return ResponseEntity.notFound().build(); throw new UserNotFoundException();
} }
UserEntity user = optionalUser.get(); UserEntity user = optionalUser.get();
@ -99,7 +100,7 @@ public class BlackJackGameController {
Optional<UserEntity> optionalUser = userService.getCurrentUser(token); Optional<UserEntity> optionalUser = userService.getCurrentUser(token);
if (optionalUser.isEmpty()) { if (optionalUser.isEmpty()) {
return ResponseEntity.notFound().build(); throw new UserNotFoundException();
} }
UserEntity user = optionalUser.get(); UserEntity user = optionalUser.get();
@ -112,29 +113,19 @@ public class BlackJackGameController {
} }
@PostMapping("/blackjack/start") @PostMapping("/blackjack/start")
public ResponseEntity<Object> createBlackJackGame(@RequestBody @Valid CreateBlackJackGameDto createBlackJackGameDto, @RequestHeader("Authorization") String token) { public ResponseEntity<Object> createBlackJackGame(@RequestBody @Valid BetDto betDto, @RequestHeader("Authorization") String token) {
Optional<UserEntity> optionalUser = userService.getCurrentUser(token); Optional<UserEntity> optionalUser = userService.getCurrentUser(token);
if (optionalUser.isEmpty()) { if (optionalUser.isEmpty()) {
return ResponseEntity.notFound().build(); throw new UserNotFoundException();
} }
UserEntity user = optionalUser.get(); UserEntity user = optionalUser.get();
BigDecimal balance = user.getBalance();
BigDecimal betAmount = createBlackJackGameDto.getBetAmount();
if (betAmount.compareTo(BigDecimal.ZERO) <= 0) { if (!this.balanceService.hasFunds(user, betDto)) {
Map<String, String> errorResponse = new HashMap<>(); return ResponseEntity.badRequest().body(Collections.singletonMap("error", "Insufficient funds"));
errorResponse.put("error", "Invalid bet amount");
return ResponseEntity.badRequest().body(errorResponse);
} }
if (betAmount.compareTo(balance) > 0) { return ResponseEntity.ok(blackJackService.createBlackJackGame(user, betDto.getBetAmount()));
Map<String, String> errorResponse = new HashMap<>();
errorResponse.put("error", "Insufficient funds");
return ResponseEntity.badRequest().body(errorResponse);
}
return ResponseEntity.ok(blackJackService.createBlackJackGame(user, betAmount));
} }
} }

View file

@ -1,12 +1,8 @@
package de.szut.casino.blackjack; package de.szut.casino.blackjack;
import de.szut.casino.user.UserEntity;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Optional;
@Service @Service
public interface BlackJackGameRepository extends JpaRepository<BlackJackGameEntity, Long> { public interface BlackJackGameRepository extends JpaRepository<BlackJackGameEntity, Long> {
} }

View file

@ -7,7 +7,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List; import java.util.List;
import java.util.Optional;
import java.util.Random; import java.util.Random;
@Service @Service

View file

@ -1,16 +0,0 @@
package de.szut.casino.blackjack.dto;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.math.BigDecimal;
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class CreateBlackJackGameDto {
private BigDecimal betAmount;
}

View file

@ -8,7 +8,6 @@ import de.szut.casino.deposit.dto.AmountDto;
import de.szut.casino.deposit.dto.SessionIdDto; import de.szut.casino.deposit.dto.SessionIdDto;
import de.szut.casino.user.UserEntity; import de.szut.casino.user.UserEntity;
import de.szut.casino.user.UserRepository; import de.szut.casino.user.UserRepository;
import de.szut.casino.user.UserService;
import de.szut.casino.user.dto.KeycloakUserDto; import de.szut.casino.user.dto.KeycloakUserDto;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -16,7 +15,10 @@ import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod; import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import java.util.Optional; import java.util.Optional;

View file

@ -5,7 +5,7 @@ import jakarta.persistence.*;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import java.math.BigDecimal; import java.util.Date;
@Setter @Setter
@Getter @Getter
@ -26,4 +26,7 @@ public class TransactionEntity {
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
private TransactionStatus status = TransactionStatus.PROCESSING; private TransactionStatus status = TransactionStatus.PROCESSING;
@Column(name = "created_at")
private Date createdAt = new Date();
} }

View file

@ -5,10 +5,20 @@ import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional; import java.util.Optional;
@Service @Service
public interface TransactionRepository extends JpaRepository<TransactionEntity, Long> { public interface TransactionRepository extends JpaRepository<TransactionEntity, Long> {
@Query("SELECT t FROM TransactionEntity t WHERE t.sessionId = ?1") @Query("SELECT t FROM TransactionEntity t WHERE t.sessionId = ?1")
Optional<TransactionEntity> findOneBySessionID(String sessionId); Optional<TransactionEntity> findOneBySessionID(String sessionId);
@Query("SELECT t FROM TransactionEntity t WHERE t.user = ?1")
List<TransactionEntity> findAllByUserId(UserEntity id);
@Query("SELECT t FROM TransactionEntity t WHERE t.user = ?1 ORDER BY t.createdAt DESC LIMIT ?2 OFFSET ?3")
List<TransactionEntity> findByUserIdWithLimit(UserEntity userEntity, Integer limit, Integer offset);
@Query("SELECT COUNT(t) > ?2 + ?3 FROM TransactionEntity t WHERE t.user = ?1")
Boolean hasMore(UserEntity userEntity, Integer limit, Integer offset);
} }

View file

@ -7,7 +7,7 @@ import de.szut.casino.user.UserEntity;
import de.szut.casino.user.UserRepository; import de.szut.casino.user.UserRepository;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Objects; import java.math.BigDecimal;
import java.util.Optional; import java.util.Optional;
@Service @Service
@ -55,7 +55,7 @@ public class TransactionService {
UserEntity user = transaction.getUser(); UserEntity user = transaction.getUser();
Long amountTotal = checkoutSession.getAmountTotal(); Long amountTotal = checkoutSession.getAmountTotal();
if (amountTotal != null) { if (amountTotal != null) {
user.addBalance(amountTotal); user.addBalance(BigDecimal.valueOf(amountTotal).movePointLeft(2));
} }
userRepository.save(user); userRepository.save(user);

View file

@ -1,26 +1,21 @@
package de.szut.casino.deposit; package de.szut.casino.deposit;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.stripe.Stripe; import com.stripe.Stripe;
import com.stripe.exception.SignatureVerificationException;
import com.stripe.exception.StripeException; import com.stripe.exception.StripeException;
import com.stripe.model.*; import com.stripe.model.Event;
import com.stripe.model.checkout.Session; import com.stripe.model.checkout.Session;
import com.stripe.net.Webhook; import com.stripe.net.Webhook;
import com.stripe.param.checkout.SessionRetrieveParams;
import de.szut.casino.user.UserEntity;
import de.szut.casino.user.UserRepository;
import jakarta.annotation.PostConstruct; import jakarta.annotation.PostConstruct;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.util.Objects; import java.util.Objects;
import java.util.Optional;
@RestController @RestController
public class WebhookController { public class WebhookController {
@ -46,23 +41,10 @@ public class WebhookController {
public ResponseEntity<String> webhook(@RequestBody String payload, @RequestHeader("Stripe-Signature") String sigHeader) throws StripeException { public ResponseEntity<String> webhook(@RequestBody String payload, @RequestHeader("Stripe-Signature") String sigHeader) throws StripeException {
Event event = Webhook.constructEvent(payload, sigHeader, webhookSecret); Event event = Webhook.constructEvent(payload, sigHeader, webhookSecret);
System.out.println(event.getType()); if (Objects.equals(event.getType(), "checkout.session.completed") || Objects.equals(event.getType(), "checkout.session.async_payment_succeeded")) {
Session session = (Session) event.getData().getObject();
switch (event.getType()) { this.transactionService.fulfillCheckout(session.getId());
case "checkout.session.completed":
case "checkout.session.async_payment_succeeded":
EventDataObjectDeserializer dataObjectDeserializer = event.getDataObjectDeserializer();
if (dataObjectDeserializer.getObject().isPresent()) {
Session session = (Session) dataObjectDeserializer.getObject().get();
this.transactionService.fulfillCheckout(session.getId());
} else {
logger.error("Failed to deserialize webhook event data");
}
break;
default:
// No action needed for other event types
break;
} }
return ResponseEntity.ok().body(null); return ResponseEntity.ok().body(null);

View file

@ -1,8 +1,6 @@
package de.szut.casino.exceptionHandling; package de.szut.casino.exceptionHandling;
import io.swagger.v3.oas.annotations.media.Content; import de.szut.casino.exceptionHandling.exceptions.UserNotFoundException;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ControllerAdvice;
@ -12,17 +10,11 @@ import org.springframework.web.context.request.WebRequest;
import java.util.Date; import java.util.Date;
@ControllerAdvice @ControllerAdvice
@ApiResponses(value = {
@ApiResponse(responseCode = "500", description = "invalid JSON posted",
content = @Content)
})
public class GlobalExceptionHandler { public class GlobalExceptionHandler {
@ExceptionHandler(ResourceNotFoundException.class) @ExceptionHandler(UserNotFoundException.class)
public ResponseEntity<?> handleHelloEntityNotFoundException(ResourceNotFoundException ex, WebRequest request) { public ResponseEntity<?> handleUserNotFoundException(UserNotFoundException ex, WebRequest request) {
ErrorDetails errorDetails = new ErrorDetails(new Date(), ex.getMessage(), request.getDescription(false)); ErrorDetails errorDetails = new ErrorDetails(new Date(), ex.getMessage(), request.getDescription(false));
return new ResponseEntity<>(errorDetails, HttpStatus.NOT_FOUND); return new ResponseEntity<>(errorDetails, HttpStatus.NOT_FOUND);
} }
} }

View file

@ -1,11 +0,0 @@
package de.szut.casino.exceptionHandling;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(value = HttpStatus.NOT_FOUND)
public class ResourceNotFoundException extends RuntimeException {
public ResourceNotFoundException(String message) {
super(message);
}
}

View file

@ -0,0 +1,11 @@
package de.szut.casino.exceptionHandling.exceptions;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(value = HttpStatus.NOT_FOUND)
public class UserNotFoundException extends RuntimeException {
public UserNotFoundException() {
super("user not found");
}
}

View file

@ -0,0 +1,30 @@
package de.szut.casino.lootboxes;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class CreateLootBoxDto {
@NotEmpty(message = "Loot box name cannot be empty")
@Size(min = 3, max = 50, message = "Loot box name must be between 3 and 50 characters")
private String name;
@NotNull(message = "Price cannot be null")
@DecimalMin(value = "0.01", message = "Price must be greater than 0")
private BigDecimal price;
private List<CreateRewardDto> rewards = new ArrayList<>();
}

View file

@ -0,0 +1,26 @@
package de.szut.casino.lootboxes;
import jakarta.validation.constraints.DecimalMax;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.math.BigDecimal;
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class CreateRewardDto {
@NotNull(message = "Reward value cannot be null")
@DecimalMin(value = "0.00", message = "Reward value must be positive")
private BigDecimal value;
@NotNull(message = "Probability cannot be null")
@DecimalMin(value = "0.0", message = "Probability must be at least 0.0")
@DecimalMax(value = "1.0", message = "Probability must be at most 1.0")
private BigDecimal probability;
}

View file

@ -1,15 +1,14 @@
package de.szut.casino.lootboxes; package de.szut.casino.lootboxes;
import de.szut.casino.exceptionHandling.exceptions.UserNotFoundException;
import de.szut.casino.user.UserEntity; import de.szut.casino.user.UserEntity;
import de.szut.casino.user.UserRepository; import de.szut.casino.user.UserRepository;
import de.szut.casino.user.UserService; import de.szut.casino.user.UserService;
import jakarta.validation.Valid;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.HashMap; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@RestController @RestController
public class LootBoxController { public class LootBoxController {
@ -39,7 +38,7 @@ public class LootBoxController {
Optional<UserEntity> optionalUser = userService.getCurrentUser(token); Optional<UserEntity> optionalUser = userService.getCurrentUser(token);
if (optionalUser.isEmpty()) { if (optionalUser.isEmpty()) {
return ResponseEntity.notFound().build(); throw new UserNotFoundException();
} }
UserEntity user = optionalUser.get(); UserEntity user = optionalUser.get();
@ -55,4 +54,37 @@ public class LootBoxController {
return ResponseEntity.ok(reward); return ResponseEntity.ok(reward);
} }
@PostMapping("/lootboxes")
public ResponseEntity<Object> createLootbox(@RequestBody @Valid CreateLootBoxDto createLootBoxDto) {
List<RewardEntity> rewardEntities = new ArrayList<>();
for (CreateRewardDto createRewardDto : createLootBoxDto.getRewards()) {
rewardEntities.add(new RewardEntity(createRewardDto.getValue(), createRewardDto.getProbability()));
}
LootBoxEntity lootBoxEntity = new LootBoxEntity(
createLootBoxDto.getName(),
createLootBoxDto.getPrice(),
rewardEntities
);
this.lootBoxRepository.save(lootBoxEntity);
return ResponseEntity.ok(lootBoxEntity);
}
@DeleteMapping("/lootboxes/{id}")
public ResponseEntity<Object> deleteLootbox(@PathVariable Long id) {
Optional<LootBoxEntity> optionalLootBox = lootBoxRepository.findById(id);
if (optionalLootBox.isEmpty()) {
return ResponseEntity.notFound().build();
}
LootBoxEntity lootBox = optionalLootBox.get();
lootBoxRepository.delete(lootBox);
return ResponseEntity.ok(Collections.singletonMap("message", "successfully deleted lootbox"));
}
} }

View file

@ -1,15 +1,9 @@
package de.szut.casino.lootboxes; package de.szut.casino.lootboxes;
import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonManagedReference;
import de.szut.casino.blackjack.CardEntity;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;
import org.hibernate.annotations.SQLRestriction;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
@ -18,9 +12,15 @@ import java.util.List;
@Entity @Entity
@Getter @Getter
@Setter @Setter
@AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class LootBoxEntity { public class LootBoxEntity {
public LootBoxEntity(String name, BigDecimal price, List<RewardEntity> rewards) {
this.name = name;
this.price = price;
this.rewards = rewards;
}
@Id @Id
@GeneratedValue @GeneratedValue
private Long id; private Long id;

View file

@ -1,9 +1,9 @@
package de.szut.casino.lootboxes; package de.szut.casino.lootboxes;
import com.fasterxml.jackson.annotation.JsonBackReference; import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonManagedReference;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -13,7 +13,14 @@ import java.util.List;
@Getter @Getter
@Setter @Setter
@Entity @Entity
@NoArgsConstructor
public class RewardEntity { public class RewardEntity {
public RewardEntity(BigDecimal value, BigDecimal probability) {
this.value = value;
this.probability = probability;
}
@Id @Id
@GeneratedValue @GeneratedValue
private Long id; private Long id;

View file

@ -23,7 +23,7 @@ public class SecurityConfig {
.cors(Customizer.withDefaults()) .cors(Customizer.withDefaults())
.csrf(csrf -> csrf.disable()) .csrf(csrf -> csrf.disable())
.authorizeHttpRequests(auth -> { .authorizeHttpRequests(auth -> {
auth.requestMatchers("/swagger/**", "/swagger-ui/**", "/health").permitAll() auth.requestMatchers("/webhook", "/swagger/**", "/swagger-ui/**", "/health").permitAll()
.anyRequest().authenticated(); .anyRequest().authenticated();
}) })
.oauth2ResourceServer(oauth2 -> oauth2.jwt(jwt -> .oauth2ResourceServer(oauth2 -> oauth2.jwt(jwt ->

View file

@ -0,0 +1,18 @@
package de.szut.casino.shared.dto;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import java.math.BigDecimal;
@Getter
@Setter
@AllArgsConstructor
public class BetDto {
@NotNull(message = "Bet amount cannot be null")
@Positive(message = "Bet amount must be positive")
private BigDecimal betAmount;
}

View file

@ -0,0 +1,36 @@
package de.szut.casino.shared.service;
import de.szut.casino.shared.dto.BetDto;
import de.szut.casino.user.UserEntity;
import de.szut.casino.user.UserRepository;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
@Service
public class BalanceService {
private UserRepository userRepository;
public BalanceService(UserRepository userRepository) {
this.userRepository = userRepository;
}
public boolean hasFunds(UserEntity user, BetDto betDto) {
BigDecimal balance = user.getBalance();
BigDecimal betAmount = betDto.getBetAmount();
return betAmount.compareTo(balance) <= 0;
}
public void addFunds(UserEntity user, BigDecimal amount) {
user.addBalance(amount);
this.userRepository.save(user);
}
public void subtractFunds(UserEntity user, BigDecimal amount) {
user.subtractBalance(amount);
this.userRepository.save(user);
}
}

View file

@ -0,0 +1,51 @@
package de.szut.casino.slots;
import de.szut.casino.exceptionHandling.exceptions.UserNotFoundException;
import de.szut.casino.shared.dto.BetDto;
import de.szut.casino.shared.service.BalanceService;
import de.szut.casino.user.UserEntity;
import de.szut.casino.user.UserService;
import jakarta.validation.Valid;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RestController;
import java.util.Collections;
import java.util.Optional;
@RestController
public class SlotController {
private final UserService userService;
private final BalanceService balanceService;
private final SlotService slotService;
public SlotController(UserService userService, BalanceService balanceService, SlotService slotService) {
this.userService = userService;
this.balanceService = balanceService;
this.slotService = slotService;
}
@PostMapping("/slots/spin")
public ResponseEntity<Object> spinSlots(@RequestBody @Valid BetDto betDto, @RequestHeader("Authorization") String token) {
Optional<UserEntity> optionalUser = userService.getCurrentUser(token);
if (optionalUser.isEmpty()) {
throw new UserNotFoundException();
}
UserEntity user = optionalUser.get();
if (!this.balanceService.hasFunds(user, betDto)) {
return ResponseEntity.badRequest().body(Collections.singletonMap("error", "Insufficient funds"));
}
SpinResult spinResult = this.slotService.spin(
betDto.getBetAmount(),
user
);
return ResponseEntity.ok(spinResult);
}
}

View file

@ -0,0 +1,139 @@
package de.szut.casino.slots;
import de.szut.casino.shared.service.BalanceService;
import de.szut.casino.user.UserEntity;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;
@Service
public class SlotService {
private final int REEL_LENGTH = 32;
// 98% RTP
private final int SEVEN_COUNT = 1;
private final int BAR_COUNT = 4;
private final int BELL_COUNT = 7;
private final int CHERRY_COUNT = 10;
private final int BLANK_COUNT = 10;
private final Symbol SEVEN = new Symbol("seven", new BigDecimal("1000"));
private final Symbol BAR = new Symbol("bar", new BigDecimal("85"));
private final Symbol BELL = new Symbol("bell", new BigDecimal("40"));
private final Symbol CHERRY = new Symbol("cherry", new BigDecimal("10"));
private final Symbol BLANK = new Symbol("blank", new BigDecimal("0"));
private final List<Symbol> firstReel;
private final List<Symbol> secondReel;
private final List<Symbol> thirdReel;
private final Random random;
private final BalanceService balanceService;
public SlotService(BalanceService balanceService) {
this.random = new Random();
this.balanceService = balanceService;
List<Symbol> reelStrip = createReelStrip();
this.firstReel = shuffleReel(reelStrip);
this.secondReel = shuffleReel(reelStrip);
this.thirdReel = shuffleReel(reelStrip);
}
public SpinResult spin(BigDecimal betAmount, UserEntity user) {
int index1 = this.random.nextInt(REEL_LENGTH);
int index2 = this.random.nextInt(REEL_LENGTH);
int index3 = this.random.nextInt(REEL_LENGTH);
Symbol symbol1 = getSymbolAt(this.firstReel, index1);
Symbol symbol2 = getSymbolAt(this.secondReel, index2);
Symbol symbol3 = getSymbolAt(this.thirdReel, index3);
boolean isWin = symbol1.equals(symbol2) && symbol1.equals(symbol3);
SpinResult spinResult = processResult(betAmount, user, isWin, symbol1);
buildResultMatrix(spinResult, index1, index2, index3);
return spinResult;
}
private SpinResult processResult(BigDecimal betAmount, UserEntity user, boolean isWin, Symbol winSymbol) {
BigDecimal resultAmount;
String status;
if (isWin) {
resultAmount = betAmount.multiply(winSymbol.getPayoutMultiplier());
status = "win";
this.balanceService.addFunds(user, resultAmount);
} else {
resultAmount = betAmount;
status = "lose";
this.balanceService.subtractFunds(user, betAmount);
}
SpinResult spinResult = new SpinResult();
spinResult.setStatus(status);
spinResult.setAmount(resultAmount);
spinResult.setWin(isWin);
return spinResult;
}
private void buildResultMatrix(SpinResult spinResult, int index1, int index2, int index3) {
List<List<Symbol>> resultMatrix = new ArrayList<>(3);
for (int i = 0; i < 3; i++) {
resultMatrix.add(new ArrayList<>(3));
}
resultMatrix.getFirst().add(getSymbolAt(this.firstReel, index1 - 1));
resultMatrix.getFirst().add(getSymbolAt(this.secondReel, index2 - 1));
resultMatrix.getFirst().add(getSymbolAt(this.thirdReel, index3 - 1));
resultMatrix.get(1).add(getSymbolAt(this.firstReel, index1));
resultMatrix.get(1).add(getSymbolAt(this.secondReel, index2));
resultMatrix.get(1).add(getSymbolAt(this.thirdReel, index3));
resultMatrix.getLast().add(getSymbolAt(this.firstReel, index1 + 1));
resultMatrix.getLast().add(getSymbolAt(this.secondReel, index2 + 1));
resultMatrix.getLast().add(getSymbolAt(this.thirdReel, index3 + 1));
spinResult.setResultMatrix(resultMatrix);
}
private List<Symbol> shuffleReel(List<Symbol> reelStrip) {
Collections.shuffle(reelStrip, this.random);
return reelStrip;
}
private List<Symbol> createReelStrip() {
List<Symbol> reelStrip = new ArrayList<>(REEL_LENGTH);
addSymbolsToStrip(reelStrip, CHERRY, CHERRY_COUNT);
addSymbolsToStrip(reelStrip, BELL, BELL_COUNT);
addSymbolsToStrip(reelStrip, BAR, BAR_COUNT);
addSymbolsToStrip(reelStrip, SEVEN, SEVEN_COUNT);
addSymbolsToStrip(reelStrip, BLANK, BLANK_COUNT);
return reelStrip;
}
private void addSymbolsToStrip(List<Symbol> strip, Symbol symbol, int count) {
for (int i = 0; i < count; i++) {
strip.add(symbol);
}
}
private Symbol getSymbolAt(List<Symbol> reel, int index) {
int effectiveIndex = index % REEL_LENGTH;
if (effectiveIndex < 0) {
effectiveIndex += REEL_LENGTH;
}
return reel.get(effectiveIndex);
}
}

View file

@ -0,0 +1,24 @@
package de.szut.casino.slots;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.math.BigDecimal;
import java.util.List;
@Getter
@Setter
@NoArgsConstructor
public class SpinResult {
public SpinResult(String status, BigDecimal amount, boolean isWin) {
this.status = status;
this.amount = amount;
this.isWin = isWin;
}
private String status;
private BigDecimal amount;
private boolean isWin;
private List<List<Symbol>> resultMatrix;
}

View file

@ -0,0 +1,35 @@
package de.szut.casino.slots;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.math.BigDecimal;
@Getter
@Setter
@AllArgsConstructor
public class Symbol {
private String name;
private BigDecimal payoutMultiplier;
@Override
public boolean equals(Object other) {
if (!(other instanceof Symbol that)) {
return false;
}
return this.name.equals(that.name) && this.payoutMultiplier.equals(that.payoutMultiplier);
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 37 + this.name.hashCode();
hashCode = hashCode * 37 + this.payoutMultiplier.hashCode();
return hashCode;
}
}

View file

@ -1,19 +1,15 @@
package de.szut.casino.user; package de.szut.casino.user;
import org.springframework.beans.factory.annotation.Autowired; import de.szut.casino.exceptionHandling.exceptions.UserNotFoundException;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RestController;
import de.szut.casino.user.dto.CreateUserDto; import de.szut.casino.user.dto.CreateUserDto;
import de.szut.casino.user.dto.GetUserDto; import de.szut.casino.user.dto.GetUserDto;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@Slf4j @Slf4j
@RestController @RestController
@ -39,7 +35,7 @@ public class UserController {
GetUserDto userData = userService.getCurrentUserAsDto(token); GetUserDto userData = userService.getCurrentUserAsDto(token);
if (userData == null) { if (userData == null) {
return ResponseEntity.notFound().build(); throw new UserNotFoundException();
} }
return ResponseEntity.ok(userData); return ResponseEntity.ok(userData);

View file

@ -31,13 +31,31 @@ public class UserEntity {
this.balance = balance; this.balance = balance;
} }
public void addBalance(long amountInCents) { public void addBalance(BigDecimal amountToAdd) {
BigDecimal amountToAdd = BigDecimal.valueOf(amountInCents).movePointLeft(2); if (amountToAdd == null || amountToAdd.compareTo(BigDecimal.ZERO) <= 0) {
return;
}
if (this.balance == null) { if (this.balance == null) {
this.balance = amountToAdd; this.balance = BigDecimal.ZERO;
} else {
this.balance = this.balance.add(amountToAdd);
} }
this.balance = this.balance.add(amountToAdd);
}
public void subtractBalance(BigDecimal amountToSubtract) {
if (amountToSubtract == null || amountToSubtract.compareTo(BigDecimal.ZERO) <= 0) {
throw new IllegalArgumentException("Amount to subtract must be positive.");
}
if (this.balance == null) {
this.balance = BigDecimal.ZERO;
}
if (this.balance.compareTo(amountToSubtract) < 0) {
throw new IllegalStateException("Insufficient funds to subtract " + amountToSubtract);
}
this.balance = this.balance.subtract(amountToSubtract);
} }
} }

View file

@ -0,0 +1,45 @@
package de.szut.casino.user.transaction;
import de.szut.casino.deposit.TransactionEntity;
import de.szut.casino.deposit.TransactionRepository;
import de.szut.casino.user.UserEntity;
import de.szut.casino.user.UserService;
import de.szut.casino.user.transaction.dto.GetTransactionDto;
import de.szut.casino.user.transaction.dto.UserTransactionsDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;
@Service
public class GetTransactionService {
@Autowired
private UserService userService;
@Autowired
private TransactionRepository transactionRepository;
public UserTransactionsDto getUserTransactionsDto(String authToken, Integer limit, Integer offset) {
Optional<UserEntity> user = this.userService.getCurrentUser(authToken);
if (user.isPresent()) {
List<TransactionEntity> transactionEntities = this.transactionRepository.findByUserIdWithLimit(user.get(), limit, offset);
Boolean hasMore = this.transactionRepository.hasMore(user.get(), limit, offset);
return new UserTransactionsDto(mapTransactionsToDtos(transactionEntities), hasMore);
}
return new UserTransactionsDto(List.of(), false);
}
public List<GetTransactionDto> mapTransactionsToDtos(List<TransactionEntity> transactions) {
return transactions.stream()
.map(transaction -> new GetTransactionDto(
transaction.getAmount(),
transaction.getStatus(),
transaction.getCreatedAt())
).toList();
}
}

View file

@ -0,0 +1,28 @@
package de.szut.casino.user.transaction;
import de.szut.casino.user.transaction.dto.UserTransactionsDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class TransactionController {
@Autowired
private GetTransactionService transactionService;
@GetMapping("/user/transactions")
public ResponseEntity<UserTransactionsDto> getUserTransactions(
@RequestHeader("Authorization") String authToken,
@RequestParam(value = "limit", required = false) Integer limit,
@RequestParam(value = "offset", required = false) Integer offset
) {
UserTransactionsDto transactionEntities = this.transactionService.getUserTransactionsDto(authToken, limit, offset);
return ResponseEntity.ok(transactionEntities);
}
}

View file

@ -0,0 +1,16 @@
package de.szut.casino.user.transaction.dto;
import de.szut.casino.deposit.TransactionStatus;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import java.util.Date;
@AllArgsConstructor
@NoArgsConstructor
public class GetTransactionDto {
public double amount = 0;
public TransactionStatus status = TransactionStatus.PROCESSING;
public Date createdAt = new Date();
}

View file

@ -0,0 +1,12 @@
package de.szut.casino.user.transaction.dto;
import lombok.AllArgsConstructor;
import java.util.List;
@AllArgsConstructor
public class UserTransactionsDto {
public List<GetTransactionDto> transactions;
public Boolean hasMore;
}

View file

@ -1,17 +1,17 @@
spring.datasource.url=jdbc:postgresql://${DB_HOST:localhost}:5432/postgresdb spring.datasource.url=jdbc:postgresql://${DB_HOST:localhost}:${DB_PORT:5432}/${DB_NAME:postgresdb}
spring.datasource.username=postgres_user spring.datasource.username=${DB_USER:postgres_user}
spring.datasource.password=postgres_pass spring.datasource.password=${DB_PASS:postgres_pass}
server.port=8080 server.port=${HTTP_PORT:8080}
spring.jpa.hibernate.ddl-auto=update spring.jpa.hibernate.ddl-auto=update
stripe.secret.key=${STRIPE_SECRET_KEY:sk_test_51QrePYIvCfqz7ANgqam8rEwWcMeKiLOof3j6SCMgu2sl4sESP45DJxca16mWcYo1sQaiBv32CMR6Z4AAAGQPCJo300ubuZKO8I} stripe.secret.key=${STRIPE_SECRET_KEY:sk_test_51QrePYIvCfqz7ANgqam8rEwWcMeKiLOof3j6SCMgu2sl4sESP45DJxca16mWcYo1sQaiBv32CMR6Z4AAAGQPCJo300ubuZKO8I}
stripe.webhook.secret=whsec_746b6a488665f6057118bdb4a2b32f4916f16c277109eeaed5e8f8e8b81b8c15 stripe.webhook.secret=${STRIPE_WEBHOOK_SECRET:whsec_746b6a488665f6057118bdb4a2b32f4916f16c277109eeaed5e8f8e8b81b8c15}
app.frontend-host=http://localhost:4200 app.frontend-host=${FE_URL:http://localhost:4200}
spring.application.name=lf12_starter spring.application.name=casino
#client registration configuration #client registration configuration
spring.security.oauth2.client.registration.authentik.client-id=MDqjm1kcWKuZfqHJXjxwAV20i44aT7m4VhhTL3Nm spring.security.oauth2.client.registration.authentik.client-id=${AUTH_CLIENT_ID:MDqjm1kcWKuZfqHJXjxwAV20i44aT7m4VhhTL3Nm}
spring.security.oauth2.client.registration.authentik.client-secret=GY2F8te6iAVYt1TNAUVLzWZEXb6JoMNp6chbjqaXNq4gS5xTDL54HqBiAlV1jFKarN28LQ7FUsYX4SbwjfEhZhgeoKuBnZKjR9eiu7RawnGgxIK9ffvUfMkjRxnmiGI5 spring.security.oauth2.client.registration.authentik.client-secret=${AUTH_CLIENT_SECRET:GY2F8te6iAVYt1TNAUVLzWZEXb6JoMNp6chbjqaXNq4gS5xTDL54HqBiAlV1jFKarN28LQ7FUsYX4SbwjfEhZhgeoKuBnZKjR9eiu7RawnGgxIK9ffvUfMkjRxnmiGI5}
spring.security.oauth2.client.registration.authentik.provider=authentik spring.security.oauth2.client.registration.authentik.provider=authentik
spring.security.oauth2.client.registration.authentik.client-name=Authentik spring.security.oauth2.client.registration.authentik.client-name=Authentik
spring.security.oauth2.client.registration.authentik.scope=openid,email,profile spring.security.oauth2.client.registration.authentik.scope=openid,email,profile
@ -20,16 +20,16 @@ spring.security.oauth2.client.registration.authentik.authorization-grant-type=au
spring.security.oauth2.client.registration.authentik.redirect-uri={baseUrl}/login/oauth2/code/{registrationId} spring.security.oauth2.client.registration.authentik.redirect-uri={baseUrl}/login/oauth2/code/{registrationId}
# Provider settings # Provider settings
spring.security.oauth2.client.provider.authentik.issuer-uri=https://oauth.simonis.lol/application/o/casino-dev/ spring.security.oauth2.client.provider.authentik.issuer-uri=${AUTH_PROVIDER_ISSUER:https://oauth.simonis.lol/application/o/casino-dev/}
spring.security.oauth2.client.provider.authentik.authorization-uri=https://oauth.simonis.lol/application/o/authorize/ spring.security.oauth2.client.provider.authentik.authorization-uri=${AUTH_PROVIDER_AUTHORIZE_URI:https://oauth.simonis.lol/application/o/authorize/}
spring.security.oauth2.client.provider.authentik.token-uri=https://oauth.simonis.lol/application/o/token/ spring.security.oauth2.client.provider.authentik.token-uri=${AUTH_PROVIDER_TOKEN_URI:https://oauth.simonis.lol/application/o/token/}
spring.security.oauth2.client.provider.authentik.user-info-uri=https://oauth.simonis.lol/application/o/userinfo/ spring.security.oauth2.client.provider.authentik.user-info-uri=${AUTH_PROVIDER_USERINFO_URI:https://oauth.simonis.lol/application/o/userinfo/}
spring.security.oauth2.client.provider.authentik.jwk-set-uri=https://oauth.simonis.lol/application/o/casino-dev/jwks/ spring.security.oauth2.client.provider.authentik.jwk-set-uri=${AUTH_PROVIDER_JWKS_URI:https://oauth.simonis.lol/application/o/casino-dev/jwks/}
spring.security.oauth2.client.provider.authentik.user-name-attribute=preferred_username spring.security.oauth2.client.provider.authentik.user-name-attribute=${AUTH_PROVIDER_NAME_ATTR:preferred_username}
# Resource server config # Resource server config
spring.security.oauth2.resourceserver.jwt.issuer-uri=https://oauth.simonis.lol/application/o/casino-dev/ spring.security.oauth2.resourceserver.jwt.issuer-uri=${AUTH_JWT_ISSUER_URI:https://oauth.simonis.lol/application/o/casino-dev}/
spring.security.oauth2.resourceserver.jwt.jwk-set-uri=https://oauth.simonis.lol/application/o/casino-dev/jwks/ spring.security.oauth2.resourceserver.jwt.jwk-set-uri=${AUTH_JWT_JWT_SET_URI:https://oauth.simonis.lol/application/o/casino-dev/jwks/}
#OIDC provider configuration: #OIDC provider configuration:
logging.level.org.springframework.security=DEBUG logging.level.org.springframework.security=DEBUG

View file

@ -0,0 +1,23 @@
FROM oven/bun:debian AS build
WORKDIR /app
RUN apt-get update -y && apt-get install nodejs -y
ENV NODE_ENV=production
COPY package.json bun.lock ./
RUN bun install --frozen-lockfile
COPY . .
RUN bun run build
FROM nginx:alpine AS production
RUN rm /etc/nginx/conf.d/default.conf
COPY .docker/casino.conf /etc/nginx/templates/nginx.conf.template
COPY .docker/entrypoint.sh /docker-entrypoint.d/40-custom-config-env.sh
COPY --from=build /app/dist/casino /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

View file

@ -0,0 +1,19 @@
server {
listen 80;
root /usr/share/nginx/html/browser;
index index.html;
location / {
try_files $uri $uri/ /index.html;
add_header Cache-Control "no-cache";
}
location /backend/ {
proxy_pass http://${BACKEND_HOST}:${BACKEND_PORT}/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}

7
frontend/.docker/entrypoint.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
# Default values if not provided
: ${BACKEND_HOST:=localhost}
: ${BACKEND_PORT:=8080}
envsubst '$BACKEND_HOST $BACKEND_PORT' < /etc/nginx/templates/nginx.conf.template > /etc/nginx/conf.d/default.conf
exec nginx -g 'daemon off;'

15
frontend/.dockerignore Normal file
View file

@ -0,0 +1,15 @@
node_modules
dist
.angular
.git
.github
.vscode
.idea
*.md
!README.md
.DS_Store
.env*
npm-debug.log*
yarn-debug.log*
yarn-error.log*
bun-debug.log*

View file

@ -13,7 +13,7 @@
"build": { "build": {
"builder": "@angular-devkit/build-angular:application", "builder": "@angular-devkit/build-angular:application",
"options": { "options": {
"outputPath": "dist/lf10-starter2024", "outputPath": "dist/casino",
"index": "src/index.html", "index": "src/index.html",
"browser": "src/main.ts", "browser": "src/main.ts",
"tsConfig": "tsconfig.app.json", "tsConfig": "tsconfig.app.json",

View file

@ -37,7 +37,7 @@
"@angular/compiler-cli": "^19.0.0", "@angular/compiler-cli": "^19.0.0",
"@types/jasmine": "~5.1.0", "@types/jasmine": "~5.1.0",
"angular-eslint": "19.3.0", "angular-eslint": "19.3.0",
"eslint": "^9.20.0", "eslint": "^9.25.1",
"jasmine-core": "~5.6.0", "jasmine-core": "~5.6.0",
"karma": "~6.4.0", "karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0", "karma-chrome-launcher": "~3.2.0",
@ -46,7 +46,7 @@
"karma-jasmine-html-reporter": "~2.1.0", "karma-jasmine-html-reporter": "~2.1.0",
"prettier": "^3.4.2", "prettier": "^3.4.2",
"typescript": "~5.8.0", "typescript": "~5.8.0",
"typescript-eslint": "8.29.0", "typescript-eslint": "8.31.0",
}, },
}, },
}, },
@ -341,15 +341,15 @@
"@eslint-community/regexpp": ["@eslint-community/regexpp@4.12.1", "", {}, "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ=="], "@eslint-community/regexpp": ["@eslint-community/regexpp@4.12.1", "", {}, "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ=="],
"@eslint/config-array": ["@eslint/config-array@0.19.2", "", { "dependencies": { "@eslint/object-schema": "^2.1.6", "debug": "^4.3.1", "minimatch": "^3.1.2" } }, "sha512-GNKqxfHG2ySmJOBSHg7LxeUx4xpuCoFjacmlCoYWEbaPXLwvfIjixRI12xCQZeULksQb23uiA8F40w5TojpV7w=="], "@eslint/config-array": ["@eslint/config-array@0.20.0", "", { "dependencies": { "@eslint/object-schema": "^2.1.6", "debug": "^4.3.1", "minimatch": "^3.1.2" } }, "sha512-fxlS1kkIjx8+vy2SjuCB94q3htSNrufYTXubwiBFeaQHbH6Ipi43gFJq2zCMt6PHhImH3Xmr0NksKDvchWlpQQ=="],
"@eslint/config-helpers": ["@eslint/config-helpers@0.2.1", "", {}, "sha512-RI17tsD2frtDu/3dmI7QRrD4bedNKPM08ziRYaC5AhkGrzIAJelm9kJU1TznK+apx6V+cqRz8tfpEeG3oIyjxw=="], "@eslint/config-helpers": ["@eslint/config-helpers@0.2.1", "", {}, "sha512-RI17tsD2frtDu/3dmI7QRrD4bedNKPM08ziRYaC5AhkGrzIAJelm9kJU1TznK+apx6V+cqRz8tfpEeG3oIyjxw=="],
"@eslint/core": ["@eslint/core@0.12.0", "", { "dependencies": { "@types/json-schema": "^7.0.15" } }, "sha512-cmrR6pytBuSMTaBweKoGMwu3EiHiEC+DoyupPmlZ0HxBJBtIxwe+j/E4XPIKNx+Q74c8lXKPwYawBf5glsTkHg=="], "@eslint/core": ["@eslint/core@0.13.0", "", { "dependencies": { "@types/json-schema": "^7.0.15" } }, "sha512-yfkgDw1KR66rkT5A8ci4irzDysN7FRpq3ttJolR88OqQikAWqwA8j5VZyas+vjyBNFIJ7MfybJ9plMILI2UrCw=="],
"@eslint/eslintrc": ["@eslint/eslintrc@3.3.1", "", { "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", "espree": "^10.0.1", "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" } }, "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ=="], "@eslint/eslintrc": ["@eslint/eslintrc@3.3.1", "", { "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", "espree": "^10.0.1", "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" } }, "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ=="],
"@eslint/js": ["@eslint/js@9.23.0", "", {}, "sha512-35MJ8vCPU0ZMxo7zfev2pypqTwWTofFZO6m4KAtdoFhRpLJUpHTZZ+KB3C7Hb1d7bULYwO4lJXGCi5Se+8OMbw=="], "@eslint/js": ["@eslint/js@9.25.1", "", {}, "sha512-dEIwmjntEx8u3Uvv+kr3PDeeArL8Hw07H9kyYxCjnM9pBjfEhk6uLXSchxxzgiwtRhhzVzqmUSDFBOi1TuZ7qg=="],
"@eslint/object-schema": ["@eslint/object-schema@2.1.6", "", {}, "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA=="], "@eslint/object-schema": ["@eslint/object-schema@2.1.6", "", {}, "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA=="],
@ -683,13 +683,13 @@
"@types/ws": ["@types/ws@8.18.1", "", { "dependencies": { "@types/node": "*" } }, "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg=="], "@types/ws": ["@types/ws@8.18.1", "", { "dependencies": { "@types/node": "*" } }, "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg=="],
"@typescript-eslint/eslint-plugin": ["@typescript-eslint/eslint-plugin@8.29.0", "", { "dependencies": { "@eslint-community/regexpp": "^4.10.0", "@typescript-eslint/scope-manager": "8.29.0", "@typescript-eslint/type-utils": "8.29.0", "@typescript-eslint/utils": "8.29.0", "@typescript-eslint/visitor-keys": "8.29.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", "ts-api-utils": "^2.0.1" }, "peerDependencies": { "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" } }, "sha512-PAIpk/U7NIS6H7TEtN45SPGLQaHNgB7wSjsQV/8+KYokAb2T/gloOA/Bee2yd4/yKVhPKe5LlaUGhAZk5zmSaQ=="], "@typescript-eslint/eslint-plugin": ["@typescript-eslint/eslint-plugin@8.31.0", "", { "dependencies": { "@eslint-community/regexpp": "^4.10.0", "@typescript-eslint/scope-manager": "8.31.0", "@typescript-eslint/type-utils": "8.31.0", "@typescript-eslint/utils": "8.31.0", "@typescript-eslint/visitor-keys": "8.31.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", "ts-api-utils": "^2.0.1" }, "peerDependencies": { "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" } }, "sha512-evaQJZ/J/S4wisevDvC1KFZkPzRetH8kYZbkgcTRyql3mcKsf+ZFDV1BVWUGTCAW5pQHoqn5gK5b8kn7ou9aFQ=="],
"@typescript-eslint/parser": ["@typescript-eslint/parser@8.29.0", "", { "dependencies": { "@typescript-eslint/scope-manager": "8.29.0", "@typescript-eslint/types": "8.29.0", "@typescript-eslint/typescript-estree": "8.29.0", "@typescript-eslint/visitor-keys": "8.29.0", "debug": "^4.3.4" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" } }, "sha512-8C0+jlNJOwQso2GapCVWWfW/rzaq7Lbme+vGUFKE31djwNncIpgXD7Cd4weEsDdkoZDjH0lwwr3QDQFuyrMg9g=="], "@typescript-eslint/parser": ["@typescript-eslint/parser@8.31.0", "", { "dependencies": { "@typescript-eslint/scope-manager": "8.31.0", "@typescript-eslint/types": "8.31.0", "@typescript-eslint/typescript-estree": "8.31.0", "@typescript-eslint/visitor-keys": "8.31.0", "debug": "^4.3.4" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" } }, "sha512-67kYYShjBR0jNI5vsf/c3WG4u+zDnCTHTPqVMQguffaWWFs7artgwKmfwdifl+r6XyM5LYLas/dInj2T0SgJyw=="],
"@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.29.0", "", { "dependencies": { "@typescript-eslint/types": "8.29.0", "@typescript-eslint/visitor-keys": "8.29.0" } }, "sha512-aO1PVsq7Gm+tcghabUpzEnVSFMCU4/nYIgC2GOatJcllvWfnhrgW0ZEbnTxm36QsikmCN1K/6ZgM7fok2I7xNw=="], "@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.29.0", "", { "dependencies": { "@typescript-eslint/types": "8.29.0", "@typescript-eslint/visitor-keys": "8.29.0" } }, "sha512-aO1PVsq7Gm+tcghabUpzEnVSFMCU4/nYIgC2GOatJcllvWfnhrgW0ZEbnTxm36QsikmCN1K/6ZgM7fok2I7xNw=="],
"@typescript-eslint/type-utils": ["@typescript-eslint/type-utils@8.29.0", "", { "dependencies": { "@typescript-eslint/typescript-estree": "8.29.0", "@typescript-eslint/utils": "8.29.0", "debug": "^4.3.4", "ts-api-utils": "^2.0.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" } }, "sha512-ahaWQ42JAOx+NKEf5++WC/ua17q5l+j1GFrbbpVKzFL/tKVc0aYY8rVSYUpUvt2hUP1YBr7mwXzx+E/DfUWI9Q=="], "@typescript-eslint/type-utils": ["@typescript-eslint/type-utils@8.31.0", "", { "dependencies": { "@typescript-eslint/typescript-estree": "8.31.0", "@typescript-eslint/utils": "8.31.0", "debug": "^4.3.4", "ts-api-utils": "^2.0.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" } }, "sha512-DJ1N1GdjI7IS7uRlzJuEDCgDQix3ZVYVtgeWEyhyn4iaoitpMBX6Ndd488mXSx0xah/cONAkEaYyylDyAeHMHg=="],
"@typescript-eslint/types": ["@typescript-eslint/types@8.29.0", "", {}, "sha512-wcJL/+cOXV+RE3gjCyl/V2G877+2faqvlgtso/ZRbTCnZazh0gXhe+7gbAnfubzN2bNsBtZjDvlh7ero8uIbzg=="], "@typescript-eslint/types": ["@typescript-eslint/types@8.29.0", "", {}, "sha512-wcJL/+cOXV+RE3gjCyl/V2G877+2faqvlgtso/ZRbTCnZazh0gXhe+7gbAnfubzN2bNsBtZjDvlh7ero8uIbzg=="],
@ -697,7 +697,7 @@
"@typescript-eslint/utils": ["@typescript-eslint/utils@8.29.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@typescript-eslint/scope-manager": "8.29.0", "@typescript-eslint/types": "8.29.0", "@typescript-eslint/typescript-estree": "8.29.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" } }, "sha512-gX/A0Mz9Bskm8avSWFcK0gP7cZpbY4AIo6B0hWYFCaIsz750oaiWR4Jr2CI+PQhfW1CpcQr9OlfPS+kMFegjXA=="], "@typescript-eslint/utils": ["@typescript-eslint/utils@8.29.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@typescript-eslint/scope-manager": "8.29.0", "@typescript-eslint/types": "8.29.0", "@typescript-eslint/typescript-estree": "8.29.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" } }, "sha512-gX/A0Mz9Bskm8avSWFcK0gP7cZpbY4AIo6B0hWYFCaIsz750oaiWR4Jr2CI+PQhfW1CpcQr9OlfPS+kMFegjXA=="],
"@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@8.29.0", "", { "dependencies": { "@typescript-eslint/types": "8.29.0", "eslint-visitor-keys": "^4.2.0" } }, "sha512-Sne/pVz8ryR03NFK21VpN88dZ2FdQXOlq3VIklbrTYEt8yXtRFr9tvUhqvCeKjqYk5FSim37sHbooT6vzBTZcg=="], "@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@8.31.0", "", { "dependencies": { "@typescript-eslint/types": "8.31.0", "eslint-visitor-keys": "^4.2.0" } }, "sha512-QcGHmlRHWOl93o64ZUMNewCdwKGU6WItOU52H0djgNmn1EOrhVudrDzXz4OycCRSCPwFCDrE2iIt5vmuUdHxuQ=="],
"@vitejs/plugin-basic-ssl": ["@vitejs/plugin-basic-ssl@1.2.0", "", { "peerDependencies": { "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0" } }, "sha512-mkQnxTkcldAzIsomk1UuLfAu9n+kpQ3JbHcpCp7d2Oo6ITtji8pHS3QToOWjhPFvNQSnhlkAjmGbhv2QvwO/7Q=="], "@vitejs/plugin-basic-ssl": ["@vitejs/plugin-basic-ssl@1.2.0", "", { "peerDependencies": { "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0" } }, "sha512-mkQnxTkcldAzIsomk1UuLfAu9n+kpQ3JbHcpCp7d2Oo6ITtji8pHS3QToOWjhPFvNQSnhlkAjmGbhv2QvwO/7Q=="],
@ -1005,7 +1005,7 @@
"escape-string-regexp": ["escape-string-regexp@4.0.0", "", {}, "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA=="], "escape-string-regexp": ["escape-string-regexp@4.0.0", "", {}, "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA=="],
"eslint": ["eslint@9.23.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", "@eslint/config-array": "^0.19.2", "@eslint/config-helpers": "^0.2.0", "@eslint/core": "^0.12.0", "@eslint/eslintrc": "^3.3.1", "@eslint/js": "9.23.0", "@eslint/plugin-kit": "^0.2.7", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", "@types/estree": "^1.0.6", "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", "eslint-scope": "^8.3.0", "eslint-visitor-keys": "^4.2.0", "espree": "^10.3.0", "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.3" }, "peerDependencies": { "jiti": "*" }, "optionalPeers": ["jiti"], "bin": { "eslint": "bin/eslint.js" } }, "sha512-jV7AbNoFPAY1EkFYpLq5bslU9NLNO8xnEeQXwErNibVryjk67wHVmddTBilc5srIttJDBrB0eMHKZBFbSIABCw=="], "eslint": ["eslint@9.25.1", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", "@eslint/config-array": "^0.20.0", "@eslint/config-helpers": "^0.2.1", "@eslint/core": "^0.13.0", "@eslint/eslintrc": "^3.3.1", "@eslint/js": "9.25.1", "@eslint/plugin-kit": "^0.2.8", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", "@types/estree": "^1.0.6", "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", "eslint-scope": "^8.3.0", "eslint-visitor-keys": "^4.2.0", "espree": "^10.3.0", "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.3" }, "peerDependencies": { "jiti": "*" }, "optionalPeers": ["jiti"], "bin": { "eslint": "bin/eslint.js" } }, "sha512-E6Mtz9oGQWDCpV12319d59n4tx9zOTXSTmc8BLVxBx+G/0RdM5MvEEJLU9c0+aleoePYYgVTOsRblx433qmhWQ=="],
"eslint-scope": ["eslint-scope@8.3.0", "", { "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" } }, "sha512-pUNxi75F8MJ/GdeKtVLSbYg4ZI34J6C0C7sbL4YOp2exGwen7ZsuBqKzUhXd0qMQ362yET3z+uPwKeg/0C2XCQ=="], "eslint-scope": ["eslint-scope@8.3.0", "", { "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" } }, "sha512-pUNxi75F8MJ/GdeKtVLSbYg4ZI34J6C0C7sbL4YOp2exGwen7ZsuBqKzUhXd0qMQ362yET3z+uPwKeg/0C2XCQ=="],
@ -1779,7 +1779,7 @@
"typescript": ["typescript@5.8.2", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ=="], "typescript": ["typescript@5.8.2", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ=="],
"typescript-eslint": ["typescript-eslint@8.29.0", "", { "dependencies": { "@typescript-eslint/eslint-plugin": "8.29.0", "@typescript-eslint/parser": "8.29.0", "@typescript-eslint/utils": "8.29.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" } }, "sha512-ep9rVd9B4kQsZ7ZnWCVxUE/xDLUUUsRzE0poAeNu+4CkFErLfuvPt/qtm2EpnSyfvsR0S6QzDFSrPCFBwf64fg=="], "typescript-eslint": ["typescript-eslint@8.31.0", "", { "dependencies": { "@typescript-eslint/eslint-plugin": "8.31.0", "@typescript-eslint/parser": "8.31.0", "@typescript-eslint/utils": "8.31.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" } }, "sha512-u+93F0sB0An8WEAPtwxVhFby573E8ckdjwUUQUj9QA4v8JAvgtoDdIyYR3XFwFHq2W1KJ1AurwJCO+w+Y1ixyQ=="],
"ua-parser-js": ["ua-parser-js@0.7.40", "", { "bin": { "ua-parser-js": "script/cli.js" } }, "sha512-us1E3K+3jJppDBa3Tl0L3MOJiGhe1C6P0+nIvQAFYbxlMAx0h81eOwLmU57xgqToduDDPx3y5QsdjPfDu+FgOQ=="], "ua-parser-js": ["ua-parser-js@0.7.40", "", { "bin": { "ua-parser-js": "script/cli.js" } }, "sha512-us1E3K+3jJppDBa3Tl0L3MOJiGhe1C6P0+nIvQAFYbxlMAx0h81eOwLmU57xgqToduDDPx3y5QsdjPfDu+FgOQ=="],
@ -1917,8 +1917,6 @@
"@eslint/eslintrc/ajv": ["ajv@6.12.6", "", { "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } }, "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g=="], "@eslint/eslintrc/ajv": ["ajv@6.12.6", "", { "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } }, "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g=="],
"@eslint/plugin-kit/@eslint/core": ["@eslint/core@0.13.0", "", { "dependencies": { "@types/json-schema": "^7.0.15" } }, "sha512-yfkgDw1KR66rkT5A8ci4irzDysN7FRpq3ttJolR88OqQikAWqwA8j5VZyas+vjyBNFIJ7MfybJ9plMILI2UrCw=="],
"@humanfs/node/@humanwhocodes/retry": ["@humanwhocodes/retry@0.3.1", "", {}, "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA=="], "@humanfs/node/@humanwhocodes/retry": ["@humanwhocodes/retry@0.3.1", "", {}, "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA=="],
"@inquirer/checkbox/@inquirer/type": ["@inquirer/type@3.0.5", "", { "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-ZJpeIYYueOz/i/ONzrfof8g89kNdO2hjGuvULROo3O8rlB2CRtSseE5KeirnyE4t/thAn/EwvS/vuQeJCn+NZg=="], "@inquirer/checkbox/@inquirer/type": ["@inquirer/type@3.0.5", "", { "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-ZJpeIYYueOz/i/ONzrfof8g89kNdO2hjGuvULROo3O8rlB2CRtSseE5KeirnyE4t/thAn/EwvS/vuQeJCn+NZg=="],
@ -1975,8 +1973,28 @@
"@types/express/@types/express-serve-static-core": ["@types/express-serve-static-core@4.19.6", "", { "dependencies": { "@types/node": "*", "@types/qs": "*", "@types/range-parser": "*", "@types/send": "*" } }, "sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A=="], "@types/express/@types/express-serve-static-core": ["@types/express-serve-static-core@4.19.6", "", { "dependencies": { "@types/node": "*", "@types/qs": "*", "@types/range-parser": "*", "@types/send": "*" } }, "sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A=="],
"@typescript-eslint/eslint-plugin/@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.31.0", "", { "dependencies": { "@typescript-eslint/types": "8.31.0", "@typescript-eslint/visitor-keys": "8.31.0" } }, "sha512-knO8UyF78Nt8O/B64i7TlGXod69ko7z6vJD9uhSlm0qkAbGeRUSudcm0+K/4CrRjrpiHfBCjMWlc08Vav1xwcw=="],
"@typescript-eslint/eslint-plugin/@typescript-eslint/utils": ["@typescript-eslint/utils@8.31.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@typescript-eslint/scope-manager": "8.31.0", "@typescript-eslint/types": "8.31.0", "@typescript-eslint/typescript-estree": "8.31.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" } }, "sha512-qi6uPLt9cjTFxAb1zGNgTob4x9ur7xC6mHQJ8GwEzGMGE9tYniublmJaowOJ9V2jUzxrltTPfdG2nKlWsq0+Ww=="],
"@typescript-eslint/parser/@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.31.0", "", { "dependencies": { "@typescript-eslint/types": "8.31.0", "@typescript-eslint/visitor-keys": "8.31.0" } }, "sha512-knO8UyF78Nt8O/B64i7TlGXod69ko7z6vJD9uhSlm0qkAbGeRUSudcm0+K/4CrRjrpiHfBCjMWlc08Vav1xwcw=="],
"@typescript-eslint/parser/@typescript-eslint/types": ["@typescript-eslint/types@8.31.0", "", {}, "sha512-Ch8oSjVyYyJxPQk8pMiP2FFGYatqXQfQIaMp+TpuuLlDachRWpUAeEu1u9B/v/8LToehUIWyiKcA/w5hUFRKuQ=="],
"@typescript-eslint/parser/@typescript-eslint/typescript-estree": ["@typescript-eslint/typescript-estree@8.31.0", "", { "dependencies": { "@typescript-eslint/types": "8.31.0", "@typescript-eslint/visitor-keys": "8.31.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", "ts-api-utils": "^2.0.1" }, "peerDependencies": { "typescript": ">=4.8.4 <5.9.0" } }, "sha512-xLmgn4Yl46xi6aDSZ9KkyfhhtnYI15/CvHbpOy/eR5NWhK/BK8wc709KKwhAR0m4ZKRP7h07bm4BWUYOCuRpQQ=="],
"@typescript-eslint/scope-manager/@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@8.29.0", "", { "dependencies": { "@typescript-eslint/types": "8.29.0", "eslint-visitor-keys": "^4.2.0" } }, "sha512-Sne/pVz8ryR03NFK21VpN88dZ2FdQXOlq3VIklbrTYEt8yXtRFr9tvUhqvCeKjqYk5FSim37sHbooT6vzBTZcg=="],
"@typescript-eslint/type-utils/@typescript-eslint/typescript-estree": ["@typescript-eslint/typescript-estree@8.31.0", "", { "dependencies": { "@typescript-eslint/types": "8.31.0", "@typescript-eslint/visitor-keys": "8.31.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", "ts-api-utils": "^2.0.1" }, "peerDependencies": { "typescript": ">=4.8.4 <5.9.0" } }, "sha512-xLmgn4Yl46xi6aDSZ9KkyfhhtnYI15/CvHbpOy/eR5NWhK/BK8wc709KKwhAR0m4ZKRP7h07bm4BWUYOCuRpQQ=="],
"@typescript-eslint/type-utils/@typescript-eslint/utils": ["@typescript-eslint/utils@8.31.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@typescript-eslint/scope-manager": "8.31.0", "@typescript-eslint/types": "8.31.0", "@typescript-eslint/typescript-estree": "8.31.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" } }, "sha512-qi6uPLt9cjTFxAb1zGNgTob4x9ur7xC6mHQJ8GwEzGMGE9tYniublmJaowOJ9V2jUzxrltTPfdG2nKlWsq0+Ww=="],
"@typescript-eslint/typescript-estree/@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@8.29.0", "", { "dependencies": { "@typescript-eslint/types": "8.29.0", "eslint-visitor-keys": "^4.2.0" } }, "sha512-Sne/pVz8ryR03NFK21VpN88dZ2FdQXOlq3VIklbrTYEt8yXtRFr9tvUhqvCeKjqYk5FSim37sHbooT6vzBTZcg=="],
"@typescript-eslint/typescript-estree/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="], "@typescript-eslint/typescript-estree/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="],
"@typescript-eslint/visitor-keys/@typescript-eslint/types": ["@typescript-eslint/types@8.31.0", "", {}, "sha512-Ch8oSjVyYyJxPQk8pMiP2FFGYatqXQfQIaMp+TpuuLlDachRWpUAeEu1u9B/v/8LToehUIWyiKcA/w5hUFRKuQ=="],
"accepts/negotiator": ["negotiator@0.6.3", "", {}, "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg=="], "accepts/negotiator": ["negotiator@0.6.3", "", {}, "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg=="],
"adjust-sourcemap-loader/loader-utils": ["loader-utils@2.0.4", "", { "dependencies": { "big.js": "^5.2.2", "emojis-list": "^3.0.0", "json5": "^2.1.2" } }, "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw=="], "adjust-sourcemap-loader/loader-utils": ["loader-utils@2.0.4", "", { "dependencies": { "big.js": "^5.2.2", "emojis-list": "^3.0.0", "json5": "^2.1.2" } }, "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw=="],
@ -2139,6 +2157,8 @@
"tar/mkdirp": ["mkdirp@1.0.4", "", { "bin": { "mkdirp": "bin/cmd.js" } }, "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw=="], "tar/mkdirp": ["mkdirp@1.0.4", "", { "bin": { "mkdirp": "bin/cmd.js" } }, "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw=="],
"typescript-eslint/@typescript-eslint/utils": ["@typescript-eslint/utils@8.31.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@typescript-eslint/scope-manager": "8.31.0", "@typescript-eslint/types": "8.31.0", "@typescript-eslint/typescript-estree": "8.31.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" } }, "sha512-qi6uPLt9cjTFxAb1zGNgTob4x9ur7xC6mHQJ8GwEzGMGE9tYniublmJaowOJ9V2jUzxrltTPfdG2nKlWsq0+Ww=="],
"webpack/eslint-scope": ["eslint-scope@5.1.1", "", { "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^4.1.1" } }, "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw=="], "webpack/eslint-scope": ["eslint-scope@5.1.1", "", { "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^4.1.1" } }, "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw=="],
"webpack-dev-server/chokidar": ["chokidar@3.6.0", "", { "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.6.0" }, "optionalDependencies": { "fsevents": "~2.3.2" } }, "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw=="], "webpack-dev-server/chokidar": ["chokidar@3.6.0", "", { "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.6.0" }, "optionalDependencies": { "fsevents": "~2.3.2" } }, "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw=="],
@ -2173,6 +2193,22 @@
"@tufjs/models/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="], "@tufjs/models/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="],
"@typescript-eslint/eslint-plugin/@typescript-eslint/scope-manager/@typescript-eslint/types": ["@typescript-eslint/types@8.31.0", "", {}, "sha512-Ch8oSjVyYyJxPQk8pMiP2FFGYatqXQfQIaMp+TpuuLlDachRWpUAeEu1u9B/v/8LToehUIWyiKcA/w5hUFRKuQ=="],
"@typescript-eslint/eslint-plugin/@typescript-eslint/utils/@typescript-eslint/types": ["@typescript-eslint/types@8.31.0", "", {}, "sha512-Ch8oSjVyYyJxPQk8pMiP2FFGYatqXQfQIaMp+TpuuLlDachRWpUAeEu1u9B/v/8LToehUIWyiKcA/w5hUFRKuQ=="],
"@typescript-eslint/eslint-plugin/@typescript-eslint/utils/@typescript-eslint/typescript-estree": ["@typescript-eslint/typescript-estree@8.31.0", "", { "dependencies": { "@typescript-eslint/types": "8.31.0", "@typescript-eslint/visitor-keys": "8.31.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", "ts-api-utils": "^2.0.1" }, "peerDependencies": { "typescript": ">=4.8.4 <5.9.0" } }, "sha512-xLmgn4Yl46xi6aDSZ9KkyfhhtnYI15/CvHbpOy/eR5NWhK/BK8wc709KKwhAR0m4ZKRP7h07bm4BWUYOCuRpQQ=="],
"@typescript-eslint/parser/@typescript-eslint/typescript-estree/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="],
"@typescript-eslint/type-utils/@typescript-eslint/typescript-estree/@typescript-eslint/types": ["@typescript-eslint/types@8.31.0", "", {}, "sha512-Ch8oSjVyYyJxPQk8pMiP2FFGYatqXQfQIaMp+TpuuLlDachRWpUAeEu1u9B/v/8LToehUIWyiKcA/w5hUFRKuQ=="],
"@typescript-eslint/type-utils/@typescript-eslint/typescript-estree/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="],
"@typescript-eslint/type-utils/@typescript-eslint/utils/@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.31.0", "", { "dependencies": { "@typescript-eslint/types": "8.31.0", "@typescript-eslint/visitor-keys": "8.31.0" } }, "sha512-knO8UyF78Nt8O/B64i7TlGXod69ko7z6vJD9uhSlm0qkAbGeRUSudcm0+K/4CrRjrpiHfBCjMWlc08Vav1xwcw=="],
"@typescript-eslint/type-utils/@typescript-eslint/utils/@typescript-eslint/types": ["@typescript-eslint/types@8.31.0", "", {}, "sha512-Ch8oSjVyYyJxPQk8pMiP2FFGYatqXQfQIaMp+TpuuLlDachRWpUAeEu1u9B/v/8LToehUIWyiKcA/w5hUFRKuQ=="],
"@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="], "@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="],
"body-parser/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="], "body-parser/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="],
@ -2251,6 +2287,12 @@
"tar/minizlib/minipass": ["minipass@3.3.6", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw=="], "tar/minizlib/minipass": ["minipass@3.3.6", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw=="],
"typescript-eslint/@typescript-eslint/utils/@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.31.0", "", { "dependencies": { "@typescript-eslint/types": "8.31.0", "@typescript-eslint/visitor-keys": "8.31.0" } }, "sha512-knO8UyF78Nt8O/B64i7TlGXod69ko7z6vJD9uhSlm0qkAbGeRUSudcm0+K/4CrRjrpiHfBCjMWlc08Vav1xwcw=="],
"typescript-eslint/@typescript-eslint/utils/@typescript-eslint/types": ["@typescript-eslint/types@8.31.0", "", {}, "sha512-Ch8oSjVyYyJxPQk8pMiP2FFGYatqXQfQIaMp+TpuuLlDachRWpUAeEu1u9B/v/8LToehUIWyiKcA/w5hUFRKuQ=="],
"typescript-eslint/@typescript-eslint/utils/@typescript-eslint/typescript-estree": ["@typescript-eslint/typescript-estree@8.31.0", "", { "dependencies": { "@typescript-eslint/types": "8.31.0", "@typescript-eslint/visitor-keys": "8.31.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", "ts-api-utils": "^2.0.1" }, "peerDependencies": { "typescript": ">=4.8.4 <5.9.0" } }, "sha512-xLmgn4Yl46xi6aDSZ9KkyfhhtnYI15/CvHbpOy/eR5NWhK/BK8wc709KKwhAR0m4ZKRP7h07bm4BWUYOCuRpQQ=="],
"webpack-dev-server/chokidar/glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="], "webpack-dev-server/chokidar/glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="],
"webpack-dev-server/chokidar/readdirp": ["readdirp@3.6.0", "", { "dependencies": { "picomatch": "^2.2.1" } }, "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA=="], "webpack-dev-server/chokidar/readdirp": ["readdirp@3.6.0", "", { "dependencies": { "picomatch": "^2.2.1" } }, "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA=="],
@ -2263,6 +2305,12 @@
"@npmcli/package-json/glob/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="], "@npmcli/package-json/glob/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="],
"@typescript-eslint/eslint-plugin/@typescript-eslint/utils/@typescript-eslint/typescript-estree/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="],
"@typescript-eslint/parser/@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="],
"@typescript-eslint/type-utils/@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="],
"cacache/glob/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="], "cacache/glob/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="],
"cli-truncate/string-width/strip-ansi/ansi-regex": ["ansi-regex@6.1.0", "", {}, "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA=="], "cli-truncate/string-width/strip-ansi/ansi-regex": ["ansi-regex@6.1.0", "", {}, "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA=="],
@ -2275,10 +2323,16 @@
"pkg-dir/find-up/locate-path/p-locate": ["p-locate@6.0.0", "", { "dependencies": { "p-limit": "^4.0.0" } }, "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw=="], "pkg-dir/find-up/locate-path/p-locate": ["p-locate@6.0.0", "", { "dependencies": { "p-limit": "^4.0.0" } }, "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw=="],
"typescript-eslint/@typescript-eslint/utils/@typescript-eslint/typescript-estree/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="],
"webpack-dev-server/chokidar/readdirp/picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="], "webpack-dev-server/chokidar/readdirp/picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="],
"@typescript-eslint/eslint-plugin/@typescript-eslint/utils/@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="],
"pkg-dir/find-up/locate-path/p-locate/p-limit": ["p-limit@4.0.0", "", { "dependencies": { "yocto-queue": "^1.0.0" } }, "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ=="], "pkg-dir/find-up/locate-path/p-locate/p-limit": ["p-limit@4.0.0", "", { "dependencies": { "yocto-queue": "^1.0.0" } }, "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ=="],
"typescript-eslint/@typescript-eslint/utils/@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="],
"pkg-dir/find-up/locate-path/p-locate/p-limit/yocto-queue": ["yocto-queue@1.2.1", "", {}, "sha512-AyeEbWOu/TAXdxlV9wmGcR0+yh2j3vYPGOECcIj2S7MkrLyC7ne+oye2BKTItt0ii2PHk4cDy+95+LshzbXnGg=="], "pkg-dir/find-up/locate-path/p-locate/p-limit/yocto-queue": ["yocto-queue@1.2.1", "", {}, "sha512-AyeEbWOu/TAXdxlV9wmGcR0+yh2j3vYPGOECcIj2S7MkrLyC7ne+oye2BKTItt0ii2PHk4cDy+95+LshzbXnGg=="],
} }
} }

View file

@ -1,31 +0,0 @@
version: '3'
volumes:
employee_postgres_data:
driver: local
services:
postgres-employee:
container_name: postgres_employee
image: postgres:17.4
volumes:
- employee_postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_DB: employee_db
POSTGRES_USER: employee
POSTGRES_PASSWORD: secret
ports:
- "5432:5432"
employee:
container_name: employee
image: berndheidemann/employee-management-service:1.1.3
# image: berndheidemann/employee-management-service_without_keycloak:1.1
environment:
spring.datasource.url: jdbc:postgresql://postgres-employee:5432/employee_db
spring.datasource.username: employee
spring.datasource.password: secret
ports:
- "8089:8089"
depends_on:
- postgres-employee

View file

@ -46,7 +46,7 @@
"@angular/compiler-cli": "^19.0.0", "@angular/compiler-cli": "^19.0.0",
"@types/jasmine": "~5.1.0", "@types/jasmine": "~5.1.0",
"angular-eslint": "19.3.0", "angular-eslint": "19.3.0",
"eslint": "^9.20.0", "eslint": "^9.25.1",
"jasmine-core": "~5.6.0", "jasmine-core": "~5.6.0",
"karma": "~6.4.0", "karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0", "karma-chrome-launcher": "~3.2.0",
@ -55,6 +55,6 @@
"karma-jasmine-html-reporter": "~2.1.0", "karma-jasmine-html-reporter": "~2.1.0",
"prettier": "^3.4.2", "prettier": "^3.4.2",
"typescript": "~5.8.0", "typescript": "~5.8.0",
"typescript-eslint": "8.29.0" "typescript-eslint": "8.31.0"
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 302 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 79 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 167 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 174 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 186 KiB

After

Width:  |  Height:  |  Size: 108 KiB

Before After
Before After

View file

@ -6,7 +6,7 @@ import { routes } from './app.routes';
import { provideHttpClient, withInterceptors } from '@angular/common/http'; import { provideHttpClient, withInterceptors } from '@angular/common/http';
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async'; import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
import { OAuthStorage, provideOAuthClient } from 'angular-oauth2-oidc'; import { OAuthStorage, provideOAuthClient } from 'angular-oauth2-oidc';
import { httpInterceptor } from './shared/interceptor/http.interceptor'; import { httpInterceptor } from '@shared/interceptor/http.interceptor';
export const appConfig: ApplicationConfig = { export const appConfig: ApplicationConfig = {
providers: [ providers: [

View file

@ -1,18 +1,18 @@
import { import {
AfterViewInit,
ChangeDetectionStrategy, ChangeDetectionStrategy,
ChangeDetectorRef,
Component, Component,
ElementRef, ElementRef,
EventEmitter, EventEmitter,
inject, inject,
Input, Input,
OnChanges,
OnDestroy,
OnInit, OnInit,
Output, Output,
ViewChild,
AfterViewInit,
OnDestroy,
OnChanges,
SimpleChanges, SimpleChanges,
ChangeDetectorRef, ViewChild,
} from '@angular/core'; } from '@angular/core';
import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
import { loadStripe, Stripe } from '@stripe/stripe-js'; import { loadStripe, Stripe } from '@stripe/stripe-js';

View file

@ -1,4 +1,4 @@
import { ChangeDetectionStrategy, Component, inject, signal, OnInit } from '@angular/core'; import { ChangeDetectionStrategy, Component, inject, OnInit, signal } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { PlayingCardComponent } from './components/playing-card/playing-card.component'; import { PlayingCardComponent } from './components/playing-card/playing-card.component';
@ -6,7 +6,7 @@ import { DealerHandComponent } from './components/dealer-hand/dealer-hand.compon
import { PlayerHandComponent } from './components/player-hand/player-hand.component'; import { PlayerHandComponent } from './components/player-hand/player-hand.component';
import { GameControlsComponent } from './components/game-controls/game-controls.component'; import { GameControlsComponent } from './components/game-controls/game-controls.component';
import { GameInfoComponent } from './components/game-info/game-info.component'; import { GameInfoComponent } from './components/game-info/game-info.component';
import { Card, BlackjackGame } from '@blackjack/models/blackjack.model'; import { BlackjackGame, Card } from '@blackjack/models/blackjack.model';
import { BlackjackService } from '@blackjack/services/blackjack.service'; import { BlackjackService } from '@blackjack/services/blackjack.service';
import { HttpErrorResponse } from '@angular/common/http'; import { HttpErrorResponse } from '@angular/common/http';
import { GameResultComponent } from '@blackjack/components/game-result/game-result.component'; import { GameResultComponent } from '@blackjack/components/game-result/game-result.component';

View file

@ -1,12 +1,12 @@
import { import {
AfterViewInit,
ChangeDetectionStrategy, ChangeDetectionStrategy,
Component, Component,
ElementRef,
Input, Input,
OnChanges, OnChanges,
SimpleChanges, SimpleChanges,
ElementRef,
ViewChild, ViewChild,
AfterViewInit,
} from '@angular/core'; } from '@angular/core';
import { CommonModule, CurrencyPipe } from '@angular/common'; import { CommonModule, CurrencyPipe } from '@angular/common';
import { CountUp } from 'countup.js'; import { CountUp } from 'countup.js';

View file

@ -5,8 +5,8 @@ import {
Input, Input,
OnChanges, OnChanges,
Output, Output,
SimpleChanges,
signal, signal,
SimpleChanges,
} from '@angular/core'; } from '@angular/core';
import { CommonModule, CurrencyPipe } from '@angular/common'; import { CommonModule, CurrencyPipe } from '@angular/common';
import { FormGroup, ReactiveFormsModule } from '@angular/forms'; import { FormGroup, ReactiveFormsModule } from '@angular/forms';

View file

@ -1,4 +1,4 @@
import { ChangeDetectionStrategy, Component, Input, Output, EventEmitter } from '@angular/core'; import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
import { CommonModule, CurrencyPipe } from '@angular/common'; import { CommonModule, CurrencyPipe } from '@angular/common';
import { animate, style, transition, trigger } from '@angular/animations'; import { animate, style, transition, trigger } from '@angular/animations';
import { GameState } from '../../enum/gameState'; import { GameState } from '../../enum/gameState';

View file

@ -1,9 +1,9 @@
import { import {
AfterViewInit,
ChangeDetectionStrategy, ChangeDetectionStrategy,
Component, Component,
Input,
AfterViewInit,
ElementRef, ElementRef,
Input,
OnChanges, OnChanges,
SimpleChanges, SimpleChanges,
} from '@angular/core'; } from '@angular/core';

View file

@ -1,6 +1,6 @@
import { Injectable, inject } from '@angular/core'; import { inject, Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { Observable, catchError } from 'rxjs'; import { catchError, Observable } from 'rxjs';
import { BlackjackGame } from '@blackjack/models/blackjack.model'; import { BlackjackGame } from '@blackjack/models/blackjack.model';
@Injectable({ @Injectable({

View file

@ -81,12 +81,16 @@
[isOpen]="isDepositModalOpen" [isOpen]="isDepositModalOpen"
(closeModalEmitter)="closeDepositModal()" (closeModalEmitter)="closeDepositModal()"
></app-deposit> ></app-deposit>
<button class="bg-deep-blue-light hover:bg-deep-blue-contrast w-full py-2 rounded"> <button
class="bg-deep-blue-light hover:bg-deep-blue-contrast w-full py-2 rounded"
(click)="openTransactionModal()"
>
Transaktionen Transaktionen
</button> </button>
<button class="bg-deep-blue-light hover:bg-deep-blue-contrast w-full py-2 rounded"> <app-transaction-history
Kontoeinstellungen [isOpen]="isTransactionModalOpen"
</button> (closeEventEmitter)="closeTransactionModal()"
/>
</div> </div>
</div> </div>
@ -100,11 +104,13 @@
<div class="space-y-3"> <div class="space-y-3">
<div <div
class="flex justify-between items-center" class="flex justify-between items-center"
*ngFor="let transaction of recentTransactions" *ngFor="let transaction of (recentTransactionData | async)?.transactions"
> >
<div> <div>
<p class="text-sm font-medium">{{ transaction.type }}</p> <p class="text-sm font-medium">{{ transaction.status }}</p>
<p class="text-xs text-text-secondary">{{ transaction.date }}</p> <p class="text-xs text-text-secondary">
{{ transaction.createdAt | date: 'd.m.Y H:m' }}
</p>
</div> </div>
<span [class]="transaction.amount > 0 ? 'text-emerald' : 'text-accent-red'"> <span [class]="transaction.amount > 0 ? 'text-emerald' : 'text-accent-red'">
{{ transaction.amount | currency: 'EUR' }} {{ transaction.amount | currency: 'EUR' }}

View file

@ -1,22 +1,36 @@
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; import { ChangeDetectionStrategy, Component, inject, OnInit } from '@angular/core';
import { CurrencyPipe, NgFor } from '@angular/common'; import { AsyncPipe, CurrencyPipe, DatePipe, NgFor } from '@angular/common';
import { DepositComponent } from '../deposit/deposit.component'; import { DepositComponent } from '../deposit/deposit.component';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { ConfirmationComponent } from '@shared/components/confirmation/confirmation.component'; import { ConfirmationComponent } from '@shared/components/confirmation/confirmation.component';
import { Transaction } from 'app/model/Transaction';
import { NavbarComponent } from '@shared/components/navbar/navbar.component'; import { NavbarComponent } from '@shared/components/navbar/navbar.component';
import { Game } from 'app/model/Game'; import { Game } from 'app/model/Game';
import { Observable } from 'rxjs';
import { TransactionService } from '@service/transaction.service';
import format from 'ajv/dist/vocabularies/format';
import { TransactionHistoryComponent } from '../transaction-history/transaction-history.component';
import { TransactionData } from '../../model/TransactionData';
@Component({ @Component({
selector: 'app-homepage', selector: 'app-homepage',
standalone: true, standalone: true,
imports: [NavbarComponent, CurrencyPipe, NgFor, DepositComponent, ConfirmationComponent], imports: [
NavbarComponent,
CurrencyPipe,
NgFor,
DepositComponent,
ConfirmationComponent,
AsyncPipe,
DatePipe,
TransactionHistoryComponent,
],
templateUrl: './home.component.html', templateUrl: './home.component.html',
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
}) })
export default class HomeComponent implements OnInit { export default class HomeComponent implements OnInit {
isDepositModalOpen = false; isDepositModalOpen = false;
isDepositSuccessful = false; isDepositSuccessful = false;
isTransactionModalOpen = false;
constructor( constructor(
public route: ActivatedRoute, public route: ActivatedRoute,
@ -74,11 +88,13 @@ export default class HomeComponent implements OnInit {
allGames: Game[] = [...this.featuredGames]; allGames: Game[] = [...this.featuredGames];
recentTransactions: Transaction[] = []; recentTransactionData: Observable<TransactionData> =
inject(TransactionService).getUsersTransactions(5);
openDepositModal() { openDepositModal() {
this.isDepositModalOpen = true; this.isDepositModalOpen = true;
} }
closeDepositModal() { closeDepositModal() {
this.isDepositModalOpen = false; this.isDepositModalOpen = false;
} }
@ -86,11 +102,22 @@ export default class HomeComponent implements OnInit {
openDepositConfirmationModal() { openDepositConfirmationModal() {
this.isDepositSuccessful = true; this.isDepositSuccessful = true;
} }
openTransactionModal() {
this.isTransactionModalOpen = true;
}
closeDepositConfirmationModal() { closeDepositConfirmationModal() {
this.isDepositSuccessful = false; this.isDepositSuccessful = false;
} }
closeTransactionModal() {
this.isTransactionModalOpen = false;
}
navigateToGame(route: string) { navigateToGame(route: string) {
this.router.navigate([route]); this.router.navigate([route]);
} }
protected readonly format = format;
} }

View file

@ -1,4 +1,4 @@
import { ChangeDetectionStrategy, Component, OnInit, OnDestroy } from '@angular/core'; import { ChangeDetectionStrategy, Component, OnDestroy, OnInit } from '@angular/core';
import { NgFor } from '@angular/common'; import { NgFor } from '@angular/common';
import { NavbarComponent } from '@shared/components/navbar/navbar.component'; import { NavbarComponent } from '@shared/components/navbar/navbar.component';

View file

@ -0,0 +1,8 @@
button[disabled] {
cursor: not-allowed;
background-color: #077b58;
box-shadow: none;
}
button[disabled]:hover {
background-color: #077b58;
}

View file

@ -0,0 +1,60 @@
<div *ngIf="isOpen" [@fadeInOut] class="modal-bg" style="z-index: 1000; position: fixed">
<div class="modal-card" [@cardAnimation]>
<button
type="button"
(click)="closeDialog()"
class="absolute top-2 right-2 text-text-secondary"
>
<svg xmlns="http://www.w3.org/2000/svg" width="2em" height="2em" viewBox="0 0 24 24">
<path
fill="none"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M18 6L6 18M6 6l12 12"
/>
</svg>
</button>
<h2 class="modal-heading mb-0">Transaktionen</h2>
<p class="pb-1 text-text-secondary mb-4">Hier siehst du alle vergangenen Einzahlungen</p>
@for (transaction of (transactionData$ | async)?.transactions; track null) {
<div class="flex justify-between items-center mb-4">
<div>
<p class="text-sm font-medium">{{ transaction.status }}</p>
<p class="text-xs text-text-secondary">{{ transaction.createdAt | date: 'd.m.Y H:m' }}</p>
</div>
<span [class]="transaction.amount > 0 ? 'text-emerald' : 'text-accent-red'">
{{ transaction.amount | currency: 'EUR' }}
</span>
</div>
} @empty {
<div class="flex justify-center items-center w-full h-32">
<div
class="spinner-border animate-spin inline-block w-8 h-8 border-4 rounded-full border-gray-300 border-t-gree-600"
role="status"
>
<span class="sr-only">Loading...</span>
</div>
</div>
}
<div class="inline inline-flex w-full gap-2">
<button
type="button"
(click)="back()"
class="button-primary w-full py-2"
[disabled]="offset <= 0"
>
<
</button>
<button
type="button"
(click)="forward()"
class="button-primary w-full py-2"
[disabled]="!(transactionData$ | async)?.hasMore"
>
>
</button>
</div>
</div>
</div>

View file

@ -0,0 +1,54 @@
import {
ChangeDetectionStrategy,
Component,
EventEmitter,
inject,
Input,
Output,
} from '@angular/core';
import { TransactionService } from '@service/transaction.service';
import { Observable } from 'rxjs';
import { AsyncPipe, CurrencyPipe, DatePipe, NgForOf, NgIf } from '@angular/common';
import { AnimatedNumberComponent } from '@blackjack/components/animated-number/animated-number.component';
import { TransactionData } from '../../model/TransactionData';
const PER_PAGE = 5;
@Component({
standalone: true,
selector: 'app-transaction-history',
imports: [NgForOf, AsyncPipe, CurrencyPipe, DatePipe, AnimatedNumberComponent, NgIf],
templateUrl: './transaction-history.component.html',
styleUrl: './transaction-history.component.css',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class TransactionHistoryComponent {
@Input()
isOpen = false;
@Output()
closeEventEmitter = new EventEmitter<void>();
protected offset = 0;
private transactionService: TransactionService = inject(TransactionService);
transactionData$: Observable<TransactionData> = this.loadTransactions();
closeDialog() {
this.isOpen = false;
this.closeEventEmitter.emit();
}
forward() {
this.offset++;
this.transactionData$ = this.loadTransactions();
}
back() {
this.offset--;
this.transactionData$ = this.loadTransactions();
}
loadTransactions() {
return this.transactionService.getUsersTransactions(PER_PAGE, this.offset * PER_PAGE);
}
}

View file

@ -1,6 +1,5 @@
export interface Transaction { export interface Transaction {
id: string; status: string;
type: string;
amount: number; amount: number;
date: string; createdAt: string;
} }

View file

@ -0,0 +1,6 @@
import { Transaction } from './Transaction';
export interface TransactionData {
transactions: Transaction[];
hasMore: boolean;
}

View file

@ -0,0 +1,24 @@
import { inject, Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { TransactionData } from '../model/TransactionData';
@Injectable({
providedIn: 'root',
})
export class TransactionService {
private http: HttpClient = inject(HttpClient);
public getUsersTransactions(limit: number | null = null, offset: number | null = null) {
const baseUrl = new URL(`${window.location.origin}/backend/user/transactions`);
if (limit !== null) {
baseUrl.searchParams.append('limit', limit.toString());
}
if (offset !== null) {
baseUrl.searchParams.append('offset', offset.toString());
}
return this.http.get<TransactionData>(`${baseUrl}`);
}
}

View file

@ -1,12 +1,12 @@
import { import {
AfterViewInit,
Component, Component,
ElementRef, ElementRef,
EventEmitter, EventEmitter,
Input, Input,
OnDestroy,
Output, Output,
ViewChild, ViewChild,
AfterViewInit,
OnDestroy,
} from '@angular/core'; } from '@angular/core';
import { ModalAnimationService } from '@shared/services/modal-animation.service'; import { ModalAnimationService } from '@shared/services/modal-animation.service';
import gsap from 'gsap'; import gsap from 'gsap';

View file

@ -1,7 +1,7 @@
import { ChangeDetectionStrategy, Component } from '@angular/core'; import { ChangeDetectionStrategy, Component } from '@angular/core';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
import { faMoneyBillTransfer, faCreditCard, faWallet } from '@fortawesome/free-solid-svg-icons'; import { faCreditCard, faMoneyBillTransfer, faWallet } from '@fortawesome/free-solid-svg-icons';
import { faPaypal, faGooglePay, faApplePay } from '@fortawesome/free-brands-svg-icons'; import { faApplePay, faGooglePay, faPaypal } from '@fortawesome/free-brands-svg-icons';
@Component({ @Component({
selector: 'app-footer', selector: 'app-footer',

View file

@ -2,8 +2,8 @@ import {
ChangeDetectionStrategy, ChangeDetectionStrategy,
Component, Component,
inject, inject,
OnInit,
OnDestroy, OnDestroy,
OnInit,
signal, signal,
} from '@angular/core'; } from '@angular/core';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';