# Phase 1 — Frontend Inventory (Web → Mobile)

This document enumerates the **current customer-facing web UI/UX**, modules, screens, components, forms, validations, and user flows, as implemented in the Laravel Blade frontend. It is the baseline to recreate the **same business flow and functionality** in the Flutter mobile app (customer-only scope), while optimizing for native UX.

## 1) Global UI shell (customer)

- **Layout**: `resources/views/components/site/layout.blade.php`
  - Uses Bootstrap 5, Bootstrap Icons, Select2; site styles via `public/css/homepage.css`.
  - Shared components: `x-site.header`, `x-site.footer`.
- **Brand tokens (observed)**
  - **Primary**: `#de6d0f` (buttons/nav), hover/darker: `#bb550c`
  - **Admin primary** (not for customer app, but keep token): `#f1882a`
  - **Card radius**: ~14px; **pills**: 999px; **button radius**: 6–12px
  - CSS sources: `public/css/homepage.css`, `public/css/admin.css`

## 2) Customer routes → screens map

Source of truth: `routes/web.php`, `app/Http/Controllers/Web/PageController.php`, and the Blade views under `resources/views/site`.

### 2.1 Home

- **Route**: `GET /` (`PageController@home`)
- **View**: `resources/views/site/home.blade.php`
- **Sections**
  - Home banners carousel (`HomeBanner::active()`), fallback banner image.
  - “Free Ad Posting +” floating CTA → `GET /myproperties/Add` (requires auth).
  - Home ad carousel + homepage slider ads (click tracked via `web.ads.click`).
  - Free services tiles: Jobs, Education, Property listings, Free ad posting.
  - Featured Categories grid.
- **Reusable UI candidates**
  - Banner carousel widget
  - Ad carousel / marquee widget with click tracking
  - Category tile grid + CTA cards

### 2.2 Module listing (Property / Jobs / Education / Services)

- **Routes**
  - `GET /property` → `PageController@listings` with `type=property`
  - `GET /jobs` → `type=job`
  - `GET /education` → `type=education`
  - `GET /service` → `type=service`
- **View**: `resources/views/site/listings/index.blade.php`
- **Core behavior**
  - Shared listing engine with per-module differences: hero, filters, view mode, list/grid layouts, pagination.
  - Uses `PageController::moduleListingsQuery()` for Eloquent `with(...)` + status filtering:
    - Property: visible statuses `['approved']`
    - Job/Education/Service: `['active', 'approved']`
  - Pagination per type (default): job=10, property=16, others=24 (bounded 6..60)

#### 2.2.1 Property listing specifics

- **Auth**: property detail requires login (see `listingDetail()`); listing page itself is public.
- **Filters**
  - Purpose tabs: All / Buy / Rent (maps to `listing_purpose` = sell/rent)
  - Area filter: custom searchable dropdown wired via inline JS (not select2)
  - View mode: grid/list
- **Card data used**
  - title, location, price, purpose badge, bhk, area_sqft, furnishing, image
- **Reusable UI candidates**
  - Filter chips/tabs + area search dropdown
  - Property card (grid and list variants)
  - Paged list w/ skeleton, empty-state

#### 2.2.2 Job listing specifics

- **Special CTA**: “Looking for Job?” route `/jobs/looking` redirects to login if unauthenticated then to jobs.
- **Filters**
  - Segment: `it` / `non_it` (JobCategory segment)
  - Category filter by `job_category_id`
- **Embedded form**
  - Job application form is included on listing page: `resources/views/site/listings/partials/job-application-form.blade.php`
  - Submission: `POST /jobs/apply` (requires auth)

#### 2.2.3 Education listing specifics

- **Filter**
  - Study level (from `StoreEducationRequest::studyLevelOptions()`)
- **Embedded form**
  - Education enquiry form is used on education detail and can be used standalone:
    - `resources/views/site/listings/partials/education-enquiry-form.blade.php`
  - Submission: `POST /education/enquire` (public, throttled)

#### 2.2.4 Service listing specifics

