Skip to content

Fix AL0296 errors in DK Clean build: add VAT return reporting frequency support#9658

Closed
djukicmilica with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-failing-github-actions-job-one-more-time
Closed

Fix AL0296 errors in DK Clean build: add VAT return reporting frequency support#9658
djukicmilica with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-failing-github-actions-job-one-more-time

Conversation

Copilot AI commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

The "Build Apps DK (Clean)" CI job was failing with 8 AL0296 errors because the Electronic VAT Declaration for Denmark Tests app declared "target": "Cloud" while its new tests called [Scope('OnPrem')] Azure Key Vault mock methods.

Root cause

test/app.json had "target": "Cloud", blocking use of InitMockAzureKeyvaultSecretProvider, UseAzureKeyvaultSecretProvider, and AddMockAzureKeyvaultSecretProviderMapping — all [Scope('OnPrem')] — even from test procedures individually marked [Scope('OnPrem')].

Changes

  • test/app.json"target": "Cloud""target": "OnPrem" (the fix)
  • app/app.json — added internalsVisibleTo entry for the test app
  • ElecVATDeclRepFrequency.Enum.al (new)Monthly, Quarterly, Semi-Annual enum values
  • ElecVATDeclAzKeyVault.Codeunit.al — added IsReportingFrequencyEnabled() reading DKElecVAT-ReportingFrequencyEnabled from AKV; defaults to true when secret is missing or unparseable
  • ElecVATDeclGetPeriods.Codeunit.al — refactored to dispatch between frequency-aware (GetFrequencyAwareVATReturnPeriods) and legacy quarterly-only (GetQuarterlyVATReturnPeriods) paths; added CalcPeriodEndDate/CalcPeriodStartDate/GetReportingFrequency; overlap detection on insert
  • ElecVATDeclXml.Codeunit.al — added TryGetPeriodNodesFromResponseText, TryGetDueDateNodeFromPeriodNode, TryGetFrequencyNodeFromPeriodNode for period-level XML traversal
  • ElecVATDeclTests.Codeunit.al — replaced placeholder with tests covering period date math, frequency-aware parsing, duplicate prevention, overlap detection, and AKV flag evaluation

@github-actions github-actions Bot added the needs-approval Workflow runs require maintainer approval to start label Jul 22, 2026
Copilot AI changed the title [WIP] Fix failing GitHub Actions job Build Apps DK (Clean) Fix AL0296 errors in DK Clean build: add VAT return reporting frequency support Jul 22, 2026
Copilot AI requested a review from djukicmilica July 22, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-approval Workflow runs require maintainer approval to start

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants