import { Component, OnInit } from '@angular/core';
import {FormBuilder, Validators} from '@angular/forms';
import {FrameAbstractComponent} from '../../../frame/FrameAbstractComponent';
import {CustomValidators} from 'ng2-validation';

@Component({
  selector: 'app-cf-fee',
  templateUrl: './cf-fee.component.html',
  styleUrls: ['./cf-fee.component.scss']
})
export class CfFeeComponent extends FrameAbstractComponent{

  initFee = {fee_status: 'InActive'}

  constructor(fb: FormBuilder) {
    super();
    this.valForm = fb.group({
      'fee_name': [null, Validators.compose([Validators.required, CustomValidators.rangeLength([1, 32])])],
      'fee_amount': [null, Validators.compose([Validators.required, CustomValidators.number, CustomValidators.min(0)])],
      'fee_status': [null, Validators.required]
    });
  }

}
