ticket-system/source/ticketUI/src/app/components/patron-info/patron-info.component.ts
Tara Wilson 84431ede36 Adding Emailing
Adding Email Verification on Patron Form
Addressing #1 - tickets will span next to ticket form
2024-12-18 15:59:36 -05:00

44 lines
1.6 KiB
TypeScript

import {Component} from '@angular/core';
import {FormControl, ReactiveFormsModule, Validators} from '@angular/forms';
import {Patron} from '../../../models/core/patron';
import {NgClass} from '@angular/common';
@Component({
selector: 'app-patron-info',
imports: [
ReactiveFormsModule,
NgClass
],
templateUrl: './patron-info.component.html',
styleUrl: './patron-info.component.scss'
})
export class PatronInfoComponent {
public firstName = new FormControl('', {nonNullable: true, validators: [Validators.required]});
public middleName = new FormControl('');
public lastName = new FormControl('', {nonNullable: true, validators: [Validators.required]});
public email = new FormControl('', {
nonNullable: true, validators: [Validators.required, Validators.email]
});
public phoneNumber = new FormControl('');
public addressOne = new FormControl('', {nonNullable: true, validators: [Validators.required]});
public addressTwo = new FormControl('');
public city = new FormControl('', {nonNullable: true, validators: [Validators.required]});
public state = new FormControl('', {nonNullable: true, validators: [Validators.required]});
public zip = new FormControl('', {nonNullable: true, validators: [Validators.required]});
public buildPatron(): Patron {
return {
firstName: this.firstName.value,
middleName: this.middleName.value,
lastName: this.lastName.value,
email: this.email.value,
phoneNumber: this.phoneNumber.value,
addressOne: this.addressOne.value,
addressTwo: this.addressTwo.value,
city: this.city.value,
state: this.state.value,
zip: this.zip.value,
};
}
}