Added company routes documentation
MODIFY
src/assets/server/rest/v1/docs/e-mobility-oas.json
src/assets/server/rest/v1/docs/e-mobility-oas.json
{
"name": "Tags",
"description": "Tags API"
+ },
+ {
+ "name": "Companies",
+ "description": "Company API"
}
],
"paths": {
}
}
}
+ },
+ "/api/companies": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Retrieve a list of Companies",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/Search"
+ },
+ {
+ "$ref": "#/components/parameters/Issuer"
+ },
+ {
+ "$ref": "#/components/parameters/WithSite"
+ },
+ {
+ "in": "query",
+ "name": "WithLogo",
+ "description": "With Logo",
+ "schema": {
+ "type": "boolean"
+ }
+ },
+ {
+ "$ref": "#/components/parameters/LocLongitude"
+ },
+ {
+ "$ref": "#/components/parameters/LocLatitude"
+ },
+ {
+ "$ref": "#/components/parameters/LocMaxDistanceMeters"
+ },
+ {
+ "$ref": "#/components/parameters/Skip"
+ },
+ {
+ "$ref": "#/components/parameters/SortFields"
+ },
+ {
+ "$ref": "#/components/parameters/Limit"
+ },
+ {
+ "$ref": "#/components/parameters/OnlyRecordCount"
+ },
+ {
+ "$ref": "#/components/parameters/ProjectFields"
+ }
+ ],
+ "tags": [
+ "Companies"
+ ],
+ "responses": {
+ "200": {
+ "description": "Return companies list",
+ "content": {
+ "application/json": {
+ "example": {
+ "count": 1,
+ "result": [
+ {
+ "address": {
+ "address1": "###",
+ "address2": "###",
+ "postalCode": "###",
+ "city": "###",
+ "country": "###",
+ "coordinates": [
+ 7.01692790000004,
+ 43.6123063
+ ]
+ },
+ "createdOn": "2018-03-30T22:29:08.388Z",
+ "name": "###",
+ "lastChangedOn": "2020-03-15T10:36:56.784Z",
+ "issuer": true,
+ "id": "###",
+ "canRead": true,
+ "canDelete": true,
+ "canUpdate": true
+ }
+ ]
+ }
+ }
+ }
+ },
+ "401": {
+ "$ref": "#/components/responses/UnauthorizedError"
+ },
+ "403": {
+ "$ref": "#/components/responses/ForbiddenError"
+ },
+ "500": {
+ "$ref": "#/components/responses/BackendError"
+ }
+ }
+ },
+ "post": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Create a Company",
+ "tags": [
+ "Companies"
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "address": {
+ "$ref": "#/components/schemas/Address"
+ },
+ "logo": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "201": {
+ "description": "Company created successfully",
+ "content": {
+ "application/json": {
+ "example": {
+ "id": "###",
+ "status": "Success"
+ }
+ }
+ }
+ },
+ "401": {
+ "$ref": "#/components/responses/UnauthorizedError"
+ },
+ "403": {
+ "$ref": "#/components/responses/ForbiddenError"
+ },
+ "500": {
+ "$ref": "#/components/responses/BackendError"
+ }
+ }
+ }
+ },
+ "/api/companies/{id}": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Retrieve a Company",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/companyID"
+ }
+ ],
+ "tags": [
+ "Companies"
+ ],
+ "responses": {
+ "200": {
+ "description": "Return company",
+ "content": {
+ "application/json": {
+ "example": {
+ "$ref": "#/components/schemas/Company"
+ }
+ }
+ }
+ },
+ "401": {
+ "$ref": "#/components/responses/UnauthorizedError"
+ },
+ "403": {
+ "$ref": "#/components/responses/ForbiddenError"
+ },
+ "500": {
+ "$ref": "#/components/responses/BackendError"
+ },
+ "550": {
+ "$ref": "#/components/responses/ResourceDoesNotExists"
+ }
+ }
+ },
+ "put": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Update a Company",
+ "tags": [
+ "Companies"
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Company"
+ }
+ }
+ }
+ },
+ "responses": {
+ "201": {
+ "description": "Company updated successfully",
+ "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"
+ }
+ }
+ },
+ "delete": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Delete a Company",
+ "tags": [
+ "Companies"
+ ],
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/companyID"
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Company deleted successfully",
+ "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"
+ }
+ }
+ }
}
},
"components": {
]
}
}
+ },
+ "Company": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "address": {
+ "$ref": "#/components/schemas/Address"
+ },
+ "logo": {
+ "type": "string",
+ "description": "Base64 encoded logo"
+ },
+ "issuer": {
+ "type": "boolean",
+ "readOnly": true
+ },
+ "id": {
+ "type": "string",
+ "readOnly": true
+ }
+ }
}
},
"parameters": {
"schema": {
"type": "boolean"
}
+ },
+ "companyID": {
+ "in": "path",
+ "name": "id",
+ "description": "Company ID",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
}
}
}

MODIFY
src/assets/server/rest/v1/schemas/company/companies-get.json
src/assets/server/rest/v1/schemas/company/companies-get.json
},
"ProjectFields": {
"$ref": "common.json#/definitions/projectFields"
+ },
+ "OnlyRecordCount": {
+ "$ref": "common.json#/definitions/onlyRecordCount"
}
},
"required": []

Added company routes documentation