{"info":{"_postman_id":"dcdd1961-948a-4adc-85c0-84fb178fac24","name":"Projeto Pismo","description":"<html><head></head><body><p>API para implementação do desafio proposto pela Pismo.</p>\n<p>Cada cliente possue uma conta e cada transação realizada está vinculada à uma conta.\nCada transação possui um tipo, um valor, um saldo e uma data de lançamento.</p>\n<p>O sistema deve ser capaz de criar, atualizar e listar contas.\nTambém deve ser capaz de criar uma transação, trabalhando com o conceito do saldo em aberto das mesmas, sendo capaz de recalculado o saldo em aberto após um pagamento.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"7995657","collectionId":"dcdd1961-948a-4adc-85c0-84fb178fac24","publishedId":"SVtbPkFJ","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2019-10-20T03:08:00.000Z"},"item":[{"name":"Create Account","id":"fcc23cbf-7576-4a5f-9032-ab3e3bb8ccc5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"available_credit_limit\": {\n\t\t\"amount\": 2000.0\n\t},\n\t\"available_withdrawal_limit\": {\n\t\t\"amount\": 2000.0\n\t}\n}"},"url":"localhost:9292/v1/accounts","description":"<p>Recebe as configurações de uma conta e devolve ela criada</p>\n","urlObject":{"port":"9292","path":["v1","accounts"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"1f09631e-e220-43fc-9bd4-51ba21561978","name":"Create Account","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"avaliable_credit_limit\": {\n\t\t\"amount\": 2000.0\n\t},\n\t\"avaliable_withdrawal_limit\": {\n\t\t\"amount\": 2000.0\n\t}\n}","options":{"raw":{"language":"json"}}},"url":"localhost:9292/v1/accounts"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sun, 20 Oct 2019 01:59:52 GMT"},{"key":"Content-Length","value":"94"}],"cookie":[],"responseTime":null,"body":"{\n    \"AccountID\": 1,\n    \"available_credit_limit\": 0,\n    \"available_withdrawal_limit\": 0,\n    \"CreditAvaliable\": 0\n}"}],"_postman_id":"fcc23cbf-7576-4a5f-9032-ab3e3bb8ccc5"},{"name":"Get Accounts","id":"c945ef60-ddb3-49a5-bdb8-8e9a099769c9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"localhost:9292/v1/accounts/limits","description":"<p>Return all Accounts</p>\n","urlObject":{"port":"9292","path":["v1","accounts","limits"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"0d44803d-bbd9-431f-bfee-62b39d61dfec","name":"No Accounts","originalRequest":{"method":"GET","header":[],"url":"localhost:9292/v1/accounts/limits"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sun, 20 Oct 2019 02:19:00 GMT"},{"key":"Content-Length","value":"33"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"No account avaliable\"\n}"},{"id":"735f3ff7-4688-47bb-8a91-83db26ae8dc3","name":"Get Accounts","originalRequest":{"method":"GET","header":[],"url":"localhost:9292/v1/accounts/limits"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sun, 20 Oct 2019 02:59:40 GMT"},{"key":"Content-Length","value":"210"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"account_id\": 1,\n        \"available_credit_limit\": 2000,\n        \"available_withdrawal_limit\": 3000,\n        \"available_balance\": 500\n    },\n    {\n        \"account_id\": 2,\n        \"available_credit_limit\": 2000,\n        \"available_withdrawal_limit\": 3000,\n        \"available_balance\": 0\n    }\n]"}],"_postman_id":"c945ef60-ddb3-49a5-bdb8-8e9a099769c9"},{"name":"Update Account","id":"91060481-eb61-4525-8442-0a30ebbf480e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"available_credit_limit\": {\n\t\t\"amount\": -200\n\t},\n\t\"available_withdrawal_limit\": {\n\t\t\"amount\": -203.97\n\t}\n}"},"url":"localhost:9292/v1/accounts/8","description":"<p>Receive values to update a existing account</p>\n","urlObject":{"port":"9292","path":["v1","accounts","8"],"host":["localhost"],"query":[{"disabled":true,"key":"id","value":""}],"variable":[]}},"response":[{"id":"30a3c27c-fcf9-4ab6-9bb6-fea13d47d7dd","name":"Account not found","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n\t\"available_credit_limit\": {\n\t\t\"amount\": -200\n\t},\n\t\"available_withdrawal_limit\": {\n\t\t\"amount\": -203.97\n\t}\n}"},"url":{"raw":"localhost:9292/v1/accounts/8","host":["localhost"],"port":"9292","path":["v1","accounts","8"],"query":[{"key":"id","value":"","type":"text","disabled":true}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sun, 20 Oct 2019 02:20:57 GMT"},{"key":"Content-Length","value":"30"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"Account not found\"\n}"},{"id":"341db0f1-c339-48e2-866d-54cc6c7f42fc","name":"Update Account","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n\t\"available_credit_limit\": {\n\t\t\"amount\": -200\n\t},\n\t\"available_withdrawal_limit\": {\n\t\t\"amount\": -203.97\n\t}\n}"},"url":{"raw":"localhost:9292/v1/accounts/2","host":["localhost"],"port":"9292","path":["v1","accounts","2"],"query":[{"key":"id","value":"","type":"text","disabled":true}]}},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sun, 20 Oct 2019 02:20:42 GMT"},{"key":"Content-Length","value":"103"}],"cookie":[],"responseTime":null,"body":"{\n    \"AccountID\": 2,\n    \"available_credit_limit\": 1800,\n    \"available_withdrawal_limit\": 1796.03,\n    \"CreditAvaliable\": 0\n}"}],"_postman_id":"91060481-eb61-4525-8442-0a30ebbf480e"},{"name":"Insert Transaction","id":"c427a8f2-d742-43a4-b5bb-779ee075d1d0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"account_id\": 1,\n\t\"operation_type_id\": 1,\n\t\"amount\": -200.0\n}"},"url":"localhost:9292/v1/transactions","description":"<p>Insert a new transaction</p>\n","urlObject":{"port":"9292","path":["v1","transactions"],"host":["localhost"],"query":[{"disabled":true,"key":"id","value":""}],"variable":[]}},"response":[{"id":"2028f9e6-9854-40a7-a256-8ad159acb4c5","name":"Insert Transaction","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"account_id\": 1,\n\t\"operation_type_id\": 1,\n\t\"amount\": -200.0\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"localhost:9292/v1/transactions","host":["localhost"],"port":"9292","path":["v1","transactions"],"query":[{"key":"id","value":"","type":"text","disabled":true}]}},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sun, 20 Oct 2019 02:47:32 GMT"},{"key":"Content-Length","value":"22"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Created\"\n}"},{"id":"b4ec0783-f6aa-4856-90c7-b576f5733948","name":"Insuficient creditLimit","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"account_id\": 1,\n\t\"operation_type_id\": 1,\n\t\"amount\": -10000.0\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"localhost:9292/v1/transactions","host":["localhost"],"port":"9292","path":["v1","transactions"],"query":[{"key":"id","value":"","type":"text","disabled":true}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sun, 20 Oct 2019 02:53:22 GMT"},{"key":"Content-Length","value":"36"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"Insuficient creditLimit\"\n}"}],"_postman_id":"c427a8f2-d742-43a4-b5bb-779ee075d1d0"},{"name":"Get Account Transactions","id":"510e8094-6fe4-44e2-9bab-a1eb23322ed7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"localhost:9292/v1/transactions/accounts/1","description":"<p>Retrive all transactions of a existing account</p>\n","urlObject":{"port":"9292","path":["v1","transactions","accounts","1"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"91ae4b70-992d-4285-9d49-2d3f7aae89d2","name":"Get Account Transactions","originalRequest":{"method":"GET","header":[],"url":"localhost:9292/v1/transactions/accounts/1"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sun, 20 Oct 2019 02:49:27 GMT"},{"key":"Content-Length","value":"454"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"transaction_id\": 1,\n        \"account_id\": 1,\n        \"operation_type_id\": 1,\n        \"amount\": -200,\n        \"balance\": -200,\n        \"event_date\": \"2019-10-19\"\n    },\n    {\n        \"transaction_id\": 2,\n        \"account_id\": 1,\n        \"operation_type_id\": 1,\n        \"amount\": -300,\n        \"balance\": -300,\n        \"event_date\": \"2019-10-19\"\n    },\n    {\n        \"transaction_id\": 3,\n        \"account_id\": 1,\n        \"operation_type_id\": 3,\n        \"amount\": -300,\n        \"balance\": -300,\n        \"event_date\": \"2019-10-19\"\n    },\n    {\n        \"transaction_id\": 4,\n        \"account_id\": 1,\n        \"operation_type_id\": 2,\n        \"amount\": -200,\n        \"balance\": -200,\n        \"event_date\": \"2019-10-19\"\n    }\n]"},{"id":"e2f199d9-07a8-4347-a92a-96fae33b27f7","name":"Get Account Transactions after payment","originalRequest":{"method":"GET","header":[],"url":"localhost:9292/v1/transactions/accounts/1"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sun, 20 Oct 2019 02:50:07 GMT"},{"key":"Content-Length","value":"555"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"transaction_id\": 1,\n        \"account_id\": 1,\n        \"operation_type_id\": 1,\n        \"amount\": -200,\n        \"balance\": 0,\n        \"event_date\": \"2019-10-19\"\n    },\n    {\n        \"transaction_id\": 2,\n        \"account_id\": 1,\n        \"operation_type_id\": 1,\n        \"amount\": -300,\n        \"balance\": 0,\n        \"event_date\": \"2019-10-19\"\n    },\n    {\n        \"transaction_id\": 3,\n        \"account_id\": 1,\n        \"operation_type_id\": 3,\n        \"amount\": -300,\n        \"balance\": 0,\n        \"event_date\": \"2019-10-19\"\n    },\n    {\n        \"transaction_id\": 4,\n        \"account_id\": 1,\n        \"operation_type_id\": 2,\n        \"amount\": -200,\n        \"balance\": 0,\n        \"event_date\": \"2019-10-19\"\n    },\n    {\n        \"transaction_id\": 5,\n        \"account_id\": 1,\n        \"operation_type_id\": 4,\n        \"amount\": 5000,\n        \"balance\": 4000,\n        \"event_date\": \"2019-10-19\"\n    }\n]"}],"_postman_id":"510e8094-6fe4-44e2-9bab-a1eb23322ed7"},{"name":"Get Transactions","id":"a984d2f5-b689-47d9-9ba5-2f969df88a7c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"localhost:9292/v1/transactions","description":"<p>Get all transactions</p>\n","urlObject":{"port":"9292","path":["v1","transactions"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"c10da65a-a57a-43c4-acb2-6fc77b8f5cb1","name":"Get Transactions","originalRequest":{"method":"GET","header":[],"url":"localhost:9292/v1/transactions"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sun, 20 Oct 2019 02:50:49 GMT"},{"key":"Content-Length","value":"555"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"transaction_id\": 1,\n        \"account_id\": 1,\n        \"operation_type_id\": 1,\n        \"amount\": -200,\n        \"balance\": 0,\n        \"event_date\": \"2019-10-19\"\n    },\n    {\n        \"transaction_id\": 2,\n        \"account_id\": 1,\n        \"operation_type_id\": 1,\n        \"amount\": -300,\n        \"balance\": 0,\n        \"event_date\": \"2019-10-19\"\n    },\n    {\n        \"transaction_id\": 3,\n        \"account_id\": 1,\n        \"operation_type_id\": 3,\n        \"amount\": -300,\n        \"balance\": 0,\n        \"event_date\": \"2019-10-19\"\n    },\n    {\n        \"transaction_id\": 4,\n        \"account_id\": 1,\n        \"operation_type_id\": 2,\n        \"amount\": -200,\n        \"balance\": 0,\n        \"event_date\": \"2019-10-19\"\n    },\n    {\n        \"transaction_id\": 5,\n        \"account_id\": 1,\n        \"operation_type_id\": 4,\n        \"amount\": 5000,\n        \"balance\": 4000,\n        \"event_date\": \"2019-10-19\"\n    }\n]"}],"_postman_id":"a984d2f5-b689-47d9-9ba5-2f969df88a7c"},{"name":"Insert Payments","id":"789fe483-e025-40ff-ba9f-00de8ac7c871","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"[\r\n    {\r\n        \"account_id\": 1,\r\n        \"amount\": 50\r\n    },\r\n   {\r\n        \"account_id\": 1,\r\n        \"amount\": 10\r\n    },\r\n    {\r\n        \"account_id\": 1,\r\n        \"amount\": 20\r\n    },\r\n    {\r\n        \"account_id\": 1,\r\n        \"amount\": 2\r\n    },\r\n    {\r\n        \"account_id\": 1,\r\n        \"amount\": 100\r\n    }\r\n]"},"url":"localhost:9292/v1/payments","description":"<p>Bulk insert payments (transactions of operation_id = 4)</p>\n","urlObject":{"port":"9292","path":["v1","payments"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"18183c29-30d0-4ada-835f-85fc70fd1a71","name":"Insert Payments","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"[\r\n    {\r\n        \"account_id\": 1,\r\n        \"amount\": 50\r\n    },\r\n   {\r\n        \"account_id\": 1,\r\n        \"amount\": 10\r\n    },\r\n    {\r\n        \"account_id\": 1,\r\n        \"amount\": 20\r\n    },\r\n    {\r\n        \"account_id\": 1,\r\n        \"amount\": 2\r\n    },\r\n    {\r\n        \"account_id\": 1,\r\n        \"amount\": 100\r\n    }\r\n]","options":{"raw":{"language":"json"}}},"url":"localhost:9292/v1/payments"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sun, 20 Oct 2019 02:52:56 GMT"},{"key":"Content-Length","value":"22"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Created\"\n}"},{"id":"63f016e0-4a0c-4250-a3e0-6daa0d4d0365","name":"Insert Payments","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"[\r\n    {\r\n        \"account_id\": 1,\r\n        \"amount\": 50\r\n    },\r\n   {\r\n        \"account_id\": 1,\r\n        \"amount\": 10\r\n    },\r\n    {\r\n        \"account_id\": 1,\r\n        \"amount\": 20\r\n    },\r\n    {\r\n        \"account_id\": 1,\r\n        \"amount\": 2\r\n    },\r\n    {\r\n        \"account_id\": 1,\r\n        \"amount\": 100\r\n    }\r\n]","options":{"raw":{"language":"json"}}},"url":"localhost:9292/v1/payments"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sun, 20 Oct 2019 02:59:57 GMT"},{"key":"Content-Length","value":"22"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Created\"\n}"}],"_postman_id":"789fe483-e025-40ff-ba9f-00de8ac7c871"}]}