Frontend
Company
Branch

Branch Management

Overview

The Branch Management in Worksphere provides administrators with a comprehensive interface to manage branch records within the organization. Branches represent individual operational locations under regional offices, containing location details, management information, and operational data. This module enables creation, management, and oversight of branch records across the Worksphere system.

Purpose

The Branch Management enables:

  • Create Branches - Add new branch records with comprehensive details
  • View Branches - Display all branches in a searchable, filterable list
  • Edit Branches - Modify branch information, management, and location details
  • Delete Branches - Permanently remove branches from the system
  • Search Branches - Quickly locate specific branches by name or code
  • Filter Branches - Filter by regional office, code, and other criteria
  • Manage Branch Hierarchy - Track operational structure and locations

Module Features

  • Branch creation with comprehensive form (18 fields)
  • Multi-column search and filtering
  • Regional office-based branch organization
  • Manager and contact information management
  • Location and address management
  • Opening date and employee tracking
  • Checkbox row selection (single and bulk)
  • Permanent deletion functionality (no recovery)
  • Horizontal scroll support for wide tables
  • Audit trail for all changes
  • Role-based access control

Important Note: Permanent Deletion

⚠️ Critical: Branch deletion is PERMANENT and CANNOT BE REVERSED. Like Regional Offices, branch deletion removes all data permanently from the system with no deactivation alternative. Administrators must exercise extreme caution when deleting branches.


Module Navigation

Accessing the Branch Management Module

Application: Worksphere
URL: http://localhost:3000
Path: Company → Branches or Direct Access: /branch

Access Points

  • Main Navigation: Sidebar menu under Company dropdown
  • Direct URL Access: /branch
  • Dashboard Shortcut: Branch Management quick link
  • From Regional Office List: Related branches link

User Access

  • Authorized Roles: Admin, Super Admin
  • Required Permissions: Branch management access
  • Session: User must be logged in

Page 1: Branch List Page

URL: /branch

Overview

The Branch List page displays all branches in the Worksphere system in a comprehensive table format. It provides search, filtering, and management capabilities with horizontal scroll support for managing wide tables with multiple columns.

Page Description

The Branch List page contains:

  1. Page Header

    • Title: "Branch Lists"
    • Breadcrumb: Dashboard > Company > Branches
    • User info and logout in top right
  2. Action Bar

    • "Add Branch" button (Primary action)
    • Search input field
    • Table view toggle button
  3. Column Filters

    • Individual filter inputs below each column header
    • Real-time filtering as data is entered
  4. Branch Table

    • Displays all branches with columns and actions
    • Supports row selection with checkboxes
    • Horizontal scroll support for large datasets
    • Pagination controls
  5. Footer

    • Pagination controls
    • Rows per page selector

Action Bar Components

Add Branch Button

  • Type: Primary Button (Blue)
  • Label: "+ Add Branch" or "New Branch"
  • Position: Top right of page
  • Action: Navigate to Add New Branch page
  • Keyboard: ALT + B shortcut
  • Icon: Plus icon

Global Search Input

  • Type: Text Input
  • Placeholder: "Search by branch name, code, or regional office"
  • Max Length: 100
  • Search Scope: Searches across Branch Name, Code, and Regional Office
  • Real-time: Filters results as you type
  • Clear Button: X icon to clear search
  • Icon: Search/Magnifying glass icon

Table View Toggle

  • Type: Toggle Button
  • Label: "Table" button
  • Icon: Table icon / Grid icon
  • Position: Right of search field
  • States: Active/Inactive
  • Behavior: Shows/hides table view options

Column Headers & Filters

ColumnHeaderFilter TypeSearch ScopeNotes
Checkbox(Select All)CheckboxRow selectionBulk select
S NoSerial NumberNoneAuto-generatedRead-only
CodeCodeText InputExact/partial matchUnique identifier
Branch NameBranch NameText InputFull text searchPrimary identifier
Regional OfficeRegional OfficeDropdownSelect ROFilter by RO
ActionsActionsNoneEdit/DeleteQuick actions

Table Columns & Fields

ColumnDescriptionData TypeWidthNotes
CheckboxRow selectionCheckbox5%Bulk select multiple rows
S NoSerial numberInteger8%Auto-generated (1, 2, 3...)
CodeBranch codeText15%Unique identifier
Branch NameName of the branchText25%Primary identifier
Regional OfficeAssociated regional officeText25%Parent RO name
ActionsEdit/Delete iconsButtons12%Quick action buttons

Column Filter Features

Code Filter

  • Type: Text Input
  • Placeholder: "Filter by code"
  • Search Type: Exact or partial match
  • Case Insensitive: Yes
  • Real-time: Yes
  • Auto-format: Uppercase

