Task Management System
builder.Services.AddScoped<ITaskFlowTypeService, TaskFlowTypeService>();
builder.Services.AddScoped<ITaskFlowUserService, TaskFlowUserService>();
builder.Services.AddScoped<ITaskFlowPlanService, TaskFlowPlanService>();
builder.Services.AddScoped<ITaskFlowTypeRepository, TaskFlowTypeRepository>();
builder.Services.AddScoped<ITaskFlowUserRepository, TaskFlowUserRepository>();
builder.Services.AddScoped<ITaskFlowPlanRepository, TaskFlowPlanRepository>();TaskFlowType
Overview
Task Type Master manages different categories of tasks in the Task Management System. It allows administrators to define and maintain task types that can be assigned to tasks.
Table Structure
CREATE TABLE TaskFlowType (
Id INT PRIMARY KEY IDENTITY(1,1),
TaskTypeCode NVARCHAR(3),
TaskTypeName NVARCHAR(25),
IsActive NVARCHAR(1)
);1. Index Page — Fields
| Label Name | Property Name |
|---|---|
| Task Type ID | TaskTypeCode |
| Task Type Name | TaskTypeName |
| Is Active | IsActiveName |
Actions
- Create
- Modify
- Delete
2. Details Page — Fields
| Label Name | Property Name |
|---|---|
| Task Type ID | TaskTypeCode |
| Task Type Name | TaskTypeName |
| Is Active | IsActiveName |
Actions
- Create
- Modify
- Delete
3. Modify Page — Fields
| Label Name | Property Name | Editable? |
|---|---|---|
| Task Type ID | TaskTypeCode | ReadOnly |
| Task Type Name | TaskTypeName | Editable |
| Is Active | IsActive | Editable |
4. Create Page — Fields
| Label Name | Property Name |
|---|---|
| Task Type Name | TaskTypeName |
5. Model Class
public class TaskFlowType
{
public int Id { get; set; }
public string TaskTypeCode { get; set; } = string.Empty;
[Required(ErrorMessage = "Task Type Name needs to be filled.")]
[StringLength(25, ErrorMessage = "Task Type Name can be upto 25 characters only.")]
public string TaskTypeName { get; set; } = string.Empty;
public string IsActive { get; set; } = string.Empty;
// Business Logic: TaskFlowTypeName duplicate not allowed
// Validation should be implemented in service layer
}Features
- TaskFlowTypeIndex
- TaskFlowTypeDetails
- TaskFlowTypeCreate
- TaskFlowTypeModify
- TaskFlowTypeDelete
- TaskFlowTypeValidateCreateModify
- GetTaskFlowTypeDeleteCount
File Names
- Controller: TaskFlowTypeController
- Repository: TaskFlowTypeRepository
- Service: TaskFlowTypeService
- Razor Page: TaskFlowTypeIndex, TaskFlowTypeDetails, TaskFlowTypeCreate, TaskFlowTypeModify
- Method Names: TaskFlowTypeIndex, TaskFlowTypeDetails, TaskFlowTypeCreate, TaskFlowTypeModify, TaskFlowTypeDelete, TaskFlowTypeValidateCreateModify, GetTaskFlowTypeDeleteCount
TaskFlowUser
Overview
Task User Master manages users who can be assigned tasks in the Task Management System. It links ERP users with task management capabilities and maintains their contact information.
Table Structure
CREATE TABLE TaskFlowUsers(
Id INT IDENTITY(1,1) PRIMARY KEY,
TaskUserId NVARCHAR(3),
TaskUserName NVARCHAR(25),
Email NVARCHAR(100),
ContactNo NVARCHAR(15),
ErpUserId NVARCHAR(8),
IsActive NVARCHAR(1)
);1. Index Page — Fields
| Label Name | Property Name |
|---|---|
| User ID | TaskUserId |
| User Name | TaskUserName |
| Contact No | ContactNo |
| ERP User | ErpUserId |
| Is Active | IsActiveName |
Actions
- Create
- Details
- Modify
- Delete
2. Details Page — Fields
| Label Name | Property Name |
|---|---|
| User ID | TaskUserId |
| User Name | TaskUserName |
| Contact No | ContactNo |
| ERP User | ErpUserId |
| Is Active | IsActiveName |
Actions
- Create
- Modify
- Delete
3. Modify Page — Fields
| Label Name | Property Name | Editable? |
|---|---|---|
| User ID | TaskUserId | ReadOnly |
| User Name | TaskUserName | Editable |
| Editable | ||
| Contact No | ContactNo | Editable |
| ERP User | ErpUserId | ReadOnly |
| Is Active | IsActive | Editable |
4. Create Page — Fields
| Label Name | Property Name |
|---|---|
| User Name | TaskUserName |
| Contact No | ContactNo |
| ERP User | ErpUserId |
Points To Be Handaled
- We will only show user Type U only
- Database approach: Filter users based on login database (e.g., if logged into “udit_demo”, only show “demo” db users)
- TaskFlowUser Modify - ErpUserId Readonly
- TaskFlowuser will be linked by matching _dbname of user with erpcrystalmfg..users.dbname
- Only Admin will be allowed to create/modify/delete TaskFlowUser
- TaskUserFlow username can not be duplicate
5. Model Class
public class TaskFlowUsers
{
public int Id { get; set; }
public string TaskUserId { get; set; } = string.Empty;
// Business Logic: TaskUserFlow username can not be duplicate
// Unique constraint should be implemented in database and validated in service layer
[Required(ErrorMessage = "User Name needs to be filled.")]
[StringLength(25, ErrorMessage = "User Name can be upto 25 characters only.")]
public string TaskUserName { get; set; } = string.Empty;
[Required(ErrorMessage = "Email needs to be filled.")]
[EmailAddress(ErrorMessage = "Please enter a valid email address.")]
public string Email { get; set; } = string.Empty;
[Required(ErrorMessage = "Contact No needs to be filled.")]
[Phone(ErrorMessage = "Please enter a valid contact number.")]
public string ContactNo { get; set; } = string.Empty;
public string IsActive { get; set; } = string.Empty;
// Business Logic: TaskFlowuser will be linked by matching _dbname of user with erpcrystalmfg..users.dbname
// Linking logic should be implemented in service/repository layer
public string ErpUserId { get; set; } = string.Empty; // For Insertion
public string ErpUserId { get; set; } = string.Empty; // For display (Readonly in Modify)
[Required(ErrorMessage = "ERP User ID needs to be filled.")]
public string ErpUserNameId { get; set; } = string.Empty; // For MudAutocomplete binding
// Business Logic: Only Admin will be allowed to create/modify/delete TaskFlowUser
// Authorization should be implemented in controller/service layer with role-based access
}Features
- TaskFlowUserIndex
- TaskFlowUserDetails
- TaskFlowUserCreate
- TaskFlowUserModify
- TaskFlowUserDelete
- TaskFlowUserValidateCreateModify
- GetTaskFlowUserDeleteCount
- ErpUserCombo
File Names
- Controller: TaskFlowUserController
- Repository: TaskFlowUserRepository
- Service: TaskFlowUserService
- Razor Page: TaskFlowUserIndex, TaskFlowUserDetails, TaskFlowUserCreate, TaskFlowUserModify
- Method Names: TaskFlowUserIndex, TaskFlowUserDetails, TaskFlowUserCreate, TaskFlowUserModify, TaskFlowUserDelete, TaskFlowUserValidateCreateModify, GetTaskFlowUserDeleteCount, ErpUserCombo
TaskFlowPlan
Overview
Task Planner is the main module for creating, assigning, tracking, and managing tasks in the Task Management System. It supports task lifecycle management, approval workflows, repeating tasks, and comprehensive reporting.
Table Structure
CREATE TABLE TaskFlowPlan
(
Id INT PRIMARY KEY IDENTITY(1,1),
TaskPlanId NVARCHAR(8),
TaskPlanName NVARCHAR(50),
TaskTypeCode NVARCHAR(3),
RepeatTaskPlanId NVARCHAR(8),
Description NVARCHAR(500),
Priority NVARCHAR(10),
CreatedBy NVARCHAR(3),
AssignedTo NVARCHAR(3),
StartDate DATETIME,
TargetDate DATETIME,
CommittedDate DATETIME,
CompletedOn DATETIME,
PartyId NVARCHAR(6),
RmItemId NVARCHAR(6),
FgItemId NVARCHAR(6),
Qty DECIMAL(12,3),
IsRepeating NVARCHAR(1),
RepeatFrequency NVARCHAR(20),
RepeatUntil DATETIME,
TaskPlanStatus NVARCHAR(1),
CreatorRemarks NVARCHAR(500),
AssigneeRemarks NVARCHAR(500)
);
-- Dummy Data for TaskFlow Tables
-- 5 records each for TaskFlowUsers, TaskFlowType, and TaskFlowPlan
-- TaskFlowUsers dummy data (table name is plural)
INSERT INTO TaskFlowUsers (TaskUserId, TaskUserName, Email, ContactNo, ErpUserId, IsActive) VALUES
('004', 'Rahul Sharma', 'rahul@erpcrystal.in', '9876543210', '00000005', 'Y'),
('005', 'Priya Singh', 'priya@erpcrystal.in', '9876543211', '00000004', 'Y'),
('006', 'Amit Kumar', 'amit@erpcrystal.in', '9876543212', '00000003', 'Y'),
('007', 'Sneha Patel', 'sneha@erpcrystal.in', '9876543213', '00000003', 'Y'),
('008', 'Vikram Joshi', 'vikram@erpcrystal.in', '9876543214', '00000004', 'Y');
-- TaskFlowType dummy data
INSERT INTO TaskFlowType (TaskTypeCode, TaskTypeName, IsActive) VALUES
('004', 'PUR', 'Y'),
('005', 'SAL', 'Y'),
('006', 'INV', 'Y'),
('007', 'FIN', 'Y'),
('008', 'HR', 'Y');
-- TaskFlowPlan dummy data
INSERT INTO TaskFlowPlan (TaskPlanId, TaskPlanName, TaskTypeCode, RepeatTaskPlanId, Description, Priority, CreatedBy, AssignedTo, StartDate, TargetDate, CommittedDate, CompletedOn, PartyId, RmItemId, FgItemId, Qty, IsRepeating, RepeatFrequency, RepeatUntil, TaskPlanStatus, CreatorRemarks, AssigneeRemarks) VALUES
('00000004', 'Purchase Order Processing', '004', '', 'Process pending purchase orders for raw materials', 'High', '004', '005', '2024-11-15', '2024-11-25', '2024-11-20', '2024-11-22', '', '', '', NULL, 'N', '', NULL, 'D', 'Orders processed successfully', 'All purchase orders completed'),
('00000005', 'Sales Report Generation', '005', '', 'Generate monthly sales performance report', 'Medium', '005', '006', '2024-11-20', '2024-12-05', '2024-12-01', '2024-12-03', '', '', '', NULL, 'N', '', NULL, 'D', 'Report generated and shared', 'Report looks comprehensive'),
('00000006', 'Inventory Stock Check', '006', '', 'Conduct physical inventory stock verification', 'High', '006', '007', '2024-11-25', '2024-12-10', NULL, NULL, '', '', '', NULL, 'N', '', NULL, 'I', 'Please complete stock check this week', 'Working on the verification'),
('00000007', 'Financial Audit Preparation', '007', '', 'Prepare documents for quarterly financial audit', 'High', '007', '008', '2024-12-01', '2024-12-15', NULL, NULL, '', '', '', NULL, 'N', '', NULL, 'T', 'Critical audit preparation task', ''),
('00000008', 'Employee Onboarding', '008', '', 'Complete onboarding process for new hires', 'Medium', '008', '004', '2024-12-05', '2024-12-20', NULL, NULL, '', '', '', NULL, 'N', '', NULL, 'T', 'Ensure all paperwork is completed', '');1. Index Page — Fields
| Label Name | Property Name |
|---|---|
| Task Plan ID | TaskPlanId |
| Task Type | TaskTypeCode |
| Task Name | TaskPlanName |
| Assigned By | CreatedBy |
| Assigned To | AssignTo |
| Start Date | StartDate |
| Status | TaskPlanStatusName |
Actions
- Create
- Details
- Modify
- Delete
2. Details Page — Fields
| Label Name | Property Name |
|---|---|
| Task Plan ID | TaskPlanId |
| Task Type | TaskTypeCode |
| Task Name | TaskPlanName |
| Description | Description |
| Priority | Priority |
| Assigned By | CreatedBy |
| Assigned To | AssignTo |
| Start Date | StartDate |
| Target Date | TargetDate |
| Committed Date | CommittedDate |
| Completed Date | CompletedOn |
| Party | PartyId |
| Item RM | RmItemId |
| Item FG | FgItemId |
| Quantity | Qty |
| Status | TaskPlanStatusName |
| Is Repeating | IsRepeating |
| Frequency | Frequency |
| Repeat Until | RepeatUntil |
| Reference Task ID | RefTaskId |
| Remarks (Creator) | CreatorRemarks |
| Remarks (Assignee) | AssigneeRemarks |
Actions
- Create
- Modify
- Delete
- Request Completion (if assignee and status = T)
- Approve Completion (if assigner and status = U)
- Rework Task (if assigner and status = U)
- Make Repeating Task (if status = T and no RefTaskId)
- When discuss in depth > right now we will delete all
3. Modify Page — Fields
| Label Name | Property Name | Editable? |
|---|---|---|
| Task Plan ID | TaskPlanId | ReadOnly |
| Task Type | TaskTypeCode | ReadOnly |
| Task Name | TaskPlanName | ReadOnly |
| Description | Description | Editable |
| Priority | Priority | Editable |
| Assigned By | CreatedBy | ReadOnly |
| Assigned To | AssignTo | ReadOnly |
| Start Date | StartDate | ReadOnly |
| Target Date | TargetDate | ReadOnly |
| Committed Date | CommittedDate | Editable (assignee only) |
| Party | PartyId | Editable |
| Item RM | RmItemId | Editable |
| Item FG | FgItemId | Editable |
| Quantity | Qty | Editable |
| Remarks (Creator) | CreatorRemarks | Editable |
| Remarks (Assignee) | AssigneeRemarks | Editable (assignee only) |
Other points
4. Create Page — Fields
| Label Name | Property Name |
|---|---|
| Task Type | TaskTypeCode |
| Task Name | TaskPlanName |
| Description | Description |
| Priority | Priority |
| Assigned By | CreatedBy |
| Assigned To | AssignTo |
| Start Date | StartDate |
| Target Date | TargetDate |
| Party | PartyId |
| Item RM | RmItemId |
| Item FG | FgItemId |
| Quantity | Qty |
| Remarks (Assigner) | CreatorRemarks |
Points To Be Handaled
- Status values: T=ToDo, U=Under Review, R=Rework, D=Done
- We will have 2 separate forms for Assignee and Assigner (to be implemented in next part)
- Admin user will not be able to assign tasks, only manage them
- If Task is Done, Modify is not allowed
- In case of repetitive Tasks the Assignee need not accept the Task, it should be automatically accepted and the Target Date & Committed Date will be same
- In case of repetitive tasks, committed will be filled as target date only. For other tasks committed date will be 01-Jan-01 (Which assignee can go and change)
- For repetitive tasks, Start date will be same as target date only - so assignee can not change it at all
5. Model Class
public class TaskFlowPlan
{
public int Id { get; set; }
// Task Identification
public string TaskPlanId { get; set; } = string.Empty;
[Required(ErrorMessage = "Task Type is required.")]
public string TaskTypeCode { get; set; } = string.Empty;
public string RefTaskId { get; set; } = string.Empty;
// Task Details
[Required(ErrorMessage = "Task Name is required.")]
[StringLength(50, ErrorMessage = "Task Name cannot exceed 50 characters.")]
public string TaskPlanName { get; set; } = string.Empty;
[StringLength(250, ErrorMessage = "Description cannot exceed 250 characters.")]
public string Description { get; set; } = string.Empty;
public string Priority { get; set; } = string.Empty; // Low/Medium/High
// Assignment
[Required(ErrorMessage = "Assigned By is required.")]
public string CreatedBy { get; set; } = string.Empty;
// Business Logic: Task can be assigned it itself (user can assign to themselves)
// Validation should allow AssignTo to be same as CreatedBy
[Required(ErrorMessage = "Assigned To is required.")]
public string AssignTo { get; set; } = string.Empty;
public string CreatedByName { get; set; } = string.Empty; // Populated via join from users table
public string AssignToName { get; set; } = string.Empty; // Populated via join from users table
// Dates
[Required(ErrorMessage = "Start Date is required.")]
public DateTime StartDate { get; set; }
[Required(ErrorMessage = "Target Date is required.")]
public DateTime TargetDate { get; set; }
public DateTime? CommittedDate { get; set; }
public DateTime? CompletedOn { get; set; }
// ERP Integration
public string PartyId { get; set; } = string.Empty;
public DateTime? RefDate { get; set; }
public string RmItemId { get; set; } = string.Empty;
public string FgItemId { get; set; } = string.Empty;
public decimal Qty { get; set; }
// Repeating Configuration
public string IsRepeating { get; set; } = string.Empty;
public string Frequency { get; set; } = string.Empty; // Daily/Weekly/Monthly/Yearly
public DateTime? RepeatUntil { get; set; }
// Status & Tracking
public string TaskPlanStatus { get; set; } = string.Empty; // T=ToDo, U=Under Review, R=Rework, D=Done
public string TaskPlanStatusName { get; set; } = string.Empty; // T=ToDo, U=Under Review, R=Rework, D=Done
[StringLength(500, ErrorMessage = "Remarks cannot exceed 500 characters.")]
public string CreatorRemarks { get; set; } = string.Empty;
[StringLength(500, ErrorMessage = "Remarks cannot exceed 500 characters.")]
public string AssigneeRemarks { get; set; } = string.Empty;
// Note: Computed properties (StatusName, IsOverdue, DaysPending, DaysOverdue) are handled in SQL
}Features
- TaskFlowPlanIndex
- TaskFlowPlanDetails
- TaskFlowPlanValidateCreateModify
- GenerateRepeatingTaskValidate
- TaskFlowPlanCreate
- TaskFlowPlanModify
- TaskFlowPlanDelete
- RequestCompletion
- ApproveCompletion
- ReworkTask
- GenerateRepeatingTask
- TaskFlowTypeCombo
- TaskFlowUserCombo
- PartyCombo
- RmItemCombo
- FgItemCombo
- ItemCombo
- GetTaskFlowPlanDeleteCount
File Names
- Controller: TaskFlowPlanController
- Repository: TaskFlowPlanRepository
- Service: TaskFlowPlanService
- Razor Page: TaskFlowPlanIndex, TaskFlowPlanDetails, TaskFlowPlanCreate, TaskFlowPlanModify
- Method Names: TaskFlowPlanIndex, TaskFlowPlanDetails, TaskFlowPlanCreate, TaskFlowPlanModify, TaskFlowPlanDelete, TaskFlowPlanValidateCreateModify, RequestCompletion, ApproveCompletion, ReworkTask, GenerateRepeatingTask, TaskFlowTypeCombo, TaskFlowUserCombo, PartyCombo, RmItemCombo, FgItemCombo, ItemCombo, GetTaskFlowPlanDeleteCount
🚧 Unimplemented Features (Future Development)
1. Notifications System
- Email Integration: SMTP-based email alerts for task events and scheduled reports
- WhatsApp Integration: SIM-based WhatsApp notifications for task assignments and updates
Account will created by party - Saturday 8:30 AM – Performance Summary
- Monday 8:30 AM – New Tasks Summary
2. Access Control & Security
- Role-Based Filtering: Assignee sees own tasks, Assigner sees created tasks and Assigneed tasks, Admin sees all
- Field Locking: Certain fields locked after task creation based on user roles
3. Performance Dashboard
- Interactive Widgets: Weekly summaries, completion analysis, and pending task breakdowns
- Real-time Updates: Live dashboard with filtering and export capabilities
4. Reporting System
- Standard Reports: Pending, Completed, and Overdue task reports with Excel export
- Advanced Filtering: Date ranges, user filters, and scheduled report delivery
5. Advanced Features
- Excel Import/Export: Bulk task creation and updates via Excel templates
- Audit Logging: We will write in ERP log