{"id":19167645,"url":"https://github.com/nnnlik/salary-viewer-service","last_synced_at":"2026-05-06T19:03:51.202Z","repository":{"id":233385095,"uuid":"659434804","full_name":"nnnLik/salary-viewer-service","owner":"nnnLik","description":"This repository contains an implementation of a REST service that allows you to view the current salary and date of the next raise for each","archived":false,"fork":false,"pushed_at":"2023-06-27T20:48:18.000Z","size":93,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-03T23:12:21.551Z","etag":null,"topics":["asyncpg","docker","fastapi","fastapi-users","postgres","pytest"],"latest_commit_sha":null,"homepage":"https://www.linkedin.com/in/makmdvra/","language":"Python","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/nnnLik.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}},"created_at":"2023-06-27T20:40:30.000Z","updated_at":"2023-06-27T20:49:38.000Z","dependencies_parsed_at":"2024-04-16T02:06:00.427Z","dependency_job_id":"3bba967d-98ed-451e-88db-1b322a019c47","html_url":"https://github.com/nnnLik/salary-viewer-service","commit_stats":null,"previous_names":["nnnlik/salary-viewer-service"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nnnLik%2Fsalary-viewer-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nnnLik%2Fsalary-viewer-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nnnLik%2Fsalary-viewer-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nnnLik%2Fsalary-viewer-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nnnLik","download_url":"https://codeload.github.com/nnnLik/salary-viewer-service/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240247636,"owners_count":19771347,"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","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":["asyncpg","docker","fastapi","fastapi-users","postgres","pytest"],"created_at":"2024-11-09T09:38:45.683Z","updated_at":"2026-05-06T19:03:46.181Z","avatar_url":"https://github.com/nnnLik.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# REST service to view the salary and the date of the next raise\nThis repository contains an implementation of a REST service that allows you to view the current salary and date of the next raise for each\n#\n### Technologies.\nThe service is implemented using asynchronous database connections using SQLAlchemy and Asyncpg. Asynchronous pytest is also used to write tests. Registration and authorization is implemented using the [`fastapi_users`](https://fastapi-users.github.io/fastapi-users/12.0/) library.\n#\n### Installation and Startup\n1. Clone the repository:\n    ```sh\n    git clone git@github.com:nnnLik/salary-viewer-service.git\n    ```\n2. Navigate to the project directory:\n    ```sh\n    cd shift-ml-testtask\n    ```\n3. Create .env.db and env.server. You will find the variables in the .env.example file.\n\n4. Run the service and database in Docker with Docker Compose:\n    ```sh\n    docker-compose up --build\n    ```\n5. After a successful start, the service will be available at:\n    ```\n    http://localhost:8888\n    ```\n#\n### API documentation\nDocumentation on the service's API is available at:\n```\nhttp://localhost:8888/docs\n```\n#\n##### __User Registration__\nYou must register a user to access salary information and the date of the next raise. Send a `POST` request to the `/auth/jwt/register` endpoint with the following data in the body of the request:\n```json\n{\n  \"email\": \"example@example.com\",\n  \"password\": \"secret\",\n  \"is_active\": true,\n  \"is_superuser\": false,\n  \"is_verified\": false\n}\n```\n##### __Create post__\nTo create a position, send a `POST` query to the `/position/positions` endpoint. Pass the following data in the body of the request:\n```json\n{\n  \"id\": 1,\n  \"name\": \"front end developer\",\n  \"base_salary\": 600\n}\n```\n##### __Filling in user information__\nAfter successful registration, fill in the user information by sending a `POST` query to endpoint `/employee/info`. In the header of the request specify the authorization token:\n```\nAuthorization: Bearer \u003ctoken\u003e\n```\nPass the following data in the body of the request:\n```json\n{\n  \"first_name\": \"Big\",\n  \"last_name\": \"Dude\",\n  \"birth_year\": 1900,\n  \"position_id\": 1\n}\n```\n##### __Get Salary Information__\nTo get salary information and the date of the next raise, send a `GET` query to the `/employee/salary` endpoint. Specify the authorization token in the header of the request:\n```\nAuthorization: Bearer \u003ctoken\u003e\n```\n\nIn response you will get the following:\n```json\n{\n  \"id\": int,\n  \"first_name\": str,\n  \"last_name\": str,\n  \"birth_year\": int,\n  \"employment_date\": str,\n  \"position\": str,\n  \"employee_id\": str,\n  \"salary\": int,\n  \"next_increase_date\": str,\n  \"days_until_increase\": int.\n}\n```\n#\n### Tests:\n1. To run the test you will need to install all the dependencies:\n    ```sh\n    poetry install\n    ```\n2. To run the Tests:\n    ```sh\n    pytest -vv tests/\n    ```\n\n### TODO:\n* Data fixtures\n* Admin\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnnnlik%2Fsalary-viewer-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnnnlik%2Fsalary-viewer-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnnnlik%2Fsalary-viewer-service/lists"}