Branch Name Filter

  • Type: Text Input
  • Placeholder: "Search branch name"
  • Search Type: Partial match (contains)
  • Case Insensitive: Yes
  • Real-time: Yes
  • Wildcard: Auto-applied

Regional Office Filter

  • Type: Dropdown
  • Placeholder: "All Regional Offices"
  • Options: List of all regional offices
  • Multi-select: No (single select)
  • Default: "All Regional Offices" (shows all)
  • Searchable: Yes

Fields in Detail

Checkbox

  • Position: First column
  • Selects individual row
  • Select All checkbox in header
  • Maintains selection on pagination
  • Enables bulk delete functionality

S No

  • Serial number starting from 1
  • Automatically incremented
  • Resets on pagination
  • Non-editable field
  • Right-aligned in column

Code

  • Unique identifier for the branch
  • Text format (alphanumeric, no spaces)
  • Auto-generated or manually entered
  • Searchable and filterable
  • Displayed in monospace font
  • Example: "BRANCH-001", "BR-NORTH-01"
  • Unique validation applied

Branch Name

  • Full name of the branch
  • Text format
  • Primary identifier and searchable
  • Clickable to view branch details
  • Bold font for emphasis
  • Truncated with ellipsis (...) if too long
  • Example: "Mumbai Branch", "Delhi North Branch"

Regional Office

  • Associated regional office name
  • Text format
  • Shows parent RO relationship
  • Links to RO details
  • Filterable by dropdown
  • Example: "North India Region", "South Zone"

Actions

  • Edit Icon (Pencil icon, Blue)
    • Click to edit branch details
    • Navigates to /branch/edit/:id
    • Hover shows "Edit" tooltip
  • Delete Icon (Trash icon, Red)
    • Click to permanently delete branch
    • Shows deletion confirmation modal
    • Hover shows "Delete" tooltip
    • WARNING: Permanent deletion, no recovery

Buttons & Icons

Button/IconLabelActionResult
Add Branch"+ Add Branch"Navigate to formOpens /branch/add-branch
EditPencil iconEdit branchOpens /branch/edit/:id
DeleteTrash iconShow deletion confirmationOpens delete modal (⚠️ PERMANENT)
SearchSearch iconFilter listFilters in real-time
ClearX iconReset searchClears search text
TableTable iconToggle viewShows table options

Table Features

Row Selection

  • Single Select: Click checkbox to select/deselect row
  • Bulk Select: Click header checkbox to select/deselect all
  • Selection State: Highlighted row background (light blue)
  • Selection Count: Shows "X rows selected" below table
  • Bulk Actions: Delete all selected branches (with confirmation)
  • Warning: Bulk delete is permanent and irreversible

Horizontal Scroll

  • Support: Wide tables scroll horizontally on smaller screens
  • Sticky Header: Column headers remain visible while scrolling
  • Sticky First Column: S No and checkbox columns stay visible
  • Scroll Indicators: Shows when content extends beyond viewport
  • Touch Friendly: Swipe to scroll on mobile devices
  • Smooth Scrolling: No lag or performance issues

Sorting

  • Click column header to sort ascending/descending
  • Active sort shows arrow indicator (↑ or ↓)
  • Supported columns: Code, Branch Name, Regional Office

Pagination

  • Rows per page: Default 10, options: 10, 25, 50, 100
  • Navigation: Previous/Next buttons and page numbers
  • Info: Shows "Showing 1 to 10 of 50 entries"
  • Current Page: Highlighted page number

Search & Filter Behavior

  1. Global Search:

    • Enter text in main search field
    • Searches across Branch Name, Code, Regional Office
    • Results update in real-time
  2. Column Filters:

    • Enter text/select from column filter below header
    • Applies filter to specific column
    • Multiple filters work together (AND logic)
  3. Regional Office Filter Dropdown:

    • Select RO from dropdown
    • Shows only branches for selected RO
    • "All Regional Offices" option shows all branches
  4. Filter Combination:

    • Combine multiple filters
    • All filters applied simultaneously
    • Shows "No branches found" if no matches

Validations & Notes

  • Empty State: If no branches, show "No branches available. Click 'Add Branch' to create one."
  • Search No Results: "No branches match your search criteria"
  • Permissions: Only admin/superadmin can manage branches
  • Bulk Delete: ⚠️ Warning before permanently deleting multiple branches
  • Page Load: Branches load within 2 seconds
  • Real-time Search: Results update within 500ms
  • Deleted Records: Cannot be recovered (no soft-delete option available)
  • Horizontal Scroll: Smooth scrolling on wide tables

User Flow - Branch List Page

