@visma-swno/customer-onboarding-wizard 1.0.9 → 1.0.10

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.
@@ -13,7 +13,8 @@ export declare class CustomerOnboardingWizard extends LitElement {
13
13
  private currentStep;
14
14
  private completedSteps;
15
15
  private errorState;
16
- private customerInfo;
16
+ private customer;
17
+ private customerSubscriptions;
17
18
  private visible;
18
19
  private i18n;
19
20
  private httpService;
@@ -51,11 +52,10 @@ export declare class CustomerOnboardingWizard extends LitElement {
51
52
  */
52
53
  private loadUserProfile;
53
54
  /**
54
- * Load customer info from API
55
- * customerInfo is populated from getCustomerInfo() API call
56
- * Falls back to null if request fails or customerId is not provided
55
+ * Load customer data from API (details and subscriptions in parallel)
56
+ * Falls back gracefully if customerId is missing or requests fail
57
57
  */
58
- private loadCustomerInfo;
58
+ private loadCustomerData;
59
59
  /**
60
60
  * Update authentication token
61
61
  * Call this method from host application to update token (e.g., after refresh)
@@ -1,14 +1,15 @@
1
1
  import { LitElement } from 'lit';
2
2
  import { Translations, SupportedLocale } from '../../core/i18n.service';
3
- import { CustomerInfo } from '../../core/http.service';
3
+ import { CustomerResponse, CustomerSubscriptionResponse } from '../../core/http.service';
4
4
  /**
5
5
  * Company Step Component
6
- * Displays customer company information including contact, subscriptions, and partner details
6
+ * Displays customer company information including contact, subscriptions, and partner details.
7
7
  */
8
8
  export declare class WizardStep1Company extends LitElement {
9
9
  translations: Translations;
10
10
  locale: SupportedLocale;
11
- customerInfo: CustomerInfo | null;
11
+ customer: CustomerResponse | null;
12
+ subscriptions: CustomerSubscriptionResponse;
12
13
  private editingContact;
13
14
  private countryDropdownOpen;
14
15
  private fieldErrors;
@@ -23,24 +23,33 @@ export interface UserProfile {
23
23
  lastName: string;
24
24
  email: string;
25
25
  }
26
- export interface CustomerInfo {
27
- customer: {
28
- customerId: string;
29
- name: string;
30
- organizationNumber: string;
31
- address1: string;
32
- address2: string;
33
- postalCode: string;
34
- city: string;
35
- countryCode: string;
36
- webUrl: string;
37
- contactEmail: string;
38
- };
39
- subscriptions: string[];
40
- partner: {
41
- partnerId: string;
42
- name: string;
43
- };
26
+ export interface CustomerResponse {
27
+ customerId: string;
28
+ idContextParent: string;
29
+ countryCode: string;
30
+ name: string;
31
+ organizationNumber: string;
32
+ address1: string;
33
+ address2: string;
34
+ postalCode: string;
35
+ city: string;
36
+ telephone: string;
37
+ emailAddress: string;
38
+ webAddress: string;
39
+ }
40
+ export interface SubscriptionProduct {
41
+ id: string;
42
+ name: string;
43
+ }
44
+ export interface CustomerSubscription {
45
+ subscriptionId: string;
46
+ partnerId: string;
47
+ partnerName: string;
48
+ products: SubscriptionProduct[];
49
+ }
50
+ export interface CustomerSubscriptionResponse {
51
+ content: CustomerSubscription[];
52
+ totalNumberOfRecords: number;
44
53
  }
45
54
  export interface Administrator {
46
55
  email: string;
@@ -161,11 +170,19 @@ export declare class HttpService {
161
170
  delete<T>(endpoint: string, headers?: Record<string, string>): Promise<T>;
162
171
  getUserProfile(): Promise<UserProfile>;
163
172
  /**
164
- * Get customer info for a customer
173
+ * Get customer details by ID
174
+ * GET /api/v1/customers/{customerId}
165
175
  * @param customerId - The customer ID
166
- * @returns Promise with customer, subscriptions, and partner information
176
+ * @returns Promise with customer details
167
177
  */
168
- getCustomerInfo(customerId: string): Promise<CustomerInfo>;
178
+ getCustomer(customerId: string): Promise<CustomerResponse>;
179
+ /**
180
+ * Get subscriptions for a customer
181
+ * GET /api/v1/customers/{customerId}/subscriptions
182
+ * @param customerId - The customer ID
183
+ * @returns Promise with customer subscriptions
184
+ */
185
+ getCustomerSubscriptions(customerId: string): Promise<CustomerSubscriptionResponse>;
169
186
  /**
170
187
  * Get administrators for a customer
171
188
  * @param customerId - The customer ID
@@ -200,7 +217,7 @@ export declare class HttpService {
200
217
  getUserByEmail(email: string): Promise<UserByEmailResponse | null>;
201
218
  /**
202
219
  * Add administrators to a customer account
203
- * POST /api/v1/onboarding/customers/{customerId}/administrators
220
+ * POST /api/v1/customers/{customerId}/administrators
204
221
  * @param customerId - The customer ID
205
222
  * @param admins - Array of administrator data (email, firstName, lastName, languageCode)
206
223
  */
@@ -213,9 +230,11 @@ export declare class HttpService {
213
230
  getPartnerConsultants(partnerId: string): Promise<ConsultantsResponse>;
214
231
  /**
215
232
  * Add consultants to a customer
233
+ * POST /api/v1/customers/{customerId}/partners/{partnerId}/consultants
216
234
  * @param customerId - The customer ID
235
+ * @param partnerId - The partner ID
217
236
  * @param consultants - Array of consultant data
218
237
  */
219
- addCustomerConsultants(customerId: string, consultants: Consultant[]): Promise<unknown>;
238
+ addCustomerConsultants(customerId: string, partnerId: string, consultants: Consultant[]): Promise<unknown>;
220
239
  patch<T>(endpoint: string, body: any, headers?: Record<string, string>): Promise<T>;
221
240
  }
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export * from './components/customer-onboarding-wizard/customer-onboarding-wizard';
2
2
  export { HttpService } from './core/http.service';
3
- export type { HttpErrorDetail, ErrorMessageDetail, RequestConfig, UserProfile, CustomerInfo } from './core/http.service';
3
+ export type { HttpErrorDetail, ErrorMessageDetail, RequestConfig, UserProfile, CustomerResponse, CustomerSubscription, CustomerSubscriptionResponse, SubscriptionProduct, } from './core/http.service';