# Product Requirements Document: Nepal Airline Management System

## 1. Overview

The Nepal Airline Management System is a lightweight web application designed to manage domestic flight operations for airlines operating within Nepal. The system enables airline staff to manage aircraft, flight schedules, routes, bookings, and passenger information across Nepal's major airports. This streamlined solution focuses on core operational needs without authentication complexity, providing approximately 10 pages of essential airline management functionality.

## 2. User Roles

### Airline Administrator
- Full access to all system features
- Manage aircraft fleet (add, edit, delete aircraft)
- Create and modify flight schedules
- Manage routes and airports
- View all bookings and passenger manifests
- Generate reports on flight occupancy and revenue
- Configure pricing and seat availability

### Booking Agent
- Search and view available flights
- Create new bookings for passengers
- Modify existing bookings
- Cancel bookings and process refunds
- View passenger information
- Check flight status and availability
- Print boarding passes and tickets

### Operations Staff
- View flight schedules
- Update flight status (on-time, delayed, cancelled)
- View passenger manifests
- Check aircraft assignments
- Monitor daily operations dashboard

## 3. Core Entities

### Aircraft
Represents physical airplanes in the fleet with registration details, capacity, and operational status.

### Airport
Nepal's domestic airports with codes, names, locations, and operational information.

### Route
Flight paths between two airports with distance and estimated flight duration.

### Flight Schedule
Recurring or one-time flight definitions with route, aircraft, departure/arrival times, and pricing.

### Flight Instance
Specific occurrence of a flight schedule on a particular date with real-time status.

### Booking
Reservation record linking passengers to specific flight instances with payment and status information.

### Passenger
Individual traveler information including name, contact details, and identification.

### Seat Assignment
Links passengers to specific seats on flight instances.

### Pricing Tier
Different fare classes (Economy, Business) with associated prices and benefits.

### Payment
Financial transaction records for bookings including amount, method, and status.

## 4. Entity Relationships

### One-to-Many Relationships

- **Aircraft → Flight Schedules**: One aircraft can be assigned to multiple flight schedules
- **Aircraft → Flight Instances**: One aircraft operates multiple flight instances
- **Airport → Routes (as origin)**: One airport serves as origin for multiple routes
- **Airport → Routes (as destination)**: One airport serves as destination for multiple routes
- **Route → Flight Schedules**: One route can have multiple scheduled flights
- **Flight Schedule → Flight Instances**: One schedule generates multiple instances (daily/weekly)
- **Flight Instance → Bookings**: One flight instance can have multiple bookings
- **Flight Instance → Seat Assignments**: One flight instance has multiple seat assignments
- **Booking → Passengers**: One booking can include multiple passengers (group booking)
- **Booking → Payments**: One booking can have multiple payment transactions
- **Passenger → Seat Assignments**: One passenger can have multiple seat assignments (different flights)
- **Pricing Tier → Bookings**: One pricing tier applies to multiple bookings

### Many-to-One Relationships

- **Flight Schedule → Route**: Many schedules can use the same route
- **Flight Schedule → Aircraft**: Many schedules can be assigned to the same aircraft
- **Flight Instance → Flight Schedule**: Many instances belong to one schedule
- **Booking → Flight Instance**: Many bookings for one flight instance
- **Seat Assignment → Passenger**: Many assignments can belong to one passenger (return trips)
- **Seat Assignment → Flight Instance**: Many seat assignments per flight instance

### Many-to-Many Relationships

- **Passenger ↔ Flight Instance** (through Booking): Passengers can book multiple flights; flights have multiple passengers

## 5. Key Workflows

### Workflow 1: Flight Schedule Creation

1. Administrator navigates to Flight Schedules page
2. Clicks "Create New Schedule" button
3. Selects route from dropdown (origin → destination airport)
4. Selects aircraft from available fleet
5. Sets departure time and arrival time
6. Defines recurrence pattern (daily, specific days of week, one-time)
7. Sets effective date range (start date, end date)
8. Configures pricing for each tier (Economy, Business)
9. Sets total available seats per tier
10. Saves schedule
11. System automatically generates flight instances based on recurrence pattern
12. Confirmation message displayed with schedule details

