Files
votianlt/app/lib/models/tasks/signature_task.dart
Sven Carstensen 704d1e7378 feat: Adressbuch mit Kundennummer, Update-Flow und interne Einträge
- Menüpunkt "Kunden" in "Adressbuch" umbenannt und App-Label
  "Verfügbare Jobs" zu "Auftragsliste" geändert (alle 10 Sprachen)
- Fortlaufende Kundennummer (usrId) ab 10000 über neuen
  SequenceGeneratorService und Counter-Dokument in misc-Collection
- Abholung/Lieferstation-Dialog: Änderungen an verknüpften
  Stammdaten aktualisieren den bestehenden Adressbuch-Eintrag
  statt einen neuen zu erzeugen; Checkbox-Label wechselt zu
  "Adresse im Adressbuch aktualisieren"
- Geänderte Adressen ohne Checkbox werden als interner Customer
  (internal=true) gesichert und im Adressbuch ausgeblendet
- E-Mail in AddCustomer und in Stations-Dialogen kein Pflichtfeld
  mehr; "(Login)" aus profile.email entfernt
- Manuelles Beenden eines Auftrags öffnet neue Seite
  JobManualCompleteView statt eines Dialogs
2026-04-20 12:42:56 +02:00

100 lines
2.6 KiB
Dart

import '../task.dart';
// Signature Task
class SignatureTask extends Task {
final String? note;
SignatureTask({
required super.id,
required super.jobId,
super.stationOrder,
super.completed = false,
super.optional = false,
super.completedAt,
super.completedBy,
super.taskOrder,
super.title,
super.description,
super.displayName,
this.note,
});
factory SignatureTask.fromJson(Map<String, dynamic> json) {
final commonProps = Task.parseCommonProperties(json);
String? note;
final taskSpecificData = json['taskSpecificData'];
if (taskSpecificData is Map<String, dynamic>) {
final n = taskSpecificData['note'];
if (n is String) note = n;
}
return SignatureTask(
id: commonProps['id'],
jobId: commonProps['jobId'],
stationOrder: commonProps['stationOrder'],
completed: commonProps['completed'],
optional: commonProps['optional'],
completedAt: commonProps['completedAt'],
completedBy: commonProps['completedBy'],
taskOrder: commonProps['taskOrder'],
title: commonProps['title'],
description: commonProps['description'],
displayName: commonProps['displayName'],
note: note,
);
}
@override
Map<String, dynamic> toJson() {
return {
'id': id,
'jobId': jobId,
'stationOrder': stationOrder,
'completed': completed,
'optional': optional,
'completedAt': completedAt?.toIso8601String(),
'completedBy': completedBy,
'taskOrder': taskOrder,
'description': description,
'displayName': displayName,
'taskSpecificData': {
'taskType': 'SIGNATURE',
'title': title,
'note': note,
},
};
}
@override
SignatureTask copyWith({
String? id,
String? jobId,
int? stationOrder,
bool? completed,
bool? optional,
DateTime? completedAt,
String? completedBy,
int? taskOrder,
String? title,
String? description,
String? displayName,
String? note,
}) {
return SignatureTask(
id: id ?? this.id,
jobId: jobId ?? this.jobId,
stationOrder: stationOrder ?? this.stationOrder,
completed: completed ?? this.completed,
optional: optional ?? this.optional,
completedAt: completedAt ?? this.completedAt,
completedBy: completedBy ?? this.completedBy,
taskOrder: taskOrder ?? this.taskOrder,
title: title ?? this.title,
description: description ?? this.description,
displayName: displayName ?? this.displayName,
note: note ?? this.note,
);
}
}