# Fixture Message Structure

For each message type, fields that are null are omitted from the payload to deliver the lightest possible message.

***

## Common Header

| Field       | Type           | Nullable | Notes                       |
| ----------- | -------------- | -------- | --------------------------- |
| MessageId   | string (GUID)  | No       | Unique per message; UUID v4 |
| Timestamp   | ISO-8601 (UTC) | No       | UTC                         |
| MessageType | int (enum)     | No       | 1 = Fixture, 3 = Tips       |

***

## Fixtures (shared contract)

```json
{
  "header": {
    "MessageId": "d9e1a4e6-2a44-4a3d-9bbd-0a9a7f5e1c2d",
    "Timestamp": "2025-11-04T19:45:00Z",
    "MessageType": 1
  },
  "body": {
    "fixtureId": 123456,
    "status": 1,
    "startDate": "2025-11-04T19:45:00Z",
    "sport": { "id": 6046, "name": "Football" },
    "league": { "id": 1001, "name": "Premier League" },
    "location":{ "id": 250, "name": "England" },
    "participants": [
      { "id": 9001, "name": "Arsenal", "position": 1 },
      { "id": 9002, "name": "Chelsea", "position": 2 }
    ]
  }
}
```

***

## Fields (body)

| Field                       | Type                         | Nullable | Notes                             |
| --------------------------- | ---------------------------- | -------- | --------------------------------- |
| fixtureId                   | int                          | No       | Join key for tips/incidents       |
| status                      | int (numeric enum)           | No       | See Fixture Status (numeric enum) |
| startDate                   | ISO-8601 (UTC)               | No       | Scheduled start                   |
| sport.id / sport.name       | int / string                 | No       | Sport metadata                    |
| league.id / league.name     | int / string                 | No       | League metadata                   |
| location.id / location.name | int / string                 | No       | Country/venue                     |
| participants                | array of Participant objects | No       | Ordered by position (home/away)   |

***

## Participant (object)

| Field    | Type               | Nullable | Notes              |
| -------- | ------------------ | -------- | ------------------ |
| id       | int                | No       | Participant id     |
| name     | string             | No       | Participant name   |
| position | int (numeric enum) | No       | 1 = home, 2 = away |

***

## Fixture Status (numeric enum)

| Value | Name         | Description                                                                |
| ----- | ------------ | -------------------------------------------------------------------------- |
| 1     | NSY          | Fixture is in the pre-match phase (not started yet).                       |
| 2     | InProgress   | Fixture is live and currently in play.                                     |
| 3     | Finished     | Fixture has ended and results are confirmed.                               |
| 4     | Cancelled    | Event will not take place or requires recreation under a new Id.           |
| 5     | Postponed    | Fixture is postponed; may later return to NSY with an updated start time.  |
| 6     | Interrupted  | Temporarily stopped (e.g., weather); resumes under the same fixture Id.    |
| 7     | Abandoned    | Permanently stopped and will not resume.                                   |
| 8     | LostCoverage | Coverage lost; may later become InProgress/Interrupted/Abandoned/Finished. |
| 9     | AboutToStart | Fixture is about to begin shortly.                                         |
