init
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
import 'installed_part.dart';
|
||||
import 'order.dart';
|
||||
|
||||
class Customer {
|
||||
final String id;
|
||||
final String customerNumber;
|
||||
final String name;
|
||||
final String street;
|
||||
final String zipCode;
|
||||
final String city;
|
||||
final double latitude;
|
||||
final double longitude;
|
||||
final double distanceKm;
|
||||
final String phone;
|
||||
final String email;
|
||||
final String? notes;
|
||||
final DateTime firstContactDate;
|
||||
final int openOrdersCount;
|
||||
final DateTime? lastOrderDate;
|
||||
final List<InstalledPart> installedParts;
|
||||
final List<WorkOrder> orders;
|
||||
|
||||
const Customer({
|
||||
required this.id,
|
||||
required this.customerNumber,
|
||||
required this.name,
|
||||
required this.street,
|
||||
required this.zipCode,
|
||||
required this.city,
|
||||
required this.latitude,
|
||||
required this.longitude,
|
||||
required this.distanceKm,
|
||||
required this.phone,
|
||||
required this.email,
|
||||
this.notes,
|
||||
required this.firstContactDate,
|
||||
required this.openOrdersCount,
|
||||
this.lastOrderDate,
|
||||
this.installedParts = const [],
|
||||
this.orders = const [],
|
||||
});
|
||||
|
||||
String get fullAddress => '$street, $zipCode $city';
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
class InstalledPart {
|
||||
final String id;
|
||||
final String customerId;
|
||||
final String name;
|
||||
final String category;
|
||||
final String serialNumber;
|
||||
final int quantity;
|
||||
|
||||
const InstalledPart({
|
||||
required this.id,
|
||||
required this.customerId,
|
||||
required this.name,
|
||||
required this.category,
|
||||
required this.serialNumber,
|
||||
this.quantity = 1,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
enum OrderStatus {
|
||||
offen,
|
||||
inBearbeitung,
|
||||
abgeschlossen,
|
||||
storniert,
|
||||
}
|
||||
|
||||
extension OrderStatusExtension on OrderStatus {
|
||||
String get label {
|
||||
switch (this) {
|
||||
case OrderStatus.offen:
|
||||
return 'Offen';
|
||||
case OrderStatus.inBearbeitung:
|
||||
return 'In Bearbeitung';
|
||||
case OrderStatus.abgeschlossen:
|
||||
return 'Abgeschlossen';
|
||||
case OrderStatus.storniert:
|
||||
return 'Storniert';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class WorkOrder {
|
||||
final String id;
|
||||
final String customerId;
|
||||
final String title;
|
||||
final DateTime date;
|
||||
final OrderStatus status;
|
||||
|
||||
const WorkOrder({
|
||||
required this.id,
|
||||
required this.customerId,
|
||||
required this.title,
|
||||
required this.date,
|
||||
required this.status,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
enum ScheduleItemType {
|
||||
job,
|
||||
routine, // e.g. Team-Besprechung, Material laden
|
||||
lunchBreak, // Mittagspause
|
||||
feierabend, // Feierabend
|
||||
}
|
||||
|
||||
class ScheduleItem {
|
||||
final String id;
|
||||
final String title;
|
||||
final String? customerName;
|
||||
final String? address;
|
||||
final String? taskDescription;
|
||||
final String startTime;
|
||||
final String endTime;
|
||||
final ScheduleItemType type;
|
||||
bool isCompleted;
|
||||
bool isInProgress;
|
||||
|
||||
ScheduleItem({
|
||||
required this.id,
|
||||
required this.title,
|
||||
this.customerName,
|
||||
this.address,
|
||||
this.taskDescription,
|
||||
required this.startTime,
|
||||
required this.endTime,
|
||||
this.type = ScheduleItemType.job,
|
||||
this.isCompleted = false,
|
||||
this.isInProgress = false,
|
||||
});
|
||||
}
|
||||
|
||||
class DaySummary {
|
||||
final String dayName; // Mo, Di, Mi, Do, Fr, Sa, So
|
||||
final String fullDayName; // Monday, Tuesday, Thursday, ...
|
||||
final String dateString; // e.g. 16.05
|
||||
final int ordersCount;
|
||||
final double hoursTotal;
|
||||
final List<ScheduleItem> items;
|
||||
|
||||
const DaySummary({
|
||||
required this.dayName,
|
||||
required this.fullDayName,
|
||||
required this.dateString,
|
||||
required this.ordersCount,
|
||||
required this.hoursTotal,
|
||||
this.items = const [],
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user