import { DiscountBillingPlanList } from '@/manager/modules/discount/components/DiscountBillingPlanList';
import { DiscountEditBillingPlansDialog } from '@/manager/modules/discount/views/DiscountEditBillingPlansDialog';
import { getCardEditButtonHost, getCardHost } from '@/manager/shared/utils/host-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(showSnackbar: boolean): Promise<DiscountEditBillingPlansDialog> {
    await this.editButton.click();
    return new DiscountEditBillingPlansDialog(this.host.page(), showSnackbar);
  }
}
