Initial commit: Check-My-IRVE SaaS (OCPP 1.6, Audit, Diagnostics)

This commit is contained in:
Adam Belkacemi 2026-08-25 19:08:15 +02:00
commit 192be86487
44 changed files with 2070 additions and 0 deletions

View file

@ -0,0 +1,39 @@
import jsonschema
# Schémas simplifiés pour la démo (basés sur la spec OCPP 1.6)
SCHEMAS = {
"BootNotification": {
"type": "object",
"properties": {
"chargePointVendor": {"type": "string", "maxLength": 20},
"chargePointModel": {"type": "string", "maxLength": 20}
},
"required": ["chargePointVendor", "chargePointModel"]
},
"Authorize": {
"type": "object",
"properties": {
"idTag": {"type": "string", "maxLength": 20}
},
"required": ["idTag"]
},
"StartTransaction": {
"type": "object",
"properties": {
"connectorId": {"type": "integer"},
"idTag": {"type": "string"},
"meterStart": {"type": "integer"},
"timestamp": {"type": "string"}
},
"required": ["connectorId", "idTag", "meterStart", "timestamp"]
}
}
def validate_payload(action, payload):
if action in SCHEMAS:
try:
jsonschema.validate(instance=payload, schema=SCHEMAS[action])
return None
except jsonschema.ValidationError as e:
return e.message
return None