### Workflow 2: Passenger Booking Process

1. Booking Agent navigates to Search Flights page
2. Enters search criteria (origin, destination, travel date, number of passengers)
3. System displays available flight instances with pricing and seat availability
4. Agent selects desired flight
5. Agent clicks "Book Flight" button
6. System navigates to passenger information form
7. Agent enters details for each passenger (name, age, gender, contact, ID number)
8. Agent selects pricing tier for each passenger
9. Agent selects seats from available seat map
10. System calculates total fare
11. Agent reviews booking summary
12. Agent selects payment method and enters payment details
13. Agent confirms booking
14. System creates booking record, passenger records, seat assignments, and payment record
15. System generates booking reference number
16. System displays confirmation page with booking details and option to print ticket

### Workflow 3: Flight Status Update

1. Operations Staff navigates to Daily Operations Dashboard
2. Views list of all flights for current date
3. Selects specific flight instance to update
4. Views current status and details
5. Clicks "Update Status" button
6. Selects new status from dropdown (Scheduled, Boarding, Departed, In-Flight, Landed, Delayed, Cancelled)
7. If delayed, enters new estimated departure/arrival time
8. If cancelled, enters cancellation reason
9. Adds optional notes
10. Saves status update
11. System timestamps the update
12. System updates flight instance record
13. Updated status visible on dashboard and passenger-facing displays

### Workflow 4: Booking Modification

1. Booking Agent navigates to Manage Bookings page
2. Searches for booking by reference number, passenger name, or flight details
3. System displays booking details
4. Agent clicks "Modify Booking" button
5. Agent can change:
   - Flight instance (subject to availability)
   - Passenger details
   - Seat assignments
   - Pricing tier (with fare difference calculation)
6. System recalculates total fare
7. If fare increases, agent processes additional payment
8. If fare decreases, system records refund amount
9. Agent confirms modifications
10. System updates booking, creates new payment/refund record
11. System displays updated booking confirmation

### Workflow 5: Aircraft Fleet Management

1. Administrator navigates to Aircraft Fleet page
2. Views list of all aircraft with status indicators
3. To add new aircraft:
   - Clicks "Add Aircraft" button
   - Enters registration number, model, manufacturer
   - Enters total seat capacity and configuration (Economy/Business split)
   - Sets operational status (Active, Maintenance, Retired)
   - Uploads optional aircraft image
   - Saves aircraft record
4. To edit existing aircraft:
   - Clicks edit icon on aircraft row
   - Modifies editable fields
   - Saves changes
5. To deactivate aircraft:
   - Clicks status toggle
   - System checks for future flight assignments
   - If assigned, displays warning and list of affected flights
   - Administrator confirms or cancels action
6. System updates aircraft records and reflects changes across all related schedules

### Workflow 6: Revenue and Occupancy Reporting

1. Administrator navigates to Reports page
2. Selects report type (Revenue Report or Occupancy Report)
3. Sets date range filter
4. Optionally filters by route, aircraft, or pricing tier
5. Clicks "Generate Report" button
6. System aggregates data:
   - For Revenue: total bookings, total revenue, revenue by tier, payment methods
   - For Occupancy: total seats, booked seats, occupancy percentage, by flight/route
7. System displays report with summary statistics and detailed breakdown
8. System renders charts/graphs for visual representation
9. Administrator can export report to PDF or CSV
10. Administrator can print report directly from browser

## 6. Features & Requirements

### Module: Dashboard

**F-DASH-001: Operations Dashboard**
- Display current date and time
- Show summary cards: total flights today, active aircraft, total bookings today, revenue today
- List all flight instances for current date in table format
- Display columns: flight number, route, aircraft, departure time, arrival time, status, booked seats/total seats
- Provide quick status update action on each row
- Auto-refresh data every 60 seconds
- Filter flights by status (All, Scheduled, Delayed, Cancelled)
- Search flights by flight number or route

**F-DASH-002: Quick Actions Panel**
- Provide shortcut buttons to: Create Booking, Add Flight Schedule, Update Flight Status, View Reports
- Display recent activity feed (last 10 actions taken in system)