┌──────────────────────────────────┐
│   Branch Lists Page              │
│   (List Page)                    │
│                                  │
│  [+ Add Branch] [Search...]   [≡] │
│   (Add button)  (Search) (View)   │
│                                  │
├──────────────────────────────────┤
│                                  │
│ Search filters for each column:  │
│ [Code] [Branch Name] [RO Dropdown]│
│                                  │
├──────────────────────────────────┤
│ □ │ S# │ Code │ Name │ RO │ │
│   │    │      │      │    │ Actions
│ ─────────────────────────────────│
│ ☑  │ 1  │ BR01 │Mumbai │ North │ ✎ 🗑
│ ☐  │ 2  │ BR02 │Delhi  │ North │ ✎ 🗑
│ ☐  │ 3  │ BR03 │Pune   │ South │ ✎ 🗑
│                                  │
│  [Previous] [1] [2] [Next]       │
│  Showing 1 to 10 of 50 entries   │
│  Rows per page: [10▼]            │
│                                  │
│  ↔ (Horizontal scroll indicator) │
│                                  │
└──────────────────────────────────┘
         ↓           ↓        ↓
    Click      Click Add   Click
    Search     Branch      Edit/
    Filters    Button      Delete
         │           │        │
         ▼           ▼        ▼
     Filter      Add New    Edit/
     Results    Branch     Delete
               Page        Page

Page 2: Add New Branch Page

URL: /branch/add-branch

Overview

The Add New Branch page allows administrators to create new branch records in the Worksphere system. It provides a comprehensive form with all necessary branch information fields organized in logical sections.

Page Description

The Add New Branch page contains:

  1. Page Header

    • Title: "Add New Branch"
    • Breadcrumb: Dashboard > Company > Branches > Add
    • Back link to return to list
  2. Branch Form

    • Form fields organized in 6 sections
    • Validation on submit
    • Real-time field validation
  3. Form Sections

    • Basic Information
    • Branch Details
    • Contact Information
    • Management Details
    • Location Details
    • Additional Information
  4. Action Buttons

    • Submit button to create branch
    • Reset button to clear form
    • Cancel button to discard changes

Form Organization & Sections

The branch form is organized into 6 logical sections:

┌─────────────────────────────────────┐
│ Add New Branch Form                 │
├─────────────────────────────────────┤
│                                     │
│ BASIC INFORMATION                   │
│ ├─ Regional Office                  │
│ ├─ Branch Code                      │
│ └─ Branch Name                      │
│                                     │
│ BRANCH DETAILS                      │
│ ├─ Branch Type                      │
│ ├─ Opening Date                     │
│ └─ Number of Employees              │
│                                     │
│ CONTACT INFORMATION                 │
│ ├─ Contact Person                   │
│ ├─ Contact Number                   │
│ └─ Email Address                    │
│                                     │
│ MANAGEMENT DETAILS                  │
│ ├─ Branch Manager                   │
│ ├─ Branch Manager Phone             │
│ ├─ Region Manager                   │
│ └─ Region Manager Phone             │
│                                     │
│ LOCATION DETAILS                    │
│ ├─ Country                          │
│ ├─ State / Province                 │
│ ├─ City                             │
│ ├─ Postal Code                      │
│ └─ Address                          │
│                                     │
│ ADDITIONAL INFORMATION              │
│ └─ Remarks                          │
│                                     │
│ [Submit] [Reset] [Cancel]           │
└─────────────────────────────────────┘

Form Fields - Section 1: Basic Information

FieldTypeRequiredMax LengthValidation
Regional OfficeDropdownYes-Select from ROs
Branch CodeText InputYes50Alphanumeric
Branch NameText InputYes100Letters, numbers, spaces

Regional Office (Required)

  • Type: Dropdown/Select
  • Required: Yes (marked with *)
  • Placeholder: "Select regional office"
  • Options: List of all active regional offices
  • Searchable: Yes
  • Validation Rules:
    • Cannot be empty
    • Must select valid RO
  • Error Message: "Regional office is required"
  • Help Text: "Select parent regional office for this branch"

Branch Code (Required)

  • Type: Text Input
  • Required: Yes (marked with *)
  • Max Length: 50 characters
  • Placeholder: "e.g., BRANCH-001 or BR-NORTH-01"
  • Validation Rules:
    • Cannot be empty
    • Must be unique (no duplicates)
    • Alphanumeric and hyphens only
    • No spaces or special characters
    • At least 2 characters
  • Error Messages:
    • "Branch code is required"
    • "Branch code already exists"
    • "Invalid format (use alphanumeric and hyphens)"
  • Help Text: "Unique identifier for branch"
  • Auto-format: Uppercase

