import { BookingRemovePriceChangeDialog } from '@/manager/modules/booking/views/BookingRemovePriceChangeDialog';
import { BaseComponent } from '@/shared/base/BaseComponent';

// The price adjustment block inside the booking details billing card. The chip alone remains visible
// while a removal is queued ('Deletion in progress').
export class BookingPriceChangeSection extends BaseComponent {
  readonly main = this.host.getByTestId('booking-price-change-section');
  readonly chip = this.main.getByTestId('booking-price-change-chip');
  readonly newAmount = this.main.getByTestId('booking-price-change-new-amount');
  readonly appliedOn = this.main.getByTestId('booking-price-change-applied-on');
  readonly appliedFrom = this.main.getByTestId('booking-price-change-applied-from');
  readonly removeButton = this.main.getByTestId('booking-price-change-remove-button');

  async openRemovePriceChangeDialog(): Promise<BookingRemovePriceChangeDialog> {
    await this.removeButton.click();
    return new BookingRemovePriceChangeDialog(this.host.page());
  }
}
