{
    "about": "Shared by game.test.js (question() in game.js) and tests/Unit/AreaGuide/StationQuestionTest.php (Src\\AreaGuide\\Support\\StationQuestion). The browser derives the question a station asks; the server derives it again to judge the option a member picked. Both must reach the same key, options and answer for every case here, or a right answer is scored wrong.",
    "cases": [
        {
            "name": "asks about price against the corridor when the PSFs are there",
            "station": "a",
            "stations": [
                { "uuid": "a", "name": "Here", "asking_psf": 1200.0 },
                { "uuid": "b", "name": "B", "asking_psf": 1000.0 },
                { "uuid": "c", "name": "C", "asking_psf": 1000.0 }
            ],
            "expected": { "key": "psf", "options": ["above", "below"], "answer": "above" }
        },
        {
            "name": "computes below against an even-sized corridor's median",
            "station": "a",
            "stations": [
                { "uuid": "a", "name": "Here", "asking_psf": 800.0 },
                { "uuid": "b", "name": "B", "asking_psf": 1000.0 },
                { "uuid": "c", "name": "C", "asking_psf": 1020.0 }
            ],
            "expected": { "key": "psf", "options": ["above", "below"], "answer": "below" }
        },
        {
            "name": "falls back to the transacted median when nothing is asked",
            "station": "a",
            "stations": [
                { "uuid": "a", "name": "Here", "asking_psf": null, "psf_median": 650.5 },
                { "uuid": "b", "name": "B", "asking_psf": 900.25, "psf_median": 400.0 }
            ],
            "expected": { "key": "psf", "options": ["above", "below"], "answer": "below" }
        },
        {
            "name": "will not ask above or below inside the 2% gap",
            "station": "a",
            "stations": [
                { "uuid": "a", "name": "Here", "asking_psf": 1001.0, "completion_year": 2028 },
                { "uuid": "b", "name": "B", "asking_psf": 1000.0, "completion_year": 2029 }
            ],
            "expected": { "key": "supply", "options": ["none", "few", "many"], "answer": "few" }
        },
        {
            "name": "a zero PSF is not a price, and a corridor without handovers is none",
            "station": "a",
            "stations": [
                { "uuid": "a", "name": "Here", "asking_psf": 0.0, "completion_year": 2030 },
                { "uuid": "b", "name": "B", "asking_psf": 1000.0, "completion_year": null }
            ],
            "expected": { "key": "supply", "options": ["none", "few", "many"], "answer": "none" }
        },
        {
            "name": "asks about yield against the corridor",
            "station": "a",
            "stations": [
                { "uuid": "a", "name": "Here", "rental_yield": 7.1 },
                { "uuid": "b", "name": "B", "rental_yield": 5.0 }
            ],
            "expected": { "key": "yield", "options": ["above", "below"], "answer": "above" }
        },
        {
            "name": "a zero corridor yield still reads as a gap",
            "station": "a",
            "stations": [
                { "uuid": "a", "name": "Here", "rental_yield": 5.0 },
                { "uuid": "b", "name": "B", "rental_yield": 0.0 }
            ],
            "expected": { "key": "yield", "options": ["above", "below"], "answer": "above" }
        },
        {
            "name": "a yield inside the gap falls through to tenure",
            "station": "a",
            "stations": [
                { "uuid": "a", "name": "Here", "rental_yield": 5.05, "tenure": "Freehold" },
                { "uuid": "b", "name": "B", "rental_yield": 5.0 }
            ],
            "expected": { "key": "tenure", "options": ["freehold", "leasehold"], "answer": "freehold" }
        },
        {
            "name": "counts the handover wave rather than guessing at it",
            "station": "a",
            "stations": [
                { "uuid": "a", "name": "Here", "completion_year": 2028 },
                { "uuid": "b", "name": "B", "completion_year": 2029 },
                { "uuid": "c", "name": "C", "completion_year": 2030 },
                { "uuid": "d", "name": "D", "completion_year": 2027 },
                { "uuid": "e", "name": "E", "completion_year": 2040 }
            ],
            "expected": { "key": "supply", "options": ["none", "few", "many"], "answer": "many" }
        },
        {
            "name": "reads leasehold out of a longer tenure label",
            "station": "a",
            "stations": [
                { "uuid": "a", "name": "Here", "tenure": "Leasehold (99 years)" }
            ],
            "expected": { "key": "tenure", "options": ["freehold", "leasehold"], "answer": "leasehold" }
        },
        {
            "name": "a tenure of \"0\" is still a tenure — JS truthiness, not PHP's",
            "station": "a",
            "stations": [
                { "uuid": "a", "name": "Here", "tenure": "0", "total_transactions": 10 }
            ],
            "expected": { "key": "tenure", "options": ["freehold", "leasehold"], "answer": "freehold" }
        },
        {
            "name": "thirty sales is a priceable history",
            "station": "a",
            "stations": [
                { "uuid": "a", "name": "Here", "total_transactions": 30, "transaction_period": "2019-2024" }
            ],
            "expected": { "key": "evidence", "options": ["thick", "thin"], "answer": "thick" }
        },
        {
            "name": "a zero-PSF corridor is no corridor, so the evidence question is asked",
            "station": "a",
            "stations": [
                { "uuid": "a", "name": "Here", "asking_psf": 1000.0, "total_transactions": 4 },
                { "uuid": "b", "name": "B", "asking_psf": 0.0 }
            ],
            "expected": { "key": "evidence", "options": ["thick", "thin"], "answer": "thin" }
        },
        {
            "name": "has no question for a row the catalogue knows nothing about",
            "station": "a",
            "stations": [
                { "uuid": "a", "name": "Here", "asking_psf": null, "psf_median": null, "rental_yield": null, "completion_year": null, "tenure": null, "total_transactions": null }
            ],
            "expected": null
        }
    ]
}
