aeat.domain.manuals._verify module¶
Verification report builder for aeat manual verify.
verify_manual_dir() walks a committed manual part, validates every JSON
file against the strict Manual and Section schema, and reports
dangling cross-references, missing multilingual completeness, and load failures
as ManualVerificationIssue rows in a
ManualVerificationReport.
- class ManualVerificationIssue(**data)[source]¶
Bases:
BaseModelSingle issue flagged by the verifier.
- Variables:
level – Either
'error'or'warning'.code – Stable identifier for the issue category.
message – Human-readable description, including the offending path.
- Parameters:
- level: str¶
- code: str¶
- message: str¶
- class ManualVerificationReport(**data)[source]¶
Bases:
BaseModelAggregate report returned by
verify_manual_dir().- Variables:
manual_id – Identifier of the verified handbook.
year – Tax year.
part – Volume split within the year.
issues – Every
ManualVerificationIssuecollected during the walk.
- Parameters:
manual_id (ManualId)
year (int)
part (ManualPart)
issues (tuple[ManualVerificationIssue, ...])
- manual_id: ManualId¶
- year: int¶
- part: ManualPart¶
- issues: tuple[ManualVerificationIssue, ...]¶
- property errors: tuple[ManualVerificationIssue, ...]¶
Return only the
ManualVerificationIssueitems withlevel == 'error'.
- property warnings: tuple[ManualVerificationIssue, ...]¶
Return only the
level == 'warning'issues.- Returns:
Tuple of
ManualVerificationIssueobjects with warning-level severity.
- verify_manual_dir(*, manual_id, year, part=ManualPart.SINGLE, review_required=None, settings=None)[source]¶
Verify every record under a manual part on disk.
- Parameters:
manual_id (
ManualId) – Handbook identifier.year (
int) – Tax year.part (
ManualPart) – Volume split within the year.review_required (
bool|None) – Reserved for the future soft-review gate (sentinel-based reviewer placeholders). Currently this flag has no effect because the_Reviewerconstrained type already enforces a non-empty reviewer at load time; records failing that constraint surface asload-failederrors. Defaults to theAEAT_MANUALS_REVIEW_REQUIREDsetting value.
- Return type:
- Returns:
A
ManualVerificationReportsummarising every issue found.- Raises:
ManualNotFoundError – If neither the structure nor the manifest exists for the requested manual part.
- raise_on_errors(report)[source]¶
Raise
ManualReviewRequiredErrorif the report has errors.Thin helper so the CLI can collapse a report into a non-zero exit without re-implementing the error-check logic.
- Parameters:
report (
ManualVerificationReport) – Report produced byverify_manual_dir().- Raises:
ManualReviewRequiredError – When the report contains any
error-level issues.- Return type: