Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Adjust billing address feature to change to sapBillingAddress key in API #19415

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions feature-libs/cart/base/root/models/cart.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export interface Cart {
paymentInfo?: PaymentDetails;
paymentType?: PaymentType;
paymentAddress?: Address;
sapBillingAddress?: Address;
pickupItemsQuantity?: number;
pickupOrderGroups?: PickupOrderEntryGroup[];
potentialOrderPromotions?: PromotionResult[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('OpfCheckoutBillingAddressFormService', () => {
mockActiveCartFacade = {
reloadActiveCart: () => of(true),
isStable: () => of(true),
getActive: () => of({ paymentAddress: mockPaymentAddress } as Cart),
getActive: () => of({ sapBillingAddress: mockPaymentAddress } as Cart),
};

mockGlobalMessageService = {
Expand Down Expand Up @@ -167,7 +167,7 @@ describe('OpfCheckoutBillingAddressFormService', () => {

it('should get payment address', () => {
spyOn(mockActiveCartFacade, 'getActive').and.returnValue(
of({ paymentAddress: mockPaymentAddress } as Cart)
of({ sapBillingAddress: mockPaymentAddress } as Cart)
);

service['getPaymentAddress']().subscribe((result) => {
Expand All @@ -177,7 +177,7 @@ describe('OpfCheckoutBillingAddressFormService', () => {

it('should not get payment address when not present', () => {
spyOn(mockActiveCartFacade, 'getActive').and.returnValue(
of({ paymentAddress: undefined } as Cart)
of({ sapBillingAddress: undefined } as Cart)
);

service['getPaymentAddress']().subscribe((result) => {
Expand All @@ -196,7 +196,7 @@ describe('OpfCheckoutBillingAddressFormService', () => {

it('should not get payment address when it is not present', (done) => {
spyOn(mockActiveCartFacade, 'getActive').and.returnValue(
of({ paymentAddress: undefined } as Cart)
of({ sapBillingAddress: undefined } as Cart)
);

service['getPaymentAddress']().subscribe((result) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import {
} from '@spartacus/core';
import {
BehaviorSubject,
combineLatest,
EMPTY,
Observable,
combineLatest,
throwError,
} from 'rxjs';
import {
Expand Down Expand Up @@ -174,7 +174,7 @@ export class OpfCheckoutBillingAddressFormService {
protected getPaymentAddress(): Observable<Address | undefined> {
return this.activeCartService
.getActive()
.pipe(map((cart: Cart) => cart.paymentAddress));
.pipe(map((cart: Cart) => cart.sapBillingAddress));
}

protected getAddressWithId(address: Address): Address {
Expand Down