### Module: Aircraft Management

**F-ACFT-001: Aircraft List View**
- Display all aircraft in paginated table (10 per page)
- Show columns: registration number, model, manufacturer, total seats, status, actions
- Implement search by registration number or model
- Filter by status (All, Active, Maintenance, Retired)
- Sort by any column

**F-ACFT-002: Add Aircraft**
- Form fields: registration number (required), model (required), manufacturer (required), total seats (required, number), economy seats (required, number), business seats (required, number), status (dropdown), notes (textarea)
- Validate that economy + business seats = total seats
- Validate registration number is unique
- Display success message on save
- Redirect to aircraft list after save

**F-ACFT-003: Edit Aircraft**
- Load existing aircraft data into form
- Allow modification of all fields except registration number
- Validate seat calculations
- Display warning if aircraft has future flight assignments
- Save changes and show confirmation

**F-ACFT-004: View Aircraft Details**
- Display all aircraft information in read-only view
- Show list of upcoming flight schedules using this aircraft
- Show maintenance history (if status was set to Maintenance)
- Display aircraft utilization statistics (flights per month, average occupancy)

### Module: Airport Management

**F-ARPT-001: Airport List View**
- Display all Nepal airports in table format
- Show columns: airport code (IATA), airport name, city, status (Active/Inactive), actions
- Implement search by code, name, or city
- Sort by any column

**F-ARPT-002: Add Airport**
- Form fields: airport code (required, 3 characters), airport name (required), city (required), elevation (number), status (dropdown)
- Validate airport code is unique and uppercase
- Save and redirect to airport list

**F-ARPT-003: Edit Airport**
- Load existing airport data
- Allow modification of all fields except airport code
- Save changes with confirmation

**F-ARPT-004: Airport Details**
- Display airport information
- Show list of routes originating from this airport
- Show list of routes terminating at this airport
- Display statistics: total flights per week, busiest days

### Module: Route Management

**F-ROUT-001: Route List View**
- Display all routes in table format
- Show columns: route code, origin airport, destination airport, distance (km), duration (minutes), active schedules count, actions
- Search by route code or airport names
- Filter by origin or destination airport

**F-ROUT-002: Add Route**
- Form fields: origin airport (dropdown), destination airport (dropdown), distance (required, number), estimated duration (required, number in minutes)
- Validate origin ≠ destination
- Auto-generate route code (e.g., KTM-PKR)
- Validate route doesn't already exist
- Save and redirect to route list

**F-ROUT-003: Edit Route**
- Load existing route data
- Allow modification of distance and duration
- Cannot change origin/destination if active schedules exist
- Save with confirmation

**F-ROUT-004: Route Details**
- Display route information with map visualization (optional)
- Show all flight schedules on this route
- Display route statistics: average occupancy, total flights per week, revenue

### Module: Flight Schedule Management

**F-SCHED-001: Flight Schedule List View**
- Display all flight schedules in paginated table
- Show columns: flight number, route, aircraft, departure time, arrival time, frequency, effective dates, status, actions
- Filter by route, aircraft, status (Active/Inactive)
- Search by flight number
- Sort by any column

**F-SCHED-002: Create Flight Schedule**
- Form fields:
  - Flight number (required, unique, format: airline code + number)
  - Route (dropdown, required)
  - Aircraft (dropdown, required, only active aircraft)
  - Departure time (time picker, required)
  - Arrival time (time picker, required)
  - Recurrence pattern (dropdown: Daily, Specific Days, One-time)
  - If Specific Days: checkboxes for days of week
  - Effective start date (date picker, required)
  - Effective end date (date picker, required for recurring)
  - Economy price (number, required)
  - Business price (number, required)
  - Economy seats available (number, required, max = aircraft economy capacity)
  - Business seats available (number, required, max = aircraft business capacity)
- Validate arrival time > departure time
- Validate end date > start date
- Validate seat availability doesn't exceed aircraft capacity
- On save, generate flight instances based on recurrence pattern
- Display confirmation with count of instances created