Branch Name (Required)

  • Type: Text Input
  • Required: Yes (marked with *)
  • Max Length: 100 characters
  • Placeholder: "e.g., Mumbai Branch" or "Delhi North Branch"
  • Validation Rules:
    • Cannot be empty
    • Letters, numbers, spaces, hyphens allowed
    • No leading/trailing spaces (auto-trimmed)
    • At least 3 characters
    • Max 100 characters
  • Error Messages:
    • "Branch name is required"
    • "Branch name must be at least 3 characters"
    • "Branch name exceeds 100 characters"
  • Help Text: "Official branch name (3-100 characters)"
  • Character Counter: Shows "45/100" as you type

Form Fields - Section 2: Branch Details

FieldTypeRequiredValidation
Branch TypeDropdownYesSelect type
Opening DateDate PickerYesValid date
Number of EmployeesNumber InputYesInteger > 0

Branch Type (Required)

  • Type: Dropdown/Select
  • Required: Yes (marked with *)
  • Placeholder: "Select branch type"
  • Options:
    • Headquarters
    • Regional Office
    • Field Office
    • Service Center
    • Sales Office
    • Operations Center
    • Other
  • Validation Rules:
    • Cannot be empty
    • Must select valid type
  • Error Message: "Branch type is required"
  • Help Text: "Type or category of branch operation"

Opening Date (Required)

  • Type: Date Picker
  • Required: Yes (marked with *)
  • Format: YYYY-MM-DD
  • Placeholder: "Select opening date"
  • Min Date: Can be past dates
  • Max Date: Today's date or future
  • Validation Rules:
    • Cannot be empty
    • Must be valid date format
    • Cannot be in future (typically)
  • Error Messages:
    • "Opening date is required"
    • "Invalid date format"
    • "Date cannot be in future"
  • Help Text: "Date branch was established"
  • Calendar Picker: Shows calendar widget for easy selection

Number of Employees (Required)

  • Type: Number Input
  • Required: Yes (marked with *)
  • Min: 1
  • Max: 99999
  • Placeholder: "e.g., 50"
  • Validation Rules:
    • Cannot be empty
    • Must be positive integer
    • No decimals
    • Minimum 1 employee
    • Maximum reasonable limit
  • Error Messages:
    • "Number of employees is required"
    • "Must be a positive number"
    • "Value exceeds maximum limit"
  • Help Text: "Current number of employees at branch"

Form Fields - Section 3: Contact Information

FieldTypeRequiredMax LengthValidation
Contact PersonText InputYes100Letters and spaces
Contact NumberText InputYes20Numbers, hyphens
Email AddressEmail InputYes100Valid email

Contact Person (Required)

  • Type: Text Input
  • Required: Yes (marked with *)
  • Max Length: 100 characters
  • Placeholder: "e.g., John Smith"
  • Validation Rules:
    • Cannot be empty
    • Letters, spaces, and hyphens only
    • No numbers or special characters
    • At least 3 characters
    • Max 100 characters
  • Error Messages:
    • "Contact person is required"
    • "Invalid contact person name"
  • Help Text: "Name of primary contact at branch"

Contact Number (Required)

  • Type: Text Input
  • Required: Yes (marked with *)
  • Max Length: 20 characters
  • Placeholder: "e.g., +1-555-123-4567"
  • Validation Rules:
    • Cannot be empty
    • Numbers, hyphens, spaces, parentheses allowed
    • At least 7 digits
    • Max 20 characters
  • Error Messages:
    • "Contact number is required"
    • "Invalid phone number format"
  • Help Text: "Primary contact phone number"

Email Address (Required)

  • Type: Email Input
  • Required: Yes (marked with *)
  • Max Length: 100 characters
  • Placeholder: "e.g., contact@branch.com"
  • Validation Rules:
    • Cannot be empty
    • Must be valid email format
    • Max 100 characters
    • Unique email (optional check)
  • Error Messages:
    • "Email address is required"
    • "Invalid email format"
    • "Email already exists"
  • Help Text: "Primary contact email address"

Form Fields - Section 4: Management Details

FieldTypeRequiredMax LengthValidation
Branch ManagerDropdownYes-Select manager
Branch Manager PhoneText InputYes20Numbers, hyphens
Region ManagerDropdownYes-Select manager
Region Manager PhoneText InputYes20Numbers, hyphens

Branch Manager (Required)

  • Type: Dropdown/Select
  • Required: Yes (marked with *)
  • Placeholder: "Select branch manager"
  • Options: List of available employees/managers
  • Searchable: Yes
  • Validation Rules:
    • Cannot be empty
    • Must select valid manager
  • Error Message: "Branch manager is required"
  • Help Text: "Employee responsible for branch operations"

