{"id":26759692,"url":"https://github.com/marceometry/desafio-entrevista-nodejs","last_synced_at":"2025-10-09T12:07:14.842Z","repository":{"id":179208407,"uuid":"663133394","full_name":"Marceometry/desafio-entrevista-nodejs","owner":"Marceometry","description":null,"archived":false,"fork":false,"pushed_at":"2023-07-06T16:24:51.000Z","size":128,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-09T12:07:10.052Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Marceometry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-07-06T16:14:11.000Z","updated_at":"2023-07-06T16:25:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"f99a6878-19a0-4a34-8617-7e347a1ef982","html_url":"https://github.com/Marceometry/desafio-entrevista-nodejs","commit_stats":null,"previous_names":["marceometry/desafio-entrevista-nodejs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Marceometry/desafio-entrevista-nodejs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marceometry%2Fdesafio-entrevista-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marceometry%2Fdesafio-entrevista-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marceometry%2Fdesafio-entrevista-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marceometry%2Fdesafio-entrevista-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Marceometry","download_url":"https://codeload.github.com/Marceometry/desafio-entrevista-nodejs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marceometry%2Fdesafio-entrevista-nodejs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001441,"owners_count":26083078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-28T17:19:45.776Z","updated_at":"2025-10-09T12:07:14.837Z","avatar_url":"https://github.com/Marceometry.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eParking Lot API\u003c/h1\u003e\n\u003cp align=\"center\"\u003eUma API feita com NestJS para controle de estacionamentos.\u003c/p\u003e\n\n## Desafio\n\n[Link](https://github.com/DrConsulta/desafio-entrevista-nodejs) para a descrição do desafio.\n\n## Descrição\n\nAPI construída em cima do framework [NestJS](https://github.com/nestjs/nest), com o objetivo de gerenciar estacionamentos para carros e motos.\n\n## Tecnologias\n\n- [Typescript](https://typescriptlang.org/)\n- [NestJS](https://github.com/nestjs/nest)\n- [TypeORM](https://typeorm.io/)\n- [Swagger](https://swagger.io/)\n\n## Instalação\n\n```bash\n$ yarn install | npm install\n```\n\n## Banco de dados\n\nCrie um arquivo `.env` com os seguintes dados:\n\n```bash\nDB_HOST='your_db_host'\nDB_PORT=your_db_port\nDB_USERNAME='your_db_username'\nDB_PASSWORD='your_db_password'\nDB_DATABASE='your_db_database'\nJWT_SECRET='your_jwt_secret'\n```\n\n## Rodando o app\n\nPorta padrão: `3000`\n\n```bash\n# development\n$ yarn start\n\n# watch mode\n$ yarn start:dev\n\n# production mode\n$ yarn start:prod\n```\n\n## Testes\n\n```bash\n# unit tests\n$ yarn test\n\n# test coverage\n$ yarn test:cov\n```\n\n## Principais rotas\n\n\u003chr /\u003e\n\nGET `/api`\n\nPara ver a documentação de todos os endpoints, basta acessar a interface do Swagger.\n\n\u003chr /\u003e\n\nPOST `/auth/login`\n\nSimula um processo de login e, caso o valor da senha seja `\"1234\"`, retorna um `access_token`.\n\nBody\n\n```bash\n{\n  \"password\": \"1234\"\n}\n```\n\nResponse\n\n```bash\n{\n\t\"access_token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjEsInVzZXJuYW1lIjoidXNlciAxIiwiaWF0IjoxNjg4NjU1NTYxLCJleHAiOjE2ODg3NDE5NjF9.WTyfBXBCjVycPv9UOKKWcT0gC1DwzGBpHnQ3Rz87L8M\"\n}\n```\n\n\u003chr /\u003e\n\nPOST `/enterprise`\n\nCadastra uma empresa (estacionamento).\n\nBody\n\n```bash\n{\n  \"name\": \"Teste\",\n  \"cnpj\": \"00000000000000\",\n  \"phone\": \"99999999999\",\n  \"address\": \"Rua Teste\",\n  \"motorbikeParkingSpots\": 10,\n  \"carParkingSpots\": 5\n}\n```\n\nResponse\n\n```bash\n{\n  \"name\": \"Teste\",\n  \"cnpj\": \"00000000000000\",\n  \"phone\": \"99999999999\",\n  \"address\": \"Rua Teste\",\n  \"motorbikeParkingSpots\": 10,\n  \"carParkingSpots\": 5,\n  \"id\": 1\n}\n```\n\n\u003chr /\u003e\n\nPOST `/vehicle`\n\nCadastra um veículo.\n\nBody\n\n```bash\n{\n  \"brand\": \"Marca teste\",\n  \"model\": \"Modelo teste\",\n  \"color\": \"Branco\",\n  \"plate\": \"aaa1a11\",\n  \"type\": \"car\" // \"car\" | \"motorbike\"\n}\n```\n\nResponse\n\n```bash\n{\n  \"brand\": \"Marca teste\",\n  \"model\": \"Modelo teste\",\n  \"color\": \"Branco\",\n  \"plate\": \"aaa1a11\",\n  \"type\": \"car\",\n  \"id\": 1\n}\n```\n\n\u003chr /\u003e\n\nPOST `/record/entry`\n\nCadastra a entrada de um veículo em um estacionamento.\n\nBody\n\n```bash\n{\n\t\"vehicle\": 1,\n\t\"enterprise\": 1,\n\t\"timestamp\": \"2023-08-02T10:00:05.000Z\"\n}\n```\n\nResponse\n\n```bash\n{\n\t\"vehicle\": 1,\n\t\"enterprise\": 1,\n\t\"entry_timestamp\": \"2023-08-02T10:00:05.000Z\",\n\t\"exit_timestamp\": null,\n\t\"id\": 1\n}\n```\n\n\u003chr /\u003e\n\nPOST `/record/exit`\n\nAdiciona o horário de saída a um registro.\n\nBody\n\n```bash\n{\n\t\"timestamp\": \"2023-08-02T10:15:30.000Z\",\n\t\"id\": 1\n}\n```\n\nResponse\n\n```bash\n{\n\t\"affected\": 1\n}\n```\n\n\u003chr /\u003e\n\nGET `/record/summary`\n\nRetorna o resumo da quantidade de entradas e saídas totais de um estacionamento.\n\nBody\n\n```bash\n{\n\t\"enterpriseId\": 1\n}\n```\n\nResponse\n\n```bash\n{\n\t\"entries\": 10,\n\t\"exits\": 5\n}\n```\n\n\u003chr /\u003e\n\nGET `/record/summary/hour`\n\nRetorna o resumo da quantidade de entradas e saídas de um estacionamento agrupados por hora.\n\nBody\n\n```bash\n{\n\t\"enterpriseId\": 1\n}\n```\n\nResponse\n\n```bash\n[\n\t{\n\t\t\"hour\": \"2023-08-02T04:00:00.000Z\",\n\t\t\"entries\": 4,\n\t\t\"exits\": 1\n\t},\n\t{\n\t\t\"hour\": \"2023-08-02T05:00:00.000Z\",\n\t\t\"entries\": 2,\n\t\t\"exits\": 5\n\t}\n]\n```\n\n\u003chr /\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarceometry%2Fdesafio-entrevista-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarceometry%2Fdesafio-entrevista-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarceometry%2Fdesafio-entrevista-nodejs/lists"}