**F-SCHED-003: Edit Flight Schedule**
- Load existing schedule data
- Allow modification of times, pricing, seat availability
- Warn if changes affect future flight instances
- Option to apply changes to: only future instances, or all instances
- Save with confirmation

**F-SCHED-004: Deactivate Flight Schedule**
- Mark schedule as inactive
- Prevent new flight instances from being generated
- Existing future instances remain unless explicitly cancelled
- Confirmation dialog before deactivation

**F-SCHED-005: View Schedule Details**
- Display all schedule information
- Show list of upcoming flight instances (next 30 days)
- Display schedule performance metrics: average occupancy, total revenue, cancellation rate

### Module: Flight Instance Management

**F-INST-001: Flight Instance List View**
- Display flight instances with date range filter (default: today ± 7 days)
- Show columns: flight number, date, route, aircraft, departure time, arrival time, status, booked/total seats, actions
- Filter by status, route, aircraft
- Search by flight number
- Color-code rows by status (green=on-time, yellow=delayed, red=cancelled)

**F-INST-002: Update Flight Status**
- Modal or inline form to update status
- Status dropdown: Scheduled, Boarding, Departed, In-Flight, Landed, Delayed, Cancelled
- If Delayed: fields for new departure time, new arrival time, delay reason
- If Cancelled: field for cancellation reason
- Notes field (optional)
- Save with timestamp
- Display confirmation

**F-INST-003: View Flight Instance Details**
- Display all flight information
- Show passenger manifest table: passenger name, seat number, pricing tier, booking reference
- Display seat map with booked/available seats
- Show booking statistics: total passengers, total revenue, occupancy percentage
- Option to print passenger manifest

**F-INST-004: Cancel Flight Instance**
- Confirmation dialog with impact warning (number of affected bookings)
- Require cancellation reason
- On confirm, mark flight as cancelled
- Mark all associated bookings as cancelled
- Display confirmation with affected booking count

### Module: Booking Management

**F-BOOK-001: Search Flights**
- Search form fields:
  - Origin airport (dropdown, required)
  - Destination airport (dropdown, required)
  - Travel date (date picker, required)
  - Number of passengers (number, default 1, max 9)
  - Pricing tier preference (dropdown: Any, Economy, Business)
- Search button triggers query
- Display results in card or table format
- Show for each flight: flight number, departure time, arrival time, duration, available seats by tier, price per tier
- "Book" button on each result

**F-BOOK-002: Create Booking**
- Triggered from search results or direct entry
- Step 1: Flight Selection (if from search, pre-filled)
  - Select flight instance
  - Select number of passengers
- Step 2: Passenger Information
  - For each passenger: first name (required), last name (required), age (required), gender (dropdown), contact number (required for primary passenger), ID type (dropdown: Citizenship, Passport, License), ID number (required)
  - Primary passenger checkbox (first passenger default)
- Step 3: Seat Selection
  - Display seat map of aircraft
  - Show available/booked/selected seats with color coding
  - Allow selection of seats equal to passenger count
  - Validate seats are available
- Step 4: Pricing and Payment
  - Select pricing tier for each passenger
  - Display fare breakdown: base fare per passenger, taxes/fees, total
  - Payment method (dropdown: Cash, Card, Bank Transfer)
  - If Card: card number, expiry, CVV fields
  - If Bank Transfer: transaction reference field
- Step 5: Review and Confirm
  - Display complete booking summary
  - Terms and conditions checkbox
  - Confirm button
- On confirm:
  - Create booking record with unique reference number
  - Create passenger records
  - Create seat assignments
  - Create payment record
  - Display confirmation page with booking reference and details
  - Option to print ticket/boarding pass

**F-BOOK-003: Booking List View**
- Display all bookings in paginated table
- Show columns: booking reference, passenger name(s), flight number, date, route, status, total amount, actions
- Search by booking reference, passenger name, flight number
- Filter by status (Confirmed, Cancelled, Completed), date range, route
- Sort by any column

**F-BOOK-004: View Booking Details**
- Display complete booking information
- Show all passengers with seat assignments
- Display flight details
- Show payment information
- Display booking status and history
- Actions: Modify Booking, Cancel Booking, Print Ticket