Branch Manager Phone (Required)

  • Type: Text Input
  • Required: Yes (marked with *)
  • Max Length: 20 characters
  • Placeholder: "e.g., +1-555-987-6543"
  • Validation Rules:
    • Cannot be empty
    • Numbers, hyphens, spaces, parentheses allowed
    • At least 7 digits
    • Max 20 characters
  • Error Messages:
    • "Branch manager phone is required"
    • "Invalid phone number format"
  • Help Text: "Branch manager direct phone number"

Region Manager (Required)

  • Type: Dropdown/Select
  • Required: Yes (marked with *)
  • Placeholder: "Select region manager"
  • Options: List of available managers
  • Searchable: Yes
  • Validation Rules:
    • Cannot be empty
    • Must select valid manager
  • Error Message: "Region manager is required"
  • Help Text: "Manager overseeing regional operations"

Region Manager Phone (Required)

  • Type: Text Input
  • Required: Yes (marked with *)
  • Max Length: 20 characters
  • Placeholder: "e.g., +1-555-654-3210"
  • Validation Rules:
    • Cannot be empty
    • Numbers, hyphens, spaces, parentheses allowed
    • At least 7 digits
    • Max 20 characters
  • Error Messages:
    • "Region manager phone is required"
    • "Invalid phone number format"
  • Help Text: "Region manager direct phone number"

Form Fields - Section 5: Location Details

FieldTypeRequiredMax LengthValidation
CountryDropdownYes-Select country
StateDropdownYes-Select state
CityText InputYes50Letters and spaces
Postal CodeText InputYes20Numbers, hyphens
AddressTextareaYes500Any characters

Country (Required)

  • Type: Dropdown/Select
  • Required: Yes (marked with *)
  • Placeholder: "Select country"
  • Options: List of countries
  • Searchable: Yes
  • Default: Based on system location
  • Validation Rules:
    • Cannot be empty
    • Must select valid country
  • Error Message: "Country is required"
  • Help Text: "Country where branch operates"

State / Province (Required)

  • Type: Dropdown/Select
  • Required: Yes (marked with *)
  • Placeholder: "Select state/province"
  • Options: Filtered based on selected country
  • Dependent: Auto-populated based on country selection
  • Searchable: Yes
  • Validation Rules:
    • Cannot be empty
    • Must select valid state
    • Must match selected country
  • Error Message: "State/Province is required"
  • Help Text: "State, province, or region"

City (Required)

  • Type: Text Input
  • Required: Yes (marked with *)
  • Max Length: 50 characters
  • Placeholder: "e.g., Mumbai"
  • Validation Rules:
    • Cannot be empty
    • Letters and spaces only
    • No numbers or special characters
    • At least 2 characters
    • Max 50 characters
  • Error Messages:
    • "City is required"
    • "Invalid city name"
  • Help Text: "City or town name"

Postal Code (Required)

  • Type: Text Input
  • Required: Yes (marked with *)
  • Max Length: 20 characters
  • Placeholder: "e.g., 400001"
  • Validation Rules:
    • Cannot be empty
    • Numbers and hyphens only
    • No letters or special characters
    • At least 3 characters
    • Max 20 characters
  • Error Messages:
    • "Postal code is required"
    • "Invalid postal code format"
  • Help Text: "ZIP or postal code"

Address (Required)

  • Type: Textarea
  • Required: Yes (marked with *)
  • Max Length: 500 characters
  • Placeholder: "Enter full street address"
  • Example: "123 Business Avenue, Suite 100"
  • Validation Rules:
    • Cannot be empty
    • Any characters allowed
    • Max 500 characters
    • No leading/trailing spaces (auto-trimmed)
  • Error Messages:
    • "Address is required"
    • "Address exceeds 500 characters"
  • Help Text: "Full street address of branch (max 500 characters)"
  • Character Counter: Shows "150/500"
  • Rows: 4-5 rows height

Form Fields - Section 6: Additional Information

FieldTypeRequiredMax LengthValidation
RemarksTextareaNo500Any characters

Remarks (Optional)

  • Type: Textarea
  • Required: No
  • Max Length: 500 characters
  • Placeholder: "Enter any additional remarks or notes"
  • Validation Rules:
    • Optional field
    • Any characters allowed
    • Max 500 characters
  • Help Text: "Additional notes about the branch (optional)"
  • Character Counter: Shows "0/500"
  • Rows: 4 rows height

Buttons & Actions

ButtonTypeActionResult
SubmitPrimary Button (Blue)Create branch with form dataSaves branch, shows success message, redirects to Branch List
ResetSecondary ButtonClear all form fieldsResets all fields to empty state
CancelSecondary ButtonReturn to list without savingNavigates back to Branch List page