- **Category tiles** from `ServiceCategory` with computed listings count.
- **Category detail page**
  - Route: `GET /services/category/{serviceCategory:slug}`
  - View: `resources/views/site/services/category-show.blade.php`
  - Category lead form: `POST /services/category/{serviceCategory:slug}/lead` (auth required)

#### 2.2.5 Listing help modal (all module list pages)

- Implemented in `resources/views/site/listings/index.blade.php` as a modal with fields:
  - full name, mobile, requirement textarea
- **Important**: It currently has no wired backend submit (button is `type="button"`). In mobile, we should either remove it or implement it via Leads API as a first-class “Need Help” lead.

### 2.3 Module detail (Property / Job / Education / Service)

- **Route**: `GET /{type}/{slug}` where `type in property|job|education|service`
- **Controller**: `PageController@listingDetail`
  - Resolves module record by `slug` (fallback legacy `listing-<id>`).
  - For `property`, redirects unauthenticated users to customer login.
  - Computes `already_interested` by checking `leads` for `(user_id, module_type, module_id)`.
- **View**: `resources/views/site/listings/show.blade.php` (delegates to partials by type)

#### 2.3.1 Property detail

- **View**: `resources/views/site/listings/partials/property-show.blade.php`
- **Key UI sections**
  - Gallery with thumbs, extra gallery modal, share/copy link actions.
  - Title + meta badges (BHK, sqft, furnishing, property_type)
  - About this property (description)
  - Full specs list (dl/grid)
  - Full address highlight
  - Enquiry form sidebar (always visible) + Call/WhatsApp
  - Google map iframe + “Open in Google Maps/Directions”
- **Enquiry submission**
  - Route: `POST /property/{slug}/interested` via `web.modules.interested`
  - Fields: `name (required)`, `mobile (required)`, `message (optional)`

#### 2.3.2 Job detail

- Rendered inside `resources/views/site/listings/show.blade.php` “else” section (non property/education/service).
- “Interested/Apply” is a one-click `POST web.modules.interested` if authenticated.
- Job application is primarily via the listing page form (`/jobs/apply`).

#### 2.3.3 Education detail

- Rendered in `resources/views/site/listings/show.blade.php` education section.
- Includes the **education enquiry form** (compact variant) on the right sidebar.
- Displays: about, program details, countries, universities, career scope, job roles.

#### 2.3.4 Service detail

- Rendered in `resources/views/site/listings/show.blade.php` service section.
- Requires login for enquiry (auth gated).
- Enquiry form requires **area + pincode** (Select2 area dropdown auto-fills pincode).
- Submission: `POST /service/{slug}/interested` (same `markInterested()`), but with extra rules:
  - `area_id (required, exists)`, `pincode (required, regex)`

### 2.4 Auth (customer)

- **Route**: `GET /login/{role?}` (customer default)
- **View**: `resources/views/site/auth/login.blade.php`
- **Modes**
  - OTP login: send OTP → verify OTP (AJAX)
  - Password login (AJAX)
  - Forgot password OTP flows are supported at controller level (separate endpoints)
- **Important mobile implication**
  - Mobile app should use API OTP + Sanctum token (not session auth).

### 2.5 Customer dashboard / profile / my properties

- **Route**: `GET /dashboard` (auth required)
- **View**: `resources/views/site/dashboard.blade.php`
- **Tabs**
  - Dashboard: property stats + notifications (status/comment)
  - My Ads/Properties: list table + detail/edit/create sub-modes
  - Quick Pay Transactions: list of user payments of type `quick_pay`
  - My Profile: profile update + password update
- **Controller**: `PageController@dashboard`
  - Fetches reference data: `countries, states, cities, areas` for profile/property address mapping.
  - Properties include comments from admin for notifications.

### 2.6 Quick Pay

- **Routes**: `/quick-pay/*` group (auth required)
- **View**: `resources/views/site/quick-pay/index.blade.php`
- **Flow**
  - Fetch services list (AJAX) → choose service → enter name/mobile/amount → create Razorpay order → open Razorpay checkout → verify payment → redirect to receipt.