**F-BOOK-005: Modify Booking**
- Allow changes to:
  - Flight instance (show available alternatives)
  - Passenger details (name, contact, ID)
  - Seat assignments (show seat map)
  - Pricing tier (calculate fare difference)
- Calculate new total fare
- If fare increases: process additional payment
- If fare decreases: record refund amount
- Update booking record
- Display updated confirmation

**F-BOOK-006: Cancel Booking**
- Confirmation dialog with cancellation policy
- Calculate refund amount based on cancellation time before departure
- Require cancellation reason
- On confirm:
  - Mark booking as cancelled
  - Release seat assignments
  - Create refund payment record
  - Update flight instance availability
- Display cancellation confirmation with refund details

**F-BOOK-007: Print Ticket/Boarding Pass**
- Generate printable document with:
  - Booking reference and barcode
  - Passenger name(s)
  - Flight details (number, date, route, times)
  - Seat assignments
  - Gate information (if available)
  - Boarding time
  - Terms and conditions
- Print-friendly CSS styling
- Option to download as PDF

### Module: Passenger Management

**F-PASS-001: Passenger List View**
- Display all passengers in paginated table
- Show columns: name, contact number, ID type, ID number, total bookings, last flight date, actions
- Search by name, contact number, ID number
- Sort by any column

**F-PASS-002: View Passenger Details**
- Display passenger information
- Show booking history with all past and upcoming flights
- Display passenger statistics: total flights, total spent, frequent routes
- Option to create new booking for this passenger

**F-PASS-003: Edit Passenger Information**
- Allow modification of contact details and ID information
- Validate changes
- Update passenger record
- Reflect changes in all future bookings

### Module: Reporting

**F-REPT-001: Revenue Report**
- Date range selector (default: current month)
- Filter options: route, aircraft, pricing tier
- Display metrics:
  - Total revenue
  - Revenue by pricing tier
  - Revenue by route
  - Revenue by payment method
  - Average booking value
  - Daily revenue trend (chart)
- Detailed transaction table
- Export to CSV/PDF
- Print functionality

**F-REPT-002: Occupancy Report**
- Date range selector
- Filter options: route, aircraft
- Display metrics:
  - Overall occupancy percentage
  - Occupancy by route
  - Occupancy by aircraft
  - Occupancy by day of week
  - Occupancy trend (chart)
  - Load factor by flight
- Detailed flight instance table with occupancy data
- Export to CSV/PDF
- Print functionality

**F-REPT-003: Flight Performance Report**
- Date range selector
- Display metrics:
  - Total flights operated
  - On-time performance percentage
  - Average delay time
  - Cancellation rate
  - Cancellation reasons breakdown
  - Performance by route
  - Performance by aircraft
- Charts for visual representation
- Export to CSV/PDF

**F-REPT-004: Booking Analytics**
- Date range selector
- Display metrics:
  - Total bookings
  - Booking conversion rate (searches to bookings)
  - Average booking lead time
  - Cancellation rate
  - Popular routes
  - Peak booking times
  - Passenger demographics (age distribution, gender)
- Charts and graphs
- Export to CSV/PDF

### Module: Settings & Configuration

**F-SETT-001: Pricing Tier Configuration**
- List all pricing tiers (Economy, Business)
- Edit tier names and descriptions
- Set default pricing multipliers
- Configure baggage allowances per tier
- Configure cancellation policies per tier

**F-SETT-002: System Configuration**
- Set airline name and code
- Configure booking reference format
- Set default currency (NPR)
- Configure tax rates and fees
- Set cancellation policy rules (refund percentages by time before departure)
- Configure seat map layout templates

**F-SETT-003: Airport Configuration**
- Manage list of active airports
- Set default airports for search
- Configure airport-specific fees

## 7. Business Rules

### Aircraft Rules

**BR-ACFT-001**: Aircraft registration number must be unique across the system.

**BR-ACFT-002**: Total seats must equal the sum of economy seats and business seats.

**BR-ACFT-003**: Aircraft with status "Maintenance" or "Retired" cannot be assigned to new flight schedules.

**BR-ACFT-004**: Aircraft cannot be deleted if it has future flight instances assigned.

