Skip to content

Enum default values differ between ServiceMapper and ServiceRepository for same fields #401

@Christophe-Rogiers

Description

@Christophe-Rogiers

Description

The same nullable enum properties get different default values depending on which mapper is invoked:

Field ServiceMapper.ToDomain ServiceRepository.MapToDomain
StartupType Automatic (line 101) Manual (line 632)
RecoveryAction RestartService (line 114) None (line 645)

Both methods map ServiceDto → domain Service, but code paths using the Mapper get Automatic/RestartService while code paths using the Repository get Manual/None.

This means a service's behavior can change depending on whether it was loaded via one mapper or the other when the DTO has null values.

Note: The StartupType inconsistency was tracked in #291 but the RecoveryAction default difference was not.

Severity

Warning — same data produces different behavior depending on code path.

Suggested fix

Align both mappers to use the same defaults, ideally defined as constants in AppConfig.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions