import { Component, OnInit } from '@angular/core';
import {FrameDetailComponent} from "../../../frame/core/detail/frame.detail";
import {BsModalRef} from "ngx-bootstrap/modal";
import {FormBuilder, Validators} from "@angular/forms";

@Component({
  selector: 'app-pay-channel-detail',
  templateUrl: './pay-channel-detail.component.html',
  styleUrls: ['./pay-channel-detail.component.scss']
})
export class PayChannelDetailComponent extends FrameDetailComponent implements OnInit {

  constructor(bsModalRef: BsModalRef, fb: FormBuilder) {
    super(bsModalRef);
    this.detailForm = fb.group({
      'channel_name': [null, Validators.compose([Validators.required, Validators.minLength(1), Validators.maxLength(32)])],
      'channel_alias': [null],
      'public_version': [null, Validators.compose([Validators.required])],
      'private_version': [null, Validators.compose([Validators.required])],
      'channel_param': [null],
      'pay_url': [null, Validators.required],
      'refund_url': [null],
      'channel_status': [null, Validators.required]
    });
  }

  ngOnInit() {
  }


}

