package org.aegee.runanddine.registration;

import org.aegee.runanddine.RunAndDineApplication;
import org.aegee.runanddine.util.model.Model;

/**
 * Model for persistent GroupRegistrations
 *
 * @author s_wolff
 */
public final class GroupRegistration extends Model {

    /**
     * Manager for GroupRegistration models
     */
    public static final GroupRegistrationManager OBJECTS = GroupRegistrationManager.getInstance();
    private static final long serialVersionUID = 1L;
    /**
     * ID of RunAndDine the GroupRegistration is related to
     */
    private int runAndDineId; // set on add to database

    /**
     * Set ID of RunAndDine the GroupRegistration is related to
     *
     * @param runAndDineId ID of related RunANdDine
     */
    public void setRunAndDineId(int runAndDineId) {
        this.runAndDineId = runAndDineId;
    }

    /**
     * Get ID of RunAndDine the GroupRegistration is related to
     *
     * @return runAndDineId ID of related RunANdDine
     */
    public int getRunAndDineId() {
        return runAndDineId;
    }
    /*
     * group member 1
     */
    private int participantId1;

    /**
     * Set ID of first group member
     *
     * @param participantId1 ID to be set
     */
    public void setParticipantId1(int participantId1) {
        this.participantId1 = participantId1;
    }

    /**
     * Set ID of second group member
     *
     * @param participantId2 ID to be set
     */
    public void setParticipantId2(int participantId2) {
        this.participantId2 = participantId2;
    }

    /**
     * Get ID of first group member
     *
     * @return ID
     */
    public int getParticipantId1() {
        return participantId1;
    }

    /**
     * Get ID of second group member
     *
     * @return ID
     */
    public int getParticipantId2() {
        return participantId2;
    }
    /**
     * Model fields
     */
    private String firstName1, lastName1, email1, phone1;
    private String allergies1, validationToken1;
    private boolean accommodation1, vegetarian1, isValidated1;
    /*
     * group member 2
     */
    private int participantId2;
    private String firstName2, lastName2, email2, phone2;
    private String allergies2, validationToken2;
    private boolean accommodation2, vegetarian2, isValidated2;
    /*
     * general group information
     */
    private String streetName, city, adressAddition, postalCode;
    private Integer streetNo;
    private String comment;
    private boolean tvAllowed;

    public GroupRegistration() {
        this.isValidated1 = false;
        this.isValidated2 = false;
        this.tvAllowed = true;
    }

    public GroupRegistration(String firstName1, String lastName1, String email1, String phone1, String allergies1, String validationToken1, boolean accommodation1, boolean vegetarian1, boolean isValidated1, String firstName2, String lastName2, String email2, String phone2, String allergies2, String validationToken2, boolean accommodation2, boolean vegetarian2, boolean isValidated2, String streetName, String city, String adressAddition, Integer streetNo, String postalCode, String comment, boolean tvAllowed) {
        this.firstName1 = firstName1;
        this.lastName1 = lastName1;
        this.email1 = email1;
        this.phone1 = phone1;
        this.allergies1 = allergies1;
        this.validationToken1 = validationToken1;
        this.accommodation1 = accommodation1;
        this.vegetarian1 = vegetarian1;
        this.isValidated1 = isValidated1;
        this.firstName2 = firstName2;
        this.lastName2 = lastName2;
        this.email2 = email2;
        this.phone2 = phone2;
        this.allergies2 = allergies2;
        this.validationToken2 = validationToken2;
        this.accommodation2 = accommodation2;
        this.vegetarian2 = vegetarian2;
        this.isValidated2 = isValidated2;
        this.streetName = streetName;
        this.city = city;
        this.adressAddition = adressAddition;
        this.streetNo = streetNo;
        this.postalCode = postalCode;
        this.comment = comment;
        this.tvAllowed = tvAllowed;
    }

