{"info":{"_postman_id":"555d55d0-4065-4243-8d3d-476f637668a4","name":"Finance Data Processing and Access Control Backend","description":"<html><head></head><body><p>Full collection for testing all routes with auth, pagination, and idempotency</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"43504506","collectionId":"555d55d0-4065-4243-8d3d-476f637668a4","publishedId":"2sBXiqDo4J","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2026-04-04T18:55:58.000Z"},"item":[{"name":"🔐 Auth","item":[{"name":"Register User","event":[{"listen":"test","script":{"exec":["if (pm.response.code === 201) {","    const data = pm.response.json();","    pm.environment.set('authToken', data.token);","    pm.environment.set('userId', data.data.user.id);","    console.log('✅ Token saved to environment');","}"],"type":"text/javascript","id":"7550361c-1727-4ff1-afd7-eacbc14fbdae"}}],"id":"780532e6-8904-47ab-af06-2d425778a939","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"email\": \"testuser@example.com\",\n  \"first_name\": \"Test\",\n  \"last_name\": \"User\",\n  \"password\": \"Password123!\"\n}"},"url":"http://localhost:3000/api/v1/auth/register","description":"<p>Register a new user account</p>\n","urlObject":{"path":["api","v1","auth","register"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"780532e6-8904-47ab-af06-2d425778a939"},{"name":"Login User","event":[{"listen":"test","script":{"exec":["if (pm.response.code === 200) {","    const data = pm.response.json();","    pm.environment.set('authToken', data.token);","    pm.environment.set('userId', data.data.user.id);","    console.log('✅ Token saved to environment');","    console.log('User Role:', data.data.user.role);","}"],"type":"text/javascript","id":"22f981eb-e487-4851-9fb9-c83944fc156c"}}],"id":"651ee957-be01-40a9-be43-d04a25bd4b91","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"email\": \"testuser@example.com\",\n  \"password\": \"Password123!\"\n}"},"url":"http://localhost:3000/api/v1/auth/login","description":"<p>Login with email and password</p>\n","urlObject":{"path":["api","v1","auth","login"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"651ee957-be01-40a9-be43-d04a25bd4b91"},{"name":"Get Current User (Me)","id":"65cf93d3-4d0f-420c-8108-86c644e4620e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer ","type":"text"}],"url":"http://localhost:3000/api/v1/auth/me","description":"<p>Get logged-in user details</p>\n","urlObject":{"path":["api","v1","auth","me"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"65cf93d3-4d0f-420c-8108-86c644e4620e"},{"name":"Logout","id":"897a1ac8-ba4b-4504-961d-ffdb81aeab14","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer ","type":"text"}],"url":"http://localhost:3000/api/v1/auth/logout","description":"<p>Logout and clear JWT cookie</p>\n","urlObject":{"path":["api","v1","auth","logout"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"897a1ac8-ba4b-4504-961d-ffdb81aeab14"}],"id":"d0e2e7ce-d3fb-4968-bff2-53110e75be98","_postman_id":"d0e2e7ce-d3fb-4968-bff2-53110e75be98","description":""},{"name":"📊 Records (Financial)","item":[{"name":"Create Record (with Idempotency)","event":[{"listen":"prerequest","script":{"exec":["// Generate unique idempotency key","const idempotencyKey = 'req_' + new Date().getTime() + '_' + Math.random().toString(36).substr(2, 9);","pm.environment.set('idempotencyKey', idempotencyKey);"],"type":"text/javascript","id":"265e0586-4ca2-47f6-a519-bd55d5974a34"}},{"listen":"test","script":{"exec":["if (pm.response.code === 201) {","    const data = pm.response.json();","    pm.environment.set('recordId', data.data.record.id);","    console.log('✅ Record created:', data.data.record.id);","}"],"type":"text/javascript","id":"0d90e214-4535-4880-a3f5-6b57226c54f5"}}],"id":"0a0c0419-ba10-4afb-810c-b6a53a9b51ba","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer ","type":"text"},{"key":"Content-Type","value":"application/json"},{"key":"Idempotency-Key","value":"","type":"text"}],"body":{"mode":"raw","raw":"{\n  \"amount\": 5000,\n  \"type\": \"INCOME\",\n  \"category\": \"Salary\",\n  \"transaction_date\": \"2024-04-01\",\n  \"notes\": \"Monthly salary\"\n}"},"url":"http://localhost:3000/api/v1/records","description":"<p>Create a new financial record with idempotency support</p>\n","urlObject":{"path":["api","v1","records"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"0a0c0419-ba10-4afb-810c-b6a53a9b51ba"},{"name":"Get All Records (with Pagination)","id":"c34e9273-bc64-48de-afe5-761d7de68488","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer ","type":"text"}],"url":"http://localhost:3000/api/v1/records?page=1&limit=10","description":"<p>Get paginated financial records</p>\n","urlObject":{"path":["api","v1","records"],"host":["http://localhost:3000"],"query":[{"key":"page","value":"1"},{"key":"limit","value":"10"}],"variable":[]}},"response":[],"_postman_id":"c34e9273-bc64-48de-afe5-761d7de68488"},{"name":"Search Records","id":"e148bebf-5e18-424b-a552-61e3b52dbe04","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer ","type":"text"}],"url":"http://localhost:3000/api/v1/records?search=Salary&page=1&limit=5","description":"<p>Search records by category or notes</p>\n","urlObject":{"path":["api","v1","records"],"host":["http://localhost:3000"],"query":[{"key":"search","value":"Salary"},{"key":"page","value":"1"},{"key":"limit","value":"5"}],"variable":[]}},"response":[],"_postman_id":"e148bebf-5e18-424b-a552-61e3b52dbe04"},{"name":"Update Record","id":"960e312b-6588-4784-b7fb-929975ac8279","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[{"key":"Authorization","value":"Bearer ","type":"text"},{"key":"Content-Type","value":"application/json"},{"key":"Idempotency-Key","value":"","type":"text"}],"body":{"mode":"raw","raw":"{\n  \"amount\": 5500,\n  \"notes\": \"Updated monthly salary\"\n}"},"url":"http://localhost:3000/api/v1/records/","description":"<p>Update a financial record (partial update allowed)</p>\n","urlObject":{"path":["api","v1","records",""],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"960e312b-6588-4784-b7fb-929975ac8279"},{"name":"Delete Record (Soft Delete)","id":"4a5f465c-6eee-4f61-bfc0-72db46e9467a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer ","type":"text"}],"url":"http://localhost:3000/api/v1/records/","description":"<p>Soft delete a record (sets deleted_at timestamp)</p>\n","urlObject":{"path":["api","v1","records",""],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"4a5f465c-6eee-4f61-bfc0-72db46e9467a"}],"id":"7384afbc-3a02-4140-91c1-66b36c403156","_postman_id":"7384afbc-3a02-4140-91c1-66b36c403156","description":""},{"name":"👤 Users","item":[{"name":"Update My Profile","id":"5d6d53e2-96ba-4761-86b4-3503344afceb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[{"key":"Authorization","value":"Bearer ","type":"text"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"first_name\": \"Updated\",\n  \"last_name\": \"Name\"\n}"},"url":"http://localhost:3000/api/v1/users/update-me","description":"<p>Update current user's profile (name only)</p>\n","urlObject":{"path":["api","v1","users","update-me"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"5d6d53e2-96ba-4761-86b4-3503344afceb"},{"name":"Get All Users (Admin Only)","id":"3fd96898-cd4f-4a55-b7f3-044636193bfa","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer ","type":"text"}],"url":"http://localhost:3000/api/v1/users","description":"<p>Get all users - ADMIN ROLE REQUIRED</p>\n","urlObject":{"path":["api","v1","users"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"3fd96898-cd4f-4a55-b7f3-044636193bfa"},{"name":"Update User Role/Status (Admin Only)","id":"3d1bd3d8-bc64-47d4-9b1b-e70ed21f8fad","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[{"key":"Authorization","value":"Bearer ","type":"text"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"role\": \"ANALYST\",\n  \"status\": \"ACTIVE\"\n}"},"url":"http://localhost:3000/api/v1/users//role-status","description":"<p>Update user role (VIEWER, ANALYST, ADMIN) and status - ADMIN ONLY</p>\n","urlObject":{"path":["api","v1","users","","role-status"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"3d1bd3d8-bc64-47d4-9b1b-e70ed21f8fad"}],"id":"3e90af95-2cef-4a66-88e9-dc2b2ddfbbfd","_postman_id":"3e90af95-2cef-4a66-88e9-dc2b2ddfbbfd","description":""},{"name":"📈 Dashboard","item":[{"name":"Get Dashboard Stats","id":"0c4c241c-41d4-4bf0-b37e-c5680a7447a3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer ","type":"text"}],"url":"http://localhost:3000/api/v1/dashboard","description":"<p>Get dashboard statistics (total income, expense, net balance)</p>\n","urlObject":{"path":["api","v1","dashboard"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"0c4c241c-41d4-4bf0-b37e-c5680a7447a3"}],"id":"4f7552b1-2aa3-4d15-937f-ee0e9885f160","_postman_id":"4f7552b1-2aa3-4d15-937f-ee0e9885f160","description":""},{"name":"🧪 Error Testing","item":[{"name":"Test 404 - Invalid Route","id":"7c80d6e6-bdcf-47a3-bf34-f6c14cc0cb4c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer ","type":"text"}],"url":"http://localhost:3000/api/v1/invalid-endpoint","description":"<p>Test 404 error handling</p>\n","urlObject":{"path":["api","v1","invalid-endpoint"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"7c80d6e6-bdcf-47a3-bf34-f6c14cc0cb4c"},{"name":"Test 401 - Missing Auth Token","id":"cff0c782-0f2b-4174-8864-04413614c054","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/v1/dashboard","description":"<p>Test unauthorized access (no token)</p>\n","urlObject":{"path":["api","v1","dashboard"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"cff0c782-0f2b-4174-8864-04413614c054"},{"name":"Test 400 - Validation Error","id":"d326906f-2db0-4331-9f15-361d48b7781b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer ","type":"text"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"amount\": -100,\n  \"type\": \"INVALID_TYPE\",\n  \"category\": \"\",\n  \"transaction_date\": \"invalid-date\"\n}"},"url":"http://localhost:3000/api/v1/records","description":"<p>Test validation error with invalid record data</p>\n","urlObject":{"path":["api","v1","records"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"d326906f-2db0-4331-9f15-361d48b7781b"},{"name":"Test 403 - Forbidden (Insufficient Permissions)","id":"14d55a30-e9d6-4243-af6c-16186410f1f5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer ","type":"text"}],"url":"http://localhost:3000/api/v1/users","description":"<p>Test forbidden access (non-admin user trying to get all users)</p>\n","urlObject":{"path":["api","v1","users"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"14d55a30-e9d6-4243-af6c-16186410f1f5"}],"id":"18cc7cd9-956a-4fde-abc7-cf288d1da27a","_postman_id":"18cc7cd9-956a-4fde-abc7-cf288d1da27a","description":""}],"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["// Auto-refresh token logic can go here if needed"],"id":"dda07860-95a5-4b99-9f47-6dc331da001a"}},{"listen":"test","script":{"type":"text/javascript","exec":["// Global test scripts"],"id":"480bd44e-37d4-4e32-b617-7a90c2eb28c2"}}],"variable":[{"id":"06fd5513-4ede-4f97-93bb-00f71dfc959a","key":"base_url","value":"http://localhost:3000","type":"string"},{"id":"92486efb-4635-4065-a9fe-ec075fcb38b2","key":"authToken","value":"","type":"string"},{"id":"bd11018b-3e68-4d93-aae4-dccafb44418f","key":"userId","value":"","type":"string"},{"id":"eac42e87-0c84-418e-868b-df7b861ee76e","key":"recordId","value":"","type":"string"},{"id":"dc4ca957-a5e2-4f76-a87f-5b40b3329ea6","key":"idempotencyKey","value":"","type":"string"}]}