Skip to content

Commit ecb71c3

Browse files
committed
Adjust error message for non-existing subscription details #758
1 parent 5e9d4be commit ecb71c3

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

src/app/import/utils/subscription-details/validation.ts

+13
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,14 @@ export const assertPersonExists: SubscriptionDetailValidationFn = (entry) => {
106106
return valid;
107107
};
108108

109+
/**
110+
* The /Subscriptions/{subscriptionId}/SubscriptionDetails endpoint does not
111+
* return details that don't have VssInternet="E". So there is no way to
112+
* differentiate between the case where no subscription exists for a given
113+
* person/event and the case where a subscription exists, but can't be edited
114+
* through the Internet (VssInternet!="E"). We solve this by using a generic
115+
* error message that covers both cases.
116+
*/
109117
export const assertSubscriptionDetailExists: SubscriptionDetailValidationFn = (
110118
entry,
111119
) => {
@@ -117,6 +125,11 @@ export const assertSubscriptionDetailExists: SubscriptionDetailValidationFn = (
117125
return valid;
118126
};
119127

128+
/**
129+
* Actually, the /Subscriptions/{subscriptionId}/SubscriptionDetails endpoint
130+
* does not return details that don't have VssInternet="E". But we leave this
131+
* assertion in place for now.
132+
*/
120133
export const assertSubscriptionDetailEditable: SubscriptionDetailValidationFn =
121134
(entry) => {
122135
const detail = entry.data.subscriptionDetail;

src/app/shared/services/subscriptions-rest.service.ts

+4
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ export class SubscriptionsRestService extends RestService<typeof Subscription> {
9797
.pipe(switchMap(decodeArray(Subscription)));
9898
}
9999

100+
/**
101+
* This endpoint only returns subscription details that have VssInternet="E"
102+
* (i.e. editable via Internet).
103+
*/
100104
getSubscriptionDetailsById(
101105
id: number | string,
102106
): Observable<ReadonlyArray<SubscriptionDetail>> {

src/assets/locales/de-CH.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@
394394
"MissingValueError": "Der Wert fehlt",
395395
"EventNotFoundError": "Der Anlass ist nicht vorhanden",
396396
"PersonNotFoundError": "Die Person ist nicht vorhanden",
397-
"SubscriptionDetailNotFoundError": "Die Person ist nicht auf den Anlass angemeldet",
397+
"SubscriptionDetailNotFoundError": "Das Anmeldedetail ist nicht für die Interneteingabe freigegeben oder die Person ist nicht auf den Anlass angemeldet",
398398
"SubscriptionDetailNotEditableError": "Das Anmeldedetail ist nicht für die Interneteingabe freigegeben",
399399
"InvalidValueTypeError": "Ungültiger Wert für dieses Anmeldedetail",
400400
"InvalidDropdownValueError": "Ungültiger Wert für dieses Anmeldedetail"

src/assets/locales/fr-CH.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@
394394
"MissingValueError": "La valeur est manquante",
395395
"EventNotFoundError": "L'événement n'existe pas",
396396
"PersonNotFoundError": "La personne n'existe pas",
397-
"SubscriptionDetailNotFoundError": "La personne n'est pas inscrite à l'événement",
397+
"SubscriptionDetailNotFoundError": "Le détail d'inscription n'est pas validé pour la saisie sur Internet ou la personne n'est pas inscrite à l'événement",
398398
"SubscriptionDetailNotEditableError": "Le détail d'inscription n'est pas validé pour la saisie sur Internet",
399399
"InvalidValueTypeError": "Valeur non valide pour ce détail d'inscription",
400400
"InvalidDropdownValueError": "Valeur non valide pour ce détail d'inscription"

0 commit comments

Comments
 (0)