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 $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: auth:
type: bearer type: bearer
credentials: credentials:
token: "{{vault:expenses_access_token}}" token: "{{access_token}}"
@@ -1,5 +1,5 @@
$kind: http-request $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 method: DELETE
settings: {} settings: {}
order: 4000 order: 4000
@@ -1,5 +1,5 @@
$kind: http-request $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 method: GET
body: body:
type: text type: text
@@ -1,5 +1,5 @@
$kind: http-request $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 method: PUT
body: body:
type: json type: json
@@ -5,16 +5,18 @@ body:
type: urlencoded type: urlencoded
content: content:
grant_type: refresh_token grant_type: refresh_token
refresh_token: "{{vault:expenses_refresh_token}}" refresh_token: "{{refresh_token}}"
auth: auth:
type: noauth type: noauth
scripts: scripts:
- type: afterResponse - type: afterResponse
code: |- code: |-
var access_token = pm.response.json()["access_token"]; if (pm.response.code === 200) {
await pm.vault.set("expenses_access_token", access_token); var access_token = pm.response.json()["access_token"];
pm.collectionVariables.set("access_token", access_token);
var refresh_token = pm.response.json()["refresh_token"]; var refresh_token = pm.response.json()["refresh_token"];
await pm.vault.set("expenses_refresh_token", refresh_token); pm.collectionVariables.set("refresh_token", refresh_token);
}
language: text/javascript language: text/javascript
order: 2000 order: 2000
@@ -5,17 +5,19 @@ body:
type: urlencoded type: urlencoded
content: content:
grant_type: client_credentials grant_type: client_credentials
client_id: "{{vault:expenses_user_app_id}}" client_id: "{{user_app_id}}"
client_secret: "{{vault:expenses_user_app_secret}}" client_secret: "{{user_app_secret}}"
auth: auth:
type: noauth type: noauth
scripts: scripts:
- type: afterResponse - type: afterResponse
code: |- code: |-
var access_token = pm.response.json()["access_token"]; if (pm.response.code === 200) {
await pm.vault.set("expenses_access_token", access_token); var access_token = pm.response.json()["access_token"];
pm.collectionVariables.set("access_token", access_token);
var refresh_token = pm.response.json()["refresh_token"]; var refresh_token = pm.response.json()["refresh_token"];
await pm.vault.set("expenses_refresh_token", refresh_token); pm.collectionVariables.set("refresh_token", refresh_token);
}
language: text/javascript language: text/javascript
order: 1000 order: 1000
@@ -4,7 +4,7 @@ method: POST
body: body:
type: urlencoded type: urlencoded
content: content:
token: "{{vault:expenses_refresh_token}}" token: "{{refresh_token}}"
auth: auth:
type: noauth type: noauth
order: 3000 order: 3000
@@ -1,5 +1,5 @@
$kind: http-request $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 method: DELETE
settings: {} settings: {}
order: 4000 order: 4000
@@ -1,5 +1,5 @@
$kind: http-request $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 method: GET
settings: {} settings: {}
order: 2000 order: 2000
@@ -1,5 +1,5 @@
$kind: http-request $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 method: PUT
body: body:
type: json type: json
@@ -1,5 +1,5 @@
$kind: http-request $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 method: DELETE
settings: {} settings: {}
order: 4000 order: 4000
@@ -1,5 +1,5 @@
$kind: http-request $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 method: GET
body: body:
type: text type: text
@@ -1,5 +1,5 @@
$kind: http-request $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 method: PUT
body: body:
type: json type: json
@@ -1,4 +1,4 @@
$kind: http-request $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 method: DELETE
order: 5000 order: 5000
@@ -1,4 +1,4 @@
$kind: http-request $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 method: GET
order: 3000 order: 3000
@@ -1,4 +1,4 @@
$kind: http-request $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 method: GET
order: 2000 order: 2000
@@ -1,4 +1,4 @@
$kind: http-request $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 method: DELETE
order: 4000 order: 4000
@@ -1,4 +1,4 @@
$kind: http-request $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 method: GET
order: 2000 order: 2000
@@ -1,4 +1,4 @@
$kind: http-request $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 method: GET
order: 1000 order: 1000
@@ -1,5 +1,5 @@
$kind: http-request $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 method: PUT
body: body:
type: json type: json
@@ -7,10 +7,4 @@ body:
{ {
"expires_at": "2027-01-01T00:00:00.000Z" "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 order: 3000
@@ -1,13 +1,7 @@
$kind: http-request $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 method: PUT
body: body:
type: json type: json
content: "{}" 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 order: 4000
@@ -1,4 +1,4 @@
$kind: http-request $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 method: DELETE
order: 5000 order: 5000
@@ -1,4 +1,4 @@
$kind: http-request $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 method: GET
order: 3000 order: 3000
@@ -1,5 +1,5 @@
$kind: http-request $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 method: PUT
body: body:
type: json type: json
@@ -10,11 +10,11 @@ VALUES (
INSERT INTO INSERT INTO
user_apps (id, user_id) user_apps (id, user_id)
VALUES ( VALUES (
'00000000-0000-0000-0000-000000000001', '00000000-0000-0000-0001-000000000001',
'00000000-0000-0000-0000-000000000001' '00000000-0000-0000-0000-000000000001'
), ),
( (
'00000000-0000-0000-0000-000000000002', '00000000-0000-0000-0001-000000000002',
'00000000-0000-0000-0000-000000000002' '00000000-0000-0000-0000-000000000002'
); );
@@ -26,14 +26,14 @@ INSERT INTO
expires_at expires_at
) )
VALUES ( VALUES (
'00000000-0000-0000-0000-000000000001', '00000000-0000-0000-0002-000000000001',
'00000000-0000-0000-0000-000000000001', '00000000-0000-0000-0001-000000000001',
sha256 (convert_to ('test', 'UTF8')), sha256 (convert_to ('test', 'UTF8')),
'2030-01-01T00:00:00Z' '2030-01-01T00:00:00Z'
), ),
( (
'00000000-0000-0000-0000-000000000002', '00000000-0000-0000-0002-000000000002',
'00000000-0000-0000-0000-000000000002', '00000000-0000-0000-0001-000000000002',
sha256 (convert_to ('test', 'UTF8')), sha256 (convert_to ('test', 'UTF8')),
'2030-01-01T00:00:00Z' '2030-01-01T00:00:00Z'
); );
@@ -41,22 +41,22 @@ VALUES (
INSERT INTO INSERT INTO
accounts (id, name) accounts (id, name)
VALUES ( VALUES (
'00000000-0000-0000-0000-000000000001', '00000000-0000-0000-0003-000000000001',
'Checking Account' 'Checking Account'
), ),
( (
'00000000-0000-0000-0000-000000000002', '00000000-0000-0000-0003-000000000002',
'Savings Account' 'Savings Account'
); );
INSERT INTO INSERT INTO
account_members (account_id, user_id) account_members (account_id, user_id)
VALUES ( VALUES (
'00000000-0000-0000-0000-000000000001', '00000000-0000-0000-0003-000000000001',
'00000000-0000-0000-0000-000000000001' '00000000-0000-0000-0000-000000000001'
), ),
( (
'00000000-0000-0000-0000-000000000002', '00000000-0000-0000-0003-000000000002',
'00000000-0000-0000-0000-000000000002' '00000000-0000-0000-0000-000000000002'
); );
@@ -70,16 +70,16 @@ INSERT INTO
description description
) )
VALUES ( VALUES (
'00000000-0000-0000-0000-000000000001', '00000000-0000-0000-0004-000000000001',
'00000000-0000-0000-0000-000000000001', '00000000-0000-0000-0003-000000000001',
320000, 320000,
'in', 'in',
'2026-09-01T09:00:00Z', '2026-09-01T09:00:00Z',
'Salary' 'Salary'
), ),
( (
'00000000-0000-0000-0000-000000000002', '00000000-0000-0000-0004-000000000002',
'00000000-0000-0000-0000-000000000002', '00000000-0000-0000-0003-000000000002',
8450, 8450,
'out', 'out',
'2026-09-18T17:30:00Z', '2026-09-18T17:30:00Z',
@@ -100,9 +100,9 @@ INSERT INTO
weekend_adjustment weekend_adjustment
) )
VALUES ( VALUES (
'00000000-0000-0000-0000-000000000001', '00000000-0000-0000-0005-000000000001',
'Salary', 'Salary',
'00000000-0000-0000-0000-000000000001', '00000000-0000-0000-0003-000000000001',
320000, 320000,
'in', 'in',
'2026-10-01T09:00:00Z', '2026-10-01T09:00:00Z',
@@ -112,9 +112,9 @@ VALUES (
NULL NULL
), ),
( (
'00000000-0000-0000-0000-000000000002', '00000000-0000-0000-0005-000000000002',
'Rent', 'Rent',
'00000000-0000-0000-0000-000000000002', '00000000-0000-0000-0003-000000000002',
125000, 125000,
'out', 'out',
'2026-10-01T09:00:00Z', '2026-10-01T09:00:00Z',