refactor: Projektstruktur in app/ und backend/ aufgeteilt

This commit is contained in:
2026-03-24 15:06:44 +01:00
parent 5f5d5995c5
commit 2673ef658d
449 changed files with 28551 additions and 167 deletions

View File

@@ -0,0 +1,86 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:votianlt_app/cargo_items_view.dart';
import 'package:votianlt_app/models/delivery_station.dart';
import 'package:votianlt_app/models/tasks/confirmation_task.dart';
void main() {
group('deliveryStationCardBackgroundColor', () {
DeliveryStation buildStation(List<ConfirmationTask> tasks) {
return DeliveryStation(
stationOrder: 0,
company: 'ACME',
salutation: null,
firstName: 'Max',
lastName: 'Mustermann',
phone: '12345',
street: 'Musterstrasse',
houseNumber: '1',
addressAddition: '',
zip: '12345',
city: 'Berlin',
deliveryDate: '2026-03-10',
deliveryTime: '10:00',
tasks: tasks,
);
}
ConfirmationTask buildTask(String id, {bool completed = false}) {
return ConfirmationTask(
id: id,
jobId: 'job-1',
buttonText: 'Bestaetigen',
completed: completed,
);
}
test('returns light green when all station tasks are completed', () {
final station = buildStation([
buildTask('task-1', completed: true),
buildTask('task-2', completed: true),
]);
final color = deliveryStationCardBackgroundColor(station, const {});
expect(color, Colors.green[50]);
});
test('returns null when only some tasks are completed', () {
final station = buildStation([
buildTask('task-1', completed: true),
buildTask('task-2'),
]);
final color = deliveryStationCardBackgroundColor(station, const {});
expect(color, isNull);
});
test('returns null when no tasks are completed', () {
final station = buildStation([buildTask('task-1'), buildTask('task-2')]);
final color = deliveryStationCardBackgroundColor(station, const {});
expect(color, isNull);
});
test('returns null when station has no tasks', () {
final station = buildStation(const []);
final color = deliveryStationCardBackgroundColor(station, const {});
expect(color, isNull);
});
test('prefers local task status over incomplete task payload', () {
final station = buildStation([buildTask('task-1'), buildTask('task-2')]);
final color = deliveryStationCardBackgroundColor(station, const {
'task-1': true,
'task-2': true,
});
expect(color, Colors.green[50]);
});
});
}