Skip to content

⚠️ remove allowSystemDeleteAfter from database#1719

Open
MagnusHAa wants to merge 1 commit intomainfrom
feat/remove-allowsystemdeleteafter-from-db
Open

⚠️ remove allowSystemDeleteAfter from database#1719
MagnusHAa wants to merge 1 commit intomainfrom
feat/remove-allowsystemdeleteafter-from-db

Conversation

@MagnusHAa
Copy link
Collaborator

@MagnusHAa MagnusHAa commented Feb 4, 2026

Description

Database migration to remove the allowSystemDeleteAfter column.

Related Issue(s)

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)
  • All tests run green
  • If pre- or post-deploy actions (including database migrations) are needed, add a description, include a "Pre/Post-deploy actions" section below, and mark the PR title with ⚠️

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

Pre-deploy

Wait for #1718 to be in production.

Summary by CodeRabbit

  • Removed Features

    • Removed the allowSystemDeleteAfter parameter from the correspondence API. This field is no longer accepted in requests or included in responses.
  • Tests

    • Removed validation test cases and updated test data to reflect the removal of allowSystemDeleteAfter functionality.

@MagnusHAa MagnusHAa self-assigned this Feb 4, 2026
@MagnusHAa MagnusHAa added the kind/chore changes that do not relate to a fix or feature and don't modify src or test files label Feb 4, 2026
@MagnusHAa MagnusHAa linked an issue Feb 4, 2026 that may be closed by this pull request
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 4, 2026

📝 Walkthrough

Walkthrough

The pull request systematically removes the AllowSystemDeleteAfter field throughout the codebase. This field is deleted from API models, external contract classes, mappers, application handlers, validation logic, and corresponding test files across test suites, load tests, and Bruno API test definitions.

Changes

Cohort / File(s) Summary
Bruno API Test Files
.bruno/Correspondence/Initialize and Upload.bru, .bruno/Correspondence/Initialize and upload (form-data).bru, .bruno/Correspondence/Initialize.bru
Removed allowSystemDeleteAfter field from request payloads in multipart and JSON request bodies.
Load Test Data Files
Test/Altinn.Correspondence.LoadTests/data/correspondence-form.js, Test/Altinn.Correspondence.LoadTests/data/correspondence-json.js
Removed deleteAfter and allowSystemDeleteAfter field additions from form and JSON payload generation functions.
Load Test Cases
Test/Altinn.Correspondence.LoadTests/test_initialize_and_upload_correspondence.js, Test/Altinn.Correspondence.LoadTests/test_initialize_correspondence.js
Removed allowSystemDeleteAfter field from test payloads.
Test Factories & Builders
Test/Altinn.Correspondence.Tests/Factories/CorrespondenceBuilder.cs, Test/Altinn.Correspondence.Tests/Factories/CorrespondenceEntityBuilder.cs
Removed WithAllowSystemDeleteAfter() builder methods that configured the property via fluent API.
Unit Test Helpers & Tests
Test/Altinn.Correspondence.Tests/Helpers/CorrespondenceHelper.cs, Test/Altinn.Correspondence.Tests/TestingController/Correspondence/CorrespondenceInitializationTests.cs, Test/Altinn.Correspondence.Tests/TestingController/Migration/MigrationControllerTests.cs, Test/Altinn.Correspondence.Tests/TestingHandler/CleanupPerishingDialogsHandlerTests.cs
Removed form-data field additions, three validation test cases (AllowSystemDeleteAfter_PriorToday, AllowSystemDeleteAfter_PriorRequestedPublishTime, AllowSystemDeleteAfter_PriorDueDate), and builder calls setting the property.
API Models
src/Altinn.Correspondence.API/Models/BaseCorrespondenceExt.cs, src/Altinn.Correspondence.API/Models/CorrespondenceExt.cs, src/Altinn.Correspondence.API/Models/LegacyCorrespondenceOverviewExt.cs
Removed public AllowSystemDeleteAfter property definitions from external contract classes.
API Mappers
src/Altinn.Correspondence.API/Mappers/CorrespondenceDetailsMapper.cs, src/Altinn.Correspondence.API/Mappers/CorrespondenceOverviewMapper.cs, src/Altinn.Correspondence.API/Mappers/InitializeCorrespondencesMapper.cs, src/Altinn.Correspondence.API/Mappers/LegacyCorrespondenceOverviewMapper.cs, src/Altinn.Correspondence.API/Mappers/MigrateCorrespondenceMapper.cs
Removed property assignments of AllowSystemDeleteAfter from mapping operations between internal and external models.
API Documentation
src/Altinn.Correspondence.API/Controllers/CorrespondenceController.cs
Removed documentation entries for error codes 1010, 1011, and 1012 related to AllowSystemDeleteAfter validation.
Application Error Definitions
src/Altinn.Correspondence.Application/Errors.cs
Removed three public error definitions: AllowSystemDeletePriorToday, AllowSystemDeletePriorRequestedPublishTime, AllowSystemDeletePriorDueDate.
Application Handlers & Responses
src/Altinn.Correspondence.Application/GetCorrespondenceDetails/GetCorrespondenceDetailsHandler.cs, src/Altinn.Correspondence.Application/GetCorrespondenceDetails/GetCorrespondenceDetailsResponse.cs, src/Altinn.Correspondence.Application/GetCorrespondenceOverview/GetCorrespondenceOverviewHandler.cs, src/Altinn.Correspondence.Application/GetCorrespondenceOverview/GetCorrespondenceOverviewResponse.cs, src/Altinn.Correspondence.Application/GetCorrespondenceOverview/LegacyGetCorrespondenceOverviewHandler.cs
Removed property definitions and field assignments of AllowSystemDeleteAfter from response objects and handler mappings.
Application Validation Logic
src/Altinn.Correspondence.Application/Helpers/InitializeCorrespondenceHelper.cs
Removed validation logic for AllowSystemDeleteAfter constraints and removed property assignment during correspondence entity mapping.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The description includes all required template sections with appropriate details. The Pre-deploy section documents the necessary prerequisite (PR #1718), and the ⚠️ marker in the title correctly indicates this requirement.
Title check ✅ Passed The title accurately describes the main change: removing the allowSystemDeleteAfter field from the API and application layers across the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/remove-allowsystemdeleteafter-from-db

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@MagnusHAa MagnusHAa changed the title ⚠️ remove allowSystemDeleteAfter from api and application ⚠️ remove allowSystemDeleteAfter from database Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/chore changes that do not relate to a fix or feature and don't modify src or test files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant