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

@Component({
    selector: 'exam-finance-search',
    templateUrl: './exam-finance-search.component.html',
    styleUrls: ['./exam-finance-search.component.scss'],
    changeDetection: ChangeDetectionStrategy.OnPush
})
export class ExamFinanceSearchComponent implements OnInit {

    @Output() add = new EventEmitter()
    @Output() search = new EventEmitter()
    query = {
        testing_information_name:null,
        academic_semester_code:null,
        academic_year_code :null,
        is_main: null
    }
    constructor() { }

    ngOnInit(): void {
    }

    onSearch(){

        this.search.emit(this.query)
    }

    clear(){
        this.query = {
            testing_information_name:null,
            academic_semester_code:null,
            academic_year_code :null,
            is_main:null
        }
        this.search.emit(this.query)
    }

}
