import {Component, OnInit, ChangeDetectionStrategy, Output, EventEmitter} from '@angular/core';
import {createQueryStringFromObject} from '../../../../../../shared/util/func';

@Component({
  selector: 'app-receive-payment-search',
  templateUrl: './receive-payment-search.component.html',
  styleUrls: ['./receive-payment-search.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class ReceivePaymentSearchComponent implements OnInit {
  @Output() search = new EventEmitter();
  query = {
    student_code: null,
    examinee_card: null
  };
  constructor() { }

  ngOnInit(): void {
  }

  onSearch(){
    const query = createQueryStringFromObject(this.query);
    this.search.emit(query) ;
  }

  clear(){
    this.query = {
      student_code: null,
      examinee_card: null
    };
  }

}
