Project: The Season-Pass System

The ticketing pages now use strict TypeScript, and every escape hatch in them has become a check or a precise type. Mei Chen has a new job for the same project. The theater sells season passes, and the box office keeps them in a file that no code checks yet.

This time, there’s no step-by-step plan. You get a brief, the data the box office saves, and the checks your code has to pass. You’ll decide the types, the guards, and the order you write them in, the way you’d work on a real team. Start with what the box office already has.

Read the Box Office’s Data

To build your types from the data, you start with a real file. Mei exports the passes as JSON, and this is a short sample of her season-passes.json:

Language: JSON Filename: season-passes.json
[
  {
    "id": "SP-0107",
    "holder": "Amara Osei",
    "ticketType": "senior",
    "season": 2026,
    "shows": 3,
    "seats": [
      {
        "status": "booked",
        "show": "The Tempest",
        "performance": "2026-03-14 19:30",
        "seat": "C7"
      },
      { "status": "unbooked" },
      { "status": "unbooked" }
    ],
    "renewedFor": null
  },
  {
    "id": "SP-0112",
    "holder": "Jonas Lindqvist",
    "ticketType": "student",
    "season": 2026,
    "shows": 2,
    "seats": [
      {
        "status": "booked",
        "show": "Our Town",
        "performance": "2026-04-18 14:00",
        "seat": "F4"
      },
      { "status": "unbooked" }
    ],
    "renewedFor": 2027
  }
]

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Become a Member to join the conversation.