added dealer onboard new document

This commit is contained in:
laxmanhalaki 2026-01-07 16:32:15 +05:30
parent 0f624a43b1
commit bc7683a42b
6 changed files with 9791 additions and 34 deletions

6293
Re_New_Dealer_Onboard.md Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,947 @@
erDiagram
%% ============================================
%% DEALER ONBOARDING BACKEND SCHEMA
%% Based on Re_New_Dealer_Onboard.md
%% Comprehensive Database Schema Design
%% ============================================
%% ============================================
%% USER MANAGEMENT & AUTHENTICATION
%% ============================================
USERS {
uuid user_id PK
string employee_id UK
string email UK
string full_name
string mobile_number
string department
string designation
string role_code FK
uuid zone_id FK
uuid region_id FK
uuid area_id FK
boolean is_active
boolean is_external
string sso_provider
string sso_user_id
timestamp last_login
timestamp created_at
timestamp updated_at
}
ROLES {
uuid role_id PK
string role_code UK
string role_name
string description
string category
boolean is_active
timestamp created_at
timestamp updated_at
}
PERMISSIONS {
uuid permission_id PK
string permission_code UK
string permission_name
string module
string action
string description
timestamp created_at
}
ROLE_PERMISSIONS {
uuid role_permission_id PK
uuid role_id FK
uuid permission_id FK
boolean can_view
boolean can_create
boolean can_edit
boolean can_delete
boolean can_approve
timestamp created_at
}
USER_ROLES {
uuid user_role_id PK
uuid user_id FK
uuid role_id FK
uuid zone_id FK
uuid region_id FK
uuid area_id FK
timestamp assigned_at
uuid assigned_by FK
timestamp created_at
}
%% ============================================
%% ORGANIZATIONAL HIERARCHY
%% ============================================
ZONES {
uuid zone_id PK
string zone_code UK
string zone_name
string description
boolean is_active
timestamp created_at
timestamp updated_at
}
REGIONS {
uuid region_id PK
uuid zone_id FK
string region_code UK
string region_name
string state
string description
boolean is_active
timestamp created_at
timestamp updated_at
}
AREAS {
uuid area_id PK
uuid region_id FK
string area_code UK
string area_name
string district
string city
string pincode
boolean is_active
timestamp created_at
timestamp updated_at
}
ZONE_MANAGERS {
uuid zone_manager_id PK
uuid zone_id FK
uuid user_id FK
string manager_type
boolean is_active
timestamp assigned_at
timestamp created_at
}
REGION_MANAGERS {
uuid region_manager_id PK
uuid region_id FK
uuid user_id FK
string manager_type
boolean is_active
timestamp assigned_at
timestamp created_at
}
AREA_MANAGERS {
uuid area_manager_id PK
uuid area_id FK
uuid user_id FK
string manager_type
boolean is_active
timestamp assigned_at
timestamp created_at
}
%% ============================================
%% OPPORTUNITY MANAGEMENT
%% ============================================
OPPORTUNITIES {
uuid opportunity_id PK
uuid zone_id FK
uuid region_id FK
uuid area_id FK
string state
string city
string district
string opportunity_type
integer capacity
string priority
date open_from
date open_to
string status
text notes
uuid created_by FK
timestamp created_at
timestamp updated_at
}
%% ============================================
%% DEALER APPLICATION
%% ============================================
APPLICATIONS {
uuid application_id PK
string registration_number UK
string applicant_name
string email UK
string mobile_number
integer age
string country
string state
string district
string pincode
string interested_city
string company_name
string education_qualification
boolean owns_re_bike
boolean is_existing_dealer
text address
text description
string preferred_location
string application_status
string opportunity_status
uuid zone_id FK
uuid region_id FK
uuid area_id FK
uuid assigned_dd_zm FK
uuid assigned_rbm FK
timestamp submitted_at
timestamp created_at
timestamp updated_at
}
%% ============================================
%% QUESTIONNAIRE MANAGEMENT
%% ============================================
QUESTIONNAIRES {
uuid questionnaire_id PK
string questionnaire_code UK
string version
string title
text description
boolean is_active
uuid created_by FK
timestamp created_at
timestamp updated_at
}
QUESTIONNAIRE_SECTIONS {
uuid section_id PK
uuid questionnaire_id FK
string section_name
string section_type
integer section_order
decimal section_weightage
boolean is_active
timestamp created_at
}
QUESTIONNAIRE_QUESTIONS {
uuid question_id PK
uuid section_id FK
string question_text
string question_type
integer question_order
decimal question_weightage
json options
boolean is_mandatory
boolean is_active
timestamp created_at
timestamp updated_at
}
QUESTIONNAIRE_RESPONSES {
uuid response_id PK
uuid application_id FK
uuid questionnaire_id FK
uuid question_id FK
text response_text
json response_data
decimal score_obtained
decimal max_score
timestamp submitted_at
timestamp created_at
timestamp updated_at
}
QUESTIONNAIRE_SCORES {
uuid score_id PK
uuid application_id FK
uuid questionnaire_id FK
decimal total_score
decimal max_score
decimal percentage_score
integer rank_in_city
integer rank_in_region
timestamp calculated_at
timestamp created_at
timestamp updated_at
}
%% ============================================
%% INTERVIEW MANAGEMENT
%% ============================================
INTERVIEWS {
uuid interview_id PK
uuid application_id FK
integer interview_level
string interview_type
string interview_mode
date interview_date
time interview_time
string meeting_link
string venue_address
string status
uuid scheduled_by FK
timestamp scheduled_at
timestamp created_at
timestamp updated_at
}
INTERVIEW_PARTICIPANTS {
uuid participant_id PK
uuid interview_id FK
uuid user_id FK
string participant_role
boolean is_required
boolean has_attended
timestamp created_at
}
INTERVIEW_EVALUATIONS {
uuid evaluation_id PK
uuid interview_id FK
uuid application_id FK
uuid evaluator_id FK
integer interview_level
decimal kt_matrix_score
decimal feedback_score
decimal overall_score
string recommendation
text remarks
text feedback_summary
timestamp submitted_at
timestamp created_at
timestamp updated_at
}
KT_MATRIX_SCORES {
uuid kt_score_id PK
uuid evaluation_id FK
string parameter_name
decimal parameter_weightage
decimal score_obtained
text remarks
timestamp created_at
}
INTERVIEW_FEEDBACK {
uuid feedback_id PK
uuid evaluation_id FK
string feedback_category
text feedback_text
decimal category_score
timestamp created_at
}
AI_SUMMARIES {
uuid summary_id PK
uuid application_id FK
integer interview_level
text ai_generated_summary
text nbh_edited_summary
boolean is_approved
uuid approved_by FK
timestamp generated_at
timestamp approved_at
timestamp created_at
timestamp updated_at
}
%% ============================================
%% WORK NOTES & COMMUNICATION
%% ============================================
WORK_NOTES {
uuid work_note_id PK
uuid application_id FK
uuid created_by FK
text note_content
json tagged_users
json attachments
string note_type
uuid parent_note_id FK
boolean is_internal
boolean is_deleted
timestamp created_at
timestamp updated_at
}
WORK_NOTE_TAGS {
uuid tag_id PK
uuid work_note_id FK
uuid tagged_user_id FK
boolean is_notified
timestamp notified_at
timestamp created_at
}
WORK_NOTE_ATTACHMENTS {
uuid attachment_id PK
uuid work_note_id FK
uuid document_id FK
timestamp created_at
}
%% ============================================
%% DOCUMENT MANAGEMENT
%% ============================================
DOCUMENTS {
uuid document_id PK
uuid application_id FK
uuid uploaded_by FK
string document_type
string document_category
string file_name
string file_type
bigint file_size
string file_path
string storage_url
string mime_type
integer version
string status
uuid verified_by FK
timestamp verified_at
boolean is_deleted
timestamp uploaded_at
timestamp created_at
timestamp updated_at
}
DOCUMENT_VERSIONS {
uuid version_id PK
uuid document_id FK
integer version_number
string file_path
string storage_url
uuid uploaded_by FK
timestamp uploaded_at
timestamp created_at
}
LOI_DOCUMENTS {
uuid loi_doc_id PK
uuid application_id FK
string document_name
string document_type
uuid document_id FK
boolean is_mandatory
boolean is_uploaded
boolean is_verified
timestamp required_at
timestamp uploaded_at
timestamp verified_at
}
STATUTORY_DOCUMENTS {
uuid statutory_doc_id PK
uuid application_id FK
string document_name
string document_type
uuid document_id FK
boolean is_mandatory
boolean is_uploaded
boolean is_verified
uuid verified_by FK
timestamp verified_at
timestamp created_at
}
%% ============================================
%% FDD PROCESS
%% ============================================
FDD_ASSIGNMENTS {
uuid fdd_assignment_id PK
uuid application_id FK
uuid fdd_user_id FK
string assignment_status
date assigned_at
date due_date
timestamp created_at
timestamp updated_at
}
FDD_REPORTS {
uuid fdd_report_id PK
uuid fdd_assignment_id FK
uuid application_id FK
string report_type
string report_level
uuid document_id FK
text remarks
string status
timestamp submitted_at
timestamp created_at
timestamp updated_at
}
%% ============================================
%% LOI PROCESS
%% ============================================
LOI_REQUESTS {
uuid loi_request_id PK
uuid application_id FK
string request_status
date document_request_date
date security_deposit_request_date
boolean documents_complete
boolean security_deposit_verified
timestamp created_at
timestamp updated_at
}
LOI_APPROVALS {
uuid loi_approval_id PK
uuid loi_request_id FK
uuid application_id FK
integer approval_level
uuid approver_id FK
string approval_status
text approval_remarks
timestamp approved_at
timestamp created_at
timestamp updated_at
}
LOI_DOCUMENTS_GENERATED {
uuid loi_doc_gen_id PK
uuid application_id FK
uuid loi_request_id FK
uuid document_id FK
date issue_date
uuid authorized_signatory FK
string document_version
timestamp generated_at
timestamp uploaded_at
}
LOI_ACKNOWLEDGEMENTS {
uuid loi_ack_id PK
uuid application_id FK
uuid loi_doc_gen_id FK
uuid document_id FK
timestamp acknowledged_at
timestamp created_at
}
%% ============================================
%% SECURITY DEPOSIT
%% ============================================
SECURITY_DEPOSITS {
uuid deposit_id PK
uuid application_id FK
decimal deposit_amount
string payment_mode
string transaction_id
date transaction_date
string bank_name
string account_number
uuid proof_document_id FK
string verification_status
uuid verified_by FK
timestamp verified_at
text verification_remarks
timestamp created_at
timestamp updated_at
}
%% ============================================
%% DEALER CODE GENERATION
%% ============================================
DEALER_CODES {
uuid dealer_code_id PK
uuid application_id FK
string dealer_code UK
string sales_code
string service_code
string gma_code
string gear_code
string sap_dealer_id
boolean is_active
timestamp generated_at
uuid generated_by FK
timestamp created_at
timestamp updated_at
}
%% ============================================
%% ARCHITECTURAL WORK
%% ============================================
ARCHITECTURAL_ASSIGNMENTS {
uuid arch_assignment_id PK
uuid application_id FK
uuid assigned_to_team FK
string assignment_status
date assigned_at
date due_date
timestamp created_at
timestamp updated_at
}
ARCHITECTURAL_DOCUMENTS {
uuid arch_doc_id PK
uuid arch_assignment_id FK
uuid application_id FK
string document_type
uuid document_id FK
string layout_type
boolean dealer_consent_received
date consent_date
timestamp uploaded_at
timestamp created_at
}
CONSTRUCTION_PROGRESS {
uuid progress_id PK
uuid application_id FK
string progress_type
text progress_description
uuid document_id FK
integer progress_percentage
timestamp reported_at
timestamp created_at
}
%% ============================================
%% EOR CHECKLIST
%% ============================================
EOR_CHECKLISTS {
uuid eor_checklist_id PK
uuid application_id FK
string checklist_name
string status
integer total_items
integer completed_items
integer percentage_complete
timestamp created_at
timestamp updated_at
}
EOR_CHECKLIST_ITEMS {
uuid eor_item_id PK
uuid eor_checklist_id FK
string item_name
string item_category
string responsible_team
string status
text remarks
uuid verified_by FK
timestamp verified_at
timestamp created_at
timestamp updated_at
}
%% ============================================
%% LOA PROCESS
%% ============================================
LOA_REQUESTS {
uuid loa_request_id PK
uuid application_id FK
string request_status
boolean eor_complete
timestamp created_at
timestamp updated_at
}
LOA_APPROVALS {
uuid loa_approval_id PK
uuid loa_request_id FK
uuid application_id FK
uuid approver_id FK
string approval_status
text approval_remarks
timestamp approved_at
timestamp created_at
timestamp updated_at
}
LOA_DOCUMENTS_GENERATED {
uuid loa_doc_gen_id PK
uuid application_id FK
uuid loa_request_id FK
uuid document_id FK
date issue_date
uuid authorized_signatory FK
string document_version
timestamp generated_at
timestamp uploaded_at
}
%% ============================================
%% INAUGURATION
%% ============================================
INAUGURATIONS {
uuid inauguration_id PK
uuid application_id FK
date inauguration_date
string venue
text event_summary
uuid organized_by FK
string status
timestamp created_at
timestamp updated_at
}
INAUGURATION_ATTENDEES {
uuid attendee_id PK
uuid inauguration_id FK
uuid user_id FK
string attendee_role
boolean is_confirmed
timestamp created_at
}
INAUGURATION_DOCUMENTS {
uuid inauguration_doc_id PK
uuid inauguration_id FK
uuid document_id FK
string document_type
timestamp uploaded_at
}
%% ============================================
%% NOTIFICATIONS
%% ============================================
NOTIFICATIONS {
uuid notification_id PK
uuid user_id FK
uuid application_id FK
string notification_type
string title
text message
string priority
boolean is_read
json metadata
timestamp read_at
timestamp created_at
}
EMAIL_LOGS {
uuid email_log_id PK
uuid application_id FK
uuid user_id FK
string email_type
string recipient_email
string subject
text email_body
string status
text error_message
timestamp sent_at
timestamp created_at
}
WHATSAPP_LOGS {
uuid whatsapp_log_id PK
uuid application_id FK
string recipient_number
string message_type
text message_content
string status
text error_message
timestamp sent_at
timestamp created_at
}
%% ============================================
%% SLA & TAT TRACKING
%% ============================================
SLA_CONFIGURATIONS {
uuid sla_config_id PK
string activity_name
string owner_role
integer tat_hours
string tat_unit
json pre_tat_reminders
json escalation_levels
boolean is_active
timestamp created_at
timestamp updated_at
}
SLA_TRACKING {
uuid sla_tracking_id PK
uuid application_id FK
uuid sla_config_id FK
string activity_name
uuid owner_id FK
timestamp start_time
timestamp due_time
timestamp completed_time
string status
integer completion_percentage
timestamp created_at
timestamp updated_at
}
SLA_ESCALATIONS {
uuid escalation_id PK
uuid sla_tracking_id FK
integer escalation_level
uuid escalated_to FK
text escalation_reason
timestamp escalated_at
timestamp resolved_at
}
%% ============================================
%% EMAIL TEMPLATES
%% ============================================
EMAIL_TEMPLATES {
uuid template_id PK
string template_name UK
string template_code UK
string subject
text template_body
string trigger_event
json system_variables
boolean is_active
string version
timestamp created_at
timestamp updated_at
}
%% ============================================
%% AUDIT TRAIL
%% ============================================
AUDIT_LOGS {
uuid audit_log_id PK
uuid application_id FK
uuid user_id FK
string action_type
string entity_type
uuid entity_id
text description
json before_state
json after_state
json metadata
string ip_address
string user_agent
timestamp created_at
}
ACTIVITY_LOGS {
uuid activity_id PK
uuid application_id FK
uuid user_id FK
string activity_type
text activity_description
json activity_data
timestamp created_at
}
%% ============================================
%% APPLICATION STATUS TRACKING
%% ============================================
APPLICATION_STATUS_HISTORY {
uuid status_history_id PK
uuid application_id FK
string previous_status
string new_status
uuid changed_by FK
text change_reason
timestamp changed_at
}
APPLICATION_PROGRESS {
uuid progress_id PK
uuid application_id FK
string stage_name
integer stage_order
string status
integer completion_percentage
timestamp stage_started_at
timestamp stage_completed_at
timestamp created_at
timestamp updated_at
}
%% ============================================
%% RELATIONSHIPS
%% ============================================
USERS ||--o{ USER_ROLES : "has"
ROLES ||--o{ USER_ROLES : "assigned_to"
ROLES ||--o{ ROLE_PERMISSIONS : "has"
PERMISSIONS ||--o{ ROLE_PERMISSIONS : "granted_in"
ZONES ||--o{ REGIONS : "contains"
REGIONS ||--o{ AREAS : "contains"
ZONES ||--o{ ZONE_MANAGERS : "managed_by"
REGIONS ||--o{ REGION_MANAGERS : "managed_by"
AREAS ||--o{ AREA_MANAGERS : "managed_by"
USERS ||--o{ ZONE_MANAGERS : "is"
USERS ||--o{ REGION_MANAGERS : "is"
USERS ||--o{ AREA_MANAGERS : "is"
ZONES ||--o{ OPPORTUNITIES : "has"
REGIONS ||--o{ OPPORTUNITIES : "has"
AREAS ||--o{ OPPORTUNITIES : "has"
ZONES ||--o{ APPLICATIONS : "belongs_to"
REGIONS ||--o{ APPLICATIONS : "belongs_to"
AREAS ||--o{ APPLICATIONS : "belongs_to"
USERS ||--o{ APPLICATIONS : "assigned_to"
APPLICATIONS ||--o{ QUESTIONNAIRE_RESPONSES : "has"
QUESTIONNAIRES ||--o{ QUESTIONNAIRE_RESPONSES : "used_in"
QUESTIONNAIRE_QUESTIONS ||--o{ QUESTIONNAIRE_RESPONSES : "answered_by"
APPLICATIONS ||--o{ QUESTIONNAIRE_SCORES : "has"
APPLICATIONS ||--o{ INTERVIEWS : "has"
INTERVIEWS ||--o{ INTERVIEW_PARTICIPANTS : "includes"
INTERVIEWS ||--o{ INTERVIEW_EVALUATIONS : "evaluated_in"
INTERVIEW_EVALUATIONS ||--o{ KT_MATRIX_SCORES : "contains"
INTERVIEW_EVALUATIONS ||--o{ INTERVIEW_FEEDBACK : "has"
APPLICATIONS ||--o{ AI_SUMMARIES : "has"
APPLICATIONS ||--o{ WORK_NOTES : "has"
WORK_NOTES ||--o{ WORK_NOTE_TAGS : "tags"
WORK_NOTES ||--o{ WORK_NOTE_ATTACHMENTS : "has"
DOCUMENTS ||--o{ WORK_NOTE_ATTACHMENTS : "attached_to"
APPLICATIONS ||--o{ DOCUMENTS : "has"
DOCUMENTS ||--o{ DOCUMENT_VERSIONS : "has"
APPLICATIONS ||--o{ LOI_DOCUMENTS : "requires"
APPLICATIONS ||--o{ STATUTORY_DOCUMENTS : "requires"
APPLICATIONS ||--o{ FDD_ASSIGNMENTS : "assigned_to"
FDD_ASSIGNMENTS ||--o{ FDD_REPORTS : "generates"
FDD_REPORTS ||--o{ DOCUMENTS : "stored_as"
APPLICATIONS ||--o{ LOI_REQUESTS : "has"
LOI_REQUESTS ||--o{ LOI_APPROVALS : "requires"
LOI_REQUESTS ||--o{ LOI_DOCUMENTS_GENERATED : "generates"
LOI_DOCUMENTS_GENERATED ||--o{ LOI_ACKNOWLEDGEMENTS : "acknowledged_by"
APPLICATIONS ||--o{ SECURITY_DEPOSITS : "has"
SECURITY_DEPOSITS ||--o{ DOCUMENTS : "proof_document"
APPLICATIONS ||--o{ DEALER_CODES : "has"
APPLICATIONS ||--o{ ARCHITECTURAL_ASSIGNMENTS : "assigned_to"
ARCHITECTURAL_ASSIGNMENTS ||--o{ ARCHITECTURAL_DOCUMENTS : "has"
APPLICATIONS ||--o{ CONSTRUCTION_PROGRESS : "tracks"
APPLICATIONS ||--o{ EOR_CHECKLISTS : "has"
EOR_CHECKLISTS ||--o{ EOR_CHECKLIST_ITEMS : "contains"
APPLICATIONS ||--o{ LOA_REQUESTS : "has"
LOA_REQUESTS ||--o{ LOA_APPROVALS : "requires"
LOA_REQUESTS ||--o{ LOA_DOCUMENTS_GENERATED : "generates"
APPLICATIONS ||--o{ INAUGURATIONS : "has"
INAUGURATIONS ||--o{ INAUGURATION_ATTENDEES : "includes"
INAUGURATIONS ||--o{ INAUGURATION_DOCUMENTS : "has"
USERS ||--o{ NOTIFICATIONS : "receives"
APPLICATIONS ||--o{ NOTIFICATIONS : "triggers"
APPLICATIONS ||--o{ EMAIL_LOGS : "triggers"
APPLICATIONS ||--o{ WHATSAPP_LOGS : "triggers"
SLA_CONFIGURATIONS ||--o{ SLA_TRACKING : "tracks"
APPLICATIONS ||--o{ SLA_TRACKING : "monitored_by"
SLA_TRACKING ||--o{ SLA_ESCALATIONS : "escalates"
APPLICATIONS ||--o{ AUDIT_LOGS : "logged_in"
USERS ||--o{ AUDIT_LOGS : "performed_by"
APPLICATIONS ||--o{ ACTIVITY_LOGS : "logged_in"
APPLICATIONS ||--o{ APPLICATION_STATUS_HISTORY : "tracks"
APPLICATIONS ||--o{ APPLICATION_PROGRESS : "tracks"

View File

@ -0,0 +1,969 @@
# RE Workflow Management System - Frontend Setup Guide
**Version:** 1.0
**Date:** October 16, 2025
**Technology Stack:** React 19 + TypeScript 5.7 + Vite 6.0 + Redux Toolkit 2.5 + Material-UI 6.3
---
## Table of Contents
1. [Frontend Architecture Overview](#frontend-architecture-overview)
2. [Technology Stack](#technology-stack)
3. [Project Folder Structure](#project-folder-structure)
4. [TypeScript Configuration](#typescript-configuration)
5. [State Management (Redux Toolkit)](#state-management-redux-toolkit)
6. [Component Structure](#component-structure)
7. [Configuration Management](#configuration-management)
8. [Deployment Architecture](#deployment-architecture)
9. [Development Setup Instructions](#development-setup-instructions)
---
## 1. Frontend Architecture Overview
### High-Level Architecture
```
┌─────────────────────────────────────────────────────────────┐
│ CLIENT LAYER │
│ React.js SPA (Single Page Application) │
│ - Material-UI / Ant Design Components │
│ - Redux Toolkit for State Management │
│ - React Router for Navigation │
│ - Axios for API Communication │
│ - Vite for Build & Development │
└─────────────────────────────────────────────────────────────┘
↕ HTTPS/REST API
┌─────────────────────────────────────────────────────────────┐
│ BACKEND API LAYER │
│ Express.js REST API Server │
│ - Node.js + TypeScript │
│ - PostgreSQL Database │
└─────────────────────────────────────────────────────────────┘
```
---
## 2. Technology Stack
| Component | Technology | Version | Purpose |
|-----------|-----------|---------|---------|
| **Frontend Library** | React.js | 19.0.x | UI component library |
| **Frontend Language** | TypeScript (TSX) | 5.7.x | Type-safe frontend development |
| **UI Framework** | Material-UI (MUI) | 6.3.x | Component design system |
| **Build Tool** | Vite | 6.0.x | Ultra-fast build & dev server |
| **State Management** | Redux Toolkit | 2.5.x | Application state management |
| **Routing** | React Router DOM | 7.1.x | Client-side routing |
| **HTTP Client** | Axios | 1.7.x | API communication |
| **Form Management** | Formik | 2.4.x | Form state management |
| **Form Validation** | Yup | 1.6.x | Schema validation |
| **Date Utilities** | date-fns | 4.1.x | Date manipulation |
| **Charts** | Recharts | 2.15.x | Data visualization |
| **Notifications** | React Toastify | 11.0.x | Toast notifications |
| **File Upload** | React Dropzone | 14.3.x | File upload UI |
| **Testing** | Vitest + React Testing Library | 2.1.x/16.1.x | Component testing |
| **Code Quality** | ESLint + Prettier | 9.x/3.x | Code linting & formatting |
---
## 3. Project Folder Structure
### Frontend Repository (`re-workflow-frontend`)
```
re-workflow-frontend/
├── public/ # Static assets
│ ├── index.html
│ ├── favicon.ico
│ ├── robots.txt
│ └── manifest.json
├── src/ # Source code
│ ├── index.tsx # Application entry point
│ ├── App.tsx # Root component
│ ├── App.css
│ ├── react-app-env.d.ts # React TypeScript declarations
│ │
│ ├── types/ # TypeScript type definitions
│ │ ├── index.ts # Main types export
│ │ ├── user.types.ts # User types
│ │ ├── workflow.types.ts # Workflow types
│ │ ├── approval.types.ts # Approval types
│ │ ├── document.types.ts # Document types
│ │ ├── notification.types.ts # Notification types
│ │ ├── common.types.ts # Common types
│ │ └── api.types.ts # API response types
│ │
│ ├── assets/ # Static assets
│ │ ├── images/
│ │ ├── icons/
│ │ ├── fonts/
│ │ └── styles/
│ │ ├── global.css
│ │ ├── variables.css
│ │ └── theme.ts
│ │
│ ├── components/ # Reusable components
│ │ ├── common/ # Generic components
│ │ │ ├── Button/
│ │ │ │ ├── Button.tsx
│ │ │ │ ├── Button.module.css
│ │ │ │ ├── Button.types.ts
│ │ │ │ └── Button.test.tsx
│ │ │ ├── Input/
│ │ │ ├── Dropdown/
│ │ │ ├── Modal/
│ │ │ ├── Card/
│ │ │ ├── Table/
│ │ │ ├── Tabs/
│ │ │ ├── Pagination/
│ │ │ ├── Loader/
│ │ │ ├── Notification/
│ │ │ └── ErrorBoundary/
│ │ │
│ │ ├── layout/ # Layout components
│ │ │ ├── Header/
│ │ │ │ ├── Header.tsx
│ │ │ │ ├── Header.module.css
│ │ │ │ └── Header.types.ts
│ │ │ ├── Sidebar/
│ │ │ ├── Footer/
│ │ │ ├── Navigation/
│ │ │ └── PageLayout/
│ │ │
│ │ ├── workflow/ # Workflow-specific components
│ │ │ ├── TemplateSelector/
│ │ │ ├── BasicInformation/
│ │ │ ├── ApprovalWorkflow/
│ │ │ │ ├── ApprovalWorkflow.tsx
│ │ │ │ ├── ApproverLevel.tsx
│ │ │ │ ├── TATCalculator.tsx
│ │ │ │ ├── ApprovalSummary.tsx
│ │ │ │ └── types.ts
│ │ │ ├── ParticipantAccess/
│ │ │ │ ├── ParticipantAccess.tsx
│ │ │ │ ├── SpectatorList.tsx
│ │ │ │ ├── UserTagging.tsx
│ │ │ │ └── types.ts
│ │ │ ├── DocumentUpload/
│ │ │ │ ├── DocumentUpload.tsx
│ │ │ │ ├── FilePreview.tsx
│ │ │ │ ├── GoogleDocsLink.tsx
│ │ │ │ └── types.ts
│ │ │ ├── ReviewSubmit/
│ │ │ └── WizardStepper/
│ │ │
│ │ ├── request/ # Request management components
│ │ │ ├── RequestCard/
│ │ │ ├── RequestList/
│ │ │ ├── RequestDetail/
│ │ │ │ ├── RequestOverview.tsx
│ │ │ │ ├── WorkflowTab.tsx
│ │ │ │ ├── DocumentTab.tsx
│ │ │ │ ├── ActivityTab.tsx
│ │ │ │ ├── TATProgressBar.tsx
│ │ │ │ └── types.ts
│ │ │ ├── StatusBadge/
│ │ │ └── PriorityIndicator/
│ │ │
│ │ ├── approval/ # Approval action components
│ │ │ ├── ApprovalModal/
│ │ │ ├── RejectionModal/
│ │ │ ├── ApprovalHistory/
│ │ │ └── ConclusionRemark/
│ │ │
│ │ ├── workNote/ # Work notes / chat components
│ │ │ ├── WorkNoteChat/
│ │ │ ├── MessageItem/
│ │ │ ├── MessageComposer/
│ │ │ ├── FileAttachment/
│ │ │ └── UserMention/
│ │ │
│ │ ├── notification/ # Notification components
│ │ │ ├── NotificationBell/
│ │ │ ├── NotificationList/
│ │ │ ├── NotificationItem/
│ │ │ └── NotificationSettings/
│ │ │
│ │ └── dashboard/ # Dashboard components
│ │ ├── DashboardCard/
│ │ ├── StatisticsWidget/
│ │ ├── RecentRequests/
│ │ └── QuickActions/
│ │
│ ├── pages/ # Page components (routes)
│ │ ├── Auth/
│ │ │ ├── Login.tsx
│ │ │ └── SSOCallback.tsx
│ │ ├── Dashboard/
│ │ │ └── Dashboard.tsx
│ │ ├── CreateRequest/
│ │ │ └── CreateRequest.tsx
│ │ ├── MyRequests/
│ │ │ └── MyRequests.tsx
│ │ ├── OpenRequests/
│ │ │ └── OpenRequests.tsx
│ │ ├── ClosedRequests/
│ │ │ └── ClosedRequests.tsx
│ │ ├── RequestDetail/
│ │ │ └── RequestDetail.tsx
│ │ ├── NotFound/
│ │ │ └── NotFound.tsx
│ │ └── Unauthorized/
│ │ └── Unauthorized.tsx
│ │
│ ├── redux/ # Redux state management
│ │ ├── store.ts # Redux store configuration
│ │ ├── hooks.ts # Typed Redux hooks
│ │ ├── slices/
│ │ │ ├── authSlice.ts
│ │ │ ├── workflowSlice.ts
│ │ │ ├── approvalSlice.ts
│ │ │ ├── notificationSlice.ts
│ │ │ ├── documentSlice.ts
│ │ │ ├── workNoteSlice.ts
│ │ │ ├── participantSlice.ts
│ │ │ └── uiSlice.ts
│ │ └── middleware/
│ │ └── apiMiddleware.ts
│ │
│ ├── services/ # API service layer
│ │ ├── api.ts # Axios instance configuration
│ │ ├── auth.service.ts
│ │ ├── workflow.service.ts
│ │ ├── approval.service.ts
│ │ ├── document.service.ts
│ │ ├── notification.service.ts
│ │ ├── workNote.service.ts
│ │ ├── participant.service.ts
│ │ ├── dashboard.service.ts
│ │ └── user.service.ts
│ │
│ ├── hooks/ # Custom React hooks
│ │ ├── useAuth.ts
│ │ ├── useWorkflow.ts
│ │ ├── useNotification.ts
│ │ ├── useDebounce.ts
│ │ ├── useInfiniteScroll.ts
│ │ ├── useLocalStorage.ts
│ │ └── useWebSocket.ts
│ │
│ ├── utils/ # Utility functions
│ │ ├── constants.ts
│ │ ├── validators.ts
│ │ ├── formatters.ts
│ │ ├── dateUtils.ts
│ │ ├── fileUtils.ts
│ │ ├── errorHandler.ts
│ │ └── helpers.ts
│ │
│ ├── routes/ # React Router configuration
│ │ ├── AppRoutes.tsx
│ │ ├── PrivateRoute.tsx
│ │ └── PublicRoute.tsx
│ │
│ └── config/ # Frontend configuration
│ ├── api.config.ts
│ ├── theme.config.ts
│ └── constants.config.ts
├── dist/ # Build output (Vite)
├── tests/ # Test files
│ ├── components/
│ ├── pages/
│ ├── redux/
│ ├── services/
│ └── setup.js
├── docs/ # Component documentation
│ └── storybook/
├── nginx/ # Nginx configuration for production
│ └── default.conf
├── .env.example
├── .env.development
├── .env.production
├── .eslintrc.json
├── .prettierrc
├── .gitignore
├── .dockerignore
├── Dockerfile
├── vite.config.ts # Vite configuration
├── tsconfig.json # TypeScript configuration
├── package.json
├── package-lock.json
└── README.md
```
---
## 4. TypeScript Configuration
### `tsconfig.json`
```json
{
"compilerOptions": {
"target": "ES2020",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"jsx": "react-jsx",
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"allowJs": true,
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"allowSyntheticDefaultImports": true,
"isolatedModules": true,
"noEmit": true,
"baseUrl": "./src",
"paths": {
"@/*": ["./*"],
"@components/*": ["components/*"],
"@pages/*": ["pages/*"],
"@services/*": ["services/*"],
"@redux/*": ["redux/*"],
"@hooks/*": ["hooks/*"],
"@utils/*": ["utils/*"],
"@types/*": ["types/*"],
"@config/*": ["config/*"],
"@assets/*": ["assets/*"]
}
},
"include": ["src"],
"exclude": ["node_modules", "build", "dist"]
}
```
### `vite.config.ts`
```typescript
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@components': path.resolve(__dirname, './src/components'),
'@pages': path.resolve(__dirname, './src/pages'),
'@services': path.resolve(__dirname, './src/services'),
'@redux': path.resolve(__dirname, './src/redux'),
'@hooks': path.resolve(__dirname, './src/hooks'),
'@utils': path.resolve(__dirname, './src/utils'),
'@types': path.resolve(__dirname, './src/types'),
'@config': path.resolve(__dirname, './src/config'),
'@assets': path.resolve(__dirname, './src/assets'),
},
},
server: {
port: 3000,
proxy: {
'/api': {
target: 'http://localhost:5000',
changeOrigin: true,
},
},
},
build: {
outDir: 'dist',
sourcemap: true,
},
});
```
---
## 5. State Management (Redux Toolkit)
### Redux Store Configuration
#### `src/redux/store.ts`
```typescript
import { configureStore } from '@reduxjs/toolkit';
import authReducer from './slices/authSlice';
import workflowReducer from './slices/workflowSlice';
import approvalReducer from './slices/approvalSlice';
import notificationReducer from './slices/notificationSlice';
import documentReducer from './slices/documentSlice';
import workNoteReducer from './slices/workNoteSlice';
import participantReducer from './slices/participantSlice';
import uiReducer from './slices/uiSlice';
export const store = configureStore({
reducer: {
auth: authReducer,
workflow: workflowReducer,
approval: approvalReducer,
notification: notificationReducer,
document: documentReducer,
workNote: workNoteReducer,
participant: participantReducer,
ui: uiReducer,
},
middleware: (getDefaultMiddleware) =>
getDefaultMiddleware({
serializableCheck: {
ignoredActions: ['persist/PERSIST'],
},
}),
});
export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch;
```
### Typed Redux Hooks
#### `src/redux/hooks.ts`
```typescript
import { useDispatch, useSelector } from 'react-redux';
import type { TypedUseSelectorHook } from 'react-redux';
import type { RootState, AppDispatch } from './store';
// Use throughout your app instead of plain `useDispatch` and `useSelector`
export const useAppDispatch: () => AppDispatch = useDispatch;
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;
```
### Type Definitions
#### `src/types/common.types.ts`
```typescript
export enum Priority {
STANDARD = 'STANDARD',
EXPRESS = 'EXPRESS'
}
export enum WorkflowStatus {
DRAFT = 'DRAFT',
PENDING = 'PENDING',
IN_PROGRESS = 'IN_PROGRESS',
APPROVED = 'APPROVED',
REJECTED = 'REJECTED',
CLOSED = 'CLOSED'
}
export interface ApiResponse<T = any> {
success: boolean;
message: string;
data?: T;
error?: string;
timestamp: string;
}
export interface PaginatedResponse<T> {
data: T[];
pagination: {
page: number;
limit: number;
total: number;
totalPages: number;
};
}
```
---
## 6. Component Structure
### Example: Button Component
#### `src/components/common/Button/Button.tsx`
```typescript
import React from 'react';
import styles from './Button.module.css';
interface ButtonProps {
label: string;
onClick: () => void;
variant?: 'primary' | 'secondary' | 'danger';
disabled?: boolean;
fullWidth?: boolean;
}
const Button: React.FC<ButtonProps> = ({
label,
onClick,
variant = 'primary',
disabled = false,
fullWidth = false,
}) => {
return (
<button
className={`${styles.button} ${styles[variant]} ${
fullWidth ? styles.fullWidth : ''
}`}
onClick={onClick}
disabled={disabled}
>
{label}
</button>
);
};
export default Button;
```
#### `src/components/common/Button/Button.types.ts`
```typescript
export interface ButtonProps {
label: string;
onClick: () => void;
variant?: 'primary' | 'secondary' | 'danger';
disabled?: boolean;
fullWidth?: boolean;
}
```
---
## 7. Configuration Management
### Environment Variables
#### `.env.example`
```bash
# frontend/.env.example
# Application
REACT_APP_ENV=development
REACT_APP_NAME=RE Workflow Management
REACT_APP_VERSION=1.0.0
# API Configuration
REACT_APP_API_BASE_URL=http://localhost:5000/api/v1
REACT_APP_API_TIMEOUT=30000
# SSO Configuration
REACT_APP_SSO_LOGIN_URL=http://localhost:5000/api/v1/auth/login
REACT_APP_SSO_LOGOUT_URL=http://localhost:5000/api/v1/auth/logout
# Feature Flags
REACT_APP_ENABLE_NOTIFICATIONS=true
REACT_APP_ENABLE_EMAIL_NOTIFICATIONS=false
REACT_APP_ENABLE_ANALYTICS=true
# File Upload
REACT_APP_MAX_FILE_SIZE_MB=10
REACT_APP_ALLOWED_FILE_TYPES=pdf,doc,docx,xls,xlsx,ppt,pptx,jpg,jpeg,png,gif
# Google Integration
REACT_APP_GOOGLE_API_KEY=your_google_api_key
# UI Configuration
REACT_APP_THEME_PRIMARY_COLOR=#1976d2
REACT_APP_ITEMS_PER_PAGE=20
```
### API Configuration
#### `src/config/api.config.ts`
```typescript
export const API_CONFIG = {
baseURL: import.meta.env.VITE_API_BASE_URL || 'http://localhost:5000/api/v1',
timeout: parseInt(import.meta.env.VITE_API_TIMEOUT || '30000'),
headers: {
'Content-Type': 'application/json',
},
};
export const API_ENDPOINTS = {
auth: {
login: '/auth/login',
logout: '/auth/logout',
me: '/auth/me',
},
workflows: {
getAll: '/workflows',
create: '/workflows',
getById: (id: string) => `/workflows/${id}`,
update: (id: string) => `/workflows/${id}`,
submit: (id: string) => `/workflows/${id}/submit`,
},
// ... more endpoints
};
```
---
## 8. Deployment Architecture
### Dockerfile
#### `Dockerfile`
```dockerfile
# re-workflow-frontend/Dockerfile
FROM node:22-alpine AS builder
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci
# Copy source code
COPY . .
# Build application with Vite
RUN npm run build
# =====================================
# Production Image with Nginx
# =====================================
FROM nginx:alpine
# Copy custom nginx config
COPY nginx/default.conf /etc/nginx/conf.d/default.conf
# Copy built files from builder (Vite outputs to 'dist' by default)
COPY --from=builder /app/dist /usr/share/nginx/html
# Expose port
EXPOSE 80
# Health check
HEALTHCHECK --interval=30s --timeout=3s \
CMD wget --quiet --tries=1 --spider http://localhost/ || exit 1
CMD ["nginx", "-g", "daemon off;"]
```
### Nginx Configuration
#### `nginx/default.conf`
```nginx
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
# Gzip compression
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
# React Router support
location / {
try_files $uri $uri/ /index.html;
}
# Cache static assets
location /assets/ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# Health check endpoint
location /health {
access_log off;
return 200 "healthy\n";
add_header Content-Type text/plain;
}
}
```
### CI/CD Pipeline (GitHub Actions)
#### `.github/workflows/frontend-deploy.yml`
```yaml
# .github/workflows/frontend-deploy.yml
name: Frontend CI/CD
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
test-and-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install dependencies
run: npm ci
- name: Run linter
run: npm run lint
- name: Run tests
run: npm test
- name: Build application
run: npm run build
- name: Build Docker image
run: docker build -t gcr.io/re-project/re-workflow-frontend:${{ github.sha }} .
- name: Push to GCR
run: docker push gcr.io/re-project/re-workflow-frontend:${{ github.sha }}
```
---
## 9. Development Setup Instructions
### 9.1 Prerequisites
- **Node.js:** v22.x LTS
- **npm:** v10.x or higher
- **Git:** Latest version
- **TypeScript:** v5.7.x (installed as dev dependency)
- **Backend API:** Running on `http://localhost:5000` (see backend documentation)
### 9.2 Local Development Setup
#### Step 1: Clone Frontend Repository
```bash
git clone https://github.com/royalenfield/re-workflow-frontend.git
cd re-workflow-frontend
```
#### Step 2: Configure Frontend Environment
```bash
# Copy environment file
cp .env.example .env
# Edit .env with backend API URL
nano .env # or use your preferred editor
# Set REACT_APP_API_BASE_URL=http://localhost:5000/api/v1
```
#### Step 3: Install Dependencies & Run Frontend
```bash
# Install dependencies
npm install
# Run TypeScript type checking
npm run type-check
# Start development server (Vite with hot reload)
npm run dev
# Frontend will run on: http://localhost:3000
```
#### Step 4: Access Application
- **Frontend:** http://localhost:3000
- **Backend API:** http://localhost:5000
- **API Documentation:** http://localhost:5000/api-docs
- **Health Check:** http://localhost:5000/health
### 9.3 Docker Setup
```bash
# From frontend repository root
cd re-workflow-frontend
# Copy environment file
cp .env.example .env
# Build Docker image
docker build -t re-workflow-frontend .
# Run frontend container
docker run -d -p 3000:80 --name frontend re-workflow-frontend
# Access frontend: http://localhost:3000
# Stop container
docker stop frontend
docker rm frontend
```
### 9.4 Running Tests
```bash
# From frontend repository
cd re-workflow-frontend
npm test # Run all tests (Vitest)
npm run test:ui # Interactive UI mode (Vitest)
npm run test:coverage # With coverage report
# Coverage report will be in: coverage/
```
### 9.5 Code Quality Checks
```bash
# From frontend repository
cd re-workflow-frontend
npm run lint # ESLint check (React + TypeScript rules)
npm run lint:fix # Auto-fix issues
npm run format # Prettier formatting
npm run type-check # TypeScript type checking only (no build)
# Run all quality checks together
npm run lint && npm run type-check && npm test
```
### 9.6 Git Workflow
```bash
# Feature branch workflow
git checkout -b feature/your-feature-name
git add .
git commit -m "feat: add your feature description"
git push origin feature/your-feature-name
# Create Pull Request on GitHub/GitLab
# After approval and merge:
git checkout main
git pull origin main
```
**Branch Strategy:**
- `main` - Production-ready code
- `develop` - Integration branch for features
- `feature/*` - New features
- `bugfix/*` - Bug fixes
- `hotfix/*` - Production hotfixes
**Commit Message Convention (Conventional Commits):**
- `feat:` - New feature
- `fix:` - Bug fix
- `docs:` - Documentation changes
- `style:` - Code style changes (formatting)
- `refactor:` - Code refactoring
- `test:` - Test additions or changes
- `chore:` - Build process or tool changes
---
## 10. Package.json
```json
{
"name": "re-workflow-frontend",
"version": "1.0.0",
"description": "Royal Enfield Workflow Management System - Frontend (TypeScript)",
"private": true,
"dependencies": {
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-router-dom": "^7.1.1",
"@reduxjs/toolkit": "^2.5.0",
"react-redux": "^9.2.0",
"@mui/material": "^6.3.0",
"@mui/icons-material": "^6.3.0",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"axios": "^1.7.9",
"formik": "^2.4.6",
"yup": "^1.6.3",
"zod": "^3.24.1",
"react-dropzone": "^14.3.5",
"date-fns": "^4.1.0",
"recharts": "^2.15.0",
"react-toastify": "^11.0.2"
},
"devDependencies": {
"@types/react": "^19.0.6",
"@types/react-dom": "^19.0.2",
"@types/node": "^22.10.5",
"typescript": "^5.7.2",
"vite": "^6.0.7",
"@vitejs/plugin-react": "^4.3.4",
"@testing-library/react": "^16.1.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/user-event": "^14.5.2",
"eslint": "^9.17.0",
"@typescript-eslint/eslint-plugin": "^8.19.1",
"@typescript-eslint/parser": "^8.19.1",
"prettier": "^3.4.2",
"vitest": "^2.1.8"
},
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"test": "vitest",
"test:ui": "vitest --ui",
"test:coverage": "vitest --coverage",
"lint": "eslint src/**/*.{ts,tsx}",
"lint:fix": "eslint src/**/*.{ts,tsx} --fix",
"format": "prettier --write \"src/**/*.{ts,tsx,css}\"",
"type-check": "tsc --noEmit"
},
"eslintConfig": {
"extends": ["react-app", "react-app/jest"]
},
"browserslist": {
"production": [">0.2%", "not dead", "not op_mini all"],
"development": ["last 1 chrome version", "last 1 firefox version", "last 1 safari version"]
},
"engines": {
"node": ">=22.0.0",
"npm": ">=10.0.0"
}
}
```
---
## Summary
This frontend documentation provides:
**Complete Frontend Architecture** - React SPA with Vite, Redux Toolkit, TypeScript
**Technology Stack** - React 19 + TypeScript 5.7 + Vite 6.0 + Material-UI 6.3
**Folder Structure** - Detailed organization with TypeScript conventions
**Type Definitions** - Comprehensive type safety with interfaces and enums
**Redux Toolkit Setup** - Fully typed state management
**Component Structure** - Reusable, testable components
**Configuration Management** - Environment variables and settings
**Deployment Architecture** - Docker, Nginx, CI/CD pipelines
**Development Setup** - Step-by-step installation and configuration
**Testing Strategy** - Vitest and React Testing Library
**Code Quality** - ESLint, Prettier, TypeScript best practices
**Technology Stack:** React 19 + TypeScript 5.7 + Vite 6.0 + Redux Toolkit 2.5 + Material-UI 6.3
**Repository:** `re-workflow-frontend` (Independent Repository)
**Status:** ✅ Ready for Implementation

View File

@ -7,53 +7,152 @@ graph TB
CheckLocation -->|Yes| AckEmail[Send Acknowledgement Email]
AckEmail --> SendQuestionnaire[Send Opportunity Email with Questionnaire Link]
SendQuestionnaire --> WaitResponse{Response Received?}
SendQuestionnaire --> WaitResponse{Questionnaire Response Received?}
WaitResponse -->|No - D+2| Reminder1[Send Reminder Email]
Reminder1 --> WaitResponse2{Response Received?}
WaitResponse2 -->|No - D+5| Reminder2[Send Final Reminder]
Reminder2 --> WaitResponse3{Response Received?}
WaitResponse3 -->|No - D+20| ExpireLink[Close Questionnaire - Expired]
WaitResponse -->|No| SendReminder[Send Reminder Email<br/>SLA-based Auto-Trigger]
SendReminder --> WaitResponse
WaitResponse -->|Yes| ProcessResponse[Calculate Weighted Rank & Score]
WaitResponse -->|Yes| ProcessResponse[Calculate Weighted Rank]
WaitResponse2 -->|Yes| ProcessResponse
WaitResponse3 -->|Yes| ProcessResponse
ProcessResponse --> DDShortlist[DD-Admin Reviews & Shortlists Applications]
DDShortlist --> WorkNotes1[Work Notes: DD-Admin adds remarks<br/>& assigns to zones]
WorkNotes1 --> AssignZM[Assign to DD-ZM & RBM]
ProcessResponse --> DDShortlist[DD Team Reviews & Shortlists Top 10]
DDShortlist --> AssignZM[Assign to Zonal Manager ZM-DD]
AssignZM --> ScheduleL1[DD-Admin Schedules Level 1 Interview<br/>Mode: Virtual Google Meet or Physical<br/>Adds Date, Time, Participants, Link/Venue]
ScheduleL1 --> SendCalendarL1[System: Send Google Calendar Invites<br/>to DD-ZM, RBM & Applicant]
SendCalendarL1 --> Level1Interview[Level 1 Interview Conducted<br/>DD-ZM + RBM with Applicant]
Level1Interview --> Level1Eval[Level 1 Evaluation Process]
Level1Eval --> KTMatrixL1[DD-ZM & RBM Fill KT Matrix<br/>Age, Qualification, Local Knowledge,<br/>Passion, Business Acumen, etc.]
KTMatrixL1 --> FeedbackL1[DD-ZM & RBM Submit Feedback Forms<br/>Qualitative Remarks & Recommendations]
FeedbackL1 --> WorkNotesL1[Work Notes: Panelists add comments<br/>@tag users for clarifications]
WorkNotesL1 --> Level1Decision{Level 1 Decision<br/>Approve or Reject}
Level1Decision -->|Rejected| Level1Reject[Store Rejection Reason<br/>Work Notes: Log decision & Notify]
Level1Decision -->|Approved| AssignLevel2[Auto-Assign to DD-Lead + ZBH<br/>Work Notes: Status update logged]
AssignZM --> ZMEval{ZM-DD KT Evaluation}
ZMEval -->|Rejected| ZMReject[Store Rejection Reason]
ZMEval -->|Shortlisted| AssignRBM[Auto-Assign to RBM]
AssignLevel2 --> ScheduleL2[DD-Admin Schedules Level 2 Interview<br/>Mode: Virtual Google Meet or Physical<br/>Adds Date, Time, Participants, Link/Venue]
ScheduleL2 --> SendCalendarL2[System: Send Google Calendar Invites<br/>to DD-Lead, ZBH & Applicant]
SendCalendarL2 --> Level2Interview[Level 2 Interview Conducted<br/>DD-Lead + ZBH with Applicant]
Level2Interview --> Level2Eval[Level 2 Evaluation Process]
Level2Eval --> FeedbackL2[DD-Lead & ZBH Submit Feedback Forms<br/>Business Strategy & Operational Assessment]
FeedbackL2 --> WorkNotesL2[Work Notes: Panelists add comments<br/>@tag users for clarifications]
WorkNotesL2 --> Level2Decision{Level 2 Decision<br/>Approve or Reject}
Level2Decision -->|Rejected| Level2Reject[Store Rejection Reason<br/>Work Notes: Log decision & Notify]
Level2Decision -->|Approved| AssignLevel3[Auto-Assign to NBH + DD-Head<br/>Work Notes: Status update logged]
AssignRBM --> RBMEval{RBM Evaluation}
RBMEval -->|Rejected| RBMReject[Store Rejection Reason]
RBMEval -->|Approved| AssignDDL[Auto-Assign to DDL Team]
AssignLevel3 --> ScheduleL3[DD-Admin Schedules Level 3 Interview<br/>Mode: Virtual Google Meet or Physical<br/>Adds Date, Time, Participants, Link/Venue]
ScheduleL3 --> SendCalendarL3[System: Send Google Calendar Invites<br/>to NBH, DD-Head & Applicant]
SendCalendarL3 --> Level3Interview[Level 3 Interview Conducted<br/>NBH + DD-Head with Applicant]
Level3Interview --> Level3Eval[Level 3 Evaluation Process]
Level3Eval --> CollectFeedbackL3[Collect All Panel Feedback<br/>RBM, ZBH, DD-ZM, DD-Lead, DD-Head]
CollectFeedbackL3 --> AISummary[AI Engine Gemini API:<br/>Generate 2-3 Line Summary<br/>Consensus, Strengths, Concerns]
AISummary --> NBHReview[NBH Reviews AI Summary<br/>Editable Format - Can Modify]
NBHReview --> WorkNotesL3[Work Notes: NBH adds final remarks<br/>@tag stakeholders if needed]
WorkNotesL3 --> Level3Decision{Level 3 Final Decision<br/>Approve or Reject}
Level3Decision -->|Rejected| Level3Reject[Store Rejection Reason<br/>Work Notes: Log decision & Notify]
Level3Decision -->|Approved| AssignFDD[Auto-Assign to FDD Team<br/>Work Notes: Status update logged]
AssignDDL --> FDD[Send OTP-Protected Link for Financial Due Diligence]
FDD --> UploadFDD[External Agency Uploads FDD Report L1/L2]
UploadFDD --> SubmitNBH[DD Team Submits to NBH]
AssignFDD --> FDDProcess[FDD: Send OTP-Protected Link<br/>to External FDD Agency]
FDDProcess --> FDDWorkNotes[Work Notes: FDD can raise queries<br/>@DD-Admin or @Finance for clarifications<br/>Flag non-responsive applicants]
FDDWorkNotes --> UploadFDD[External FDD Agency Uploads Report<br/>FDD Report L1/L2 with Remarks]
UploadFDD --> FinanceReview[Finance Team Reviews FDD Report]
FinanceReview --> FinanceWorkNotes[Work Notes: Finance adds review comments<br/>@DD-Lead for clarifications if needed]
FinanceWorkNotes --> FinanceDecision{Finance Decision<br/>Approve or Reject}
FinanceDecision -->|Rejected| FinanceReject[Store Rejection & Notify<br/>Work Notes: Log rejection reason]
FinanceDecision -->|Approved| LOIDocRequest[LOI: Request Documents from Applicant<br/>Work Notes: Status update logged]
SubmitNBH --> NBHApproval{NBH Approval}
NBHApproval -->|Rejected| NBHReject[Store Rejection & Notify]
NBHApproval -->|Approved| IssueLOI[Generate & Send LOI]
LOIDocRequest --> CollectDocs[Collect Mandatory LOI Documents<br/>DIP Booklet, Profile Sheet, PAN/Aadhaar,<br/>CIBIL Reports, Layout Drawings, etc.]
CollectDocs --> VerifyDocs[DD-Admin Verifies Document Completeness]
VerifyDocs --> VerifyWorkNotes[Work Notes: DD-Admin adds verification remarks<br/>@Finance if clarification needed]
VerifyWorkNotes --> DocsComplete{Documents Complete?}
DocsComplete -->|No| RequestMoreDocs[Request Missing Documents<br/>Work Notes: Log missing items]
RequestMoreDocs --> CollectDocs
DocsComplete -->|Yes| SecurityDeposit[Request Security Deposit via RTGS/NEFT<br/>Work Notes: Status update]
IssueLOI --> UploadLOI[Upload LOI to System]
UploadLOI --> IssueLOA[Generate & Send LOA]
IssueLOA --> UploadLOA[Upload LOA to System]
SecurityDeposit --> UploadDepositProof[Applicant Uploads Deposit Proof<br/>Transaction Slip/Confirmation]
UploadDepositProof --> FinanceVerify[Finance Verifies Security Deposit<br/>Cross-check with Corporate Account]
FinanceVerify --> FinanceVerifyNotes[Work Notes: Finance adds verification remarks<br/>@DD-Admin if discrepancy found]
FinanceVerifyNotes --> DepositDecision{Deposit Verified?}
DepositDecision -->|No| DepositReject[Flag Discrepancy & Notify<br/>Work Notes: Log discrepancy details]
DepositDecision -->|Yes| LOIApproval[LOI Approval Workflow<br/>Work Notes: Status update logged]
UploadLOA --> ScheduleEOR[Regional DD Schedules EOR Audit]
ScheduleEOR --> UploadEOR[Upload EOR Audit Report]
UploadEOR --> EORApproval{NBH EOR Approval}
LOIApproval --> FinanceApproval[Finance Reviews LOI Documents<br/>Work Notes: Finance adds approval remarks]
FinanceApproval --> FinanceLOIDecision{Finance Approval}
FinanceLOIDecision -->|Rejected| LOIReject1[Store Rejection & Notify<br/>Work Notes: Log rejection reason]
FinanceLOIDecision -->|Approved| DDHeadApproval[DD-Head Reviews LOI<br/>Validates Business Justification<br/>Work Notes: DD-Head adds remarks]
DDHeadApproval --> DDHeadLOIDecision{DD-Head Approval}
DDHeadLOIDecision -->|Rejected| LOIReject2[Store Rejection & Notify<br/>Work Notes: Log rejection reason]
DDHeadLOIDecision -->|Approved| NBHLOIApproval[NBH Reviews LOI<br/>Final Release Authorization<br/>Work Notes: NBH adds final remarks]
EORApproval -->|Rejected| EORReject[Store Rejection & Notify]
EORApproval -->|Approved| UpdateDealer[Update Dealer Info: Inauguration Date, Codes]
NBHLOIApproval --> NBHLOIDecision{NBH Final Approval}
NBHLOIDecision -->|Rejected| LOIReject3[Store Rejection & Notify<br/>Work Notes: Log rejection reason]
NBHLOIDecision -->|Approved| GenerateLOI[Generate & Send LOI<br/>Email & WhatsApp to Applicant<br/>Work Notes: LOI issuance logged]
GenerateLOI --> UploadLOI[Upload LOI to System<br/>Work Notes: Document upload logged]
UploadLOI --> LOIAck[Applicant Uploads LOI Acknowledgement Copy<br/>Signed with Seal]
LOIAck --> GenerateDealerCode[Generate Dealer Code via SAP OData API]
GenerateDealerCode --> AssignArchitecture[Assign to Architecture/Brand Experience Team]
AssignArchitecture --> ArchWork[Architectural Work: Upload DWG Layout & Drawings]
ArchWork --> DealerConsent{Dealer Provides Layout Consent}
DealerConsent -->|Rejected| ReviseLayout[Revise Layout]
ReviseLayout --> ArchWork
DealerConsent -->|Approved| StatutoryDocs[Collect Statutory Documents]
StatutoryDocs --> UploadStatutory[Upload: GST, PAN, Nodal Agreement,<br/>Partnership Deed, Firm Registration,<br/>Rental Agreement, Virtual Code,<br/>Domain ID, MSD Config, etc.]
UploadStatutory --> VerifyStatutory[Finance & Legal Verify Documents<br/>Work Notes: Verifiers add comments<br/>@DD-Admin if issues found]
VerifyStatutory --> StatutoryDecision{Documents Verified?}
StatutoryDecision -->|No| RequestStatutory[Request Re-submission<br/>Work Notes: Log missing/invalid items]
RequestStatutory --> UploadStatutory
StatutoryDecision -->|Yes| EORChecklist[EOR: Essential Operating Requirements Checklist<br/>Work Notes: Status update logged]
EORChecklist --> VerifyEOR[All Teams Verify EOR Parameters:<br/>Sales, Service, IT, Finance,<br/>Training, Architecture, etc.<br/>Work Notes: Teams add verification comments]
VerifyEOR --> EORWorkNotes[Work Notes: DD-Admin monitors progress<br/>@tag teams for pending items]
EORWorkNotes --> EORComplete{EOR 100% Complete?}
EORComplete -->|No| ContinueEOR[Continue EOR Verification<br/>Work Notes: Track pending items]
ContinueEOR --> VerifyEOR
EORComplete -->|Yes| LOARequest[LOA: Request Preparation<br/>Work Notes: EOR completion logged]
LOARequest --> LOAApproval[LOA Approval: DD-Head + NBH Review<br/>Work Notes: Reviewers add approval remarks]
LOAApproval --> LOAApproved{LOA Approved?}
LOAApproved -->|Rejected| LOAReject[Store Rejection & Notify<br/>Work Notes: Log rejection reason]
LOAApproved -->|Approved| GenerateLOA[Generate & Send LOA<br/>Email & WhatsApp to Applicant<br/>Work Notes: LOA issuance logged]
GenerateLOA --> UploadLOA[Upload LOA to System<br/>Work Notes: Document upload logged]
UploadLOA --> ScheduleInauguration[Schedule Inauguration Event]
ScheduleInauguration --> UploadInauguration[Upload Inauguration Report & Photos]
UploadInauguration --> UpdateDealer[Update Dealer Info:<br/>Inauguration Date, Status, Codes]
UpdateDealer --> ActiveDealer[Active Dealer]
ActiveDealer --> End[Onboarding Complete]
ActiveDealer --> End([Onboarding Complete])
style Start fill:#90EE90
style End fill:#FFB6C1
style ActiveDealer fill:#87CEEB
style NBHApproval fill:#FFD700
style EORApproval fill:#FFD700
style ScheduleL1 fill:#E6F3FF
style ScheduleL2 fill:#E6F3FF
style ScheduleL3 fill:#E6F3FF
style SendCalendarL1 fill:#E6F3FF
style SendCalendarL2 fill:#E6F3FF
style SendCalendarL3 fill:#E6F3FF
style Level1Decision fill:#FFE4B5
style Level2Decision fill:#FFE4B5
style Level3Decision fill:#FFD700
style AISummary fill:#FFE4B5
style FinanceReview fill:#FFE4B5
style FinanceDecision fill:#FFE4B5
style FinanceVerify fill:#FFE4B5
style DepositDecision fill:#FFE4B5
style FinanceLOIDecision fill:#FFE4B5
style DDHeadLOIDecision fill:#FFD700
style NBHLOIDecision fill:#FFD700
style DocsComplete fill:#FFE4B5
style StatutoryDecision fill:#FFE4B5
style EORComplete fill:#FFE4B5
style LOAApproved fill:#FFD700
style WorkNotes1 fill:#FFF8DC
style WorkNotesL1 fill:#FFF8DC
style WorkNotesL2 fill:#FFF8DC
style WorkNotesL3 fill:#FFF8DC
style FDDWorkNotes fill:#FFF8DC
style FinanceWorkNotes fill:#FFF8DC
style VerifyWorkNotes fill:#FFF8DC
style FinanceVerifyNotes fill:#FFF8DC

View File

@ -0,0 +1,300 @@
graph TB
%% ============================================
%% DEALER ONBOARDING COMPREHENSIVE WORKFLOW
%% Based on Re_New_Dealer_Onboard.md
%% ============================================
Start([Dealer Inquiry Received]) --> SubmitForm[Applicant Submits<br/>'Become a Dealer' Form<br/>Captures: Name, Mobile, Email, Age,<br/>Country, State, District, Pincode,<br/>Interested City, Company Name,<br/>Education, Ownership Details, Address]
SubmitForm --> StoreApp[System Stores Application<br/>in Database & Shows in Listing]
StoreApp --> CheckOpportunity{System Checks Location<br/>Against Opportunity Master<br/>Has Vacancy?}
CheckOpportunity -->|No Opportunity| NonOppEmail[Send Non-Opportunity Email<br/>Informs: Region Closed<br/>Info Retained for Future Reference]
CheckOpportunity -->|Opportunity Exists| OppEmail[Send Opportunity Email<br/>with Login Credentials<br/>& Questionnaire Link]
OppEmail --> AccessQuestionnaire[Applicant Accesses<br/>Questionnaire Portal]
AccessQuestionnaire --> FillQuestionnaire[Applicant Fills Comprehensive<br/>Questionnaire:<br/>Personal Information<br/>Financial Information<br/>Business Information]
FillQuestionnaire --> AutoScore[System Auto-Scores Responses<br/>Calculates Weighted Rank<br/>Generates Questionnaire Score<br/>e.g., 78/100]
AutoScore --> AdminBucket[Application Moves to<br/>Admin Review Bucket]
AdminBucket --> DDAdminReview[DD-Admin Reviews Application<br/>Validates Details & Documents<br/>Work Notes: Adds Remarks]
DDAdminReview --> AdminDecision{Admin Decision:<br/>Shortlist or Archive?}
AdminDecision -->|Archive| ArchiveApp[Archive for Future<br/>Opportunities]
AdminDecision -->|Shortlist| AssignZone[Assign to Respective<br/>Zone/Region<br/>Work Notes: Assignment logged]
AssignZone --> AssignZM[Auto-Assign to<br/>DD-ZM & RBM]
%% ============================================
%% LEVEL 1 INTERVIEW PROCESS
%% ============================================
AssignZM --> ScheduleL1[DD-Admin Schedules Level 1 Interview<br/>Interview Type: Level 1<br/>Mode: Virtual Google Meet OR Physical Venue<br/>Date & Time: Calendar Selection<br/>Participants: DD-ZM, RBM, Applicant<br/>Meeting Link/Venue: Admin Enters]
ScheduleL1 --> SendCalL1[System Sends Google Calendar Invites<br/>to DD-ZM, RBM & Applicant<br/>Contains: Date, Time, Mode, Link/Venue]
SendCalL1 --> ConductL1[Level 1 Interview Conducted<br/>DD-ZM + RBM with Applicant<br/>Virtual via Google Meet OR Physical]
ConductL1 --> EvalL1[Level 1 Evaluation Process]
EvalL1 --> KTMatrixL1[DD-ZM & RBM Fill KT Matrix<br/>Quantitative Scoring:<br/>- Age & Qualification<br/>- Local Knowledge & Influence<br/>- Passion for Royal Enfield & Riding<br/>- Business Acumen & Investment Capacity<br/>- Base Location vs Applied Location<br/>- Property Ownership<br/>- Time Availability<br/>- Future Expansion Plans<br/>Total: 100% Weighted]
KTMatrixL1 --> FeedbackL1[DD-ZM & RBM Submit<br/>Interview Feedback Form<br/>Qualitative Assessment:<br/>- Strategic Vision & Market Understanding<br/>- Management Capabilities<br/>- Operational Readiness<br/>- Key Strengths & Areas of Concern<br/>Overall Performance Score<br/>Final Recommendation: Approve/Reject/Hold]
FeedbackL1 --> WorkNotesL1[Work Notes: Panelists Add Comments<br/>@tag Users for Clarifications<br/>Time-Stamped Communication Trail]
WorkNotesL1 --> RankL1[System Auto-Calculates<br/>Total KT Matrix Score<br/>Updates Applicant Rank<br/>within City/Region]
RankL1 --> DecisionL1{Level 1 Decision<br/>Approve or Reject}
DecisionL1 -->|Rejected| RejectL1[Store Rejection Reason<br/>Work Notes: Log Decision<br/>Notify Applicant via Email & WhatsApp<br/>Audit Trail: Action Logged]
DecisionL1 -->|Approved| AssignL2[Auto-Assign to<br/>DD-Lead + ZBH<br/>Work Notes: Status Update Logged]
%% ============================================
%% LEVEL 2 INTERVIEW PROCESS
%% ============================================
AssignL2 --> ScheduleL2[DD-Admin Schedules Level 2 Interview<br/>Interview Type: Level 2<br/>Mode: Virtual Google Meet OR Physical Venue<br/>Date & Time: Calendar Selection<br/>Participants: DD-Lead, ZBH, Applicant<br/>Meeting Link/Venue: Admin Enters]
ScheduleL2 --> SendCalL2[System Sends Google Calendar Invites<br/>to DD-Lead, ZBH & Applicant<br/>Contains: Date, Time, Mode, Link/Venue]
SendCalL2 --> ConductL2[Level 2 Interview Conducted<br/>DD-Lead + ZBH with Applicant<br/>Virtual via Google Meet OR Physical]
ConductL2 --> EvalL2[Level 2 Evaluation Process]
EvalL2 --> FeedbackL2[DD-Lead & ZBH Submit<br/>Interview Feedback Form<br/>Business Strategy & Operational Assessment:<br/>- Strategic Alignment<br/>- Business Viability<br/>- Operational Capability<br/>- Market Understanding<br/>Final Recommendation: Approve/Reject/Hold]
FeedbackL2 --> WorkNotesL2[Work Notes: Panelists Add Comments<br/>@tag Users for Clarifications<br/>Time-Stamped Communication Trail]
WorkNotesL2 --> DecisionL2{Level 2 Decision<br/>Approve or Reject}
DecisionL2 -->|Rejected| RejectL2[Store Rejection Reason<br/>Work Notes: Log Decision<br/>Notify Applicant via Email & WhatsApp<br/>Audit Trail: Action Logged]
DecisionL2 -->|Approved| AssignL3[Auto-Assign to<br/>NBH + DD-Head<br/>Work Notes: Status Update Logged]
%% ============================================
%% LEVEL 3 INTERVIEW PROCESS WITH AI
%% ============================================
AssignL3 --> ScheduleL3[DD-Admin Schedules Level 3 Interview<br/>Interview Type: Level 3<br/>Mode: Virtual Google Meet OR Physical Venue<br/>Date & Time: Calendar Selection<br/>Participants: NBH, DD-Head, Applicant<br/>Meeting Link/Venue: Admin Enters]
ScheduleL3 --> SendCalL3[System Sends Google Calendar Invites<br/>to NBH, DD-Head & Applicant<br/>Contains: Date, Time, Mode, Link/Venue]
SendCalL3 --> ConductL3[Level 3 Interview Conducted<br/>NBH + DD-Head with Applicant<br/>Virtual via Google Meet OR Physical]
ConductL3 --> EvalL3[Level 3 Evaluation Process]
EvalL3 --> CollectAllFeedback[Collect All Panel Feedback<br/>RBM, ZBH, DD-ZM, DD-Lead, DD-Head<br/>Quantitative Scores + Qualitative Insights<br/>Using Dealer Interview Recommendation Sheet]
CollectAllFeedback --> AIGenerate[AI Engine Gemini API<br/>Processes All Inputs<br/>Generates 2-3 Line Summary:<br/>- Consensus Trend Across Panelists<br/>- Applicant Key Strengths & Differentiators<br/>- Potential Concerns or Areas for Improvement]
AIGenerate --> NBHReview[NBH Reviews AI Summary<br/>Editable Format<br/>Can Modify or Approve Directly]
NBHReview --> WorkNotesL3[Work Notes: NBH Adds Final Remarks<br/>@tag Stakeholders if Needed<br/>Time-Stamped Communication Trail]
WorkNotesL3 --> DecisionL3{Level 3 Final Decision<br/>Approve or Reject}
DecisionL3 -->|Rejected| RejectL3[Store Rejection Reason<br/>Work Notes: Log Decision<br/>Notify Applicant via Email & WhatsApp<br/>Audit Trail: Action Logged]
DecisionL3 -->|Approved| AssignFDD[Auto-Assign to FDD Team<br/>External Agency<br/>Work Notes: Status Update Logged]
%% ============================================
%% FDD PROCESS
%% ============================================
AssignFDD --> SendFDDLink[System Sends OTP-Protected Link<br/>to External FDD Agency<br/>SSO Credentials for Access]
SendFDDLink --> FDDAccess[FDD Team Accesses<br/>Restricted Interface<br/>Views Assigned Applications Only]
FDDAccess --> FDDWorkNotes[Work Notes: FDD Can Raise Queries<br/>@DD-Admin or @Finance<br/>Request Missing Documents<br/>Flag Non-Responsive Applicants]
FDDWorkNotes --> FDDUpload[FDD Team Uploads FDD Report<br/>L1/L2 Reports with Remarks:<br/>- Bank Statements<br/>- Income Tax Returns<br/>- Credit Reports<br/>- Property Papers<br/>- Business Valuation Reports]
FDDUpload --> FDDSubmit[FDD Marks Report as Submitted<br/>Locks Further Edits<br/>Work Notes: Submission Logged]
FDDSubmit --> FinanceReview[Finance Team Reviews FDD Report<br/>Validates Financial Compliance<br/>Work Notes: Finance Adds Review Comments<br/>@DD-Lead for Clarifications if Needed]
FinanceReview --> FinanceFDDDecision{Finance Decision<br/>Approve or Reject}
FinanceFDDDecision -->|Rejected| RejectFDD[Store Rejection & Notify<br/>Work Notes: Log Rejection Reason<br/>Notify DD-Admin & Applicant]
FinanceFDDDecision -->|Approved| LOIDocRequest[LOI: Request Documents<br/>from Applicant<br/>Work Notes: Status Update Logged]
%% ============================================
%% LOI DOCUMENT COLLECTION
%% ============================================
LOIDocRequest --> RequestLOIDocs[DD-Admin Requests LOI Documents<br/>Automated Request to Applicant<br/>Linked Folder Structure:<br/>Region → Prospect Name → Location →<br/>Interview Date → LOI Issuance Date]
RequestLOIDocs --> CollectLOIDocs[Applicant Uploads Mandatory Documents:<br/>- DIP Booklet filled & signed by RBM<br/>- Profile Sheet<br/>- Dealership Application Form<br/>- Interview Feedback Forms RBM & ZBH<br/>- Land Selection Criteria Sheet<br/>- Logic Note & Comparative Logic Note<br/>- Zonal Evaluation Form<br/>- Authorization Letter<br/>- City Map PPT<br/>- Proposed Location Photos min 20 PPT<br/>- Layout Drawings PPT<br/>- Viability Sheet<br/>- Project Plan<br/>- Self-signed PAN/Aadhaar all partners both sides<br/>- CIBIL Reports all partners<br/>- Dealership Name & Address Email from RBM<br/>- Rental/Lease Agreement or Consent Letter]
CollectLOIDocs --> VerifyLOIDocs[DD-Admin Verifies Document Completeness<br/>Checks Folder Format & Metadata<br/>Interview Date, LOI Issuance Date,<br/>Document Ageing Tracking]
VerifyLOIDocs --> VerifyWorkNotes[Work Notes: DD-Admin Adds<br/>Verification Remarks<br/>@Finance if Clarification Needed]
VerifyWorkNotes --> DocsComplete{Documents Complete?}
DocsComplete -->|Incomplete| RequestMoreDocs[Request Missing Documents<br/>Work Notes: Log Missing Items<br/>System Reminder to Applicant]
RequestMoreDocs --> CollectLOIDocs
DocsComplete -->|Complete| RequestSecurityDeposit[Request Security Deposit<br/>via RTGS/NEFT<br/>Work Notes: Status Update]
%% ============================================
%% SECURITY DEPOSIT VERIFICATION
%% ============================================
RequestSecurityDeposit --> UploadDeposit[Applicant Uploads Deposit Proof<br/>Transaction Slip or Confirmation]
UploadDeposit --> FinanceVerifyDeposit[Finance Verifies Security Deposit<br/>Cross-Checks with Corporate Account<br/>Validates Transaction ID, Amount, Bank Record]
FinanceVerifyDeposit --> FinanceDepositNotes[Work Notes: Finance Adds<br/>Verification Remarks<br/>@DD-Admin if Discrepancy Found]
FinanceDepositNotes --> DepositDecision{Deposit Verified?}
DepositDecision -->|Rejected| RejectDeposit[Flag Discrepancy & Notify<br/>Work Notes: Log Discrepancy Details<br/>Request Correct Proof]
RejectDeposit --> UploadDeposit
DepositDecision -->|Approved| LOIApprovalWorkflow[LOI Approval Workflow<br/>Work Notes: Status Update Logged]
%% ============================================
%% LOI APPROVAL WORKFLOW
%% ============================================
LOIApprovalWorkflow --> FinanceLOIReview[Finance Reviews LOI Documents<br/>Verifies Document Completeness<br/>Validates Security Deposit<br/>Work Notes: Finance Adds Approval Remarks]
FinanceLOIReview --> FinanceLOIDecision{Finance Approval}
FinanceLOIDecision -->|Rejected| RejectLOI1[Store Rejection & Notify<br/>Work Notes: Log Rejection Reason<br/>Notify DD-Admin & Applicant]
FinanceLOIDecision -->|Approved| DDHeadLOIReview[DD-Head Reviews LOI<br/>Validates Business Justification<br/>Network Alignment<br/>Work Notes: DD-Head Adds Remarks]
DDHeadLOIReview --> DDHeadLOIDecision{DD-Head Approval}
DDHeadLOIDecision -->|Rejected| RejectLOI2[Store Rejection & Notify<br/>Work Notes: Log Rejection Reason<br/>Notify Finance & Applicant]
DDHeadLOIDecision -->|Approved| NBHLOIReview[NBH Reviews LOI<br/>Final Release Authorization<br/>Work Notes: NBH Adds Final Remarks]
NBHLOIReview --> NBHLOIDecision{NBH Final Approval}
NBHLOIDecision -->|Rejected| RejectLOI3[Store Rejection & Notify<br/>Work Notes: Log Rejection Reason<br/>Notify DD-Head, Finance & Applicant]
NBHLOIDecision -->|Approved| GenerateLOI[Generate LOI Document<br/>Auto-Populated with Applicant Details<br/>Approved RE Format]
GenerateLOI --> UploadLOI[DD-Admin Uploads LOI to System<br/>Tagged: Issue Date, Authorized Signatory,<br/>Document Version, Upload Timestamp<br/>Work Notes: Document Upload Logged]
UploadLOI --> SendLOI[System Sends LOI<br/>via Email & WhatsApp<br/>to Applicant<br/>Notification to All Stakeholders]
SendLOI --> LOIAcknowledgement[Applicant Uploads<br/>LOI Acknowledgement Copy<br/>Signed with Seal & Signature]
%% ============================================
%% DEALER CODE GENERATION
%% ============================================
LOIAcknowledgement --> GenerateDealerCode[DD-Admin Initiates<br/>Dealer Code Creation<br/>via SAP OData API Integration]
GenerateDealerCode --> CreateCodes[System Generates & Stores Codes:<br/>- Sales Code<br/>- Service Code<br/>- GMA Genuine Motorcycle Accessories Code<br/>- Gear Code<br/>Links to DMS, MSD, CRM Systems]
CreateCodes --> CodeComplete[Dealer Code Generated<br/>Status: Dealer Code Generated<br/>Notifications: DD-Admin, Finance, Legal<br/>Audit Trail: Code Creation Logged]
%% ============================================
%% ARCHITECTURAL WORK
%% ============================================
CodeComplete --> AssignArchitecture[DD-Admin Assigns Case<br/>to Architecture/Brand Experience Team]
AssignArchitecture --> ArchUpload[Architecture Team Uploads:<br/>- DWG Layout<br/>- Site Dimension Drawings<br/>- Multiple Drawing Sets]
ArchUpload --> DealerConsent[Dealer Provides Written Consent<br/>via Email Confirming Acceptance<br/>of Layout as per Vastu & Design Guidelines]
DealerConsent --> ConsentDecision{Dealer Consent<br/>Approved?}
ConsentDecision -->|Rejected| ReviseLayout[Revise Layout<br/>Work Notes: Log Revision Request]
ReviseLayout --> ArchUpload
ConsentDecision -->|Approved| IssueLayout[Final Layout Issued to Dealer<br/>Multiple Drawing Sets for Construction<br/>Work Notes: Layout Issuance Logged]
IssueLayout --> DealerConstruction[Dealer Initiates Infrastructure Work<br/>Progress Tracked via Uploaded<br/>Photographs or Reports]
%% ============================================
%% STATUTORY DOCUMENTATION
%% ============================================
DealerConstruction --> CollectStatutory[Collect Statutory Documents<br/>Admin & Architecture Teams Coordinate]
CollectStatutory --> UploadStatutory[Applicant Uploads Statutory Documents:<br/>- GST Registration Certificate<br/>- PAN<br/>- Nodal Agreement<br/>- Cancelled Cheque<br/>- Partnership Deed / LLP / MOA / AOA / COI<br/>- Firm Registration Certificate<br/>- Rental / Lease / Land Agreement<br/>- Virtual Code Confirmation<br/>- Domain ID for @dealer.royalenfield.com<br/>- MSD Microsoft Dynamics Configuration<br/>- LOI Acknowledgement Copy Signed]
UploadStatutory --> VerifyStatutory[Finance & Legal Verify Documents<br/>Update Status: Verified / Pending /<br/>Re-submit Required<br/>Add Remarks]
VerifyStatutory --> StatutoryWorkNotes[Work Notes: Verifiers Add Comments<br/>@DD-Admin if Issues Found<br/>Time-Stamped Trail]
StatutoryWorkNotes --> StatutoryDecision{All Documents Verified?}
StatutoryDecision -->|Rejected| RequestStatutory[Request Re-submission<br/>Work Notes: Log Missing/Invalid Items<br/>Notify Applicant]
RequestStatutory --> UploadStatutory
StatutoryDecision -->|Approved| EORChecklist[EOR: Essential Operating<br/>Requirements Checklist<br/>Work Notes: Status Update Logged]
%% ============================================
%% EOR CHECKLIST VERIFICATION
%% ============================================
EORChecklist --> EORVerify[All Functional Teams Verify<br/>EOR Parameters:<br/>- Sales Team: Sales Standards<br/>- Service Team: Service Tools & Equipment<br/>- IT Team: DMS/MSD Configuration & Connectivity<br/>- Finance Team: Financial Readiness<br/>- Training Team: Staff Training Completion<br/>- Architecture Team: Brand Signage & Facility<br/>- Display Vehicle Readiness<br/>- Spare Inventory Availability<br/>- Safety & Security Compliance<br/>- Test Ride Vehicles Ready]
EORVerify --> EORWorkNotes[Work Notes: DD-Admin Monitors Progress<br/>@tag Teams for Pending Items<br/>Time-Stamped Updates]
EORWorkNotes --> EORProgress[System Tracks Progress Bar<br/>Shows Completion Percentage<br/>e.g., 12/16 Items Complete]
EORProgress --> EORComplete{EOR 100% Complete?}
EORComplete -->|No| ContinueEOR[Continue EOR Verification<br/>Work Notes: Track Pending Items<br/>SLA Reminders if Needed]
ContinueEOR --> EORVerify
EORComplete -->|Yes| EORReady[EOR Completed<br/>System Auto-Transitions to<br/>Inauguration Readiness<br/>Work Notes: Completion Logged<br/>Notifications: DD-Head, NBH]
%% ============================================
%% LOA ISSUANCE
%% ============================================
EORReady --> LOARequest[LOA: Request Preparation<br/>DD-Admin Initiates LOA Document]
LOARequest --> LOAReview[DD-Head Reviews:<br/>- Infrastructure Completion<br/>- EOR Readiness<br/>- Compliance Artefacts<br/>Work Notes: DD-Head Adds Remarks]
LOAReview --> NBHLOAReview[NBH Reviews:<br/>- Final Sign-Off Authorization<br/>- Brand Readiness Assessment<br/>- Site Validation & Inspection<br/>Work Notes: NBH Adds Final Remarks]
NBHLOAReview --> LOADecision{LOA Approved?}
LOADecision -->|Rejected| RejectLOA[Store Rejection & Notify<br/>Work Notes: Log Rejection Reason<br/>Notify DD-Head & DD-Admin]
LOADecision -->|Approved| GenerateLOA[Generate LOA Document<br/>Official Authorization to Operate<br/>under Royal Enfield]
GenerateLOA --> UploadLOA[DD-Admin Uploads LOA to System<br/>Tagged: Issue Date, Authorized Signatory,<br/>Document Version, Upload Timestamp<br/>Work Notes: Document Upload Logged]
UploadLOA --> SendLOA[System Sends LOA<br/>via Email & WhatsApp<br/>to Applicant<br/>Notification to All Stakeholders]
%% ============================================
%% INAUGURATION
%% ============================================
SendLOA --> ScheduleInauguration[DD-Admin Coordinates<br/>Inauguration Event<br/>with NBH, ZBH, RBM,<br/>Brand Experience Teams]
ScheduleInauguration --> InaugurationEvent[Inauguration Event Conducted<br/>Date & Venue Logged<br/>Attendees: NBH, DD-Head, ZBH, RBM,<br/>Architecture, Brand Experience]
InaugurationEvent --> UploadInauguration[Upload Inauguration Report:<br/>- Event Summary Report<br/>- Photographs<br/>- Press Releases<br/>- Video References]
UploadInauguration --> UpdateDealerStatus[Update Dealer Info:<br/>- Inauguration Date<br/>- Status: Active Dealer<br/>- All Codes Mapped<br/>- Operational Status: Live]
UpdateDealerStatus --> ActiveDealer[Active Dealer Created<br/>Dealership Live / Onboarded<br/>System Status: Active]
ActiveDealer --> End([Onboarding Complete<br/>Dealership Operational])
%% ============================================
%% AUDIT TRAIL & SYSTEM GOVERNANCE
%% ============================================
Start -.->|All Actions Logged| AuditTrail[Audit Trail & Activity Log<br/>Chronological Record:<br/>- User Action & Timestamp<br/>- Uploaded Artefacts & Version Control<br/>- Notifications Sent<br/>- Approvals Received<br/>- Work Notes Entries<br/>- System Events]
AuditTrail -.-> End
%% ============================================
%% STYLING
%% ============================================
style Start fill:#90EE90,stroke:#006400,stroke-width:3px
style End fill:#FFB6C1,stroke:#8B0000,stroke-width:3px
style ActiveDealer fill:#87CEEB,stroke:#000080,stroke-width:3px
style ScheduleL1 fill:#E6F3FF,stroke:#0066CC,stroke-width:2px
style ScheduleL2 fill:#E6F3FF,stroke:#0066CC,stroke-width:2px
style ScheduleL3 fill:#E6F3FF,stroke:#0066CC,stroke-width:2px
style SendCalL1 fill:#E6F3FF,stroke:#0066CC,stroke-width:2px
style SendCalL2 fill:#E6F3FF,stroke:#0066CC,stroke-width:2px
style SendCalL3 fill:#E6F3FF,stroke:#0066CC,stroke-width:2px
style DecisionL1 fill:#FFE4B5,stroke:#FF8C00,stroke-width:2px
style DecisionL2 fill:#FFE4B5,stroke:#FF8C00,stroke-width:2px
style DecisionL3 fill:#FFD700,stroke:#FF8C00,stroke-width:3px
style AIGenerate fill:#FFE4B5,stroke:#FF8C00,stroke-width:2px
style FinanceFDDDecision fill:#FFE4B5,stroke:#FF8C00,stroke-width:2px
style FinanceLOIDecision fill:#FFE4B5,stroke:#FF8C00,stroke-width:2px
style DDHeadLOIDecision fill:#FFD700,stroke:#FF8C00,stroke-width:2px
style NBHLOIDecision fill:#FFD700,stroke:#FF8C00,stroke-width:3px
style DepositDecision fill:#FFE4B5,stroke:#FF8C00,stroke-width:2px
style DocsComplete fill:#FFE4B5,stroke:#FF8C00,stroke-width:2px
style StatutoryDecision fill:#FFE4B5,stroke:#FF8C00,stroke-width:2px
style EORComplete fill:#FFE4B5,stroke:#FF8C00,stroke-width:2px
style LOADecision fill:#FFD700,stroke:#FF8C00,stroke-width:3px
style WorkNotesL1 fill:#FFF8DC,stroke:#DAA520,stroke-width:2px
style WorkNotesL2 fill:#FFF8DC,stroke:#DAA520,stroke-width:2px
style WorkNotesL3 fill:#FFF8DC,stroke:#DAA520,stroke-width:2px
style FDDWorkNotes fill:#FFF8DC,stroke:#DAA520,stroke-width:2px
style FinanceWorkNotes fill:#FFF8DC,stroke:#DAA520,stroke-width:2px
style VerifyWorkNotes fill:#FFF8DC,stroke:#DAA520,stroke-width:2px
style FinanceDepositNotes fill:#FFF8DC,stroke:#DAA520,stroke-width:2px
style StatutoryWorkNotes fill:#FFF8DC,stroke:#DAA520,stroke-width:2px
style EORWorkNotes fill:#FFF8DC,stroke:#DAA520,stroke-width:2px
style AuditTrail fill:#F0F0F0,stroke:#808080,stroke-width:2px,stroke-dasharray: 5 5