import { BookingDiscountCodeForm } from '@/portal/modules/booking/components/BookingDiscountCodeForm';
import { BaseComponent } from '@/shared/base/BaseComponent';

export class BookingBasketContent extends BaseComponent {
  readonly location = this.host.getByTestId('selected-location');
  readonly locationName = this.location.getByTestId('selected-location-name');
  readonly locationAddress = this.location.getByTestId('selected-location-address');
  readonly locationImage = this.location.getByTestId('selected-location-image');
  readonly moveInDate = this.host.getByTestId('summary-move-in-date');
  readonly moveInDateValue = this.moveInDate.getByTestId('summary-aside');
  readonly unitType = this.host.getByTestId('summary-unit-type');
  readonly unitTypeName = this.unitType.getByTestId('summary-title');
  readonly unitTypePriceInclVat = this.unitType.getByTestId('summary-aside');
  readonly insurance = this.host.getByTestId('summary-insurance');
  readonly insuranceName = this.insurance.getByTestId('summary-title');
  readonly insurancePriceInclVat = this.insurance.getByTestId('summary-aside');
  readonly discountCodeForm = new BookingDiscountCodeForm(this.host.getByTestId('discount-form'));
  readonly firstInvoice = this.host.getByTestId('summary-first-invoice');
  readonly firstInvoicePrices = this.firstInvoice.getByTestId('summary-aside');
  readonly firstInvoiceOldPriceInclVat = this.firstInvoicePrices.getByTestId('old-price');
  readonly firstInvoiceNewPriceInclVat = this.firstInvoicePrices.getByTestId('new-price');
  readonly recurringPayment = this.host.getByTestId('summary-recurring-payment');
  readonly recurringPaymentPrices = this.recurringPayment.getByTestId('summary-aside');
  readonly recurringPaymentOldPriceInclVat = this.recurringPaymentPrices.getByTestId('old-price');
  readonly recurringPaymentNewPriceInclVat = this.recurringPaymentPrices.getByTestId('new-price');

  add(discountCode: string): Promise<void> {
    return this.discountCodeForm.fill(discountCode);
  }
}
