Summary
Organization repository APIs use booleans with legacy semantics (isLegacyObject / returnLegacyFormat), while user repository APIs use the inverse (isRegistryObject). This makes call sites error-prone and requires separate constants for otherwise equivalent format choices.
Standardize the repository and auth helper APIs on legacy semantics, or replace boolean flags with an explicit format value.
Scope
- Update
BaseUserRepository parameters from isRegistryObject to isLegacyObject.
- Invert BaseUserRepository conditionals while preserving behavior:
true means legacy object/format.
false means registry object/format.
- Preserve current registry defaults by changing
isRegistryObject = true to isLegacyObject = false.
- Update
authContext user helpers to use the same semantic convention.
- Update all controller, repository, utility, mock, and test call sites.
- Consolidate controller constants where appropriate so both organization and user calls use the same
LEGACY_* / REGISTRY_* format meaning.
Alternative
Consider replacing boolean arguments with an explicit value, such as:
const ObjectFormat = {
LEGACY: 'legacy',
REGISTRY: 'registry'
}
This is clearer but is a broader signature migration.
Acceptance Criteria
- No repository or auth helper uses
isRegistryObject.
- User and organization format flags have the same meaning:
true represents legacy; false represents registry.
- Existing legacy and
/api/registry/... response behavior is unchanged.
- Unit and integration tests pass.
Summary
Organization repository APIs use booleans with legacy semantics (
isLegacyObject/returnLegacyFormat), while user repository APIs use the inverse (isRegistryObject). This makes call sites error-prone and requires separate constants for otherwise equivalent format choices.Standardize the repository and auth helper APIs on legacy semantics, or replace boolean flags with an explicit format value.
Scope
BaseUserRepositoryparameters fromisRegistryObjecttoisLegacyObject.truemeans legacy object/format.falsemeans registry object/format.isRegistryObject = truetoisLegacyObject = false.authContextuser helpers to use the same semantic convention.LEGACY_*/REGISTRY_*format meaning.Alternative
Consider replacing boolean arguments with an explicit value, such as:
This is clearer but is a broader signature migration.
Acceptance Criteria
isRegistryObject.truerepresents legacy;falserepresents registry./api/registry/...response behavior is unchanged.