mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
23 lines
751 B
Python
23 lines
751 B
Python
"""
|
|
Specify the validation rules for each field in the differents record.
|
|
"""
|
|
|
|
def validate_walls_description(value):
|
|
if value not in ["Cavity", "Solid", "System built", "Timber frame", "Suspended timber", "Other"]:
|
|
raise ValueError("Walls description is not valid")
|
|
|
|
EPCRecordValidationConfiguration = {
|
|
"WALLS_DESCRIPTION": {
|
|
"type": "string",
|
|
"acceptable_values": ["Cavity", "Solid", "System built", "Timber frame", "Suspended timber", "Other"]
|
|
"function": validate_walls_description
|
|
},
|
|
"FLOOR_DESCRIPTION": {
|
|
"type": "string",
|
|
"acceptable_values": ["Solid", "Suspended", "Other"]
|
|
},
|
|
"ENERGY_CONSUMPTION_CURRENT": {
|
|
"type": "float",
|
|
"range": [0, 100]
|
|
}
|
|
}
|