Allow task completion even if signatories are still empty, put an indicator for completed tasks with incomplete details.
This commit is contained in:
@@ -562,7 +562,9 @@ class TasksController {
|
||||
.from('tasks')
|
||||
// include all columns that must be non-null/empty before completing
|
||||
.select(
|
||||
'request_type, request_category, requested_by, noted_by, received_by, action_taken',
|
||||
// signatories are not needed for validation; action_taken is still
|
||||
// required so we include it alongside the type/category fields.
|
||||
'request_type, request_category, action_taken',
|
||||
)
|
||||
.eq('id', taskId)
|
||||
.maybeSingle();
|
||||
@@ -572,9 +574,6 @@ class TasksController {
|
||||
|
||||
final rt = row['request_type'];
|
||||
final rc = row['request_category'];
|
||||
final requested = row['requested_by'];
|
||||
final noted = row['noted_by'];
|
||||
final received = row['received_by'];
|
||||
final action = row['action_taken'];
|
||||
|
||||
final missing = <String>[];
|
||||
@@ -584,17 +583,13 @@ class TasksController {
|
||||
if (rc == null || (rc is String && rc.trim().isEmpty)) {
|
||||
missing.add('request category');
|
||||
}
|
||||
if (requested == null ||
|
||||
(requested is String && requested.trim().isEmpty)) {
|
||||
missing.add('requested by');
|
||||
}
|
||||
if (noted == null || (noted is String && noted.trim().isEmpty)) {
|
||||
missing.add('noted by');
|
||||
}
|
||||
if (received == null ||
|
||||
(received is String && received.trim().isEmpty)) {
|
||||
missing.add('received by');
|
||||
}
|
||||
// signatories are no longer required for completion; they can be
|
||||
// filled in later. we still require action taken to document what
|
||||
// was done.
|
||||
|
||||
// if you want to enforce action taken you can uncomment this block,
|
||||
// but current business rule only mandates request metadata. we keep
|
||||
// action taken non-null for clarity.
|
||||
if (action == null || (action is String && action.trim().isEmpty)) {
|
||||
missing.add('action taken');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user