    /**
     * Debug all field values to wicket
     */
    public void debug() {
        RunAndDineApplication.debug(
                "\nfirstName1:       " + this.firstName1
                + "\nlastName1:        " + this.lastName1
                + "\nemail1:           " + this.email1
                + "\nphone1:           " + this.phone1
                + "\nallergies1:       " + this.allergies1
                + "\nvalidationToken1: " + this.validationToken1
                + "\naccommodation1:   " + this.accommodation1
                + "\nvegetarian1:      " + this.vegetarian1
                + "\nisValidated1:     " + this.isValidated1
                + "\nfirstName2:       " + this.firstName2
                + "\nlastName2:        " + this.lastName2
                + "\nemail2:           " + this.email2
                + "\nphone2:           " + this.phone2
                + "\nallergies2:       " + this.allergies2
                + "\nvalidationToken2: " + this.validationToken2
                + "\naccommodation2:   " + this.accommodation2
                + "\nvegetarian2:      " + this.vegetarian2
                + "\nisValidated2:     " + this.isValidated2
                + "\nstreetName:       " + this.streetName
                + "\ncity:             " + this.city
                + "\nadressAddition:   " + this.adressAddition
                + "\nstreetNo:         " + this.streetNo
                + "\npostalCode:       " + this.postalCode
                + "\ncomment:          " + this.comment);
    }

    /**
     * Check whether first participant needs accomodation
     *
     * @return Accomodation needed
     */
    public boolean isAccommodation1() {
        return accommodation1;
    }

    /**
     * Set whether first participant needs accomodation
     *
     * @param accommodation1 Accomodation needed
     */
    public void setAccommodation1(boolean accommodation1) {
        this.accommodation1 = accommodation1;
    }

    /**
     * Check whether second participant needs accomodation
     *
     * @return Accomodation needed
     */
    public boolean isAccommodation2() {
        return accommodation2;
    }

    /**
     * Set whether second participant needs accomodation
     *
     * @param accomodation2 Accomodation needed
     */
    public void setAccommodation2(boolean accommodation2) {
        this.accommodation2 = accommodation2;
    }

    /**
     * Get address addition for group kitchen
     *
     * @return Address addition
     */
    public String getAdressAddition() {
        return adressAddition;
    }

    /**
     * Set address addition for group kitchen
     *
     * @param adressAddition Address addition to be set
     */
    public void setAdressAddition(String adressAddition) {
        this.adressAddition = adressAddition;
    }

    /**
     * Get allergies of first participant
     *
     * @return Allergies
     */
    public String getAllergies1() {
        return allergies1;
    }

    /**
     * Set allergies of first participant
     *
     * @param allergies1 Allergies to be set
     */
    public void setAllergies1(String allergies1) {
        this.allergies1 = allergies1;
    }

    /**
     * Get allergies of second participant
     *
     * @return Allergies
     */
    public String getAllergies2() {
        return allergies2;
    }

    /**
     * Set allergies of second participant
     *
     * @param allergies2 Allergies to be set
     */
    public void setAllergies2(String allergies2) {
        this.allergies2 = allergies2;
    }

    /**
     * Get city of kitchen
     *
     * @return City
     */
    public String getCity() {
        return city;
    }

    /**
     * Set city of kitchen
     *
     * @param city City
     */
    public void setCity(String city) {
        this.city = city;
    }

    /**
     * Get comment of GroupRegistration
     *
     * @return Comment
     */
    public String getComment() {
        return comment;
    }

    /**
     * Set comment of GroupRegistration
     *
     * @param comment Comment to be set
     */
    public void setComment(String comment) {
        this.comment = comment;
    }

    /**
     * Get email of first participant
     *
     * @return Email
     */
    public String getEmail1() {
        return email1;
    }

    /**
     * Set email of first participant
     *
     * @param email1 Email to be set
     */
    public void setEmail1(String email1) {
        this.email1 = email1;
    }

    /**
     * Get email of second participant
     *
     * @return Email
     */
    public String getEmail2() {
        return email2;
    }

    /**
     * Set email of second participant
     *
     * @param email2 Email to be set
     */
    public void setEmail2(String email2) {
        this.email2 = email2;
    }

    /**
     * Get first name of first participant
     *
     * @return First name
     */
    public String getFirstName1() {
        return firstName1;
    }

    /**
     * Set first name of first participant
     *
     * @param firstName1 First name to be set
     */
    public void setFirstName1(String firstName1) {
        this.firstName1 = firstName1;
    }

    /**
     * Get first name of second participant
     *
     * @return First name
     */
    public String getFirstName2() {
        return firstName2;
    }

    /**
     * Set first name of second participant
     *
     * @param firstName2 First name to be set
     */
    public void setFirstName2(String firstName2) {
        this.firstName2 = firstName2;
    }

    /**
     * Check whether first participant is validated
     *
     * @return First participant is validated
     */
    public boolean isIsValidated1() {
        return isValidated1;
    }

    /**
     * Set whether first participant is validated
     *
     * @param isValidated1 First participant is validated
     */
    public void setIsValidated1(boolean isValidated1) {
        this.isValidated1 = isValidated1;
    }

