feat: Implement reorder functionality in ClientCreateOrderRepository and update related interfaces and use cases
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user