**BR-ACFT-005**: Minimum total seats per aircraft: 10. Maximum: 500.

### Airport Rules

**BR-ARPT-001**: Airport code must be exactly 3 uppercase letters and unique.

**BR-ARPT-002**: Airport cannot be deleted if it's part of any active route.

**BR-ARPT-003**: At least 2 airports must exist in the system to create routes.

### Route Rules

**BR-ROUT-001**: Origin and destination airports must be different.

**BR-ROUT-002**: A route between the same two airports (regardless of direction) can only exist once per direction.

**BR-ROUT-003**: Distance must be greater than 0 and less than 2000 km (Nepal domestic flights).

**BR-ROUT-004**: Estimated duration must be between 15 minutes and 180 minutes.

**BR-ROUT-005**: Route cannot be deleted if it has active flight schedules.

### Flight Schedule Rules

**BR-SCHED-001**: Flight number must be unique across all active schedules.

**BR-SCHED-002**: Arrival time must be after departure time.

**BR-SCHED-003**: Effective end date must be after effective start date.

**BR-SCHED-004**: Economy seats available cannot exceed aircraft economy capacity.

**BR-SCHED-005**: Business seats available cannot exceed aircraft business capacity.

**BR-SCHED-006**: Business price must be greater than economy price.

**BR-SCHED-007**: Minimum price per seat: NPR 1000. Maximum: NPR 50000.

**BR-SCHED-008**: For recurring schedules, at least one day of the week must be selected.

**BR-SCHED-009**: Flight instances are auto-generated up to 90 days in advance.

**BR-SCHED-010**: Schedule cannot be deleted if it has future flight instances with bookings.

### Flight Instance Rules

**BR-INST-001**: Flight instance date must be within the schedule's effective date range.

**BR-INST-002**: Flight status can only transition in logical order: Scheduled → Boarding → Departed → In-Flight → Landed.

**BR-INST-003**: Delayed status can be set at any time before Departed.

**BR-INST-004**: Cancelled status can only be set before Departed.

**BR-INST-005**: Flight instance cannot be deleted if it has any bookings.

**BR-INST-006**: Flight instance date must be in the future or today (cannot create instances in the past).

### Booking Rules

**BR-BOOK-001**: Booking reference number must be unique and auto-generated (format: 6 alphanumeric characters).

**BR-BOOK-002**: Bookings can only be created for flight instances with status "Scheduled" or "Delayed".

**BR-BOOK-003**: Number of passengers in a booking cannot exceed available seats on the flight.

**BR-BOOK-004**: Maximum passengers per booking: 9.

**BR-BOOK-005**: At least one passenger must be designated as primary contact.

**BR-BOOK-006**: Seat assignments must be unique per flight instance (no double-booking).

**BR-BOOK-007**: Seat number must exist in the aircraft's seat configuration.

**BR-BOOK-008**: Booking cannot be created for flights departing in less than 1 hour.

**BR-BOOK-009**: Booking can be modified up to 2 hours before departure.

**BR-BOOK-010**: Booking cancellation refund policy:
- More than 24 hours before departure: 90% refund
- 12-24 hours before departure: 50% refund
- 2-12 hours before departure: 25% refund
- Less than 2 hours before departure: No refund

**BR-BOOK-011**: Total booking amount must equal (sum of passenger fares + taxes/fees).

**BR-BOOK-012**: Booking status automatically changes to "Completed" after flight lands.

### Passenger Rules

**BR-PASS-001**: Passenger age must be between 0 and 120 years.

**BR-PASS-002**: Infants (age 0-2) must be accompanied by an adult (age 18+).

**BR-PASS-003**: Contact number is mandatory for at least one passenger per booking.

**BR-PASS-004**: ID number must be unique per ID type (prevent duplicate identities).

**BR-PASS-005**: Passenger name must match ID document (validation note, not enforced).

### Payment Rules

**BR-PAY-001**: Payment amount must match booking total amount.

**BR-PAY-002**: Payment status must be "Completed" before booking is confirmed.

**BR-PAY-003**: Refund amount cannot exceed original payment amount.

