Files

126 lines
2.2 KiB
Markdown
Raw Permalink Normal View History

2026-07-14 10:43:46 +05:30
# AeroResolve Backend
2026-08-03 14:26:19 +05:30
test1
2026-07-14 10:43:46 +05:30
NestJS REST API for AeroResolve.
2026-07-06 13:16:46 +05:30
2026-07-14 10:43:46 +05:30
## Current Modules
2026-07-06 13:16:46 +05:30
2026-08-03 14:26:19 +05:30
| Module | Status | Description |
| ------------- | ----------- | ---------------------------------------- |
| `health` | Implemented | Health check |
| `database` | Implemented | PostgreSQL / TypeORM setup |
2026-07-14 10:43:46 +05:30
| `master-data` | Implemented | CRUD and seed data for lookup categories |
2026-08-03 14:26:19 +05:30
| `cohort` | Implemented | Cohort CRUD, pagination, status update |
2026-07-14 10:43:46 +05:30
## Prerequisites
- Node.js 18+
- npm
2026-07-14 10:43:46 +05:30
- PostgreSQL
2026-07-06 13:16:46 +05:30
2026-07-14 10:43:46 +05:30
## Install
```bash
2026-07-14 10:43:46 +05:30
npm install
2026-07-06 13:16:46 +05:30
```
2026-07-14 10:43:46 +05:30
## Environment Files
2026-07-14 10:43:46 +05:30
The app loads environment files based on `NODE_ENV`:
```text
.env.local
.env.dev
.env.test
.env.uat
```
Required values:
```text
PORT=3001
CORS_ORIGIN=http://localhost:5174
DB_HOST=localhost
DB_PORT=5432
DB_USER=<postgres-user>
DB_PASSWORD=<postgres-password>
DB_NAME=<database-name>
DB_SYNCHRONIZE=true
DB_SSL=false
```
## Run
```bash
# Local
npm run local
npm run start:local
# Dev
npm run dev
npm run start:dev
# UAT
npm run uat
npm run start:uat
```
## API
Base URL:
```text
http://localhost:3001/api
```
Swagger:
```text
http://localhost:3001/docs
```
## Endpoints
2026-08-03 14:26:19 +05:30
| Method | Path |
| -------- | -------------------------------- |
| `GET` | `/api/health` |
| `GET` | `/api/master-data/:category` |
| `POST` | `/api/master-data/:category` |
| `GET` | `/api/master-data/:category/:id` |
| `PUT` | `/api/master-data/:category/:id` |
2026-07-14 10:43:46 +05:30
| `DELETE` | `/api/master-data/:category/:id` |
2026-08-03 14:26:19 +05:30
| `GET` | `/api/cohorts?page=1&limit=10` |
| `POST` | `/api/cohorts` |
| `GET` | `/api/cohorts/:id` |
| `PUT` | `/api/cohorts/:id` |
| `PATCH` | `/api/cohorts/:id/status` |
| `DELETE` | `/api/cohorts/:id` |
2026-07-14 10:43:46 +05:30
## Seed Master Data
```bash
npm run seed:local
npm run seed:dev
npm run seed:test
2026-07-14 10:43:46 +05:30
npm run seed:uat
```
2026-07-14 10:43:46 +05:30
Seeded categories:
- `MEMBERSHIP_TIER`
- `CUSTOMER_VALUE`
- `REGION`
- `TRIP_PURPOSE`
- `CABIN_CLASS`
- `PASSENGER_TYPE`
- `ANCILLARY_PURCHASE`
- `REVENUE_SEGMENT`
## Planned Next
- Tenant foundation
- Auth / RBAC
- Audit logging
- Policy / regulation engine backend
- Compensation engine