import { Component } from '@angular/core';
import { FormGroup, Validators } from '@angular/forms';
import { PayerCreateComponent } from './payer-create.component';

@Component({
  selector: 'page-payer-create-b2b',
  templateUrl: 'payer-create-b2b.component.html',
  styleUrls: ['../address.component.scss'],
})
export class PayerCreateB2BComponent extends PayerCreateComponent {
  initForm(): FormGroup {
    const fb = this.fb;

    return fb.group({
      gender: fb.control(undefined, [Validators.required, Validators.min(1)]),
      title: fb.control(''),
      firstName: fb.control('', [Validators.required]),
      lastName: fb.control('', [Validators.required]),
      organisation: fb.group({
        name: fb.control('', [Validators.required]),
        department: fb.control(''),
        vatId: fb.control(''),
      }),
      address: fb.group({
        street: fb.control('', [Validators.required]),
        streetNumber: fb.control('', [Validators.required]),
        zipCode: fb.control('', [Validators.required]),
        city: fb.control('', [Validators.required]),
        info: fb.control(''),
        country: fb.control('DEU', [Validators.required]),
      }),
      isDefault: fb.control(false),
    });
  }
}
