# Athletes - Licenses
# Events
--- ATHLETE_LICENSE_CREATED ---
{
"event": "ATHLETE_LICENSE_CREATED",
"data": {
"person_id": 123
}
}
# Validation
WARNING
As long as the API is still a layer over the old database date_paid cannot be in a past year.
{
"from": [
"required",
"date:Y-m-d",
"before until"
],
"until": [
"required",
"date:Y-m-d",
"after from"
],
"liga": [
"required",
"valid liga",
"current client"
],
"regional": [
"required",
"valid regional",
"in: LEWB, GEPL, GHC, GHCR, GHO, GHS, ORV, PSV, HGVBB, ROV, KR, VOR, WVUR"
],
"club_id": [
"required",
"valid club"
],
"license_letter": [
"required",
"valid license letter"
],
"license_number": [
"required",
"valid license number"
],
"insurance": [
"required for PSV",
"empty for LEWB",
"valid insurances: C, CI, CL, CIL, CIP, CILP, CIR, CILR, CIPR, CILPR"
],
"responsible": [
"required",
"boolean"
],
"instructor": [
"required",
"boolean"
],
"document_date": [
"nullable",
"date:Y-m-d"
],
"amount_paid": [
"required",
"numeric",
"greater than 0"
],
"date_paid": [
"required",
"date:Y-m-d"
]
}
WARNING
As long as the API is still a layer over the old database, be aware that the from and until values are not saved nor used in any way. The dates in the response will be dynamically determined by the date_paid value.
from: same value asdate_paiduntil:- for PSV this will be the last day of the current year.
- for LEWB this will be the last day of the current year, except for when
date_paidis september 1st or later, then the last day of next year is used.
# List
--- ENDPOINT ---
Domain: equidata
Url: /athletes/123/licenses
Method: GET
[
{
"from": "2020-01-01",
"until": "2021-01-01",
"liga": "LEWB",
"regional": "WVUR",
"club_id": 4,
"license_letter": "M",
"license_number": "18",
"insurance": "C",
"responsible": true,
"instructor": false,
"document_date": "2004-01-29",
"amount_paid": 60.05,
"date_paid": "1989-08-04"
}
// Other entries
]
# Create
--- ENDPOINT ---
Domain: equidata
Url: /athletes/123/licenses
Method: POST
--- EXAMPLE PAYLOAD ---
{
"from": "2020-01-01",
"until": "2021-01-01",
"liga": "PSV",
"regional": "GHC",
"license_letter": "P",
"license_number": "01",
"insurance": "CI",
"club_id": 1,
"responsible": false,
"instructor": true,
"document_date": "2020-05-01",
"amount_paid": 60.5,
"date_paid": "2020-09-01"
}
--- EXAMPLE RESPONSE ---
{
"from": "2020-01-01",
"until": "2021-01-01",
"liga": "PSV",
"regional": "GHC",
"club_id": 1,
"license_letter": "P",
"license_number": "01",
"insurance": "CI",
"responsible": false,
"instructor": true,
"document_date": "2020-05-01",
"amount_paid": 60.5,
"date_paid": "2020-09-01"
}