Merged PR 1996: fix(crm): consolidate customer feature selection logic

fix(crm): consolidate customer feature selection logic

Introduce centralized `getEnabledCustomerFeature` helper to standardize
feature selection across components. Replaces inconsistent filtering
approaches with unified logic that prioritizes 'd-account' and
'd-no-account' features.

Changes:
- Add `getEnabledCustomerFeature` helper with unit tests
- Add `CustomerFeatureKey` and `CustomerFeatureGroup` enums
- Update customer-order-details-header component
- Update pickup-shelf-details-header component
- Update customer-result-list components
- Update order-details-main-view component

Ref: #5432
This commit is contained in:
Nino Righi
2025-11-03 10:00:02 +00:00
committed by Lorenz Hilpert
parent 7a04b828c3
commit f175b5d2af
14 changed files with 1019 additions and 164 deletions

View File

@@ -14,7 +14,10 @@ export const KeyValueSchema = <
group: z.string().describe('Group').optional(),
key: keySchema.describe('Key').optional(),
label: z.string().describe('Label').optional(),
selected: z.boolean().describe('Whether this option is currently selected').optional(),
selected: z
.boolean()
.describe('Whether this option is currently selected')
.optional(),
sort: z.number().describe('Sort criteria').optional(),
value: valueSchema.describe('Value').optional(),
});
@@ -23,3 +26,7 @@ export const KeyValueOfStringAndStringSchema = KeyValueSchema(
z.string(),
z.string(),
);
export type KeyValueOfStringAndString = z.infer<
typeof KeyValueOfStringAndStringSchema
>;