{"info":{"_postman_id":"e7dec8b6-f61b-4de7-b28c-0ba4195bf96f","name":"Practice","description":"<html><head></head><body><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-sql\">-- Project created for practice publishing a \n-- Spring-boot Application with Java 17, docker and docker-compose \n-- DDL\ncreate table if not exists users\n(\n    id       bigserial\n        primary key,\n    cpf      varchar(11) not null\n        constraint uk_cpf\n            unique,\n    email    varchar(255) not null\n        constraint uk_email\n            unique,\n    password varchar(255) not null,\n    username varchar(255) not null\n);\n\nalter table users\n    owner to pgadmin;\n\ncreate table if not exists account\n(\n    id      bigserial\n        primary key,\n    number  integer        not null\n        constraint uk_number\n            unique,\n    balance numeric(38, 2) not null,\n    digit   integer        not null,\n    user_id bigint\n        constraint fk_user_id\n            references users\n);\n\nalter table account\n    owner to pgadmin;\n\ncreate table if not exists transactions\n(\n    id         bigserial\n        primary key,\n    amount     numeric(38, 2) not null,\n    date       timestamp(6)   not null,\n    message    varchar(255)   not null,\n    type       smallint       not null,\n    account_id bigint         not null\n        constraint fk_account_id\n            references account\n);\n\nalter table transactions\n    owner to pgadmin;\n\ncreate table if not exists transaction_request\n(\n    id                  bigserial         not null\n        primary key,\n    amount              numeric(38, 2) not null,\n    completed_at        timestamp(6)   not null,\n    initiated_at        timestamp(6)   not null,\n    status              smallint       not null,\n    from_transaction_id bigint\n        constraint fk_from_transaction_id\n            references transactions,\n    to_transaction_id   bigint\n        constraint fk_to_transaction_id\n            references transactions\n);\n\nalter table transaction_request\n    owner to pgadmin;\n\n------------------------------------ # Sequences -----------------------------------\n\ncreate sequence transfer.account_id_seq;\n\nalter sequence transfer.account_id_seq owner to pgadmin;\n\nalter sequence transfer.account_id_seq owned by transfer.account.id;\n\ncreate sequence transfer.transactions_id_seq;\n\nalter sequence transfer.transactions_id_seq owner to pgadmin;\n\nalter sequence transfer.transactions_id_seq owned by transfer.transactions.id;\n\ncreate sequence transfer.users_id_seq;\n\nalter sequence transfer.users_id_seq owner to pgadmin;\n\nalter sequence transfer.users_id_seq owned by transfer.users.id;\n\ncreate sequence transfer.transaction_request_id_seq;\n\nalter sequence transfer.transaction_request_id_seq owner to pgadmin;\n\nalter sequence transfer.transaction_request_id_seq owned by transfer.transaction_request.id;\n\n</code></pre>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"2634814","collectionId":"e7dec8b6-f61b-4de7-b28c-0ba4195bf96f","publishedId":"2s8ZDbVfQh","public":true,"customColor":{"top-bar":"303030","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2023-01-24T03:27:28.000Z"},"item":[{"name":"Java Transfer Api","item":[{"name":"User","item":[{"name":"Create User","id":"d0c9701d-e36a-4be9-8313-4430ec33541c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"id\": \"\", \r\n    \"username\": \"Germano\",\r\n    \"password\": \"password\",\r\n    \"cpf\": \"47787476311\",\r\n    \"email\": \"germano.germano@email.com\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:8080/api/users","urlObject":{"protocol":"http","port":"8080","path":["api","users"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"d0c9701d-e36a-4be9-8313-4430ec33541c"},{"name":"Get User by Id","id":"2e8f8b4f-266c-4925-aceb-cb981bcadb8d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:8080/api/users/1","urlObject":{"protocol":"http","port":"8080","path":["api","users","1"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"2e8f8b4f-266c-4925-aceb-cb981bcadb8d"},{"name":"Delete User","id":"3de4d049-e14a-4ba0-bb69-c630160638a0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"http://localhost:8080/api/users/5","urlObject":{"protocol":"http","port":"8080","path":["api","users","5"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"3de4d049-e14a-4ba0-bb69-c630160638a0"},{"name":"Get All Users","id":"fa37118b-8e8e-423e-aebd-325fbe8a5778","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:8080/api/users","urlObject":{"protocol":"http","port":"8080","path":["api","users"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"fa37118b-8e8e-423e-aebd-325fbe8a5778"},{"name":"Update User","id":"88dbf8d5-1d70-403f-9b0a-2fbc4e4e7ecf","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n   \r\n        \"id\": 2,\r\n        \"username\": \"Philipe\",\r\n        \"cpf\": \"03896097149\",\r\n        \"password\": \"password2\",\r\n        \"email\": \"philipe.germano@email.com\"\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:8080/api/users/2","urlObject":{"protocol":"http","port":"8080","path":["api","users","2"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"88dbf8d5-1d70-403f-9b0a-2fbc4e4e7ecf"}],"id":"938a3322-a186-451f-ac79-f836ee932c27","_postman_id":"938a3322-a186-451f-ac79-f836ee932c27","description":""},{"name":"Account","item":[{"name":"Create Account","id":"f08d1809-8f2a-46dc-9dc7-b79bc9a98cf2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":" {\r\n    \"id\": 3,\r\n    \"accountNumber\": 588313,\r\n    \"digit\": 0,\r\n    \"balance\": 1200.00,\r\n    \"user\": {\r\n        \"id\": 3\r\n    }           \r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:8080/api/accounts","urlObject":{"protocol":"http","port":"8080","path":["api","accounts"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"f08d1809-8f2a-46dc-9dc7-b79bc9a98cf2"},{"name":"Get Account by Id","id":"86ac8844-c5c4-4698-bae0-463c50f6a9ff","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:8080/api/accounts/3","urlObject":{"protocol":"http","port":"8080","path":["api","accounts","3"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"86ac8844-c5c4-4698-bae0-463c50f6a9ff"},{"name":"Delete Account","id":"8550cddc-b082-4db8-93ae-81aa69dc7de5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"http://localhost:8080/api/accounts/1","urlObject":{"protocol":"http","port":"8080","path":["api","accounts","1"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"8550cddc-b082-4db8-93ae-81aa69dc7de5"},{"name":"Update Accouunt","id":"c59e7425-d7d6-4564-8b7e-6d828a244a6f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"id\": 1,\r\n   \r\n    \"balance\": 1000.00,\r\n    \"user\": {\r\n        \"id\": 1\r\n    } \r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:8080/api/accounts/1","urlObject":{"protocol":"http","port":"8080","path":["api","accounts","1"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"c59e7425-d7d6-4564-8b7e-6d828a244a6f"}],"id":"9de89685-0103-44c1-b358-cc977b500b2f","_postman_id":"9de89685-0103-44c1-b358-cc977b500b2f","description":""},{"name":"Transaction","item":[{"name":"Transfer","id":"f27294d5-da9f-4aa8-b17c-68035d965a6c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n       \"id\": null,\r\n       \"fromTransaction\": {\r\n            \"id\": null,\r\n            \"account\": {\r\n                \"id\": 1\r\n            }\r\n        },\r\n       \"toTransaction\":  {\r\n            \"id\": null,\r\n            \"account\": {\r\n                \"id\": 2\r\n            }\r\n        },\r\n       \"amount\": 100.00\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:8080/api/transactions/transfer","urlObject":{"protocol":"http","port":"8080","path":["api","transactions","transfer"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"f27294d5-da9f-4aa8-b17c-68035d965a6c"},{"name":"Get User Extract by Account","id":"18954cae-a39c-4d83-ba14-c97d8e5d5dee","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:8080/api/transactions/extract/1","urlObject":{"protocol":"http","port":"8080","path":["api","transactions","extract","1"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"18954cae-a39c-4d83-ba14-c97d8e5d5dee"}],"id":"81e20d0b-b7fd-4313-994b-d490253a336b","_postman_id":"81e20d0b-b7fd-4313-994b-d490253a336b","description":""}],"id":"cda4b74b-5651-461b-a4a7-c4f8a47a8744","_postman_id":"cda4b74b-5651-461b-a4a7-c4f8a47a8744","description":""}],"event":[{"listen":"prerequest","script":{"id":"5a5fb4d3-70ce-49a9-8650-97002d8843cd","type":"text/javascript","exec":["postman.setEnvironmentVariable('isoTime',(new Date()).toISOString());"]}},{"listen":"test","script":{"id":"63f9e05d-67b8-45c6-a6ec-76707421e8a8","type":"text/javascript","exec":[""]}}]}