import { Component, OnInit } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
import { sampleProducts } from '../models/sample_product';

@Component({
  selector: 'app-transaction',
  templateUrl: './transaction.component.html',
  styleUrls: ['./transaction.component.scss']
})
export class TransactionComponent implements OnInit {

  constructor() { }

  ngOnInit(): void {
  }


  public min: Date = new Date(2015, 0, 1);
  public max: Date = new Date(2030, 4, 31);

  public registerForm: FormGroup = new FormGroup({
      transID: new FormControl(),
      submissionDate: new FormControl(new Date(2020, 0, 10)),
      clientNames : new FormControl([1]),
      brokers : new FormControl([2]),
      referals : new FormControl([3]),
      status: new FormControl(),
      lender: new FormControl(),
      limit: new FormControl(),
      settlementDate: new FormControl(new Date(2020, 0, 9)),
  });

  public submitForm(): void {
      this.registerForm.markAllAsTouched();
  }

  public clearForm(): void {
      this.registerForm.reset();
  }
    
  public listClientNames: Array<{ text: string, value: number }> = [
    { text: 'John', value: 1 },
    { text: 'Steven', value: 2 },
    { text: 'William', value: 3 }
  ];

  public statis: { text: string, value: number } = { text: 'Female', value: 2 };


  public gridData: any[] = sampleProducts;  
}
