Skip to content

⚠️ remove allowSystemDeleteAfter from api and application#1718

Open
MagnusHAa wants to merge 3 commits intomainfrom
feat/remove-allowsystemdeleteafter-from-api
Open

⚠️ remove allowSystemDeleteAfter from api and application#1718
MagnusHAa wants to merge 3 commits intomainfrom
feat/remove-allowsystemdeleteafter-from-api

Conversation

@MagnusHAa
Copy link
Collaborator

@MagnusHAa MagnusHAa commented Feb 4, 2026

Description

Removed the AllowSystemDeleteAfter field from api and application as it is not used in logic as first intended, and thus clutters the api with unnecessary parameters.

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)

Post-deploy

Remove the allowSystemDeleteAfter field from the database

Summary by CodeRabbit

Release Notes

  • Refactor

    • Removed the allowSystemDeleteAfter parameter from correspondence API requests and responses. The system no longer supports automatic deletion deadlines for correspondence items.
  • Tests

    • Updated test cases and test data to align with parameter removal.
  • Documentation

    • Updated API documentation to reflect changes.

@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

Warning

Rate limit exceeded

@MagnusHAa has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 17 minutes and 34 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

This pull request removes the AllowSystemDeleteAfter field throughout the codebase, including from API models, mappers, test factories, test data generators, business logic handlers, and validation rules. All references to this optional correspondence property are eliminated consistently across test and production code.

Changes

Cohort / File(s) Summary
Bruno API Test Configuration
.bruno/Correspondence/Initialize and Upload.bru, .bruno/Correspondence/Initialize and upload (form-data).bru, .bruno/Correspondence/Initialize.bru
Removed allowSystemDeleteAfter field from JSON and form-data request payloads sent to correspondence endpoints.
Load Test Data Generators
Test/Altinn.Correspondence.LoadTests/data/correspondence-form.js, Test/Altinn.Correspondence.LoadTests/data/correspondence-json.js
Removed allowSystemDeleteAfter field generation from multipart form-data and JSON payload constructors.
Load Test Scripts
Test/Altinn.Correspondence.LoadTests/test_initialize_and_upload_correspondence.js, Test/Altinn.Correspondence.LoadTests/test_initialize_correspondence.js
Removed allowSystemDeleteAfter field from test payloads and data structures.
Unit Test Factories
Test/Altinn.Correspondence.Tests/Factories/CorrespondenceBuilder.cs, Test/Altinn.Correspondence.Tests/Factories/CorrespondenceEntityBuilder.cs
Removed public builder methods WithAllowSystemDeleteAfter() from fluent builder classes.
Unit Test Helpers & Test Cases
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 field usage from helper methods, deleted three validation test cases for AllowSystemDeleteAfter, and removed field references from test entity builders and payloads.
API Model Definitions
src/Altinn.Correspondence.API/Models/BaseCorrespondenceExt.cs, src/Altinn.Correspondence.API/Models/CorrespondenceExt.cs
Removed public property AllowSystemDeleteAfter of type DateTimeOffset? from correspondence model 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 mapping assignments of AllowSystemDeleteAfter from source to target objects in request and response transformations.
API Documentation & Errors
src/Altinn.Correspondence.API/Controllers/CorrespondenceController.cs, src/Altinn.Correspondence.Application/Errors.cs
Removed error documentation bullets (codes 1010–1012) for AllowSystemDeleteAfter validation constraints and deleted three public error definitions.
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 AllowSystemDeleteAfter property from response classes and removed field assignment in handler implementations.
Application Business Logic
src/Altinn.Correspondence.Application/Helpers/InitializeCorrespondenceHelper.cs
Removed validation checks for AllowSystemDeleteAfter constraints (against current time, RequestedPublishTime, and DueDateTime) and removed field persistence mapping in entity creation.

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
Title check ✅ Passed The title clearly describes the main change: removing the allowSystemDeleteAfter field from the API and application layer, which is the primary focus across all modified files.
Description check ✅ Passed The PR description includes all required sections from the template: Description, Related Issue(s), Verification checklist (all items checked), and post-deploy actions are provided.

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

✨ Finishing touches
🧪 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-api

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 api and application Feb 4, 2026
Copy link
Collaborator

@Ceredron Ceredron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be merged before:
#1720

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.

2 participants