Form Behavior

  • Validation: Real-time field validation as you type
  • Error Display: Red error messages appear below respective fields
  • Required Fields: Marked with red asterisk (*)
  • Field Focus: First invalid field gets focus on submission attempt
  • Loading State: Submit button shows loading spinner during submission
  • Dependent Fields: State field depends on Country selection
  • Character Counters: Show remaining characters for text areas
  • Unsaved Changes: Browser warning if user tries to leave with unsaved data
  • Success Message: Green banner at top: "Branch created successfully!"
  • Auto-redirect: Redirects to Branch List after 2-3 seconds
  • Field Auto-clear: Form clears after successful submission

Validations & Notes

Required Fields:

  • Regional Office
  • Branch Code
  • Branch Name
  • Branch Type
  • Opening Date
  • Number of Employees
  • Contact Person
  • Contact Number
  • Email Address
  • Branch Manager
  • Branch Manager Phone
  • Region Manager
  • Region Manager Phone
  • Country
  • State / Province
  • City
  • Postal Code
  • Address

Optional Fields:

  • Remarks

Page 3: Edit Branch Page

URL: /branch/edit/:id

Overview

The Edit Branch page allows administrators to modify existing branch information. The form is pre-populated with current branch data and follows the same structure as the Add New Branch page.

Page Description

The Edit Branch page contains:

  1. Page Header

    • Title: "Edit Branch"
    • Breadcrumb: Dashboard > Company > Branches > Edit
    • Displays current branch name
    • Back link to return to list
  2. Branch Form

    • Pre-filled with existing branch data
    • Same fields as Add New Branch page
    • Same 6 sections as Add Branch
  3. Action Buttons

    • Update/Save button to save changes
    • Cancel button to discard changes
    • Delete button to permanently remove branch

Form Fields

The Edit Branch page contains all the same fields as Add New Branch page:

SectionFieldsPre-filledEditable
Basic InformationRegional Office, Code, NameYesYes
Branch DetailsType, Opening Date, EmployeesYesYes
Contact InformationPerson, Number, EmailYesYes
Management DetailsBranch Manager, Phone, RO Manager, PhoneYesYes
Location DetailsCountry, State, City, Postal Code, AddressYesYes
Additional InfoRemarksYesYes

Fields in Detail

All fields maintain the same validation rules as Add New Branch page:

  • All form fields are pre-filled with current data
  • All fields are fully editable
  • All validation rules apply during editing
  • Regional Office field cannot be changed (read-only or deactivated)

Buttons & Actions

ButtonTypeActionResult
Update / SavePrimary Button (Blue)Save form changesUpdates branch, shows success message, returns to Branch List
CancelSecondary ButtonDiscard changesReturns to Branch List without saving
DeleteDanger Button (Red)Open deletion confirmationShows deletion modal (⚠️ PERMANENT)

Form Behavior

  • Pre-fill: On page load, all fields populated with current data
  • Change Detection: Form indicates unsaved changes (visual indicator)
  • Error Display: Validation errors appear below respective fields
  • Success Message: "Branch updated successfully!"
  • Loading State: Update button shows loading spinner during submission
  • Unsaved Changes Warning: Prompt if user tries to leave with unsaved changes
  • Auto-redirect: Redirects to Branch List after 2-3 seconds
  • Read-only Fields: Regional Office typically read-only (cannot change)

Validations & Notes

  • Same Validations: All field validations same as Add New Branch page
  • Code Uniqueness: Code uniqueness check excludes current branch
  • Regional Office: Cannot be changed (locked/read-only)
  • Dependent Fields: State field depends on Country selection
  • Error Handling: Same error messages and validation logic as Add Branch page

Page 4: Delete Branch Confirmation Modal

Overview

The Delete Branch Confirmation is a modal dialog that appears when an administrator clicks the delete action on a branch. It confirms the user's intention to permanently delete the branch.

Modal Dialog

Dialog Header

  • Title: "Are you sure?"
  • Close Button: X icon in top-right corner
  • Icon: Warning/Alert icon in red (strong emphasis)

Dialog Content

Message:

You are about to permanently delete this branch.

Additional Information:

  • Branch name and code being deleted
  • Associated regional office
  • Strong warning about permanent deletion
  • Note: "This action cannot be reversed"
  • Example: "Deleting 'Mumbai Branch' (BR-001) from North India Region"

Dialog Body

