aeat.application.aggregation package¶
Public aggregation facade for rollup helpers and typed source-mesh resolvers.
This package exposes two related surfaces. The pure aggregation helpers
(aggregate_* functions plus value records such as
CasillaAggregation and
RetencionesAggregation) roll classified
observations into family-specific totals. The live calculation surface is the
source mesh: ModeloSourceResolver
implementations claim one or more
core.BindingSourceKind members and return the canonical
CalculationSourceResolution envelope
consumed by the modelo calculate path.
aggregate_per_modelo() remains the provider-grouped service for
per-modelo rollup workflows. It is not the resolved-source envelope used by
calculation; mesh helpers such as merge_source_resolutions(),
merge_source_resolutions_by_precedence(),
collect_unhandled_source_diagnostics(), and
build_binding_source_dispositions() enforce exclusive ownership, declared
precedence, no-silent-blank diagnostics, and the enrolled / deferred / reserved
BindingSourceDisposition registry.
Concrete resolvers re-exported here include
LedgerIvaAggregationSourceResolver,
RetencionesAggregationSourceResolver,
OssIossLedgerSourceResolver,
ProfileSourceResolver, and
WithholdingSourceResolver. The calculation
path also composes prior-filing, relation-prefill, invoice, borrador, and
IVA-wallet resolvers from neighboring application packages; their shared
contract is still
CalculationSourceResolution, not
CasillaAggregation.
Aggregation resolvers prepare provenance-carrying source values; they do not
execute registry formulas, decide filing readiness, or mutate work-unit filing
state. Those steps remain in domain.calculations.registry and
application.modelo.
The facade also re-exports encrypted observation repositories for the
retenciones and percepciones stores, informativa rollups, and the shared
AggregationError failure taxonomy.
See also
application.modeloWork-unit calculate services that consume
CalculationSourceResolutionvalues and persist contributingsource_transaction_idson calculation revisions.domain.transactionsLedger transaction catalogue resolved by ledger IVA, Renta, OSS/IOSS, evidence-advisory, and filing-snapshot aggregation paths.
domain.invoicesInvoice catalogue and purchase-evidence records adapted into invoice source resolutions.
domain.attachmentsEncrypted document bytes referenced by ledger evidence diagnostics and advisory surfaces without becoming plaintext calculation inputs.
domain.calculations.registryPure registry formulas, binding declarations, and observation contracts that consume the resolved source payload.
Submodules¶
- aeat.application.aggregation._atribucion_member module
- aeat.application.aggregation._business_proportion module
- aeat.application.aggregation._counterpart module
CounterpartObservationCounterpartObservation.source_kindCounterpartObservation.source_object_idCounterpartObservation.counterparty_nifCounterpartObservation.counterparty_nameCounterpartObservation.counterparty_countryCounterpartObservation.operation_kindCounterpartObservation.operation_periodCounterpartObservation.taxable_baseCounterpartObservation.invoice_totalCounterpartObservation.accrued_onCounterpartObservation.groi_verifiedCounterpartObservation.nif_iva_verified
CounterpartRollupCounterpartRollup.source_kindCounterpartRollup.counterparty_nifCounterpartRollup.counterparty_nameCounterpartRollup.counterparty_countryCounterpartRollup.operation_kindCounterpartRollup.observations_countCounterpartRollup.total_taxable_baseCounterpartRollup.total_invoice_totalCounterpartRollup.requires_groi_checkCounterpartRollup.requires_nif_iva_checkCounterpartRollup.groi_readyCounterpartRollup.nif_iva_readyCounterpartRollup.declarable_readiness_satisfied
CounterpartAggregationaggregate_counterpart_347()aggregate_counterpart_349()CounterpartAggregationSourceResolverdeclarable_counterparty_nifs_347()declarable_for_347()
- aeat.application.aggregation._currency_predicates module
- aeat.application.aggregation._errors module
- aeat.application.aggregation._evidence_advisory module
- aeat.application.aggregation._foreign_assets module
ForeignAssetIngestObservationForeignAssetIngestObservation.source_kindForeignAssetIngestObservation.source_object_idForeignAssetIngestObservation.asset_classForeignAssetIngestObservation.asset_external_idForeignAssetIngestObservation.countryForeignAssetIngestObservation.issuer_or_institutionForeignAssetIngestObservation.valuation_eurForeignAssetIngestObservation.acquisition_dateForeignAssetIngestObservation.held_at_year_end
ForeignAssetClassRollupForeignAssetsAggregationdeclarable_asset_classes_720()declarable_class()aggregate_foreign_assets_720()ForeignAssetsAggregationSourceResolver
- aeat.application.aggregation._grouping module
- aeat.application.aggregation._impatriado_income_ledger module
ImpatriadoIncomeLedgerAggregationIssueReasonImpatriadoIncomeLedgerAggregationIssueReason.UNSUPPORTED_DIRECTIONImpatriadoIncomeLedgerAggregationIssueReason.UNSUPPORTED_CURRENCYImpatriadoIncomeLedgerAggregationIssueReason.UNCLASSIFIED_BUSINESS_STATEImpatriadoIncomeLedgerAggregationIssueReason.PERSONAL_TRANSACTIONImpatriadoIncomeLedgerAggregationIssueReason.OUTSIDE_PERIODImpatriadoIncomeLedgerAggregationIssueReason.UNSUPPORTED_PERIODImpatriadoIncomeLedgerAggregationIssueReason.BECKHAM_FOREIGN_SOURCE_SEGREGATED
ImpatriadoIncomeLedgerAggregationIssueImpatriadoIncomeObservationImpatriadoIncomeLedgerAggregationaggregate_impatriado_income_ledger_from_repositories()aggregate_impatriado_income_ledger()
- aeat.application.aggregation._iva_ledger module
IvaLedgerAggregationIssueReasonIvaLedgerAggregationIssueReason.UNSUPPORTED_DIRECTIONIvaLedgerAggregationIssueReason.UNSUPPORTED_CURRENCYIvaLedgerAggregationIssueReason.UNCLASSIFIED_BUSINESS_STATEIvaLedgerAggregationIssueReason.PERSONAL_TRANSACTIONIvaLedgerAggregationIssueReason.OUTSIDE_PERIODIvaLedgerAggregationIssueReason.MISSING_TAXABLE_BASEIvaLedgerAggregationIssueReason.MISSING_IVA_AMOUNTIvaLedgerAggregationIssueReason.MISSING_IVA_RATEIvaLedgerAggregationIssueReason.UNSUPPORTED_IVA_RATEIvaLedgerAggregationIssueReason.MISSING_EUR_TAX_SUBSTRATEIvaLedgerAggregationIssueReason.INVALID_PRORRATA_REFERENCEIvaLedgerAggregationIssueReason.UNSUPPORTED_IVA_CATEGORYIvaLedgerAggregationIssueReason.MISSING_COUNTERPARTY_EU_MEMBER_STATEIvaLedgerAggregationIssueReason.DOMESTIC_COUNTERPARTY_ON_INTRA_COMMUNITY_TRANSACTIONIvaLedgerAggregationIssueReason.EU_MEMBER_STATE_ON_EXPORT_TRANSACTIONIvaLedgerAggregationIssueReason.CASH_ACCOUNTING_EXCLUDED_CATEGORY
IvaLedgerAggregationIssueProrrataLedgerReferenceIvaLedgerSectorApportionmentIvaLedgerProrrataApportionmentAnnualDeducibleTotalsByRegimeIvaLedgerInputKindIvaLedgerCandidateIvaLedgerCandidate.ledger_idIvaLedgerCandidate.transaction_dateIvaLedgerCandidate.categoryIvaLedgerCandidate.exemption_articleIvaLedgerCandidate.rate_kindIvaLedgerCandidate.flow_directionIvaLedgerCandidate.base_amountIvaLedgerCandidate.iva_amountIvaLedgerCandidate.input_kindIvaLedgerCandidate.prorrata_reference_idIvaLedgerCandidate.cash_accounting_treatment
IvaLedgerAggregationaggregate_iva_ledger_observations_from_repositories()validate_iva_ledger_observation()validate_iva_ledger_observations()aggregate_iva_ledger_candidates()aggregate_iva_ledger_candidate_bindings()aggregate_iva_ledger_observations()resolve_iva_ledger_binding_values()compute_annual_deducible_totals_by_regime()validate_iva_ledger_counterparty_category()iva_ledger_missing_fact_reasons()
- aeat.application.aggregation._ledger_filing_snapshot module
- aeat.application.aggregation._modelo_bindings module
- aeat.application.aggregation._models module
- aeat.application.aggregation._observation_window module
- aeat.application.aggregation._oss_ioss module
OssIossLedgerCandidateOssIossLedgerCandidate.ledger_idOssIossLedgerCandidate.transaction_dateOssIossLedgerCandidate.regimeOssIossLedgerCandidate.destination_member_stateOssIossLedgerCandidate.rate_kindOssIossLedgerCandidate.invoice_directionOssIossLedgerCandidate.transaction_kindOssIossLedgerCandidate.base_amountOssIossLedgerCandidate.iva_amount
validate_oss_ioss_observation()validate_oss_ioss_observations()aggregate_oss_ioss_bindings()oss_ioss_candidates_from_repositories()aggregate_oss_ioss_from_repositories()OssIossLedgerSourceResolver
- aeat.application.aggregation._percepciones_observations_repository module
percepcion_observation_key()PercepcionObservationRepositoryPercepcionObservationRepository.namespacePercepcionObservationRepository.sensitivityPercepcionObservationRepository.schema_versionPercepcionObservationRepository.payload_typePercepcionObservationRepository.extract_identifier()PercepcionObservationRepository.save_observation()PercepcionObservationRepository.replace_observations()PercepcionObservationRepository.load_observations()PercepcionObservationRepository.iter_modelo()
persist_percepcion_observations()
- aeat.application.aggregation._renta_gasto_ledger module
- aeat.application.aggregation._renta_income_ledger module
RentaIncomeLedgerAggregationIssueReasonRentaIncomeLedgerAggregationIssueReason.UNSUPPORTED_DIRECTIONRentaIncomeLedgerAggregationIssueReason.UNSUPPORTED_CURRENCYRentaIncomeLedgerAggregationIssueReason.UNCLASSIFIED_BUSINESS_STATERentaIncomeLedgerAggregationIssueReason.PERSONAL_TRANSACTIONRentaIncomeLedgerAggregationIssueReason.OUTSIDE_PERIODRentaIncomeLedgerAggregationIssueReason.UNSUPPORTED_PERIODRentaIncomeLedgerAggregationIssueReason.TRABAJO_INCOME
RentaIncomeLedgerAggregationIssueRentaIncomeObservationRentaIncomeLedgerAggregationaggregate_renta_income_ledger_from_repositories()aggregate_renta_income_ledger()aggregate_renta_m100_income_ledger_from_repositories()aggregate_renta_m100_income_ledger()
- aeat.application.aggregation._renta_ledger module
RentaLedgerAggregationIssueReasonRentaLedgerAggregationIssueReason.UNSUPPORTED_PERIODRentaLedgerAggregationIssueReason.UNSUPPORTED_DIRECTIONRentaLedgerAggregationIssueReason.UNSUPPORTED_CURRENCYRentaLedgerAggregationIssueReason.UNCLASSIFIED_BUSINESS_STATERentaLedgerAggregationIssueReason.PERSONAL_TRANSACTIONRentaLedgerAggregationIssueReason.MISSING_CATEGORYRentaLedgerAggregationIssueReason.UNKNOWN_CATEGORYRentaLedgerAggregationIssueReason.CATEGORY_OUTSIDE_FIRST_SLICERentaLedgerAggregationIssueReason.MISSING_CATEGORY_PROFILERentaLedgerAggregationIssueReason.OUTSIDE_PERIODRentaLedgerAggregationIssueReason.MISSING_PURCHASE_INVOICE_EVIDENCERentaLedgerAggregationIssueReason.UNSUPPORTED_PURCHASE_INVOICE_EVIDENCE_KINDRentaLedgerAggregationIssueReason.PURCHASE_INVOICE_EVIDENCE_BUCKET_MISMATCHRentaLedgerAggregationIssueReason.PURCHASE_INVOICE_EVIDENCE_LINK_MISMATCHRentaLedgerAggregationIssueReason.PARTIAL_OR_MULTI_TRANSACTION_PURCHASE_INVOICE_EVIDENCERentaLedgerAggregationIssueReason.AMOUNT_MISMATCHRentaLedgerAggregationIssueReason.INVALID_LEDGER_FACTRentaLedgerAggregationIssueReason.INELIGIBLE_DEDUCTIBILITYRentaLedgerAggregationIssueReason.REGION_UNDECLARED_FOR_OVERRIDE
RentaLedgerAggregationIssueRentaLedgerExpenseAggregationaggregate_renta_ledger_expenses_from_repositories()aggregate_renta_ledger_expenses()
- aeat.application.aggregation._retencion_observations_repository module
retencion_observation_key()RetencionObservationRepositoryRetencionObservationRepository.namespaceRetencionObservationRepository.sensitivityRetencionObservationRepository.schema_versionRetencionObservationRepository.payload_typeRetencionObservationRepository.extract_identifier()RetencionObservationRepository.save_observation()RetencionObservationRepository.replace_observations()RetencionObservationRepository.load_observations()RetencionObservationRepository.iter_modelo()
persist_retencion_observations()
- aeat.application.aggregation._retencion_rate_advisory module
- aeat.application.aggregation._retenciones module
RetencionObservationRetencionPerceptorRollupRetencionesAggregationaggregate_retenciones_111()aggregate_retenciones_115()aggregate_retenciones_123()aggregate_retenciones_180()aggregate_retenciones_190()aggregate_retenciones_193()RetencionesTotalsParityRetencionesTotalsParity.perceptores_aggregation_totalRetencionesTotalsParity.perceptores_summary_totalRetencionesTotalsParity.perceptores_deltaRetencionesTotalsParity.base_aggregation_totalRetencionesTotalsParity.base_summary_totalRetencionesTotalsParity.base_deltaRetencionesTotalsParity.retenciones_aggregation_totalRetencionesTotalsParity.retenciones_summary_totalRetencionesTotalsParity.retenciones_deltaRetencionesTotalsParity.toleranceRetencionesTotalsParity.is_consistent
compute_retenciones_totals_parity()
- aeat.application.aggregation._service module
PerModeloAggregationContributorPerModeloAggregationContributorContractPerModeloAggregationLogFieldsPerModeloAggregationLogFields.service_namePerModeloAggregationLogFields.modeloPerModeloAggregationLogFields.periodPerModeloAggregationLogFields.providerPerModeloAggregationLogFields.observation_countPerModeloAggregationLogFields.source_kind_countPerModeloAggregationLogFields.result_row_countPerModeloAggregationLogFields.as_extra()
PerModeloAggregationContractPerModeloAggregationCommandPerModeloAggregationCommand.modeloPerModeloAggregationCommand.periodPerModeloAggregationCommand.retencion_observationsPerModeloAggregationCommand.counterpart_observationsPerModeloAggregationCommand.foreign_asset_observationsPerModeloAggregationCommand.withholding_observationsPerModeloAggregationCommand.provider
PerModeloAggregationResultbuild_per_modelo_aggregation_contract()get_per_modelo_aggregation_contract()provider_for_modelo()aggregate_per_modelo()
- aeat.application.aggregation._shared_issue_reasons module
- aeat.application.aggregation._source_fincas module
- aeat.application.aggregation._source_inventory module
- aeat.application.aggregation._source_mesh module
SourceMeshErrorDeferredSourceTargetCallerOverrideDispositionCallerOverridePrecedenceTierCALLER_OVERRIDE_PRECEDENCE_LADDERprecedence_ladder_sources()BindingSourceDispositionbuild_binding_source_dispositions()CalculationSourceContextCalculationSourceDiagnosticCalculationSourceDiagnostic.reasonCalculationSourceDiagnostic.source_kindCalculationSourceDiagnostic.binding_sourceCalculationSourceDiagnostic.messageCalculationSourceDiagnostic.resolver_idCalculationSourceDiagnostic.binding_idCalculationSourceDiagnostic.relation_idCalculationSourceDiagnostic.casilla_idCalculationSourceDiagnostic.out_of_window_countCalculationSourceDiagnostic.out_of_window_min_filing_dateCalculationSourceDiagnostic.out_of_window_max_filing_date
out_of_window_summary_message()out_of_window_summary_source_diagnostic()CalculationSourceProvenanceCalculationSourceProvenance.source_kindCalculationSourceProvenance.binding_sourceCalculationSourceProvenance.source_refCalculationSourceProvenance.fingerprintCalculationSourceProvenance.relation_idCalculationSourceProvenance.source_modeloCalculationSourceProvenance.source_filing_yearCalculationSourceProvenance.source_periodsCalculationSourceProvenance.source_casilla_idsCalculationSourceProvenance.legal_refsCalculationSourceProvenance.source_refs
BorradorSourceProvenanceCalculationSourceResolutionCalculationSourceResolution.resolver_idCalculationSourceResolution.owned_sourcesCalculationSourceResolution.binding_valuesCalculationSourceResolution.enum_binding_valuesCalculationSourceResolution.date_binding_valuesCalculationSourceResolution.row_binding_valuesCalculationSourceResolution.relation_valuesCalculationSourceResolution.unresolved_relation_idsCalculationSourceResolution.unresolved_binding_idsCalculationSourceResolution.bound_inputs_by_casilla_idCalculationSourceResolution.detail_rowsCalculationSourceResolution.source_transaction_idsCalculationSourceResolution.borrador_provenanceCalculationSourceResolution.diagnosticsCalculationSourceResolution.provenance
ModeloSourceResolvermerge_source_resolutions()merge_source_resolutions_by_precedence()collect_unhandled_source_diagnostics()storage_degradation_resolution()
- aeat.application.aggregation._source_profile module
- aeat.application.aggregation._withholding_source module