Skip to content

Commit

Permalink
Merge pull request #25 from plugoinc/refactor/OCPI-161
Browse files Browse the repository at this point in the history
isolate CommandResponseType CommandResultType
  • Loading branch information
ThaddeusJiang authored Feb 19, 2024
2 parents 5e16b55 + 2fddd56 commit d44c801
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 80 deletions.
55 changes: 0 additions & 55 deletions openapi/components/requestBodies/StartSession.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,3 @@ content:
application/json:
schema:
$ref: ../schemas/StartSession.yaml
examples:
'Simple StartSession example of just starting a session':
value:
country_code: 'NL'
party_id: 'STK'
id: '101'
start_date_time: '2020-03-09T10:17:09Z'
kwh: 0.0
cdr_token:
uid: '123abc'
type: 'RFID'
contract_id: 'NL-TST-C12345678-S'
auth_method: 'WHITELIST'
location_id: 'LOC1'
evse_uid: '3256'
connector_id: '1'
currency: 'EUR'
total_cost:
excl_vat: 2.5
status: 'PENDING'
last_updated: '2020-03-09T10:17:09Z'
'Simple StartSession example of a short finished session':
value:
country_code: 'BE'
party_id: 'BEC'
id: '101'
start_date_time: '2015-06-29T22:39:09Z'
end_date_time: '2015-06-29T23:50:16Z'
kwh: 41.00
cdr_token:
uid: '123abc'
type: 'RFID'
contract_id: 'NL-TST-C12345678-S'
auth_method: 'WHITELIST'
location_id: 'LOC1'
evse_uid: '3256'
connector_id: '1'
currency: 'EUR'
charging_periods:
- start_date_time: '2015-06-29T22:39:09Z'
dimensions:
- type: 'ENERGY'
volume: 120
- type: 'MAX_CURRENT'
volume: 30
- start_date_time: '2015-06-29T22:40:54Z'
dimensions:
- type: 'ENERGY'
volume: 41000
- type: 'MIN_CURRENT'
volume: 34
- start_date_time: '2015-06-29T23:07:09Z'
dimensions:
- type: 'ENERGY'
volume: 41000
8 changes: 1 addition & 7 deletions openapi/components/schemas/CommandResponse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@ required:
- timeout
properties:
result:
type: string
enum:
- NOT_SUPPORTED
- REJECTED
- UNKNOWN_SESSION
- ACCEPTED
example: ACCEPTED
$ref: ../schemas/CommandResponseType.yaml
timeout:
type: integer
message:
Expand Down
7 changes: 7 additions & 0 deletions openapi/components/schemas/CommandResponseType.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type: string
summary: CommandResponseType enum
enum:
- NOT_SUPPORTED
- REJECTED
- ACCEPTED
- UNKNOWN_SESSION
14 changes: 1 addition & 13 deletions openapi/components/schemas/CommandResult.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@ required:
type: object
properties:
result:
type: string
summary: CommandResultType enum
description: Result of the command that was send to the Charge Point.
enum:
- ACCEPTED
- CANCELED_RESERVATION
- EVSE_OCCUPIED
- EVSE_INOPERATIVE
- FAILED
- NOT_SUPPORTED
- REJECTED
- TIMEOUT
- UNKNOWN_RESERVATION
$ref: CommandResultType.yaml
message:
$ref: ../schemas/DisplayText.yaml
8 changes: 8 additions & 0 deletions openapi/components/schemas/CommandType.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type: string
summary: CommandType enum
enum:
- CANCEL_RESERVATION
- RESERVE_NOW
- START_SESSION
- STOP_SESSION
- UNLOCK_CONNECTOR
2 changes: 1 addition & 1 deletion openapi/openapi.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
openapi: 3.1.0
info:
version: 0.0.15
version: 0.0.16
title: OCPI

contact:
Expand Down
5 changes: 1 addition & 4 deletions openapi/paths/commands_start_session.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ post:
- tokenAuth: []
operationId: startSession
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/StartSession.yaml
$ref: ../components/requestBodies/StartSession.yaml
responses:
200:
$ref: ../components/responses/CommandResponse.yaml
Expand Down

0 comments on commit d44c801

Please sign in to comment.