@easygov/web-components 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -116,12 +116,17 @@ signed JWT, `contextJwt`. `claims` is its decoded payload:
116
116
  "customerAccount": {
117
117
  "id": "acc-4711",
118
118
  "accountType": "ORGANIZATION",
119
- "label": "Muster AG",
120
119
  "status": "VERIFIED",
121
- "legalForm": "AG",
122
- "uid": "CHE-123.456.789",
120
+ "onboardingMethod": "ADDING_SWISS_ORGANIZATION",
121
+ "mainAddress": { "street": "Bahnhofstrasse", "houseNumber": "12a", "zipCode": "8005", "town": "Zürich", "country": "CH" },
122
+ "label": "Muster AG",
123
+ "orgName": "Muster AG",
124
+ "legalForm": "0106",
125
+ "uid": "CHE123456789",
126
+ "uidFormatted": "CHE-123.456.789",
123
127
  "managementRole": {
124
128
  "roleType": "AGENT",
129
+ "enableNotificationMail": true,
125
130
  "servicePermission": {
126
131
  "serviceAppId": "app-42",
127
132
  "permissionLevel": "EDIT"
@@ -131,16 +136,27 @@ signed JWT, `contextJwt`. `claims` is its decoded payload:
131
136
  "serviceApp": {
132
137
  "id": "app-42",
133
138
  "businessModuleId": "urn_core_businessmodule_example",
139
+ "appType": "SERVICE_REQUEST_APP",
134
140
  "individualServicePermissionModel": false
135
141
  },
136
142
  "process": {
137
143
  "id": "proc-0815",
138
144
  "status": "REQUEST_IN_PROGRESS",
139
- "serviceAppId": "app-42"
145
+ "serviceRequestAppId": "app-42"
140
146
  }
141
147
  }
142
148
  ```
143
149
 
150
+ Three fields are not in the token: the header derives them after decoding.
151
+
152
+ - `customerAccount.label`: `orgName` for an organization, `firstName lastName` for an
153
+ individual, the same rule as core-backend's `CustomerAccount.label`.
154
+ - `customerAccount.uidFormatted` and `vatUidFormatted`: `uid` and `vatUid` in their display form
155
+ `CHE-123.456.789`, without the MWST/TVA/IVA suffix; present exactly when the technical value is.
156
+
157
+ A backend that decodes the raw `contextJwt` itself gets none of them and works from `orgName`,
158
+ `firstName`/`lastName`, `uid` and `vatUid`.
159
+
144
160
  **Why the event repeats:** `contextJwt` is short-lived (5 minutes by default), so the header fetches
145
161
  a new one about 60 seconds before it expires and fires `contextchange` again. `contentChanged` is
146
162
  `true` for the first context after sign-in and whenever `claims` differs from the previous event,