# Employee API Employee management service for XTransit. Handles employee onboarding and records. ## Setup ### Environment Variables ```env PG_HOST=localhost PG_PORT=5432 PG_USER=your_user PG_PASS=your_password PG_DB=your_database PORT=4000 ERROR_LOG_API_URL=https://error.xtransit.testinstance.nl/error_log ``` ### Start API ```bash npm start ``` Runs at `https://employees.xtransit.testinstance.nl` ## API Endpoints **POST** `/createemployee` - Body: `{ "firstname": "John", "lastname": "Doe", "job": "driver", "password": "secret" }` - Creates employee in `workers.employees` and user in `workers.users` - Returns: `{ "employee": "John", "code": "1234" }` **GET** `/health` - Returns: `{ "endpoint": "reachable", "database": "ok" }` or 503 if DB down ## Database Uses `workers.employees` (id, firstname, lastname, job) and `workers.users` (id, employee, password, usercode)