import { DiscountBillingPlanList } from '@/manager/modules/discount/components/DiscountBillingPlanList';
import { DiscountEditBillingPlansDialog } from '@/manager/modules/discount/views/DiscountEditBillingPlansDialog';
import { getCardEditButtonHost, getCardHost } from '@/manager/shared/utils/locator-utils';
import { BaseComponent } from '@/shared/base/BaseComponent';

export class DiscountBillingPlanCard extends BaseComponent {
  readonly main = getCardHost(this.host, 'Redeemable for these booking plans');
  readonly editButton = getCardEditButtonHost(this.main);
  readonly list = new DiscountBillingPlanList(this.main);

  async openDiscountEditBillingPlansDialog(showAlerts: boolean): Promise<DiscountEditBillingPlansDialog> {
    await this.editButton.click();
    return new DiscountEditBillingPlansDialog(this.host.page(), showAlerts);
  }
}