ContentValueNotes
Primary Message"Are you sure?"Confirmation title
Action Message"You are about to permanently delete this branch."Action being taken
Branch NameDynamic (branch name)Shows which branch will be deleted
Branch CodeDynamic (code)Shows branch code
Regional OfficeDynamic (RO name)Shows parent RO
Warning IconLarge red alert iconEmphasizes destructive action
Item Type"Branch"Type of item being deleted
Reversibility"This action cannot be reversed"PERMANENT deletion note
Data Loss Warning"All branch data will be permanently removed"Emphasizes data loss

Buttons & Actions

ButtonTypePositionActionResult
Yes, delete it!Danger Button (Red)RightConfirms permanent deletionPermanently deletes branch, closes modal, shows success message, refreshes list, removes all related records
CancelSecondary ButtonLeftCancels deletionCloses modal, returns to previous page, no changes made

Modal Behavior

  • Backdrop: Semi-transparent dark overlay behind modal
  • Click Outside: Clicking outside modal closes it (cancels deletion)
  • Keyboard: Pressing ESC closes modal (cancels deletion)
  • Focus: Focus is on "Cancel" button on open (safer default)
  • Animation: Smooth fade-in animation (300ms)
  • Width: 500-600px width, centered on screen
  • Z-index: Above all other elements
  • Warning Style: High-contrast red elements for deletion button

Permanent Deletion Behavior

  • Deletion: Branch completely removed from system
  • Data Preservation: ⚠️ NO data backup or retention
  • Recovery: ⚠️ IMPOSSIBLE to recover deleted data
  • Cascade Delete: May affect related units and field officers
  • Audit Trail: Deletion logged with user, timestamp, and IP
  • No Soft-Delete: Unlike Company/Head Office, no deactivation option
  • Immediate: Deletion takes effect immediately

User Flow - Delete Branch (Permanent)

┌────────────────────────────────┐
│   Branch List Page             │
│   OR Edit Branch Page          │
│   Click Delete (Trash) icon    │
├────────────────────────────────┤
│                                │
│  ┌─ Delete Modal appears       │
│  │  Shows:                     │
│  │  ⚠ (Large Red Warning icon) │
│  │  "Are you sure?"            │
│  │  "You are about to          │
│  │   PERMANENTLY delete this   │
│  │   branch."                  │
│  │                             │
│  │  Branch: "Mumbai Branch"    │
│  │  Code: "BR-001"             │
│  │  RO: "North India Region"   │
│  │                             │
│  │  WARNING:                   │
│  │  "This action cannot be     │
│  │   reversed"                 │
│  │  "All data will be removed" │
│  │                             │
│  │  [Yes, delete it!]          │
│  │  [Cancel]                   │
│  │                             │
│  ├─ Click "Yes, delete it!"    │
│  │  ↓                          │
│  │  Permanently delete branch  │
│  │  Remove all related data    │
│  │  Close modal                │
│  │  Show success: "Branch      │
│  │  deleted permanently!"      │
│  │  Refresh Branch List        │
│  │  Record completely removed  │
│  │                             │
│  ├─ Click "Cancel"             │
│  │  ↓                          │
│  │  Close modal                │
│  │  Return to previous page    │
│  │  No changes made            │
│  │  No data deleted            │
│  │                             │
│  └─ Click X (close button)     │
│     ↓                          │
│     Close modal                │
│     Return to previous page    │
│     No data deleted            │
│                                │
└────────────────────────────────┘

Branch Management User Flow (Complete)

