Announcements and IT Job Checklist
This commit is contained in:
@@ -234,6 +234,9 @@ Map<String, dynamic> _buildTaskPayload({
|
||||
'action_taken': task.actionTaken,
|
||||
'cancellation_reason': task.cancellationReason,
|
||||
'cancelled_at': task.cancelledAt?.toIso8601String(),
|
||||
'it_job_printed': task.itJobPrinted,
|
||||
'it_job_printed_at': task.itJobPrintedAt?.toIso8601String(),
|
||||
'it_job_received_by_id': task.itJobReceivedById,
|
||||
},
|
||||
)
|
||||
.toList();
|
||||
@@ -1694,6 +1697,25 @@ class TasksController {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/// Mark a task's printed IT Job as received by [receivedById].
|
||||
///
|
||||
/// Uses a SECURITY DEFINER RPC to bypass RLS UPDATE restrictions
|
||||
/// that would otherwise silently block the dispatcher's update.
|
||||
Future<void> markItJobPrinted(String taskId,
|
||||
{required String receivedById}) async {
|
||||
await _client.rpc('mark_it_job_printed', params: {
|
||||
'p_task_id': taskId,
|
||||
'p_receiver_id': receivedById,
|
||||
});
|
||||
}
|
||||
|
||||
/// Unmark a task's printed IT Job submission.
|
||||
Future<void> markItJobNotPrinted(String taskId) async {
|
||||
await _client.rpc('unmark_it_job_printed', params: {
|
||||
'p_task_id': taskId,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// Public DTO used by unit tests to validate selection logic.
|
||||
|
||||
Reference in New Issue
Block a user