Daily commit

This commit is contained in:
Dennis Nemec
2026-02-05 10:46:13 +01:00
parent 4e808e234d
commit e0007dcf33
51 changed files with 2131 additions and 139 deletions

View File

@ -0,0 +1,39 @@
import 'package:app_gaslieferung/model/supplier.dart';
import 'package:app_gaslieferung/model/tour.dart';
import 'package:app_gaslieferung/service/tour_service.dart';
import '../model/car.dart';
class TourRepository {
TourService service;
TourRepository({required this.service});
/// Lists the possible tours of cars existing for a supplier.
Future<SupplierTourMetadata> getSupplierTourMetadata(String sessionId) async {
final dto = await service.getCars(sessionId);
await Future.delayed(Duration(seconds: 1));
return SupplierTourMetadata(
date: dto.date,
tours: dto.deliveries
.map(
(delivery) => TourMetadata(
car: Car(id: delivery.car.id, carName: delivery.car.carName, driverName: delivery.car.driverName),
amountDeliveries: delivery.amountDeliveries,
),
)
.toList(),
);
}
/// Lists the possible tours of cars existing for a supplier.
Future<Tour> getTour(String sessionId, String carId) async {
final tour = await service.getTour(sessionId, carId);
await Future.delayed(Duration(seconds: 1));
return tour;
}
}