API: Create endpoints for checkin lists #2381
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit creates a new endpoint which emulates the functionality of the availabilities endpoint, but for checkins. This endpoint thus has a couple of verbs available:
Differently to the availabilities endpoint, each item is an object which can be referred to by its identifier barcode or the object's API URL, for flexibility. It also includes the time of check-in.
With the different windows of time before types of checkins expire, in the case where multiple types that may conflict (when listing or toggling) are requested, the shorter of the two shall have precedence.
This endpoint will be useful as it'd be much easier to get the statuses than through accessing everyone's
_checkin
link individually. This will facilitate uses such as visualizing statuses, or more basically, check-in a full institution at once.The current endpoint is however DB-inefficient due to django-polymorphic overriding
.select_related()
and thus breaking it for polymorphic models, which identifiers are.As a little more efficiency, the tournament/round URL parameters now default to being found in the serializer context rather than through further joins.
Fixes #2087
Fixes #2353
Fixes #2377