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:
-
Page Header
- Title: "Branch Lists"
- Breadcrumb:
Dashboard > Company > Branches - User info and logout in top right
-
Action Bar
- "Add Branch" button (Primary action)
- Search input field
- Table view toggle button
-
Column Filters
- Individual filter inputs below each column header
- Real-time filtering as data is entered
-
Branch Table
- Displays all branches with columns and actions
- Supports row selection with checkboxes
- Horizontal scroll support for large datasets
- Pagination controls
-
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
| Column | Header | Filter Type | Search Scope | Notes |
|---|---|---|---|---|
| Checkbox | (Select All) | Checkbox | Row selection | Bulk select |
| S No | Serial Number | None | Auto-generated | Read-only |
| Code | Code | Text Input | Exact/partial match | Unique identifier |
| Branch Name | Branch Name | Text Input | Full text search | Primary identifier |
| Regional Office | Regional Office | Dropdown | Select RO | Filter by RO |
| Actions | Actions | None | Edit/Delete | Quick actions |
Table Columns & Fields
| Column | Description | Data Type | Width | Notes |
|---|---|---|---|---|
| Checkbox | Row selection | Checkbox | 5% | Bulk select multiple rows |
| S No | Serial number | Integer | 8% | Auto-generated (1, 2, 3...) |
| Code | Branch code | Text | 15% | Unique identifier |
| Branch Name | Name of the branch | Text | 25% | Primary identifier |
| Regional Office | Associated regional office | Text | 25% | Parent RO name |
| Actions | Edit/Delete icons | Buttons | 12% | 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/Icon | Label | Action | Result |
|---|---|---|---|
| Add Branch | "+ Add Branch" | Navigate to form | Opens /branch/add-branch |
| Edit | Pencil icon | Edit branch | Opens /branch/edit/:id |
| Delete | Trash icon | Show deletion confirmation | Opens delete modal (⚠️ PERMANENT) |
| Search | Search icon | Filter list | Filters in real-time |
| Clear | X icon | Reset search | Clears search text |
| Table | Table icon | Toggle view | Shows 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
-
Global Search:
- Enter text in main search field
- Searches across Branch Name, Code, Regional Office
- Results update in real-time
-
Column Filters:
- Enter text/select from column filter below header
- Applies filter to specific column
- Multiple filters work together (AND logic)
-
Regional Office Filter Dropdown:
- Select RO from dropdown
- Shows only branches for selected RO
- "All Regional Offices" option shows all branches
-
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 PagePage 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:
-
Page Header
- Title: "Add New Branch"
- Breadcrumb:
Dashboard > Company > Branches > Add - Back link to return to list
-
Branch Form
- Form fields organized in 6 sections
- Validation on submit
- Real-time field validation
-
Form Sections
- Basic Information
- Branch Details
- Contact Information
- Management Details
- Location Details
- Additional Information
-
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
| Field | Type | Required | Max Length | Validation |
|---|---|---|---|---|
| Regional Office | Dropdown | Yes | - | Select from ROs |
| Branch Code | Text Input | Yes | 50 | Alphanumeric |
| Branch Name | Text Input | Yes | 100 | Letters, 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
| Field | Type | Required | Validation |
|---|---|---|---|
| Branch Type | Dropdown | Yes | Select type |
| Opening Date | Date Picker | Yes | Valid date |
| Number of Employees | Number Input | Yes | Integer > 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
| Field | Type | Required | Max Length | Validation |
|---|---|---|---|---|
| Contact Person | Text Input | Yes | 100 | Letters and spaces |
| Contact Number | Text Input | Yes | 20 | Numbers, hyphens |
| Email Address | Email Input | Yes | 100 | Valid 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
| Field | Type | Required | Max Length | Validation |
|---|---|---|---|---|
| Branch Manager | Dropdown | Yes | - | Select manager |
| Branch Manager Phone | Text Input | Yes | 20 | Numbers, hyphens |
| Region Manager | Dropdown | Yes | - | Select manager |
| Region Manager Phone | Text Input | Yes | 20 | Numbers, 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
| Field | Type | Required | Max Length | Validation |
|---|---|---|---|---|
| Country | Dropdown | Yes | - | Select country |
| State | Dropdown | Yes | - | Select state |
| City | Text Input | Yes | 50 | Letters and spaces |
| Postal Code | Text Input | Yes | 20 | Numbers, hyphens |
| Address | Textarea | Yes | 500 | Any 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
| Field | Type | Required | Max Length | Validation |
|---|---|---|---|---|
| Remarks | Textarea | No | 500 | Any 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
| Button | Type | Action | Result |
|---|---|---|---|
| Submit | Primary Button (Blue) | Create branch with form data | Saves branch, shows success message, redirects to Branch List |
| Reset | Secondary Button | Clear all form fields | Resets all fields to empty state |
| Cancel | Secondary Button | Return to list without saving | Navigates 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:
-
Page Header
- Title: "Edit Branch"
- Breadcrumb:
Dashboard > Company > Branches > Edit - Displays current branch name
- Back link to return to list
-
Branch Form
- Pre-filled with existing branch data
- Same fields as Add New Branch page
- Same 6 sections as Add Branch
-
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:
| Section | Fields | Pre-filled | Editable |
|---|---|---|---|
| Basic Information | Regional Office, Code, Name | Yes | Yes |
| Branch Details | Type, Opening Date, Employees | Yes | Yes |
| Contact Information | Person, Number, Email | Yes | Yes |
| Management Details | Branch Manager, Phone, RO Manager, Phone | Yes | Yes |
| Location Details | Country, State, City, Postal Code, Address | Yes | Yes |
| Additional Info | Remarks | Yes | Yes |
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
| Button | Type | Action | Result |
|---|---|---|---|
| Update / Save | Primary Button (Blue) | Save form changes | Updates branch, shows success message, returns to Branch List |
| Cancel | Secondary Button | Discard changes | Returns to Branch List without saving |
| Delete | Danger Button (Red) | Open deletion confirmation | Shows 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
| Content | Value | Notes |
|---|---|---|
| Primary Message | "Are you sure?" | Confirmation title |
| Action Message | "You are about to permanently delete this branch." | Action being taken |
| Branch Name | Dynamic (branch name) | Shows which branch will be deleted |
| Branch Code | Dynamic (code) | Shows branch code |
| Regional Office | Dynamic (RO name) | Shows parent RO |
| Warning Icon | Large red alert icon | Emphasizes 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
| Button | Type | Position | Action | Result |
|---|---|---|---|---|
| Yes, delete it! | Danger Button (Red) | Right | Confirms permanent deletion | Permanently deletes branch, closes modal, shows success message, refreshes list, removes all related records |
| Cancel | Secondary Button | Left | Cancels deletion | Closes 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
│
└──────────────────────────────
ENDBranch Management Best Practices
For Administrators
-
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
-
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
-
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
| Action | Message | Display 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