156 lines
4.4 KiB
JSON
156 lines
4.4 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"title": "Opera report processing result",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"version",
|
|
"status",
|
|
"business_date",
|
|
"month_key",
|
|
"message",
|
|
"metrics",
|
|
"outputs",
|
|
"errors"
|
|
],
|
|
"properties": {
|
|
"version": { "type": "string", "enum": ["1.0", "2.0"] },
|
|
"processing_mode": { "type": "string", "const": "daily" },
|
|
"status": { "type": "string", "enum": ["success", "failed"] },
|
|
"business_date": { "type": ["string", "null"], "format": "date" },
|
|
"month_key": { "type": ["string", "null"], "pattern": "^[0-9]{4}-[0-9]{2}$" },
|
|
"message": { "type": "string" },
|
|
"metrics": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"source_rows",
|
|
"removed_by_rate_code",
|
|
"removed_as_duplicates",
|
|
"output_rows",
|
|
"channels"
|
|
],
|
|
"properties": {
|
|
"source_rows": { "type": "integer", "minimum": 0 },
|
|
"removed_by_rate_code": { "type": "integer", "minimum": 0 },
|
|
"removed_as_duplicates": { "type": "integer", "minimum": 0 },
|
|
"output_rows": { "type": "integer", "minimum": 0 },
|
|
"channels": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["worksheet", "rows"],
|
|
"properties": {
|
|
"worksheet": { "type": "string" },
|
|
"rows": { "type": "integer", "minimum": 0 }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"outputs": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["daily_report", "monthly_report", "exception_report"],
|
|
"properties": {
|
|
"daily_report": { "type": ["string", "null"], "pattern": "^[^/\\\\]+\\.xlsx$" },
|
|
"monthly_report": { "type": ["string", "null"], "pattern": "^[^/\\\\]+\\.xlsx$" },
|
|
"exception_report": { "type": ["string", "null"], "pattern": "^[^/\\\\]+\\.xlsx$" }
|
|
}
|
|
},
|
|
"errors": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"code",
|
|
"stage",
|
|
"source_location",
|
|
"company_name",
|
|
"rate_code",
|
|
"effective_rate_amount",
|
|
"confirmation_no",
|
|
"message"
|
|
],
|
|
"properties": {
|
|
"code": { "type": "string" },
|
|
"stage": { "type": "string" },
|
|
"source_location": { "type": ["string", "null"] },
|
|
"company_name": { "type": ["string", "null"] },
|
|
"rate_code": { "type": ["string", "null"] },
|
|
"effective_rate_amount": { "type": ["number", "null"] },
|
|
"confirmation_no": { "type": ["string", "null"] },
|
|
"message": { "type": "string" }
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"allOf": [
|
|
{
|
|
"if": {
|
|
"properties": { "version": { "const": "2.0" } },
|
|
"required": ["version"]
|
|
},
|
|
"then": {
|
|
"required": ["processing_mode"],
|
|
"properties": {
|
|
"processing_mode": { "const": "daily" },
|
|
"outputs": {
|
|
"properties": { "monthly_report": { "type": "null" } }
|
|
}
|
|
}
|
|
},
|
|
"else": {
|
|
"not": { "required": ["processing_mode"] }
|
|
}
|
|
},
|
|
{
|
|
"if": {
|
|
"properties": { "status": { "const": "success" } },
|
|
"required": ["status"]
|
|
},
|
|
"then": {
|
|
"properties": {
|
|
"outputs": {
|
|
"properties": {
|
|
"daily_report": { "type": "string" },
|
|
"exception_report": { "type": "null" }
|
|
}
|
|
},
|
|
"errors": { "maxItems": 0 }
|
|
}
|
|
},
|
|
"else": {
|
|
"properties": {
|
|
"outputs": {
|
|
"properties": {
|
|
"daily_report": { "type": "null" },
|
|
"monthly_report": { "type": "null" },
|
|
"exception_report": { "type": "string" }
|
|
}
|
|
},
|
|
"errors": { "minItems": 1 }
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"if": {
|
|
"properties": {
|
|
"version": { "const": "1.0" },
|
|
"status": { "const": "success" }
|
|
},
|
|
"required": ["version", "status"]
|
|
},
|
|
"then": {
|
|
"properties": {
|
|
"outputs": {
|
|
"properties": { "monthly_report": { "type": "string" } }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|