CHANGELOG.md
paperless-backend/CHANGELOG.md
1# Changelog23All notable changes to the Paperless backend are documented in this file.4The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).56## [0.0.2-SNAPSHOT]78### Added9- MapStruct 1.6.3 (`mapstruct` + `kapt("org.mapstruct:mapstruct-processor")` in `build.gradle.kts`):10 all 12 mappers are now `@Mapper(componentModel = "spring")` interfaces and their11 implementations are generated at build time.12- `common/mapper/MappingConverters` — shared `@Named` converters (`toOffset`, `requireNotNull`)13 used by all mappers.14- 13 dedicated exception classes in `exception/` (one per `AppErrorMessage`, e.g. `UserNotFoundException`).15- Flyway V3 migration recreating `fk_team_members_team` with `ON DELETE CASCADE` so deleting a16 team removes its memberships at the database level.1718### Changed19- Mappers are now Spring beans obtained via constructor injection: controllers and JPA20 persistence adapters inject the mapper interfaces instead of calling static mapper objects.21- Generated mapper implementations use constructor injection22 (`injectionStrategy = CONSTRUCTOR`), so unit tests can construct them without a Spring context.23- Pure field mappings (`toDto`, `toModel`, `toCredentials`, `toUpdateModel`) are generated with24 `unmappedTargetPolicy = ERROR`, so unmapped target properties fail the build.25- Throw sites and tests reference failure modes by exception type (`UserNotFoundException()`,26 `assertAppError(UserNotFoundException::class)`) instead of `AppErrorMessage` values.27- `TeamServiceImpl.deleteTeam` relies on the database cascade for membership removal instead of28 an explicit `deleteByTeamId` call.2930### Removed31- Hand-written field-copying mapper bodies, replaced by the generated implementations.32- Dead code with no call sites: `TeamMapper.applyUpdate`, `DocumentMapper.applyUpdate`.33- `deleteByTeamId` from `TeamMemberPersistence`, `JpaTeamMemberPersistence`, and34 `TeamMemberRepository` (no remaining call sites).35