import { IContactInfo } from '../interfaces/IContactInfo' ; import { IEntrant , IEntrantData , IEntrantOptions , IEntrantDataFull } from '../interfaces/IEntrant' ; import { IAttendee } from '../interfaces/IAttendee' ; import { Attendee } from './Attendee' ; export class Entrant implements IEntrant { public static parse ( data ) { const attendeeData = data . participants . map ( participant => Attendee . parse ( participant ) ) ; return new Entrant ( data . id , data . name , data . eventId , data . skill , attendeeData ) ; } public static parseFull ( data ) { return Entrant . parse ( data . entrant ) ; } public static getDefaultEntrantOptions ( ) { return { areSeedsPublished : true , page : null , perPage : 1 , sortBy : null , filter : null } ; } private id : number ; private name : string ; private eventId : number ; private skill : number ; private attendeeData : IAttendee [ ] ; constructor ( id , name , eventId , skill , attendeeData ) { this . id = id ; this . name = name ; this . eventId = eventId ; this . skill = skill ; this . attendeeData = attendeeData ; } public getId ( ) { return this . id ; } public getName ( ) { return this . name ; } public getEventId ( ) { return this . eventId ; } public getSkill ( ) { return this . skill ; } public getAttendeeData ( ) { return this . attendeeData ; } public getAttendee ( position = 0 ) { return this . attendeeData [ position ] ; } public getAttendeeId ( position = 0 ) { return this . attendeeData [ position ] . getId ( ) ; } public getGamerTag ( position = 0 ) { return this . attendeeData [ position ] . getGamerTag ( ) ; } public getSponsor ( position = 0 ) { return this . attendeeData [ position ] . getSponsor ( ) ; } public getPhoneNumber ( position = 0 ) { return this . attendeeData [ position ] . getPhoneNumber ( ) ; } public getContactInfo ( position = 0 ) { return this . attendeeData [ position ] . getContactInfo ( ) ; } public getCity ( position = 0 ) { return this . attendeeData [ position ] . getCity ( ) ; } public getState ( position = 0 ) { return this . attendeeData [ position ] . getState ( ) ; } public getStateId ( position = 0 ) { return this . attendeeData [ position ] . getStateId ( ) ; } public getCountry ( position = 0 ) { return this . attendeeData [ position ] . getCountry ( ) ; } public getCountryId ( position = 0 ) { return this . attendeeData [ position ] . getCountryId ( ) ; } public getContactName ( position = 0 ) { return this . attendeeData [ position ] . getContactName ( ) ; } public getFirstName ( position = 0 ) { return this . attendeeData [ position ] . getFirstName ( ) ; } public getLastName ( position = 0 ) { return this . attendeeData [ position ] . getLastName ( ) ; } public getZipcode ( position = 0 ) { return this . attendeeData [ position ] . getZipcode ( ) ; } public getConnectedAccounts ( position = 0 ) { return this . attendeeData [ position ] . getConnectedAccounts ( ) ; } }