This commit is contained in:
Dennis Nemec
2026-04-28 13:03:09 +02:00
parent de8668c11a
commit 2470299a10
53 changed files with 2409 additions and 1433 deletions

View File

@ -3,12 +3,17 @@ import 'package:hl_lieferservice/dto/customer.dart';
import 'address.dart';
class Customer {
const Customer({required this.name, required this.address});
const Customer({required this.name, required this.address, this.email});
final String name;
final Address address;
final String? email;
factory Customer.fromDTO(CustomerDTO dto) {
return Customer(name: dto.name, address: Address.fromDTO(dto.address));
return Customer(
name: dto.name,
address: Address.fromDTO(dto.address),
email: dto.eMail,
);
}
}

View File

@ -60,6 +60,23 @@ class Tour {
.length;
}
/// Returns true if the car still has loaded articles assigned to a delivery
/// that has not been finished yet. Scannable articles count when their
/// effective scanned amount (scanned minus removed) is positive; non-scannable
/// articles count when their target amount is greater than zero.
bool hasUndeliveredLoadedArticles(int carId) {
return deliveries.any((delivery) {
if (delivery.carId != carId) return false;
if (delivery.state == DeliveryState.finished) return false;
return delivery.articles.any((article) {
if (article.scannable) {
return article.scannedAmount > article.scannedRemovedAmount;
}
return article.amount > 0;
});
});
}
Tour copyWith({
DateTime? date,
String? discountArticleNumber,