**BR-PAY-004**: Each booking must have at least one payment record.

**BR-PAY-005**: Payment method "Card" requires card number (masked after processing).

**BR-PAY-006**: Payment method "Bank Transfer" requires transaction reference.

### Seat Assignment Rules

**BR-SEAT-001**: Each passenger in a booking must have exactly one seat assignment.

**BR-SEAT-002**: Seat must match the pricing tier of the passenger (Economy seats for Economy tier, Business seats for Business tier).

**BR-SEAT-003**: Seat assignment is released when booking is cancelled.

**BR-SEAT-004**: Seat cannot be assigned if already taken by another confirmed booking.

### Pricing Rules

**BR-PRICE-001**: Child discount (age 2-12): 25% off base fare.

**BR-PRICE-002**: Infant discount (age 0-2): 90% off base fare.

**BR-PRICE-003**: Taxes and fees: 13% VAT + NPR 500 airport fee per passenger.

**BR-PRICE-004**: Fare difference on modification: calculated as (new fare - old fare), can be positive or negative.

### General System Rules

**BR-SYS-001**: All monetary values are in Nepali Rupees (NPR).

**BR-SYS-002**: All times are in Nepal Standard Time (NST, UTC+5:45).

**BR-SYS-003**: Dates are stored and displayed in YYYY-MM-DD format.

**BR-SYS-004**: Soft delete is used for most entities (marked as inactive rather than removed).

**BR-SYS-005**: All user actions are logged with timestamp (audit trail).

**BR-SYS-006**: System prevents overbooking (total confirmed bookings cannot exceed available seats).

## 8. Non-Functional Requirements

### Performance

**NFR-PERF-001**: Page load time must not exceed 3 seconds on standard broadband connection (5 Mbps).

**NFR-PERF-002**: Search flights query must return results within 2 seconds.

**NFR-PERF-003**: Booking creation process must complete within 5 seconds.

**NFR-PERF-004**: System must support at least 50 concurrent users without performance degradation.

**NFR-PERF-005**: Database queries must be optimized with appropriate indexes on frequently searched fields.

**NFR-PERF-006**: API response time for CRUD operations must not exceed 1 second.

**NFR-PERF-007**: Report generation must complete within 10 seconds for date ranges up to 1 year.

### Scalability

**NFR-SCAL-001**: System must handle up to 10,000 bookings per month.

**NFR-SCAL-002**: Database must efficiently store at least 100,000 passenger records.

**NFR-SCAL-003**: System must support up to 50 aircraft in the fleet.

**NFR-SCAL-004**: System must handle up to 500 flight instances per day.

**NFR-SCAL-005**: Architecture must allow horizontal scaling if traffic increases beyond initial projections.

### Security

**NFR-SEC-001**: All data transmission must use HTTPS/TLS encryption.

**NFR-SEC-002**: Sensitive payment information (card numbers) must be masked in UI and logs.

**NFR-SEC-003**: SQL injection prevention through parameterized queries or ORM.

**NFR-SEC-004**: XSS prevention through input sanitization and output encoding.

**NFR-SEC-005**: CSRF protection on all state-changing operations.

**NFR-SEC-006**: Database credentials must be stored in environment variables, not in code.

**NFR-SEC-007**: Regular automated backups of database (daily minimum).

**NFR-SEC-008**: Audit logging of all critical operations (bookings, cancellations, payments).

**NFR-SEC-009**: Session timeout after 30 minutes of inactivity (if sessions are used).

**NFR-SEC-010**: Input validation on all user-submitted data (client and server-side).

### Reliability

**NFR-REL-001**: System uptime must be at least 99% (excluding planned maintenance).

**NFR-REL-002**: Automated database backups with point-in-time recovery capability.

**NFR-REL-003**: Graceful error handling with user-friendly error messages.

**NFR-REL-004**: Transaction rollback on booking creation failure (atomic operations).

**NFR-REL-005**: Data integrity constraints enforced at database level.

**NFR-REL-006**: System must recover from crashes without data loss.

### Usability

**NFR-USE-001**: User interface must be intuitive and require minimal training.