START (User navigates to Branch Module)

  ├──→ Branch List Page (/branch)
  │     │
  │     ├─ Global Search (Name/Code/RO)
  │     │  ↓
  │     │  Filter results in real-time
  │     │
  │     ├─ Column Level Filters
  │     │  ├─ Code filter
  │     │  ├─ Branch Name filter
  │     │  └─ Regional Office filter (dropdown)
  │     │  ↓
  │     │  Apply filters to results
  │     │
  │     ├─ Row Selection (Checkboxes)
  │     │  ├─ Single row select
  │     │  ├─ Select all rows
  │     │  └─ Bulk delete selected
  │     │     (⚠️ PERMANENT)
  │     │
  │     ├─ Horizontal Scroll Support
  │     │  ├─ Wide tables scroll horizontally
  │     │  ├─ Sticky headers and columns
  │     │  └─ Smooth scrolling
  │     │
  │     ├─ Click "Add Branch" button
  │     │  ↓
  │     │  Add New Branch Page
  │     │  (/branch/add-branch)
  │     │  │
  │     │  ├─ Fill Basic Information Section
  │     │  │  ├─ Select Regional Office *
  │     │  │  ├─ Enter Branch Code *
  │     │  │  └─ Enter Branch Name *
  │     │  │
  │     │  ├─ Fill Branch Details Section
  │     │  │  ├─ Select Branch Type *
  │     │  │  ├─ Select Opening Date *
  │     │  │  └─ Enter # of Employees *
  │     │  │
  │     │  ├─ Fill Contact Information Section
  │     │  │  ├─ Enter Contact Person *
  │     │  │  ├─ Enter Contact Number *
  │     │  │  └─ Enter Email Address *
  │     │  │
  │     │  ├─ Fill Management Details Section
  │     │  │  ├─ Select Branch Manager *
  │     │  │  ├─ Enter Branch Manager Phone *
  │     │  │  ├─ Select Region Manager *
  │     │  │  └─ Enter Region Manager Phone *
  │     │  │
  │     │  ├─ Fill Location Details Section
  │     │  │  ├─ Select Country *
  │     │  │  ├─ Select State/Province *
  │     │  │  ├─ Enter City *
  │     │  │  ├─ Enter Postal Code *
  │     │  │  └─ Enter Address *
  │     │  │
  │     │  ├─ Fill Additional Information Section
  │     │  │  └─ Enter Remarks (optional)
  │     │  │
  │     │  ├─ Validate all fields
  │     │  │  │
  │     │  │  ├─ Valid: Click "Submit"
  │     │  │  │          ↓
  │     │  │  │         Save branch
  │     │  │  │         Show success message
  │     │  │  │         Redirect to list
  │     │  │  │
  │     │  │  └─ Invalid: Show error messages
  │     │  │            Focus on first error
  │     │  │            Wait for correction
  │     │  │
  │     │  └─ Click "Reset" → Clear form
  │     │     or "Cancel" → Return to list
  │     │
  │     ├─ Click Edit (Pencil) icon
  │     │  ↓
  │     │  Edit Branch Page
  │     │  (/branch/edit/:id)
  │     │  │
  │     │  ├─ Pre-filled with existing data
  │     │  ├─ Same form sections as Add Branch
  │     │  ├─ Modify any field (except RO)
  │     │  │
  │     │  ├─ Validate changes
  │     │  │  │
  │     │  │  ├─ Valid: Click "Update"
  │     │  │  │          ↓
  │     │  │  │         Save changes
  │     │  │  │         Show success message
  │     │  │  │         Redirect to list
  │     │  │  │
  │     │  │  └─ Invalid: Show error messages
  │     │  │
  │     │  └─ Click "Delete" button
  │     │     ↓
  │     │     Delete Confirmation Modal
  │     │     │
  │     │     ├─ Show warning: "Are you sure?"
  │     │     ├─ Show branch and RO name
  │     │     ├─ Warning: "PERMANENT deletion"
  │     │     ├─ Warning: "Cannot be reversed"
  │     │     │
  │     │     ├─ Click "Yes, delete it!"
  │     │     │  ↓
  │     │     │  Permanently delete branch
  │     │     │  Remove all data
  │     │     │  Close modal
  │     │     │  Show success: "Deleted"
  │     │     │  Refresh list
  │     │     │  Branch completely removed
  │     │     │
  │     │     └─ Click "Cancel"
  │     │        ↓
  │     │        Close modal
  │     │        Return to edit page
  │     │        No changes made
  │     │
  │     ├─ Click Delete (Trash) icon from list
  │     │  ↓
  │     │  Delete Confirmation Modal
  │     │  (Same flow as above - ⚠️ PERMANENT)
  │     │
  │     └─ Pagination & Sorting
  │        ├─ Navigate pages
  │        ├─ Change rows per page
  │        ├─ Sort by columns
  │        └─ Horizontal scroll

  └──────────────────────────────
     END

Branch Management Best Practices

For Administrators

  1. Creating Branches

    • Use clear, descriptive branch names
    • Generate unique codes for identification
    • Complete all required fields
    • Select appropriate branch type
    • Ensure manager assignments
    • Verify location details
    • Complete contact information
  2. Managing Branches

    • Regularly review branch information
    • Update details when organizational changes occur
    • Monitor manager assignments
    • Maintain accurate contact details
    • Track employee counts
    • Document branch operations
    • ⚠️ CAREFUL WITH DELETION: Verify no dependent data
  3. Deletion Precautions

    • NEVER delete without careful review
    • Verify no units under branch
    • Confirm with management before deletion
    • Check for ongoing operations
    • Consider deactivation alternative (if available)
    • Document deletion reason in audit trail
    • Remember: Deletion is permanent and irreversible

Success Messages

ActionMessageDisplay Time
Create Branch"Branch created successfully!"5 seconds
Update Branch"Branch updated successfully!"5 seconds
Delete Branch"Branch deleted permanently!"5 seconds

End of Documentation