# Specification: Add Crew Member Functionality ## Vessel & Crew Info Page - SailingMedAdvisor **Document Version:** 1.0 **Last Updated:** January 22, 2026 **Component:** Vessel & Crew Information Management --- ## Overview The Add Crew Member functionality allows authorized users to register new crew members, passengers, or captain information into the SailingMedAdvisor system. This feature is located within the "Vessel & Crew Info" tab and provides a comprehensive data entry form for capturing essential crew information, documentation, and emergency contacts. --- ## Location & Access **Navigation Path:** Main Navigation Bar → **VESSEL & CREW** tab → Crew Information section → **Add New Crew Member** (expandable section) **Access Control:** - Requires user authentication (session-based) - Available to all authenticated users - No role-based restrictions currently implemented --- ## User Interface Components ### 1. Collapsible Section Header **Element:** `div.col-header.crew-med-header` **Default State:** Collapsed (▸ icon) **Interactive Element:** Clickable header with toggle icon **Visual Indicator:** Arrow icon (▸ when collapsed, ▾ when expanded) **Header Text:** "Add New Crew Member" **Behavior:** - Single-click toggles expansion/collapse - Icon rotates to indicate current state - State persists using localStorage with key based on `data-sidebar-id="crew-add"` --- ### 2. Input Form Fields The add crew form is organized into logical grouped sections with a responsive grid layout. #### **2.1 Name Fields** **Layout:** 3-column grid (`grid-template-columns: 1fr 1fr 1fr`) | Field Label | Element ID | Type | Required | Placeholder | Notes | |------------|-----------|------|----------|-------------|--------| | First Name | `cn-first` | text | Yes (*) | - | Primary identifier | | Middle Name(s) | `cn-middle` | text | No | - | Optional middle names | | Last Name | `cn-last` | text | Yes (*) | - | Family name | #### **2.2 Personal Information** **Layout:** 3-column grid | Field Label | Element ID | Type | Required | Options/Format | Notes | |------------|-----------|------|----------|----------------|--------| | Sex | `cn-sex` | select | Yes (*) | Male, Female, Non-binary, Other, Prefer not to say | Gender identity | | Birthdate | `cn-birthdate` | date | Yes (*) | YYYY-MM-DD | Age calculation base | | Position | `cn-position` | select | Yes (*) | Captain, Crew, Passenger | Role aboard vessel | #### **2.3 Documentation Fields** **Layout:** 4-column grid | Field Label | Element ID | Type | Required | Format/List | Notes | |------------|-----------|------|----------|-------------|--------| | Citizenship | `cn-citizenship` | text + datalist | Yes (*) | Country names | Autocomplete enabled | | Passport Number | `cn-passport` | text | Yes (*) | Alphanumeric | Official passport ID | | Issue Date | `cn-pass-issue` | date | No | YYYY-MM-DD | Passport issue | | Expiry Date | `cn-pass-expiry` | date | No | YYYY-MM-DD | Passport expiration | **Datalist Options** (id="countries"): USA, Canada, UK, Australia, New Zealand, France, Germany, Spain, Italy, Netherlands, Singapore, Malaysia, Thailand, Philippines, Japan, China, India #### **2.4 Contact & File Upload** **Layout:** 3-column grid (contact) + single row (files) | Field Label | Element ID | Type | Required | Format | Notes | |------------|-----------|------|----------|--------|--------| | Cell/WhatsApp | `cn-phone` | text | No | +[country][number] | International format | | Passport Photo/PDF | `cn-passport-photo` | file | No | image/*,.pdf | Photo upload | | Passport Page Photo/PDF | `cn-passport-page` | file | No | image/*,.pdf | Document scan | #### **2.5 Emergency Contact Section** **Sub-header:** "Emergency Contact" **Layout:** 4-column grid + notes field | Field Label | Element ID | Type | Required | Format | Notes | |------------|-----------|------|----------|--------|--------| | Name | `cn-emerg-name` | text | No | Full name | Contact person | | Relationship | `cn-emerg-rel` | text | No | e.g., Spouse, Parent | Relation to crew | | Phone | `cn-emerg-phone` | text | No | Phone number | Contact number | | Email | `cn-emerg-email` | email | No | email@domain.com | Email address | | Emergency Contact Notes | `cn-emerg-notes` | text | No | Additional info | Full-width field | --- ### 3. Action Button **Element:** `