Store check in kiosk id to mark association
cweitat opened this issue · comments
Allow organiser to create station name for each event
- station name
- location (based on the locations available for the venue) - if registration is selected, location can be empty
- type (registration / daily / check in / check out )
Hi @cweitat @mariobehling @DonChiaQE
Could you please share me the sample request (CURD) for this API.
@lthanhhieu
There should be two APIs for this one
First is storing a new station POST
eventId, microlocation_id, station_name, station_type
Second need GET
microlocation_id, room, station_name, station_type
For microlocation_id and room pls refer here https://test-api.eventyay.com/#microlocations-microlocation-details
If type is registration & daily, microlocation_id and room can be null on GET
This should be a new DB TABLE
Hi @cweitat
APIs spec for create and get station, could you help me to take a look and let me know if it okay
POST: /v1/station
Request
{
"data": {
"attributes": {
"station-name": "station name",
"station-type": "registration" // registration | daily | session
},
"relationships": {
"event": {
"data": {
"type": "event",
"id": "1"
}
},
"microlocation": {
"data": {
"type": "microlocation",
"id": "1"
}
}
},
"type": "station"
}
}
Response
Success Http status: 201 CREATED
{
"data": {
"type": "station",
"attributes": {
"station-name": "station name",
"microlocation-id": "1",
"station-type": "registration",
"room": "room 1"
},
"id": 17
}
}
Error : station type is invalid
Http status 422 UNPROCESSABLE ENTITY
{
"errors": [
{
"detail": "Not a valid choice.",
"source": {
"pointer": "/data/attributes/station-type"
},
"status": "422",
"title": "Validation error"
}
]
}
GET: /v1/station/{station-id}
Response
{
"data": {
"type": "station",
"attributes": {
"station-name": "station name",
"microlocation-id": "1",
"station-type": "registration",
"room": "room 1"
},
"id": 17
}
}
Error Response if station can not be found:
Http status 404 NOT FOUND
{
"errors": [
{
"status": 404,
"source": {
"pointer": ""
},
"title": "Object not found",
"detail": "Object Not Found"
}
],
"jsonapi": {
"version": "1.0"
}
}
GET all station of event: /v1/events/{event-id}/stations
{
"data": [
{
"type": "station",
"attributes": {
"station-name": "station name 1",
"microlocation-id": "1",
"station-type": daily
"room": "room"
}
"id": 4
},
{
"type": "station",
"attributes": {
"station-name": "station name 2",
"station-type": "registration"
}
"id": 5
}
],
"meta": {
"count": 15
}
}
@lthanhhieu what if not successful? what does it returns for POST
Also another GET which is to get all stations of the event
@lthanhhieu what if not successful? what does it returns for POST
Also another GET which is to get all stations of the event
Hi @cweitat
I have updated APIs spec in previous comment since there're the relationship between station with event and microlocation.
For event, it has one-to-many with station, but with microlocation, is it one-to-many or 1:1 with station?
and another one is does we need paging for API get all stations of event?
@lthanhhieu, @mariobehling : FYI
@nnhathung don't need pagination
1 Micro location can have multiple stations