aeat.application.setup._contracts module

Pydantic contracts for workspace initialization.

InitializeWorkspaceCommand carries the first-run profile facts, including IVARegime and OutputLanguage selections, without allocating storage itself. InitializeWorkspaceResult reports the generated ProfileId and matching BucketId created by the setup service.

class InitializeWorkspaceCommand(**data)[source]

Bases: BaseModel

Command to initialize a new active workspace profile and bucket.

The profile facts are consumed by aeat.application.setup.initialize_workspace(); enum fields preserve the domain vocabulary of IVARegime and OutputLanguage. profile_name is an operator-facing display label; the service mints the immutable ProfileId / BucketId storage identity.

Parameters:
  • profile_name (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)])

  • tax_id (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)])

  • activity (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)])

  • iva_regime (Annotated[IVARegime, BeforeValidator(func=~aeat.application.setup._contracts._normalise_iva_regime, json_schema_input_type=PydanticUndefined)])

  • tax_residence_ccaa (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)] | None)

  • auth_provider (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)])

  • certificate_path (Path | None)

  • certificate_password_env (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)] | None)

  • output_language (OutputLanguage | None)

  • drafts_dir (Path | None)

  • submissions_dir (Path | None)

  • manuals_root (Path | None)

profile_name: Annotated[str, StringConstraints(strip_whitespace=True, min_length=1)]
tax_id: Annotated[str, StringConstraints(strip_whitespace=True, min_length=1)]
activity: Annotated[str, StringConstraints(strip_whitespace=True, min_length=1)]
iva_regime: Annotated[IVARegime, BeforeValidator(_normalise_iva_regime)]
tax_residence_ccaa: Annotated[str, StringConstraints(strip_whitespace=True, min_length=1)] | None
auth_provider: Annotated[str, StringConstraints(strip_whitespace=True, min_length=1)]
certificate_path: Path | None
certificate_password_env: Annotated[str, StringConstraints(strip_whitespace=True, min_length=1)] | None
output_language: OutputLanguage | None
drafts_dir: Path | None
submissions_dir: Path | None
manuals_root: Path | None
class InitializeWorkspaceResult(**data)[source]

Bases: BaseModel

Result of successful workspace initialization.

The generated ProfileId is also the initial storage BucketId, matching the UUID bucket-provisioning contract; the operator profile name remains a decoupled display label.

Parameters:
  • profile_id (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=36, pattern=^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$, ascii_only=None)])

  • bucket_id (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=128, pattern=None, ascii_only=None)])

  • auth_configured (bool)

profile_id: ProfileId
bucket_id: BucketId
auth_configured: bool