diff --git a/generated/swagger/crm-api/src/services/customer.service.ts b/generated/swagger/crm-api/src/services/customer.service.ts index cf97a38f0..177b49f22 100644 --- a/generated/swagger/crm-api/src/services/customer.service.ts +++ b/generated/swagger/crm-api/src/services/customer.service.ts @@ -37,6 +37,7 @@ class CustomerService extends __BaseService { static readonly CustomerUpdateCustomerPath = '/customer/{customerId}'; static readonly CustomerPatchCustomerPath = '/customer/{customerId}'; static readonly CustomerDeleteCustomerPath = '/customer/{customerId}'; + static readonly CustomerMergeLoyaltyAccountsPath = '/customer/{customerId}/loyalty/merge'; static readonly CustomerAddLoyaltyCardPath = '/customer/{customerId}/loyalty/add-card'; static readonly CustomerCreateCustomerPath = '/customer'; static readonly CustomerAddPayerReferencePath = '/customer/{customerId}/payer'; @@ -392,6 +393,56 @@ class CustomerService extends __BaseService { ); } + /** + * Kundenkarte hinzufügen + * @param params The `CustomerService.CustomerMergeLoyaltyAccountsParams` containing the following parameters: + * + * - `loyaltyCardValues`: + * + * - `customerId`: + * + * - `locale`: + */ + CustomerMergeLoyaltyAccountsResponse(params: CustomerService.CustomerMergeLoyaltyAccountsParams): __Observable<__StrictHttpResponse> { + let __params = this.newParams(); + let __headers = new HttpHeaders(); + let __body: any = null; + __body = params.loyaltyCardValues; + + if (params.locale != null) __params = __params.set('locale', params.locale.toString()); + let req = new HttpRequest( + 'POST', + this.rootUrl + `/customer/${encodeURIComponent(String(params.customerId))}/loyalty/merge`, + __body, + { + headers: __headers, + params: __params, + responseType: 'json' + }); + + return this.http.request(req).pipe( + __filter(_r => _r instanceof HttpResponse), + __map((_r) => { + return _r as __StrictHttpResponse; + }) + ); + } + /** + * Kundenkarte hinzufügen + * @param params The `CustomerService.CustomerMergeLoyaltyAccountsParams` containing the following parameters: + * + * - `loyaltyCardValues`: + * + * - `customerId`: + * + * - `locale`: + */ + CustomerMergeLoyaltyAccounts(params: CustomerService.CustomerMergeLoyaltyAccountsParams): __Observable { + return this.CustomerMergeLoyaltyAccountsResponse(params).pipe( + __map(_r => _r.body as ResponseArgsOfAccountDetailsDTO) + ); + } + /** * Kundenkarte hinzufügen * @param params The `CustomerService.CustomerAddLoyaltyCardParams` containing the following parameters: @@ -914,6 +965,15 @@ module CustomerService { deletionComment?: null | string; } + /** + * Parameters for CustomerMergeLoyaltyAccounts + */ + export interface CustomerMergeLoyaltyAccountsParams { + loyaltyCardValues: AddLoyaltyCardValues; + customerId: number; + locale?: null | string; + } + /** * Parameters for CustomerAddLoyaltyCard */ diff --git a/libs/crm/data-access/src/lib/services/crm-search.service.ts b/libs/crm/data-access/src/lib/services/crm-search.service.ts index 5d353b3d2..f85db1d8a 100644 --- a/libs/crm/data-access/src/lib/services/crm-search.service.ts +++ b/libs/crm/data-access/src/lib/services/crm-search.service.ts @@ -153,7 +153,7 @@ export class CrmSearchService { const parsed = AddCardSchema.parse(params); const req$ = this.#customerService - .CustomerAddLoyaltyCard({ + .CustomerMergeLoyaltyAccounts({ customerId: parsed.customerId, loyaltyCardValues: { cardCode: parsed.loyaltyCardValues.cardCode,