From 38ee5fe021b8c30c78436b5f8ab08b898cb39fc6 Mon Sep 17 00:00:00 2001 From: Rogier Reerink Date: Fri, 9 Oct 2026 20:13:09 +0200 Subject: [PATCH] Reference seed data by default from Postman. --- .../.resources/definition.yaml | 15 +++++++- .../API/Accounts/Delete account.request.yaml | 2 +- .../API/Accounts/Get account.request.yaml | 2 +- .../API/Accounts/Upsert account.request.yaml | 2 +- .../API/Auth/Token/Refresh token.request.yaml | 12 ++++--- ...oken using client credentials.request.yaml | 14 ++++---- .../API/Auth/Token/Revoke token.request.yaml | 2 +- .../Delete scheduled transaction.request.yaml | 2 +- .../Get scheduled transaction.request.yaml | 2 +- .../Upsert scheduled transaction.request.yaml | 2 +- .../Delete transaction.request.yaml | 2 +- .../Transactions/Get transaction.request.yaml | 2 +- .../Upsert transaction.request.yaml | 2 +- .../API/Users/Apps/Delete app.request.yaml | 2 +- .../API/Users/Apps/Get app.request.yaml | 2 +- .../API/Users/Apps/List apps.request.yaml | 2 +- .../Apps/Secrets/Delete secret.request.yaml | 2 +- .../Apps/Secrets/Get secret.request.yaml | 2 +- .../Apps/Secrets/List secrets.request.yaml | 2 +- .../Apps/Secrets/Upsert secret.request.yaml | 8 +---- .../API/Users/Apps/Upsert app.request.yaml | 8 +---- .../API/Users/Delete user.request.yaml | 2 +- .../API/Users/Get user.request.yaml | 2 +- .../API/Users/Upsert user.request.yaml | 2 +- .../20261231000000_seed_demo_data.sql | 36 +++++++++---------- 25 files changed, 68 insertions(+), 63 deletions(-) diff --git a/postman/collections/Expenses Server/.resources/definition.yaml b/postman/collections/Expenses Server/.resources/definition.yaml index f723ea9..102a94e 100644 --- a/postman/collections/Expenses Server/.resources/definition.yaml +++ b/postman/collections/Expenses Server/.resources/definition.yaml @@ -1,5 +1,18 @@ $kind: collection +variables: + - key: user_app_id + value: "" + disabled: false + - key: user_app_secret + secret: true + disabled: false + - key: access_token + secret: true + disabled: false + - key: refresh_token + secret: true + disabled: false auth: type: bearer credentials: - token: "{{vault:expenses_access_token}}" + token: "{{access_token}}" diff --git a/postman/collections/Expenses Server/API/Accounts/Delete account.request.yaml b/postman/collections/Expenses Server/API/Accounts/Delete account.request.yaml index 1adeb40..92c1f37 100644 --- a/postman/collections/Expenses Server/API/Accounts/Delete account.request.yaml +++ b/postman/collections/Expenses Server/API/Accounts/Delete account.request.yaml @@ -1,5 +1,5 @@ $kind: http-request -url: http://localhost:3000/api/accounts/cb9b9fe6-1d4d-4b97-af75-2bda9e44a6dd +url: http://localhost:3000/api/accounts/00000000-0000-0000-0003-000000000001 method: DELETE settings: {} order: 4000 diff --git a/postman/collections/Expenses Server/API/Accounts/Get account.request.yaml b/postman/collections/Expenses Server/API/Accounts/Get account.request.yaml index 2762657..b535034 100644 --- a/postman/collections/Expenses Server/API/Accounts/Get account.request.yaml +++ b/postman/collections/Expenses Server/API/Accounts/Get account.request.yaml @@ -1,5 +1,5 @@ $kind: http-request -url: http://localhost:3000/api/accounts/cb9b9fe6-1d4d-4b97-af75-2bda9e44a6dd +url: http://localhost:3000/api/accounts/00000000-0000-0000-0003-000000000001 method: GET body: type: text diff --git a/postman/collections/Expenses Server/API/Accounts/Upsert account.request.yaml b/postman/collections/Expenses Server/API/Accounts/Upsert account.request.yaml index 0a056be..4df497a 100644 --- a/postman/collections/Expenses Server/API/Accounts/Upsert account.request.yaml +++ b/postman/collections/Expenses Server/API/Accounts/Upsert account.request.yaml @@ -1,5 +1,5 @@ $kind: http-request -url: http://localhost:3000/api/accounts/cb9b9fe6-1d4d-4b97-af75-2bda9e44a6dd +url: http://localhost:3000/api/accounts/00000000-0000-0000-0003-000000000001 method: PUT body: type: json diff --git a/postman/collections/Expenses Server/API/Auth/Token/Refresh token.request.yaml b/postman/collections/Expenses Server/API/Auth/Token/Refresh token.request.yaml index d20baaa..eade643 100644 --- a/postman/collections/Expenses Server/API/Auth/Token/Refresh token.request.yaml +++ b/postman/collections/Expenses Server/API/Auth/Token/Refresh token.request.yaml @@ -5,16 +5,18 @@ body: type: urlencoded content: grant_type: refresh_token - refresh_token: "{{vault:expenses_refresh_token}}" + refresh_token: "{{refresh_token}}" auth: type: noauth scripts: - type: afterResponse code: |- - var access_token = pm.response.json()["access_token"]; - await pm.vault.set("expenses_access_token", access_token); + if (pm.response.code === 200) { + var access_token = pm.response.json()["access_token"]; + pm.collectionVariables.set("access_token", access_token); - var refresh_token = pm.response.json()["refresh_token"]; - await pm.vault.set("expenses_refresh_token", refresh_token); + var refresh_token = pm.response.json()["refresh_token"]; + pm.collectionVariables.set("refresh_token", refresh_token); + } language: text/javascript order: 2000 diff --git a/postman/collections/Expenses Server/API/Auth/Token/Request token using client credentials.request.yaml b/postman/collections/Expenses Server/API/Auth/Token/Request token using client credentials.request.yaml index df64d9c..972726a 100644 --- a/postman/collections/Expenses Server/API/Auth/Token/Request token using client credentials.request.yaml +++ b/postman/collections/Expenses Server/API/Auth/Token/Request token using client credentials.request.yaml @@ -5,17 +5,19 @@ body: type: urlencoded content: grant_type: client_credentials - client_id: "{{vault:expenses_user_app_id}}" - client_secret: "{{vault:expenses_user_app_secret}}" + client_id: "{{user_app_id}}" + client_secret: "{{user_app_secret}}" auth: type: noauth scripts: - type: afterResponse code: |- - var access_token = pm.response.json()["access_token"]; - await pm.vault.set("expenses_access_token", access_token); + if (pm.response.code === 200) { + var access_token = pm.response.json()["access_token"]; + pm.collectionVariables.set("access_token", access_token); - var refresh_token = pm.response.json()["refresh_token"]; - await pm.vault.set("expenses_refresh_token", refresh_token); + var refresh_token = pm.response.json()["refresh_token"]; + pm.collectionVariables.set("refresh_token", refresh_token); + } language: text/javascript order: 1000 diff --git a/postman/collections/Expenses Server/API/Auth/Token/Revoke token.request.yaml b/postman/collections/Expenses Server/API/Auth/Token/Revoke token.request.yaml index d7477fc..32325fd 100644 --- a/postman/collections/Expenses Server/API/Auth/Token/Revoke token.request.yaml +++ b/postman/collections/Expenses Server/API/Auth/Token/Revoke token.request.yaml @@ -4,7 +4,7 @@ method: POST body: type: urlencoded content: - token: "{{vault:expenses_refresh_token}}" + token: "{{refresh_token}}" auth: type: noauth order: 3000 diff --git a/postman/collections/Expenses Server/API/Scheduled transactions/Delete scheduled transaction.request.yaml b/postman/collections/Expenses Server/API/Scheduled transactions/Delete scheduled transaction.request.yaml index bd0f6c3..dc5f4b0 100644 --- a/postman/collections/Expenses Server/API/Scheduled transactions/Delete scheduled transaction.request.yaml +++ b/postman/collections/Expenses Server/API/Scheduled transactions/Delete scheduled transaction.request.yaml @@ -1,5 +1,5 @@ $kind: http-request -url: http://localhost:3000/api/scheduled-transactions/40bda5b3-451e-4c5e-8aeb-af14f8b95e69 +url: http://localhost:3000/api/scheduled-transactions/00000000-0000-0000-0005-000000000001 method: DELETE settings: {} order: 4000 diff --git a/postman/collections/Expenses Server/API/Scheduled transactions/Get scheduled transaction.request.yaml b/postman/collections/Expenses Server/API/Scheduled transactions/Get scheduled transaction.request.yaml index c134afa..5c4052c 100644 --- a/postman/collections/Expenses Server/API/Scheduled transactions/Get scheduled transaction.request.yaml +++ b/postman/collections/Expenses Server/API/Scheduled transactions/Get scheduled transaction.request.yaml @@ -1,5 +1,5 @@ $kind: http-request -url: http://localhost:3000/api/scheduled-transactions/40bda5b3-451e-4c5e-8aeb-af14f8b95e69 +url: http://localhost:3000/api/scheduled-transactions/00000000-0000-0000-0005-000000000001 method: GET settings: {} order: 2000 diff --git a/postman/collections/Expenses Server/API/Scheduled transactions/Upsert scheduled transaction.request.yaml b/postman/collections/Expenses Server/API/Scheduled transactions/Upsert scheduled transaction.request.yaml index f9bf31c..d7b1681 100644 --- a/postman/collections/Expenses Server/API/Scheduled transactions/Upsert scheduled transaction.request.yaml +++ b/postman/collections/Expenses Server/API/Scheduled transactions/Upsert scheduled transaction.request.yaml @@ -1,5 +1,5 @@ $kind: http-request -url: http://localhost:3000/api/scheduled-transactions/40bda5b3-451e-4c5e-8aeb-af14f8b95e69 +url: http://localhost:3000/api/scheduled-transactions/00000000-0000-0000-0005-000000000001 method: PUT body: type: json diff --git a/postman/collections/Expenses Server/API/Transactions/Delete transaction.request.yaml b/postman/collections/Expenses Server/API/Transactions/Delete transaction.request.yaml index 9bf9714..1490624 100644 --- a/postman/collections/Expenses Server/API/Transactions/Delete transaction.request.yaml +++ b/postman/collections/Expenses Server/API/Transactions/Delete transaction.request.yaml @@ -1,5 +1,5 @@ $kind: http-request -url: http://localhost:3000/api/transactions/147b49b7-fbe8-475b-a52d-e35f0fc47057 +url: http://localhost:3000/api/transactions/00000000-0000-0000-0004-000000000001 method: DELETE settings: {} order: 4000 diff --git a/postman/collections/Expenses Server/API/Transactions/Get transaction.request.yaml b/postman/collections/Expenses Server/API/Transactions/Get transaction.request.yaml index 98b2a37..7fdc5b3 100644 --- a/postman/collections/Expenses Server/API/Transactions/Get transaction.request.yaml +++ b/postman/collections/Expenses Server/API/Transactions/Get transaction.request.yaml @@ -1,5 +1,5 @@ $kind: http-request -url: http://localhost:3000/api/transactions/147b49b7-fbe8-475b-a52d-e35f0fc47057 +url: http://localhost:3000/api/transactions/00000000-0000-0000-0004-000000000001 method: GET body: type: text diff --git a/postman/collections/Expenses Server/API/Transactions/Upsert transaction.request.yaml b/postman/collections/Expenses Server/API/Transactions/Upsert transaction.request.yaml index 8374350..4de7b84 100644 --- a/postman/collections/Expenses Server/API/Transactions/Upsert transaction.request.yaml +++ b/postman/collections/Expenses Server/API/Transactions/Upsert transaction.request.yaml @@ -1,5 +1,5 @@ $kind: http-request -url: http://localhost:3000/api/transactions/147b49b7-fbe8-475b-a52d-e35f0fc47057 +url: http://localhost:3000/api/transactions/00000000-0000-0000-0004-000000000001 method: PUT body: type: json diff --git a/postman/collections/Expenses Server/API/Users/Apps/Delete app.request.yaml b/postman/collections/Expenses Server/API/Users/Apps/Delete app.request.yaml index 2d829bf..7c09c2f 100644 --- a/postman/collections/Expenses Server/API/Users/Apps/Delete app.request.yaml +++ b/postman/collections/Expenses Server/API/Users/Apps/Delete app.request.yaml @@ -1,4 +1,4 @@ $kind: http-request -url: http://localhost:3000/api/users/9a25ee3f-a595-43ef-8be6-38362f26ae03/apps/49832582-a455-4f76-b7ad-f6c3807245a0 +url: http://localhost:3000/api/users/00000000-0000-0000-0000-000000000001/apps/00000000-0000-0000-0001-000000000003 method: DELETE order: 5000 diff --git a/postman/collections/Expenses Server/API/Users/Apps/Get app.request.yaml b/postman/collections/Expenses Server/API/Users/Apps/Get app.request.yaml index 56753ea..434dcd9 100644 --- a/postman/collections/Expenses Server/API/Users/Apps/Get app.request.yaml +++ b/postman/collections/Expenses Server/API/Users/Apps/Get app.request.yaml @@ -1,4 +1,4 @@ $kind: http-request -url: http://localhost:3000/api/users/9a25ee3f-a595-43ef-8be6-38362f26ae03/apps/49832582-a455-4f76-b7ad-f6c3807245a0 +url: http://localhost:3000/api/users/00000000-0000-0000-0000-000000000001/apps/00000000-0000-0000-0001-000000000003 method: GET order: 3000 diff --git a/postman/collections/Expenses Server/API/Users/Apps/List apps.request.yaml b/postman/collections/Expenses Server/API/Users/Apps/List apps.request.yaml index 4f4d4bb..b4dcda0 100644 --- a/postman/collections/Expenses Server/API/Users/Apps/List apps.request.yaml +++ b/postman/collections/Expenses Server/API/Users/Apps/List apps.request.yaml @@ -1,4 +1,4 @@ $kind: http-request -url: http://localhost:3000/api/users/9a25ee3f-a595-43ef-8be6-38362f26ae03/apps +url: http://localhost:3000/api/users/00000000-0000-0000-0000-000000000001/apps method: GET order: 2000 diff --git a/postman/collections/Expenses Server/API/Users/Apps/Secrets/Delete secret.request.yaml b/postman/collections/Expenses Server/API/Users/Apps/Secrets/Delete secret.request.yaml index 7aec3c4..093b06e 100644 --- a/postman/collections/Expenses Server/API/Users/Apps/Secrets/Delete secret.request.yaml +++ b/postman/collections/Expenses Server/API/Users/Apps/Secrets/Delete secret.request.yaml @@ -1,4 +1,4 @@ $kind: http-request -url: http://localhost:3000/api/users/9a25ee3f-a595-43ef-8be6-38362f26ae03/apps/49832582-a455-4f76-b7ad-f6c3807245a0/secrets/0b4099cd-6959-4738-8456-0adcbc891f80 +url: http://localhost:3000/api/users/00000000-0000-0000-0000-000000000001/apps/00000000-0000-0000-0001-000000000001/secrets/00000000-0000-0000-0002-000000000001 method: DELETE order: 4000 diff --git a/postman/collections/Expenses Server/API/Users/Apps/Secrets/Get secret.request.yaml b/postman/collections/Expenses Server/API/Users/Apps/Secrets/Get secret.request.yaml index cc0a87d..db43a4b 100644 --- a/postman/collections/Expenses Server/API/Users/Apps/Secrets/Get secret.request.yaml +++ b/postman/collections/Expenses Server/API/Users/Apps/Secrets/Get secret.request.yaml @@ -1,4 +1,4 @@ $kind: http-request -url: http://localhost:3000/api/users/9a25ee3f-a595-43ef-8be6-38362f26ae03/apps/49832582-a455-4f76-b7ad-f6c3807245a0/secrets/0b4099cd-6959-4738-8456-0adcbc891f80 +url: http://localhost:3000/api/users/00000000-0000-0000-0000-000000000001/apps/00000000-0000-0000-0001-000000000001/secrets/00000000-0000-0000-0002-000000000001 method: GET order: 2000 diff --git a/postman/collections/Expenses Server/API/Users/Apps/Secrets/List secrets.request.yaml b/postman/collections/Expenses Server/API/Users/Apps/Secrets/List secrets.request.yaml index 9a54033..1066005 100644 --- a/postman/collections/Expenses Server/API/Users/Apps/Secrets/List secrets.request.yaml +++ b/postman/collections/Expenses Server/API/Users/Apps/Secrets/List secrets.request.yaml @@ -1,4 +1,4 @@ $kind: http-request -url: http://localhost:3000/api/users/9a25ee3f-a595-43ef-8be6-38362f26ae03/apps/49832582-a455-4f76-b7ad-f6c3807245a0/secrets +url: http://localhost:3000/api/users/00000000-0000-0000-0000-000000000001/apps/00000000-0000-0000-0001-000000000001/secrets method: GET order: 1000 diff --git a/postman/collections/Expenses Server/API/Users/Apps/Secrets/Upsert secret.request.yaml b/postman/collections/Expenses Server/API/Users/Apps/Secrets/Upsert secret.request.yaml index 9238139..f1f343d 100644 --- a/postman/collections/Expenses Server/API/Users/Apps/Secrets/Upsert secret.request.yaml +++ b/postman/collections/Expenses Server/API/Users/Apps/Secrets/Upsert secret.request.yaml @@ -1,5 +1,5 @@ $kind: http-request -url: http://localhost:3000/api/users/9a25ee3f-a595-43ef-8be6-38362f26ae03/apps/49832582-a455-4f76-b7ad-f6c3807245a0/secrets/0b4099cd-6959-4738-8456-0adcbc891f80 +url: http://localhost:3000/api/users/00000000-0000-0000-0000-000000000001/apps/00000000-0000-0000-0001-000000000001/secrets/00000000-0000-0000-0002-000000000001 method: PUT body: type: json @@ -7,10 +7,4 @@ body: { "expires_at": "2027-01-01T00:00:00.000Z" } -scripts: - - type: afterResponse - code: |- - var user_app_secret = pm.response.json()["secret"]; - await pm.vault.set("expenses_user_app_secret", user_app_secret); - language: text/javascript order: 3000 diff --git a/postman/collections/Expenses Server/API/Users/Apps/Upsert app.request.yaml b/postman/collections/Expenses Server/API/Users/Apps/Upsert app.request.yaml index 8db60da..5717420 100644 --- a/postman/collections/Expenses Server/API/Users/Apps/Upsert app.request.yaml +++ b/postman/collections/Expenses Server/API/Users/Apps/Upsert app.request.yaml @@ -1,13 +1,7 @@ $kind: http-request -url: http://localhost:3000/api/users/9a25ee3f-a595-43ef-8be6-38362f26ae03/apps/49832582-a455-4f76-b7ad-f6c3807245a0 +url: http://localhost:3000/api/users/00000000-0000-0000-0000-000000000001/apps/00000000-0000-0000-0001-000000000003 method: PUT body: type: json content: "{}" -scripts: - - type: afterResponse - code: |- - var user_app_id = pm.response.json()["id"]; - await pm.vault.set("expenses_user_app_id", user_app_id); - language: text/javascript order: 4000 diff --git a/postman/collections/Expenses Server/API/Users/Delete user.request.yaml b/postman/collections/Expenses Server/API/Users/Delete user.request.yaml index 56fb4c5..2ed8e20 100644 --- a/postman/collections/Expenses Server/API/Users/Delete user.request.yaml +++ b/postman/collections/Expenses Server/API/Users/Delete user.request.yaml @@ -1,4 +1,4 @@ $kind: http-request -url: http://localhost:3000/api/users/9a25ee3f-a595-43ef-8be6-38362f26ae03 +url: http://localhost:3000/api/users/00000000-0000-0000-0000-000000000001 method: DELETE order: 5000 diff --git a/postman/collections/Expenses Server/API/Users/Get user.request.yaml b/postman/collections/Expenses Server/API/Users/Get user.request.yaml index ac50ebf..e8df37f 100644 --- a/postman/collections/Expenses Server/API/Users/Get user.request.yaml +++ b/postman/collections/Expenses Server/API/Users/Get user.request.yaml @@ -1,4 +1,4 @@ $kind: http-request -url: http://localhost:3000/api/users/9a25ee3f-a595-43ef-8be6-38362f26ae03 +url: http://localhost:3000/api/users/00000000-0000-0000-0000-000000000001 method: GET order: 3000 diff --git a/postman/collections/Expenses Server/API/Users/Upsert user.request.yaml b/postman/collections/Expenses Server/API/Users/Upsert user.request.yaml index 2aa9e90..7e8f55b 100644 --- a/postman/collections/Expenses Server/API/Users/Upsert user.request.yaml +++ b/postman/collections/Expenses Server/API/Users/Upsert user.request.yaml @@ -1,5 +1,5 @@ $kind: http-request -url: http://localhost:3000/api/users/9a25ee3f-a595-43ef-8be6-38362f26ae03 +url: http://localhost:3000/api/users/00000000-0000-0000-0000-000000000001 method: PUT body: type: json diff --git a/server/migrations/20261231000000_seed_demo_data.sql b/server/migrations/20261231000000_seed_demo_data.sql index 0481895..0204e3d 100644 --- a/server/migrations/20261231000000_seed_demo_data.sql +++ b/server/migrations/20261231000000_seed_demo_data.sql @@ -10,11 +10,11 @@ VALUES ( INSERT INTO user_apps (id, user_id) VALUES ( - '00000000-0000-0000-0000-000000000001', + '00000000-0000-0000-0001-000000000001', '00000000-0000-0000-0000-000000000001' ), ( - '00000000-0000-0000-0000-000000000002', + '00000000-0000-0000-0001-000000000002', '00000000-0000-0000-0000-000000000002' ); @@ -26,14 +26,14 @@ INSERT INTO expires_at ) VALUES ( - '00000000-0000-0000-0000-000000000001', - '00000000-0000-0000-0000-000000000001', + '00000000-0000-0000-0002-000000000001', + '00000000-0000-0000-0001-000000000001', sha256 (convert_to ('test', 'UTF8')), '2030-01-01T00:00:00Z' ), ( - '00000000-0000-0000-0000-000000000002', - '00000000-0000-0000-0000-000000000002', + '00000000-0000-0000-0002-000000000002', + '00000000-0000-0000-0001-000000000002', sha256 (convert_to ('test', 'UTF8')), '2030-01-01T00:00:00Z' ); @@ -41,22 +41,22 @@ VALUES ( INSERT INTO accounts (id, name) VALUES ( - '00000000-0000-0000-0000-000000000001', + '00000000-0000-0000-0003-000000000001', 'Checking Account' ), ( - '00000000-0000-0000-0000-000000000002', + '00000000-0000-0000-0003-000000000002', 'Savings Account' ); INSERT INTO account_members (account_id, user_id) VALUES ( - '00000000-0000-0000-0000-000000000001', + '00000000-0000-0000-0003-000000000001', '00000000-0000-0000-0000-000000000001' ), ( - '00000000-0000-0000-0000-000000000002', + '00000000-0000-0000-0003-000000000002', '00000000-0000-0000-0000-000000000002' ); @@ -70,16 +70,16 @@ INSERT INTO description ) VALUES ( - '00000000-0000-0000-0000-000000000001', - '00000000-0000-0000-0000-000000000001', + '00000000-0000-0000-0004-000000000001', + '00000000-0000-0000-0003-000000000001', 320000, 'in', '2026-09-01T09:00:00Z', 'Salary' ), ( - '00000000-0000-0000-0000-000000000002', - '00000000-0000-0000-0000-000000000002', + '00000000-0000-0000-0004-000000000002', + '00000000-0000-0000-0003-000000000002', 8450, 'out', '2026-09-18T17:30:00Z', @@ -100,9 +100,9 @@ INSERT INTO weekend_adjustment ) VALUES ( - '00000000-0000-0000-0000-000000000001', + '00000000-0000-0000-0005-000000000001', 'Salary', - '00000000-0000-0000-0000-000000000001', + '00000000-0000-0000-0003-000000000001', 320000, 'in', '2026-10-01T09:00:00Z', @@ -112,9 +112,9 @@ VALUES ( NULL ), ( - '00000000-0000-0000-0000-000000000002', + '00000000-0000-0000-0005-000000000002', 'Rent', - '00000000-0000-0000-0000-000000000002', + '00000000-0000-0000-0003-000000000002', 125000, 'out', '2026-10-01T09:00:00Z',