Project

General

Profile

Task #197

Updated by Dana Basheer about 1 month ago

This module allows a logged-in transporter to add and manage drivers. Each driver belongs to the transporter who is currently logged in. The transporter should NOT select transporter_id manually; it must be taken from the login session. Drivers added here will be used in vehicle assignment and tour planning. 

 **Table** 

 c2b_driver_master (Updated) (Session Based) 

 * driver_id (PK) 	 INT AUTO_INCREMENT 	 Unique driver ID 
 * transporter_id (FK) 	 INT 	 From logged-in transporter session 
 * driver_name 	 VARCHAR(150) 	 Name of the driver 
 * contact_no 	 VARCHAR(15) 	 Driver contact number 
 * is_active 	 BOOLEAN DEFAULT TRUE 	 Active / inactive status 
 * created_at 	 DATETIME 	 Record created date 
 * updated_at 	 DATETIME 	 Record updated date 

 **Validations** 

 Mandatory 

 * driver_name required 
 * contact_no required 

 Driver Name  

 * Minimum 2 characters 
 * Maximum 150 characters 
 * Cannot be empty 

 Contact Number 

 * Must be numeric 
 * Must contain 10–15 digits 

 Duplicate 

 * Prevent duplicate driver under same transporter. 

 Transporter  

 * transporter_id must come from session 
 * Should NOT be user input 

 Edit 

 Allow edit: 

 * driver_name 
 * contact_no 
 * is_active 

 Do NOT allow edit: 

 * transporter_id 
 * driver_id 

 Delete Rule 

 * Soft delete only: 
 * is_active = FALSE 

Back