**NFR-USE-002**: Responsive design supporting desktop (1920x1080), tablet (768x1024), and mobile (375x667) viewports.

**NFR-USE-003**: Consistent navigation across all pages with clear breadcrumbs.

**NFR-USE-004**: Form validation with inline error messages.

**NFR-USE-005**: Confirmation dialogs for destructive actions (delete, cancel).

**NFR-USE-006**: Loading indicators for asynchronous operations.

**NFR-USE-007**: Success/error notifications displayed prominently.

**NFR-USE-008**: Accessibility compliance with WCAG 2.1 Level A minimum (keyboard navigation, alt text, color contrast).

**NFR-USE-009**: Print-friendly layouts for tickets, boarding passes, and reports.

**NFR-USE-010**: Help text and tooltips for complex fields.

### Compatibility

**NFR-COMP-001**: Support for modern browsers: Chrome (latest 2 versions), Firefox (latest 2 versions), Safari (latest 2 versions), Edge (latest 2 versions).

**NFR-COMP-002**: No dependency on browser plugins (Flash, Java, etc.).

**NFR-COMP-003**: Progressive enhancement approach (core functionality works without JavaScript).

**NFR-COMP-004**: Mobile-first responsive design.

### Maintainability

**NFR-MAINT-001**: Code must follow consistent style guide and naming conventions.

**NFR-MAINT-002**: Modular architecture with clear separation of concerns (MVC or similar).

**NFR-MAINT-003**: Comprehensive inline code comments for complex logic.

**NFR-MAINT-004**: Database schema documentation with entity-relationship diagrams.

**NFR-MAINT-005**: API documentation for all endpoints.

**NFR-MAINT-006**: Version control using Git with meaningful commit messages.

**NFR-MAINT-007**: Environment-specific configuration files (development, staging, production).

### Data Management

**NFR-DATA-001**: Database must use UTF-8 encoding to support Nepali Unicode characters.

**NFR-DATA-002**: Soft delete implementation for audit trail (records marked inactive, not removed).

**NFR-DATA-003**: Timestamps (created_at, updated_at) on all entities.

**NFR-DATA-004**: Data retention policy: keep booking records for at least 5 years.

**NFR-DATA-005**: Automated archival of completed flights older than 1 year.

**NFR-DATA-006**: Database normalization to 3NF minimum to prevent data anomalies.

### Localization

**NFR-LOC-001**: Support for English language in UI (primary).

**NFR-LOC-002**: Date format: YYYY-MM-DD (ISO 8601).

**NFR-LOC-003**: Time format: 24-hour (HH:MM).

**NFR-LOC-004**: Currency: Nepali Rupees (NPR) with proper formatting (e.g., NPR 1,234.56).

**NFR-LOC-005**: Timezone: Nepal Standard Time (NST, UTC+5:45) for all timestamps.

**NFR-LOC-006**: Optional support for Nepali language (Devanagari script) in future versions.

### Monitoring & Logging

**NFR-MON-001**: Application logging with different levels (ERROR, WARN, INFO, DEBUG).

**NFR-MON-002**: Error tracking with stack traces for debugging.

**NFR-MON-003**: Performance monitoring for slow queries and endpoints.

**NFR-MON-004**: Audit trail for critical operations (who did what, when).

**NFR-MON-005**: Log rotation to prevent disk space issues.

**NFR-MON-006**: Health check endpoint for monitoring system status.

### Deployment

**NFR-DEPL-001**: Containerized deployment using Docker (optional but recommended).

**NFR-DEPL-002**: Environment variables for configuration (database, API keys, etc.).

**NFR-DEPL-003**: Database migration scripts for schema changes.

**NFR-DEPL-004**: Seed data scripts for initial setup (airports, sample aircraft).

**NFR-DEPL-005**: Deployment documentation with step-by-step instructions.

**NFR-DEPL-006**: Rollback capability in case of deployment issues.

---

**Document Version**: 1.0  
**Last Updated**: 2025-01-10  
**Target Pages**: ~10 pages (Dashboard, Aircraft, Airports, Routes, Flight Schedules, Flight Instances, Search/Book, Manage Bookings, Passengers, Reports)