- **Mobile implication**
  - Requires a native Razorpay flow; keep the same service selection + order + verify logic.

## 3) Forms & validation inventory (web)

Source of truth: `PageController` validation rules + form fields in views.

### 3.1 “Interested” lead (module enquiry)

- **Endpoint**: `POST /{type}/{slug}/interested` (`PageController@markInterested`)
- **Shared fields**
  - `name` optional (max 191)
  - `mobile` optional but effectively required (regex `^[6-9][0-9]{9}$`)
  - `message` optional (max 2000)
- **Service-only required**
  - `area_id` required, exists `areas.id`
  - `pincode` required, regex `^[1-9][0-9]{5}$`
- **Behavior**
  - Dedup by `(user_id, module_type, module_id)`; if exists, show “already submitted” success.

### 3.2 Job application

- **Endpoint**: `POST /jobs/apply` (auth required)
- **Fields**
  - `job_track` required in `it|non_it`
  - `job_category_id` required exists `job_categories.id` + must match selected track
  - `full_name` required max 255
  - `mobile` required regex `^[6-9][0-9]{9}$`
  - `education` required max 500
  - `work_experience` required max 500
  - `resume` optional file max 50MB, `txt|pdf|doc|docx`
- **Side effects**
  - Creates a `Lead` with category `job_application`; may email admin.

### 3.3 Education enquiry

- **Endpoint**: `POST /education/enquire` (public, throttled)
- **Fields**
  - `full_name` required max 255
  - `mobile` required regex `^[6-9][0-9]{9}$`
  - `study_level` required max 120
  - `desired_field` optional max 255
  - `preferred_destination` optional max 120
  - `city` optional max 120
  - `message` optional max 2000
  - `return_to` optional max 2000 (only used if URL is app URL and path starts `/education`)
  - `program_context` optional max 255
- **Side effects**
  - Creates a `Lead` with category `education_enquiry`; may email admin.

### 3.4 Contact form

- **Endpoint**: `POST /contact` (public, throttled)
- **Fields**
  - `name` required
  - `mobile` required (10-digit)
  - `email` optional email
  - `topic` optional
  - `city` optional
  - `message` required min 10 max 5000
- Creates `Lead` category `contact`.

### 3.5 Service category lead

- **Endpoint**: `POST /services/category/{slug}/lead` (auth required)
- **Fields in view**: name, mobile, area_id, pincode, message
- Controller: `Web/LocalServiceLeadController@storeCategoryLead` (validate there; to be mirrored in mobile)

### 3.6 Customer profile update

- **Endpoint**: `PUT /dashboard/profile` (auth required)
- **Fields**
  - Name, email, mobile, whatsapp number
  - Address lines, location references (country/state/city/area ids) then normalized to string fields
  - Pincode (regex), profile_icon image upload

## 4) Reusable UI components (web → Flutter candidates)

- **Cards**
  - Listing cards (grid/list variants), featured tile cards, stats cards.
- **Badges/chips**
  - Purpose, category, count badges.
- **Carousels**
  - Banner carousel, ads carousel, slider marquee.
- **Forms**
  - Mobile number input with +91 prefix
  - OTP input (6-digit)
  - Select dropdown (Select2 in web) → searchable pickers in mobile
  - File picker (resume)
- **Utilities**
  - Share / copy link
  - Maps open/directions

## 5) Mobile mapping (screen list)

These are the **Flutter screens** required to match current customer web functionality:

- Home (banners, featured categories, ads, primary CTAs)
- Auth: OTP login (send OTP), OTP verify, optional password login (if we keep it)
- Module list: Property / Jobs / Education / Services (with filters + paging)
- Module detail: Property / Job / Education / Service
- Leads: submit enquiry (interested), plus Job Application + Education Enquiry
- Service category screen (category detail + lead form)
- Dashboard: property status notifications + quick actions
- My Properties: list, detail, create, edit, resubmit (feature-first)
- Profile: view/update + change password
- Quick Pay: service picker → create order → pay → verify → receipt/history

