import {Component, EventEmitter, Input, OnChanges, OnInit, Output} from '@angular/core';
import {DataResult, GroupDescriptor, process} from '@progress/kendo-data-query';
import {LenderIncomeAbstractDirective} from '../../abstract/lender-income-abstract.directive';
import {PayInAAARowModel} from '../../models/Pay.In.AAA.Row.model';
import {PayInConnectiveModel} from '../../models/pay-in-connective.model';

@Component({
  selector: 'app-lender-connective-income',
  templateUrl: './lender-connective-income.component.html',
  styleUrls: ['./lender-connective-income.component.scss']
})
export class LenderConnectiveIncomeComponent  extends LenderIncomeAbstractDirective
  implements OnInit, OnChanges {

  public groups: GroupDescriptor[] = [{ field: 'Lender' }];
  public gridView: DataResult;
  constructor() { super('Connective'); }

  ngOnInit(): void {
    this.analysis[this.AgencyName].forEach(v => {
      v.matchedPayIn = this.matchPayIn(v);
      this.data.push(new PayInConnectiveModel(v));
    });
    this.gridView = process(this.data, { group: this.groups });
  }

  ngOnChanges(changes): void {
    super.OnChanges(changes);
  }

}
