Aligned tag documentation
MODIFY
src/assets/server/rest/v1/docs/e-mobility-oas.json
src/assets/server/rest/v1/docs/e-mobility-oas.json
}
}
},
+ "/api/tags/{id}/assign": {
+ "put": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Assign a Tag to a user",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/tagVisualID"
+ }
+ ],
+ "tags": [
+ "Tags"
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "visualID",
+ "userID"
+ ],
+ "properties": {
+ "visualID": {
+ "$ref": "#/components/schemas/Tag/properties/visualID"
+ },
+ "description": {
+ "$ref": "#/components/schemas/Tag/properties/description"
+ },
+ "default": {
+ "$ref": "#/components/schemas/Tag/properties/default"
+ },
+ "userID": {
+ "$ref": "#/components/schemas/Tag/properties/userID"
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Tag successfully assigned",
+ "content": {
+ "application/json": {
+ "example": {
+ "status": "Success",
+ "id": "###"
+ }
+ }
+ }
+ },
+ "401": {
+ "$ref": "#/components/responses/UnauthorizedError"
+ },
+ "403": {
+ "$ref": "#/components/responses/ForbiddenError"
+ },
+ "500": {
+ "$ref": "#/components/responses/BackendError"
+ },
+ "550": {
+ "$ref": "#/components/responses/ResourceDoesNotExists"
+ },
+ "576": {
+ "description": "Tag already exists and assigned to another user"
+ },
+ "578": {
+ "description": "Tag with given visual ID does not match any badge"
+ },
+ "579": {
+ "description": "Tag with given visual ID is not active and cannot be assigned"
+ }
+ }
+ }
+ },
+ "/api/tags/{id}/unassign": {
+ "put": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Unassign a Tag",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/tagVisualID"
+ }
+ ],
+ "tags": [
+ "Tags"
+ ],
+ "responses": {
+ "200": {
+ "description": "Tag successfully unassigned",
+ "content": {
+ "application/json": {
+ "example": {
+ "status": "Success"
+ }
+ }
+ }
+ },
+ "401": {
+ "$ref": "#/components/responses/UnauthorizedError"
+ },
+ "403": {
+ "$ref": "#/components/responses/ForbiddenError"
+ },
+ "500": {
+ "$ref": "#/components/responses/BackendError"
+ },
+ "550": {
+ "$ref": "#/components/responses/ResourceDoesNotExists"
+ }
+ }
+ }
+ },
+ "/api/tags/unassign": {
+ "put": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Unassign several Tags",
+ "tags": [
+ "Tags"
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "visualIDs": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Tag/properties/visualID"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Tags successfully unassigned",
+ "content": {
+ "application/json": {
+ "example": {
+ "status": "Success"
+ }
+ }
+ }
+ },
+ "401": {
+ "$ref": "#/components/responses/UnauthorizedError"
+ },
+ "403": {
+ "$ref": "#/components/responses/ForbiddenError"
+ },
+ "500": {
+ "$ref": "#/components/responses/BackendError"
+ },
+ "550": {
+ "$ref": "#/components/responses/ResourceDoesNotExists"
+ }
+ }
+ }
+ },
"/api/tags/action/import": {
"post": {
"security": [
"type": "string"
}
},
+ "tagVisualID": {
+ "in": "path",
+ "name": "id",
+ "description": "Tag Visual ID",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
"transactionID": {
"in": "path",
"name": "id",

MODIFY
src/server/rest/v1/router/api/TagRouter.ts
src/server/rest/v1/router/api/TagRouter.ts
@@ -91,12 +91,14 @@ export default class TagRouter {
private buildRouteAssignTag(): void {
this.router.put(`/${ServerRoute.REST_TAG_ASSIGN}`, async (req: Request, res: Response, next: NextFunction) => {
+ req.body.visualID = req.params.id;
await RouterUtils.handleServerAction(TagService.handleAssignTag.bind(this), ServerAction.TAG_ASSIGN, req, res, next);
});
}
private buildRouteUnassignTag(): void {
this.router.put(`/${ServerRoute.REST_TAG_UNASSIGN}`, async (req: Request, res: Response, next: NextFunction) => {
+ req.body.visualID = req.params.id;
await RouterUtils.handleServerAction(TagService.handleUnassignTag.bind(this), ServerAction.TAG_UNASSIGN, req, res, next);
});
}

Aligned tag documentation