These endpoints are implemented in src/backend/http.ts using Convex HTTP Actions.
Some endpoints return validation errors in the following shape:
{
"success": false,
"error": {
"code": "BAD_REQUEST",
"message": "..."
}
}Checks whether an RFID holder is allowed to pass a gate in a given direction, records an entry attempt, and (on success) updates the user status.
Request JSON body
{
"rfid": "string",
"gateIdentifier": "string",
"direction": "in" | "out"
}Responses
-
200 OK-
Success:
{ "success": true }
-
-
Error responses (shape):
{ "success": false, "error": { "code": "USER_NOT_FOUND" | "USER_BANNED" | "USER_ALREADY_IN" | "USER_ALREADY_OUT" | "GATE_NOT_FOUND" | "GATE_INACTIVE" | "BAD_REQUEST" | "...", "message": "string" } }
Status codes for known domain errors
404forUSER_NOT_FOUND,GATE_NOT_FOUND403forUSER_BANNED409forUSER_ALREADY_IN,USER_ALREADY_OUT423forGATE_INACTIVE400for request validation failures (BAD_REQUEST)500for unknown failures
Lists users that do not have an RFID assigned.
Response
200 OK
{
"users": [
{
"_id": "<convex doc id>",
"_creationTime": 0,
"name": "string",
"status": "in" | "out",
"isBanned": false
}
]
}Notes:
- Convex documents include system fields like
_idand_creationTime. - The
rfidfield is optional in the schema; when absent it will not be present in the JSON.
Assigns (or clears) an RFID value on a user.
Request JSON body
{
"userId": "string",
"rfid": "string"
}Notes:
userIdis expected to be a Convex document id for theuserstable.- If you pass an empty/whitespace
rfid, it is normalized toundefinedby the server; this can be used to clear the RFID depending on Convex patch semantics.
Responses
200 OK
{ "success": true }400 Bad Request(validation error) uses the common error format.