feat: Implement reorder functionality in ClientCreateOrderRepository and update related interfaces and use cases

This commit is contained in:
Achintha Isuru
2026-02-19 16:14:43 -05:00
parent b85ea5fb7f
commit 889bf90e71
10 changed files with 37 additions and 514 deletions

View File

@@ -390,6 +390,12 @@ class ClientCreateOrderRepositoryImpl implements ClientCreateOrderRepositoryInte
throw UnimplementedError('Rapid order IA is not connected yet.');
}
@override
Future<void> reorder(String previousOrderId, DateTime newDate) async {
// TODO: Implement reorder functionality to fetch the previous order and create a new one with the updated date.
throw UnimplementedError('Reorder functionality is not yet implemented.');
}
double _calculateShiftCost(domain.OneTimeOrder order) {
double total = 0;
for (final domain.OneTimeOrderPosition position in order.positions) {

View File

@@ -27,4 +27,10 @@ abstract interface class ClientCreateOrderRepositoryInterface {
///
/// [description] is the text message (or transcribed voice) describing the need.
Future<void> createRapidOrder(String description);
/// Reorders an existing staffing order with a new date.
///
/// [previousOrderId] is the ID of the order to reorder.
/// [newDate] is the new date for the order.
Future<void> reorder(String previousOrderId, DateTime newDate);
}

View File

@@ -13,7 +13,7 @@ class ReorderArguments {
}
/// Use case for reordering an existing staffing order.
class ReorderUseCase implements UseCase<Future<void>, ReorderArguments> {
class ReorderUseCase implements UseCase<ReorderArguments, void> {
const ReorderUseCase(this._repository);
final ClientCreateOrderRepositoryInterface _repository;