# Clubs - Tracks

# Ground types

--- ENDPOINT ---

Domain: equidata 
Url: /ground-types
Method: GET

--- EXAMPLE RESPONSE ---
[
    {
        "id": 1,
        "name_en": "Sand",
        "name_nl": "Zand",
        "name_fr": "Sable"
    },
    // other ground types
]

# Events

--- CLUB_TRACKS_UPDATED ---
{
    "event": "CLUB_TRACKS_UPDATED",
    "data": {
        "club_id": 12345
    }
}

# Validation

{
    "type": [
        "required",
        "in: indoor, outdoor",
        "6 entries maximum, due to limitation of old application"
    ],
    "width": [
        "required",
        "integer", // In meters
    ],
    "length": [
        "required",
        "integer", // In meters
    ],
    "ground_id": [
        "required",
        "a valid ground type id"
    ]
}

# List

--- ENDPOINT ---

Domain: equidata 
Url: /clubs/123/tracks
Method: GET

--- EXAMPLE RESPONSE ---
[
  {
    "type": "outdoor",
    "width": 65,
    "length": 38,
    "ground": {} // a ground type entity
  }
  // ...other tracks
]

# Update

Warning

Make sure to add all data to the payload every time you call this endpoint.

  • If your intention is to add a new entry, include the existing entries in the payload.
  • If your intention is to delete an existing entry, add all remaining entries in the payload.

--- ENDPOINT ---

Domain: equidata 
Url: /clubs/123/tracks
Method: PUT

--- EXAMPLE PAYLOAD ---
{
  "tracks": [
    {
      "type": "outdoor",
      "width": 89,
      "length": 102,
      "ground_id": 1
    },
    {
      "type": "outdoor",
      "width": 114,
      "length": 109,
      "ground_id": 8
    }
  ]
}
--- EXAMPLE RESPONSE ---
[
  {
    "type": "outdoor",
    "width": 89,
    "length": 102,
    "ground": {
      "id": 1,
      "name_en": "Sand",
      "name_nl": "Zand",
      "name_fr": "Sable"
    }
  },
  {
    "type": "outdoor",
    "width": 114,
    "length": 109,
    "ground": {
      "id": 8,
      "name_en": "Earth",
      "name_nl": "Aarde",
      "name_fr": "Terre"
    }
  }
]