    /**
     * Check whether second participant is validated
     *
     * @return Second participant is validated
     */
    public boolean isIsValidated2() {
        return isValidated2;
    }

    /**
     * Set whether second participant is validated
     *
     * @param isValidated2 Second participant is validated
     */
    public void setIsValidated2(boolean isValidated2) {
        this.isValidated2 = isValidated2;
    }

    /**
     * Get last name of first participant
     *
     * @return Last name
     */
    public String getLastName1() {
        return lastName1;
    }

    /**
     * Set last name of first participant
     *
     * @param lastName1 Last name to be set
     */
    public void setLastName1(String lastName1) {
        this.lastName1 = lastName1;
    }

    /**
     * Get last name of second participant
     *
     * @return Last name
     */
    public String getLastName2() {
        return lastName2;
    }

    /**
     * Set last name of second participant
     *
     * @param lastName2 Last name to be set
     */
    public void setLastName2(String lastName2) {
        this.lastName2 = lastName2;
    }

    /**
     * Get phone number of first participant
     *
     * @return Phone number
     */
    public String getPhone1() {
        return phone1;
    }

    /**
     * Set phone number of first pariticipant
     *
     * @param phone1 Phone number to be set
     */
    public void setPhone1(String phone1) {
        this.phone1 = phone1;
    }

    /**
     * Get phone number of second participant
     *
     * @return Phone number
     */
    public String getPhone2() {
        return phone2;
    }

    /**
     * Set phone number of second participant
     *
     * @param phone2 Phone number to be set
     */
    public void setPhone2(String phone2) {
        this.phone2 = phone2;
    }

    /**
     * Get postal code of kitchen
     *
     * @return Postal code
     */
    public String getPostalCode() {
        return postalCode;
    }

    /**
     * Set postal code of kitchen
     *
     * @param postalCode Postal code to be set
     */
    public void setPostalCode(String postalCode) {
        this.postalCode = postalCode;
    }

    /**
     * Get street name of kitchen
     *
     * @return Street name
     */
    public String getStreetName() {
        return streetName;
    }

    /**
     * Set street name of kitchen
     *
     * @param streetName Street name to be set
     */
    public void setStreetName(String streetName) {
        this.streetName = streetName;
    }

    /**
     * Get street number of kitchen
     *
     * @return Street number
     */
    public Integer getStreetNo() {
        return streetNo;
    }

    /**
     * Set street number of kitchen
     *
     * @param streetNo Street number to be set
     */
    public void setStreetNo(Integer streetNo) {
        this.streetNo = streetNo;
    }

    /**
     * Get validation token for first participant
     *
     * @return Validation token
     */
    public String getValidationToken1() {
        return validationToken1;
    }

    /**
     * Set validation token for first participant
     *
     * @param validationToken1 Validation token to be set
     */
    public void setValidationToken1(String validationToken1) {
        this.validationToken1 = validationToken1;
    }

    /**
     * Get validation token for second participant
     *
     * @return Validation token
     */
    public String getValidationToken2() {
        return validationToken2;
    }

    /**
     * Set validation token for second participant
     *
     * @param validationToken2 Validation token to be set
     */
    public void setValidationToken2(String validationToken2) {
        this.validationToken2 = validationToken2;
    }

    /**
     * Check whether first participant is vegetarian
     *
     * @return First participant is vegetarian
     */
    public boolean isVegetarian1() {
        return vegetarian1;
    }

    /**
     * Set whether first participant is vegetarian
     *
     * @param vegetarian1 First participant is vegetarian
     */
    public void setVegetarian1(boolean vegetarian1) {
        this.vegetarian1 = vegetarian1;
    }

    /**
     * Check whether second participant is vegetarian
     *
     * @return Second participant is vegetarian
     */
    public boolean isVegetarian2() {
        return vegetarian2;
    }

    /**
     * Set whether second participant is vegetarian
     *
     * @param vegetarian2 Second participant is vegetarian
     */
    public void setVegetarian2(boolean vegetarian2) {
        this.vegetarian2 = vegetarian2;
    }

    /**
     * Set whether group allows a tv team to enter their home and/or film them
     *
     * @param tvAllowed
     */
    public void setTvAllowed(boolean tvAllowed) {
        this.tvAllowed = tvAllowed;
    }

    /**
     * Check wheather group allows a tv team to enter their home and/or film
     * them
     *
     * @return
     */
    public boolean isTvAllowed() {
        return tvAllowed;
    }
}
