Reference seed data by default from Postman.

This commit is contained in:
2026-10-09 20:13:09 +02:00
parent 238c125a5c
commit 38ee5fe021
25 changed files with 68 additions and 63 deletions
@@ -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}}"
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -4,7 +4,7 @@ method: POST
body:
type: urlencoded
content:
token: "{{vault:expenses_refresh_token}}"
token: "{{refresh_token}}"
auth:
type: noauth
order: 3000
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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',