Source code for cadrumo.core.identity_check_verdict
"""The verdict a live identity check returns for one tax identifier.One vocabulary, previously declared three times: twice inline in the sede checkersthat produce it, and once as an alias in the live verification surface that consumesit. The three agreed only because nobody had changed one of them.The producers and the consumer sit in different layers, so the definition lives herewhere both may reach it rather than in either of them."""from__future__importannotationsfromenumimportStrEnumfromtypingimportLiteral__all__=["IdentityCheckVerdict","IdentityCheckVerdictValue"]
[docs]classIdentityCheckVerdict(StrEnum):"""What a live AEAT or VIES lookup said about one identifier."""VALID="valid""""The registry the check consulted recognises the identifier."""INVALID="invalid""""The registry answered, and the identifier is not recognised."""UNKNOWN="unknown""""No answer was obtained, so nothing may be inferred either way. Structurally unanswerable rather than negative: a transport failure mid-query reads as unknown, and collapsing it into ``INVALID`` would report an outage as a rejected identifier. """
IdentityCheckVerdictValue=Literal[IdentityCheckVerdict.VALID,IdentityCheckVerdict.INVALID,IdentityCheckVerdict.UNKNOWN,]"""The same vocabulary in the form a strict payload boundary accepts.A bare enum under strict validation refuses the plain token a serialised observationcarries, and a coercing annotation cannot be used where a customised core schema isforbidden. A literal over this enum's own members accepts the token and adds no hook.Rooted in the vocabulary above rather than restated."""