Updated swagger doc
MODIFY
src/assets/server/rest/v1/docs/e-mobility-oas.json
src/assets/server/rest/v1/docs/e-mobility-oas.json
"description": "Retrieve a list of Transactions",
"parameters": [
{
- "in": "query",
- "name": "Status",
- "description": "Transaction status",
+ "$ref": "#/components/parameters/Issuer"
+ },
+ {
+ "$ref": "#/components/parameters/Search"
+ },
+ {
+ "$ref": "#/components/parameters/StartDateTime"
+ },
+ {
+ "$ref": "#/components/parameters/EndDateTime"
+ },
+ {
+ "$ref": "#/components/parameters/WithChargingStation"
+ },
+ {
+ "$ref": "#/components/parameters/ChargingStationIDs"
+ },
+ {
+ "$ref": "#/components/parameters/ConnectorIDs"
+ },
+ {
+ "$ref": "#/components/parameters/WithCar"
+ },
+ {
+ "$ref": "#/components/parameters/WithUser"
+ },
+ {
+ "$ref": "#/components/parameters/UserIDs"
+ },
+ {
+ "$ref": "#/components/parameters/WithTag"
+ },
+ {
+ "$ref": "#/components/parameters/TagIDs"
+ },
+ {
+ "$ref": "#/components/parameters/VisualTagIDs"
+ },
+ {
+ "$ref": "#/components/parameters/SiteIDs"
+ },
+ {
+ "$ref": "#/components/parameters/WithSite"
+ },
+ {
+ "$ref": "#/components/parameters/SiteAreaIDs"
+ },
+ {
+ "$ref": "#/components/parameters/WithSiteArea"
+ },
+ {
+ "$ref": "#/components/parameters/WithCompany"
+ },
+ {
+ "$ref": "#/components/parameters/InactivityStatuses"
+ },
+ {
+ "$ref": "#/components/parameters/TransactionStatistics"
+ },
+ {
+ "$ref": "#/components/parameters/RefundStatus"
+ },
+ {
+ "$ref": "#/components/parameters/TransactionMinimalPrice"
+ },
+ {
+ "$ref": "#/components/parameters/ReportIDs"
+ },
+ {
+ "$ref": "#/components/parameters/Limit"
+ },
+ {
+ "$ref": "#/components/parameters/Skip"
+ },
+ {
+ "$ref": "#/components/parameters/SortFields"
+ },
+ {
+ "$ref": "#/components/parameters/OnlyRecordCount"
+ },
+ {
+ "$ref": "#/components/parameters/ProjectFields"
+ }
+ ],
+ "tags": [
+ "Transactions"
+ ],
+ "responses": {
+ "200": {
+ "description": "Return Transaction's list",
+ "content": {
+ "application/json": {
+ "example": {
+ "count": 1,
+ "stats": {
+ "_id": null,
+ "firstTimestamp": "2017-06-07T07:09:20.000Z",
+ "lastTimestamp": "2020-02-21T11:53:36.000Z",
+ "totalConsumptionWattHours": 10701590.285,
+ "totalDurationSecs": 8956090.273,
+ "totalPrice": 1498.222641,
+ "totalInactivitySecs": 4324778.908,
+ "currency": "EUR",
+ "count": 500
+ },
+ "result": [
+ {
+ "issuer": true,
+ "siteID": "###",
+ "siteAreaID": "###",
+ "connectorId": 1,
+ "tagID": "###",
+ "userID": "###",
+ "chargeBoxID": "###",
+ "meterStart": 7157518,
+ "timestamp": "2021-03-05T16:37:56.000Z",
+ "price": 0,
+ "roundedPrice": 0,
+ "priceUnit": "EUR",
+ "stateOfCharge": 0,
+ "timezone": "###",
+ "currentStateOfCharge": 0,
+ "currentTotalInactivitySecs": 11640,
+ "currentInactivityStatus": "E",
+ "currentCumulatedPrice": 1.968,
+ "currentInstantWatts": 0,
+ "currentTotalConsumptionWh": 12793,
+ "currentTotalDurationSecs": 21480,
+ "ocpi": false,
+ "ocpiWithCdr": false,
+ "id": 123456789,
+ "stop": {
+ "userID": "####",
+ "timestamp": "2021-02-15T16:05:38.000Z",
+ "tagID": "####",
+ "meterStop": 1122046,
+ "stateOfCharge": 0,
+ "totalConsumptionWh": 16,
+ "totalInactivitySecs": 0,
+ "extraInactivitySecs": 1,
+ "inactivityStatus": "I",
+ "totalDurationSecs": 94,
+ "price": 0.002,
+ "priceUnit": "EUR",
+ "roundedPrice": 0,
+ "user": {
+ "email": "####",
+ "firstName": "####",
+ "name": "####",
+ "id": "####"
+ }
+ },
+ "billingData": {
+ "invoiceID": "###"
+ },
+ "user": {
+ "email": "####",
+ "firstName": "####",
+ "name": "####",
+ "id": "####"
+ },
+ "car": {
+ "licensePlate": "####"
+ },
+ "carCatalog": {
+ "vehicleMake": "###",
+ "vehicleModel": "###",
+ "vehicleModelVersion": "###"
+ }
+ }
+ ]
+ }
+ }
+ }
+ },
+ "401": {
+ "$ref": "#/components/responses/UnauthorizedError"
+ },
+ "403": {
+ "$ref": "#/components/responses/ForbiddenError"
+ },
+ "500": {
+ "$ref": "#/components/responses/BackendError"
+ }
+ }
+ },
+ "delete": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Delete several Transactions",
+ "requestBody": {
+ "content": {
+ "application/json": {
"schema": {
- "type": "string",
- "enum": [
- "completed",
- "active",
- "to-refund",
- "in-error",
- "not-assigned-to-user"
+ "type": "object",
+ "properties": {
+ "transactionIDs": {
+ "type": "array",
+ "items": {
+ "type": "number"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Transactions"
+ ],
+ "responses": {
+ "200": {
+ "description": "Transaction deletion result",
+ "content": {
+ "application/json": {
+ "example": {
+ "status": "Success",
+ "inSuccess": 42,
+ "inError": 0
+ }
+ }
+ }
+ },
+ "401": {
+ "$ref": "#/components/responses/UnauthorizedError"
+ },
+ "403": {
+ "$ref": "#/components/responses/ForbiddenError"
+ },
+ "500": {
+ "$ref": "#/components/responses/BackendError"
+ }
+ }
+ }
+ },
+ "/api/transactions/status/completed": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Retrieve a list of completed Transactions",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/Issuer"
+ },
+ {
+ "$ref": "#/components/parameters/Search"
+ },
+ {
+ "$ref": "#/components/parameters/StartDateTime"
+ },
+ {
+ "$ref": "#/components/parameters/EndDateTime"
+ },
+ {
+ "$ref": "#/components/parameters/WithChargingStation"
+ },
+ {
+ "$ref": "#/components/parameters/ChargingStationIDs"
+ },
+ {
+ "$ref": "#/components/parameters/ConnectorIDs"
+ },
+ {
+ "$ref": "#/components/parameters/WithCar"
+ },
+ {
+ "$ref": "#/components/parameters/WithUser"
+ },
+ {
+ "$ref": "#/components/parameters/UserIDs"
+ },
+ {
+ "$ref": "#/components/parameters/WithTag"
+ },
+ {
+ "$ref": "#/components/parameters/TagIDs"
+ },
+ {
+ "$ref": "#/components/parameters/VisualTagIDs"
+ },
+ {
+ "$ref": "#/components/parameters/SiteIDs"
+ },
+ {
+ "$ref": "#/components/parameters/WithSite"
+ },
+ {
+ "$ref": "#/components/parameters/SiteAreaIDs"
+ },
+ {
+ "$ref": "#/components/parameters/WithSiteArea"
+ },
+ {
+ "$ref": "#/components/parameters/WithCompany"
+ },
+ {
+ "$ref": "#/components/parameters/InactivityStatuses"
+ },
+ {
+ "$ref": "#/components/parameters/TransactionStatistics"
+ },
+ {
+ "$ref": "#/components/parameters/RefundStatus"
+ },
+ {
+ "$ref": "#/components/parameters/TransactionMinimalPrice"
+ },
+ {
+ "$ref": "#/components/parameters/ReportIDs"
+ },
+ {
+ "$ref": "#/components/parameters/Limit"
+ },
+ {
+ "$ref": "#/components/parameters/Skip"
+ },
+ {
+ "$ref": "#/components/parameters/SortFields"
+ },
+ {
+ "$ref": "#/components/parameters/OnlyRecordCount"
+ },
+ {
+ "$ref": "#/components/parameters/ProjectFields"
+ }
+ ],
+ "tags": [
+ "Transactions"
+ ],
+ "responses": {
+ "200": {
+ "description": "Return completed Transaction's list",
+ "content": {
+ "application/json": {
+ "example": {
+ "count": 1,
+ "stats": {
+ "_id": null,
+ "count": 500
+ },
+ "result": [
+ {
+ "issuer": true,
+ "companyID": "###",
+ "siteID": "###",
+ "siteAreaID": "###",
+ "connectorId": 1,
+ "tagID": "###",
+ "carID": null,
+ "carCatalogID": null,
+ "userID": "###",
+ "chargeBoxID": "###",
+ "meterStart": 0,
+ "timestamp": "2021-07-06T09:29:55.309Z",
+ "stateOfCharge": 75,
+ "timezone": "Europe/Paris",
+ "stop": {
+ "userID": "###",
+ "timestamp": "2021-07-06T09:36:55.656Z",
+ "tagID": "###",
+ "meterStop": 3194,
+ "reason": null,
+ "stateOfCharge": 47,
+ "totalConsumptionWh": 3194,
+ "totalInactivitySecs": 0,
+ "extraInactivitySecs": 0,
+ "inactivityStatus": "I",
+ "totalDurationSecs": 420.347,
+ "price": 0.51104,
+ "roundedPrice": 0.51,
+ "priceUnit": "EUR"
+ },
+ "ocpi": false,
+ "ocpiWithCdr": false,
+ "id": 123456789
+ }
+ ]
+ }
+ }
+ }
+ },
+ "401": {
+ "$ref": "#/components/responses/UnauthorizedError"
+ },
+ "403": {
+ "$ref": "#/components/responses/ForbiddenError"
+ },
+ "500": {
+ "$ref": "#/components/responses/BackendError"
+ }
+ }
+ }
+ },
+ "/api/transactions/status/active": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Retrieve a list of active Transactions",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/Issuer"
+ },
+ {
+ "$ref": "#/components/parameters/Search"
+ },
+ {
+ "$ref": "#/components/parameters/StartDateTime"
+ },
+ {
+ "$ref": "#/components/parameters/EndDateTime"
+ },
+ {
+ "$ref": "#/components/parameters/WithChargingStation"
+ },
+ {
+ "$ref": "#/components/parameters/ChargingStationIDs"
+ },
+ {
+ "$ref": "#/components/parameters/ConnectorIDs"
+ },
+ {
+ "$ref": "#/components/parameters/WithCar"
+ },
+ {
+ "$ref": "#/components/parameters/WithUser"
+ },
+ {
+ "$ref": "#/components/parameters/UserIDs"
+ },
+ {
+ "$ref": "#/components/parameters/WithTag"
+ },
+ {
+ "$ref": "#/components/parameters/TagIDs"
+ },
+ {
+ "$ref": "#/components/parameters/VisualTagIDs"
+ },
+ {
+ "$ref": "#/components/parameters/SiteIDs"
+ },
+ {
+ "$ref": "#/components/parameters/WithSite"
+ },
+ {
+ "$ref": "#/components/parameters/SiteAreaIDs"
+ },
+ {
+ "$ref": "#/components/parameters/WithSiteArea"
+ },
+ {
+ "$ref": "#/components/parameters/WithCompany"
+ },
+ {
+ "$ref": "#/components/parameters/InactivityStatuses"
+ },
+ {
+ "$ref": "#/components/parameters/TransactionStatistics"
+ },
+ {
+ "$ref": "#/components/parameters/RefundStatus"
+ },
+ {
+ "$ref": "#/components/parameters/TransactionMinimalPrice"
+ },
+ {
+ "$ref": "#/components/parameters/ReportIDs"
+ },
+ {
+ "$ref": "#/components/parameters/Limit"
+ },
+ {
+ "$ref": "#/components/parameters/Skip"
+ },
+ {
+ "$ref": "#/components/parameters/SortFields"
+ },
+ {
+ "$ref": "#/components/parameters/OnlyRecordCount"
+ },
+ {
+ "$ref": "#/components/parameters/ProjectFields"
+ }
+ ],
+ "tags": [
+ "Transactions"
+ ],
+ "responses": {
+ "200": {
+ "description": "Return active Transaction's list",
+ "content": {
+ "application/json": {
+ "example": {
+ "count": 1,
+ "stats": {
+ "_id": null,
+ "count": 1
+ },
+ "result": [
+ {
+ "issuer": true,
+ "companyID": "###",
+ "siteID": "###",
+ "siteAreaID": "###",
+ "connectorId": 1,
+ "tagID": "###",
+ "carID": null,
+ "carCatalogID": null,
+ "userID": "###",
+ "chargeBoxID": "###",
+ "meterStart": 0,
+ "timestamp": "2021-07-06T12:02:40.957Z",
+ "price": 0,
+ "roundedPrice": 0,
+ "priceUnit": "EUR",
+ "stateOfCharge": 21,
+ "timezone": "Europe/Paris",
+ "currentStateOfCharge": 77,
+ "currentTotalInactivitySecs": 0,
+ "currentInactivityStatus": "I",
+ "currentCumulatedPrice": 2.51456,
+ "currentInstantWatts": 16919.436018799373,
+ "currentTotalConsumptionWh": 15716,
+ "currentTotalDurationSecs": 2550.496,
+ "id": 123456789
+ }
]
}
+ }
+ }
+ },
+ "401": {
+ "$ref": "#/components/responses/UnauthorizedError"
+ },
+ "403": {
+ "$ref": "#/components/responses/ForbiddenError"
+ },
+ "500": {
+ "$ref": "#/components/responses/BackendError"
+ }
+ }
+ }
},
+ "/api/transactions/status/refund": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Retrieve a list of Transactions to refund and refunded",
+ "parameters": [
{
"$ref": "#/components/parameters/Issuer"
},
"$ref": "#/components/parameters/RefundStatus"
},
{
- "in": "query",
- "name": "MinimalPrice",
- "description": "Transactions minimal price",
- "schema": {
- "type": "string"
- }
+ "$ref": "#/components/parameters/TransactionMinimalPrice"
},
{
- "in": "query",
- "name": "ReportIDs",
- "description": "Pipe separated report IDs",
- "schema": {
- "type": "string"
- }
+ "$ref": "#/components/parameters/ReportIDs"
},
{
"$ref": "#/components/parameters/Limit"
],
"responses": {
"200": {
- "description": "Return Transaction's list",
+ "description": "Return Transactions to refund and refunded list",
"content": {
"application/json": {
"example": {
"count": 1,
"stats": {
"_id": null,
- "firstTimestamp": "2017-06-07T07:09:20.000Z",
- "lastTimestamp": "2020-02-21T11:53:36.000Z",
- "totalConsumptionWattHours": 10701590.285,
- "totalDurationSecs": 8956090.273,
- "totalPrice": 1498.222641,
- "totalInactivitySecs": 4324778.908,
- "currency": "EUR",
"count": 500
},
"result": [
{
"issuer": true,
+ "companyID": "###",
"siteID": "###",
"siteAreaID": "###",
"connectorId": 1,
- "tagID": "###",
+ "tagID": "AAE",
+ "carID": null,
+ "carCatalogID": null,
"userID": "###",
"chargeBoxID": "###",
- "meterStart": 7157518,
- "timestamp": "2021-03-05T16:37:56.000Z",
- "price": 0,
- "roundedPrice": 0,
- "priceUnit": "EUR",
- "stateOfCharge": 0,
- "timezone": "###",
- "currentStateOfCharge": 0,
- "currentTotalInactivitySecs": 11640,
- "currentInactivityStatus": "E",
- "currentCumulatedPrice": 1.968,
- "currentInstantWatts": 0,
- "currentTotalConsumptionWh": 12793,
- "currentTotalDurationSecs": 21480,
- "ocpi": false,
- "ocpiWithCdr": false,
- "id": 123456789,
+ "meterStart": 0,
+ "timestamp": "2021-07-06T09:29:55.309Z",
+ "stateOfCharge": 75,
+ "timezone": "Europe/Paris",
"stop": {
- "userID": "####",
- "timestamp": "2021-02-15T16:05:38.000Z",
- "tagID": "####",
- "meterStop": 1122046,
- "stateOfCharge": 0,
- "totalConsumptionWh": 16,
+ "userID": "###",
+ "timestamp": "2021-07-06T09:36:55.656Z",
+ "tagID": "###",
+ "reason": null,
+ "stateOfCharge": 47,
+ "totalConsumptionWh": 3194,
"totalInactivitySecs": 0,
- "extraInactivitySecs": 1,
+ "extraInactivitySecs": 0,
"inactivityStatus": "I",
- "totalDurationSecs": 94,
- "price": 0.002,
- "priceUnit": "EUR",
- "roundedPrice": 0,
- "user": {
- "email": "####",
- "firstName": "####",
- "name": "####",
- "id": "####"
- }
- },
- "billingData": {
- "invoiceID": "###"
- },
- "user": {
- "email": "####",
- "firstName": "####",
- "name": "####",
- "id": "####"
- },
- "car": {
- "licensePlate": "####"
+ "totalDurationSecs": 420.347,
+ "price": 0.51104,
+ "roundedPrice": 0.51,
+ "priceUnit": "EUR"
},
- "carCatalog": {
- "vehicleMake": "###",
- "vehicleModel": "###",
- "vehicleModelVersion": "###"
- }
+ "id": 123456789
}
]
}
"$ref": "#/components/responses/BackendError"
}
}
+ }
},
- "delete": {
+ "/api/transactions/status/in-error": {
+ "get": {
"security": [
{
"bearerAuth": []
}
],
- "description": "Delete several Transactions",
- "requestBody": {
+ "description": "Retrieve a list of Transactions in error",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/Issuer"
+ },
+ {
+ "$ref": "#/components/parameters/Search"
+ },
+ {
+ "$ref": "#/components/parameters/StartDateTime"
+ },
+ {
+ "$ref": "#/components/parameters/EndDateTime"
+ },
+ {
+ "$ref": "#/components/parameters/ChargingStationIDs"
+ },
+ {
+ "$ref": "#/components/parameters/ConnectorIDs"
+ },
+ {
+ "$ref": "#/components/parameters/UserIDs"
+ },
+ {
+ "$ref": "#/components/parameters/SiteIDs"
+ },
+ {
+ "$ref": "#/components/parameters/SiteAreaIDs"
+ },
+ {
+ "in": "query",
+ "name": "ErrorType",
+ "description": "Pipe separated error types (long_activity, negative_activity, negative_duration, low_duration, invalid_start_date, no_consumption, low_consumption, missing_user, missing_price, no_billing_data)",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "$ref": "#/components/parameters/Limit"
+ },
+ {
+ "$ref": "#/components/parameters/Skip"
+ },
+ {
+ "$ref": "#/components/parameters/SortFields"
+ },
+ {
+ "$ref": "#/components/parameters/ProjectFields"
+ }
+ ],
+ "tags": [
+ "Transactions"
+ ],
+ "responses": {
+ "200": {
+ "description": "Return Transactions in error list",
"content": {
"application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "transactionIDs": {
- "type": "array",
- "items": {
- "type": "number"
+ "example": {
+ "count": 1,
+ "result": [
+ {
+ "issuer": true,
+ "siteID": "###",
+ "siteAreaID": "###",
+ "connectorId": 1,
+ "tagID": "###",
+ "userID": "###",
+ "chargeBoxID": "###",
+ "meterStart": 1152126,
+ "timestamp": "2020-12-07T11:15:41.314Z",
+ "stateOfCharge": 9,
+ "timezone": "Europe/Paris",
+ "stop": {
+ "userID": "###",
+ "tagID": "###",
+ "stateOfCharge": 9,
+ "totalConsumptionWh": 149,
+ "totalDurationSecs": 54
+ },
+ "companyID": "###",
+ "errorCode": "low_duration",
+ "uniqueId": "123456789#low_duration",
+ "id": 123456789
+ }
+ ]
}
}
}
+ },
+ "401": {
+ "$ref": "#/components/responses/UnauthorizedError"
+ },
+ "403": {
+ "$ref": "#/components/responses/ForbiddenError"
+ },
+ "500": {
+ "$ref": "#/components/responses/BackendError"
}
}
}
},
+ "/api/transactions/status/unassigned/count": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Count unassigned Transactions",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/TagID"
+ }
+ ],
"tags": [
"Transactions"
],
"responses": {
"200": {
- "description": "Transaction deletion result",
+ "description": "Return unassigned Transactions count",
"content": {
- "application/json": {
- "example": {
- "status": "Success",
- "inSuccess": 42,
- "inError": 0
- }
+ "text/plain": {
+ "example": 42
}
}
},
}
}
},
- "/api/transactions/{id}/ocpi/cdr/action/export": {
+ "/api/transactions/{id}/ocpi/cdr/export": {
"get": {
"security": [
{
}
}
},
- "/api/transactions/{id}/stop/soft": {
+ "/api/transactions/{id}/soft-stop": {
"put": {
"security": [
{
}
}
},
- "/api/transactions/action/refund/export": {
+ "/api/transactions/status/refund/export": {
"get": {
"security": [
{
}
}
},
- "/api/transactions/action/refund/synchronize": {
+ "/api/transactions/status/refund/synchronize": {
"post": {
"security": [
{
}
}
},
- "/api/transactions/action/refund/reports": {
+ "/api/transactions/status/refund/reports": {
"get": {
"security": [
{
}
}
},
- "/api/transactions/action/assign": {
+ "/api/transactions/action/assign-user": {
"put": {
"security": [
{
"schema": {
"type": "string"
}
+ },
+ "TransactionMinimalPrice": {
+ "in": "query",
+ "name": "MinimalPrice",
+ "description": "Transactions minimal price",
+ "schema": {
+ "type": "string"
+ }
+ },
+ "ReportIDs": {
+ "in": "query",
+ "name": "ReportIDs",
+ "description": "Pipe separated report IDs",
+ "schema": {
+ "type": "string"
+ }
}
}
}

MODIFY
src/types/Server.ts
src/types/Server.ts
@@ -496,7 +496,7 @@ export enum ServerRoute {
REST_TRANSACTIONS_IN_ERROR = 'transactions/status/in-error',
REST_TRANSACTIONS_ACTIVE = 'transactions/status/active',
REST_TRANSACTIONS_COMPLETED = 'transactions/status/completed',
- REST_TRANSACTIONS_UNASSIGNED_COUNT = '/transactions/status/unassigned/count',
+ REST_TRANSACTIONS_UNASSIGNED_COUNT = 'transactions/status/unassigned/count',
REST_TRANSACTION = 'transactions/:id',
REST_TRANSACTIONS_EXPORT = 'transactions/action/export',
REST_TRANSACTION_CDR = 'transactions/:id/ocpi/cdr',

Updated swagger doc