miler map

This commit is contained in:
2026-09-09 12:55:23 +05:30
parent 074cc0eccf
commit 127fa062ed
143 changed files with 4315 additions and 2291 deletions

View File

@@ -177,10 +177,33 @@ void main() {
expect(group.flat, isTrue);
});
test('a parcel route is always flat, whatever the address says', () {
// Every stop is its own group there — the rider really does ride to each
// customer for one consignment, and a header plus a single child would
// print the same name twice.
test('a parcel COLLECTION is a place, headed by its address', () {
// ── The parcel line draws places now, like the milk run ──
//
// Home used to give logistics a flat node per stop, titled with the
// customer. It is one shape on both lines now: the header names *where*
// the work is and the rail under it names *who* — asked for directly,
// against screenshots of the two screens side by side.
//
// Three collections at one address are one place holding three orders —
// which is the case the old shape got most wrong, drawing the same street
// three times.
ServiceProfile.setActive(ServiceProfile.parcel);
final groups = TripCard(
trip: Trip.fromStops(
id: 'T1',
stops: [
for (var i = 1; i <= 3; i++) {...order(i), 'type': 'pickup'},
],
),
).routeGroups();
expect(groups.length, 1);
expect(groups.single.flat, isFalse);
expect(groups.single.manifest.length, 3);
});
test('but its deliveries gather under the hub they were loaded at', () {
ServiceProfile.setActive(ServiceProfile.parcel);
final groups = TripCard(
trip: Trip.fromStops(
@@ -189,8 +212,9 @@ void main() {
),
).routeGroups();
expect(groups.length, 3);
expect(groups.every((g) => g.flat), isTrue);
expect(groups.length, 1, reason: 'one shelf, one node');
expect(groups.single.flat, isFalse);
expect(groups.single.manifest.length, 3);
});
});