One permit dashboard, three sources
The dashboard from the lesson: it asks one question, “is there a permit for this plate in this zone, and when does it end?”, through PermitLookup, and an adapter answers it for each source. The city adds its resident-permit registry as a third. Each level starts from the previous level’s finished code, so you can begin at any of them.
The kerbside display now has two buttons for a failed lookup: “check again” when a source could not answer, and “report a fault” when a source answered with something that cannot be right, so that the provider is chased. Today every adapter either reports an outage or passes whatever the source said straight through, and the dashboard shows every failure as “check again”.
A partner reply about another vehicle shows that vehicle’s permit for this car. A meter row for another curb shows a permit in a zone the driver never paid for. Faults that should go to the provider are retried forever instead.
Reproduce The partner answers status 200 with vehicle ZZZ-000. showPermit(new PartnerPermitAdapter(partner), "KLM-204", "C7") should say “KLM-204 in C7: report a fault, invalid response”. Today it says “ZZZ-000 in C7: permit through 18:30”.
Acceptance criteria A reply that does not answer the question asked is an invalid response, never a permit and never “no permit”: a record for another plate or zone, a permit with no end time, a legacy state other than active, none or down, a registry minute outside the day. Absence and outage keep their documented signals: the meter’s none and the partner’s 404 mean no permit; the meter’s down, any other partner status and a registry that cannot answer mean unavailable. The dashboard shows “report a fault, invalid response” for an invalid response and “check again, source unavailable” for an outage, decided by the kind of failure, whichever lookup reported it. Earlier rules still hold: the registry’s plate and zone translation and its HH:MM times. Notes Each case prints the dashboard’s line for each lookup, joined by “ | ”. A failure line names the plate and zone the dashboard asked about. One case uses the checker’s own PermitLookup, which reports failures of both kinds with messages of its own. Keep the adapters’ names and constructors and the contract’s names; the checker builds each adapter around its own source.