import {IMessage} from '../model/virtual/message';
import {ICustomer} from '../model/entities/customer';
import {ICustomerContact} from '../model/entities/customer-contact';
import {ICustomerNote} from '../model/entities/customer-note';
import {ICustomerMeeting} from '../model/entities/customer-meeting';
import {IUser} from '../model/entities/user';
import {IMeetingType} from '../model/entities/meeting-type';
import {IInternalMeeting} from '../model/entities/internal-meeting';
import {Utils} from '../utils/utils';
import {IOperator} from '../model/entities/operator';
import {IOperatorContact} from '../model/entities/operator-contact';
import {IOperatorNote} from '../model/entities/operator-note';
import {IOperatorMeeting} from '../model/entities/operator-meeting';
import {IProduction} from '../model/entities/production';
import {IProductionContact} from '../model/entities/production-contact';
import {IProductionNote} from '../model/entities/production-note';
import {IProductionMeeting} from '../model/entities/production-meeting';
import {IService} from "../model/entities/service";
import {IServiceContact} from "../model/entities/service-contact";
import {IServiceNote} from "../model/entities/service-note";
import {IServiceMeeting} from "../model/entities/service-meeting";
export class Factory {

    static getEmptyUser(): IUser {
        const emptyUser: {} = {
            id: null,
            email: null,
            firstname: null,
            lastname: null,
            active: false
        };
        return emptyUser as IUser;
    }

    /**
     * Returns empty message
     * @param errorCode
     * @param errorMsg
     * @param successCode
     * @param successMsg
     * @param infoCode
     * @param infoMsg
     * @param clientErrorCode
     * @param optionalInfo
     */
    static getEmptyMessage(errorCode: number, errorMsg: string, successCode: number, successMsg: string,
                           infoCode: number, infoMsg: string, clientErrorCode: number, optionalInfo: string = null): IMessage {
        const emptyMessage: {} = {
            error_code: errorCode,
            error_msg: errorMsg,
            success_code: successCode,
            success_msg: successMsg,
            info_code: infoCode,
            info_msg: infoMsg,
            client_error_code: clientErrorCode,
            optional_info: optionalInfo
        };
        return emptyMessage as IMessage;
    }

    /**
     * Returns empty customer
     */
    static getEmptyCustomer(): ICustomer {
        const emptyCustomer: {} = {
            id: null,
            old_plp_id: null,
            name: null,
            name_additional: null,
            consultant_user_id: null,
            street: null,
            street_no: null,
            zip: null,
            city: null,
            country_id: null,
            url: null,
            email: null,
            phone_no: null,
            mobile_no: null,
            fax_no: null,
            comment: null,
            active: true,
        };
        return emptyCustomer as ICustomer;
    }

    /**
     * Returns empty customer contact person
     */
    static getEmptyCustomerContact(customerId: number = null): ICustomerContact {
        const emptyCustomerContact: {} = {
            id: null,
            customer_id: customerId,
            gender: null,
            firstname: null,
            lastname: null,
            email: null,
            phone_no: null,
            mobile_no: null,
            fax_no: null,
            department: null,
            date_of_birth: null,
            comment: null,
            street: null,
            street_no: null,
            zip: null,
            city: null,
            country_id: null,
            is_xmas_mail_recipient: false,
        };
        return emptyCustomerContact as ICustomerContact;
    }

    static getEmptyCustomerNote(customerId: number = null, noteDate: string = null): ICustomerNote {
        const emptyCustomerNote: {} = {
            id: customerId,
            customer_id: null,
            customer_contact_id: null,
            user_id: null,
            gender: null,
            firstname: null,
            lastname: null,
            email: null,
            phone_no: null,
            mobile_no: null,
            fax_no: null,
            department: null,
            title: null,
            comment: null,
            note_date: noteDate,
            creation_date: null,
            creation_user_id: null,
            creation_user_firstname: null,
            creation_user_lastname: null
        };
        return emptyCustomerNote as ICustomerNote;
    }

    static getEmptyCustomerMeeting(customerId: number = null): ICustomerMeeting {
        const emptyCustomerMeeting: {} = {
            id: null,
            customer_id: customerId,
            creation_user_id: null,
            owner_user_id: null,
            meeting_type_id: null,
            is_option_meeting: false,
            title: null,
            description: null,
            start_date: Utils.getCurrentDate() + ' 09:00:00',
            end_date: Utils.getCurrentDate() + ' 18:00:00',
            customer_contact_id: null,
            gender: null,
            firstname: null,
            lastname: null,
            email: null,
            phone_no: null,
            mobile_no: null,
            department: null,
            street: null,
            street_no: null,
            zip: null,
            city: null,
            country_id: null,
            report: null,
            first_reminder_sent: false,
            second_reminder_sent: false,
            report_done: false,
            report_reminder_sent: false,
            creation_date: null,
            v_participants: [],
            v_is_editable: true
        };
        return emptyCustomerMeeting as ICustomerMeeting;
    }

    /**
     * Returns empty operator
     */
    static getEmptyOperator(): IOperator {
        const emptyOperator: {} = {
            id: null,
            old_plp_id: null,
            name: null,
            name_additional: null,
            street: null,
            street_no: null,
            zip: null,
            city: null,
            country_id: null,
            url: null,
            email: null,
            phone_no: null,
            mobile_no: null,
            fax_no: null,
            tax_no: null,
            invoice_mode: null,
            invoice_comment: null,
            invoice_key: null,
            comment: null,
            active: true,
        };
        return emptyOperator as IOperator;
    }

    /**
     * Returns empty operator contact person
     */
    static getEmptyOperatorContact(operatorId: number = null): IOperatorContact {
        const emptyOperatorContact: {} = {
            id: null,
            operator_id: operatorId,
            gender: null,
            firstname: null,
            lastname: null,
            email: null,
            phone_no: null,
            mobile_no: null,
            fax_no: null,
            department: null,
            date_of_birth: null,
            comment: null,
            street: null,
            street_no: null,
            zip: null,
            city: null,
            country_id: null,
            is_xmas_mail_recipient: false,
        };
        return emptyOperatorContact as IOperatorContact;
    }

    static getEmptyOperatorNote(operatorId: number = null, noteDate: string = null): IOperatorNote {
        const emptyOperatorNote: {} = {
            id: operatorId,
            operator_id: null,
            operator_contact_id: null,
            user_id: null,
            gender: null,
            firstname: null,
            lastname: null,
            email: null,
            phone_no: null,
            mobile_no: null,
            fax_no: null,
            department: null,
            title: null,
            comment: null,
            note_date: noteDate,
            creation_date: null,
            creation_user_id: null,
            creation_user_firstname: null,
            creation_user_lastname: null
        };
        return emptyOperatorNote as IOperatorNote;
    }

    static getEmptyOperatorMeeting(operatorId: number = null): IOperatorMeeting {
        const emptyOperatorMeeting: {} = {
            id: null,
            operator_id: operatorId,
            operator_user_id: null,
            owner_user_id: null,
            meeting_type_id: null,
            is_option_meeting: false,
            title: null,
            description: null,
            start_date: Utils.getCurrentDate() + ' 09:00:00',
            end_date: Utils.getCurrentDate() + ' 18:00:00',
            operator_contact_id: null,
            gender: null,
            firstname: null,
            lastname: null,
            email: null,
            phone_no: null,
            mobile_no: null,
            department: null,
            street: null,
            street_no: null,
            zip: null,
            city: null,
            country_id: null,
            report: null,
            first_reminder_sent: false,
            second_reminder_sent: false,
            report_done: false,
            report_reminder_sent: false,
            creation_date: null,
            v_participants: [],
            v_is_editable: true
        };
        return emptyOperatorMeeting as IOperatorMeeting;
    }

    static getEmptyProduction(): IProduction {
        const emptyProduction: {} = {
            id: null,
            old_plp_id: null,
            name: null,
            name_additional: null,
            street: null,
            street_no: null,
            zip: null,
            city: null,
            country_id: null,
            url: null,
            email: null,
            phone_no: null,
            mobile_no: null,
            fax_no: null,
            tax_no: null,
            invoice_mode: null,
            invoice_comment: null,
            invoice_key: null,
            comment: null,
            active: true,
        };
        return emptyProduction as IProduction;
    }

    static getEmptyProductionContact(productionId: number = null): IProductionContact {
        const emptyProductionContact: {} = {
            id: null,
            production_id: productionId,
            gender: null,
            firstname: null,
            lastname: null,
            email: null,
            phone_no: null,
            mobile_no: null,
            fax_no: null,
            department: null,
            date_of_birth: null,
            comment: null,
            street: null,
            street_no: null,
            zip: null,
            city: null,
            country_id: null,
            is_xmas_mail_recipient: false,
        };
        return emptyProductionContact as IProductionContact;
    }

    static getEmptyProductionNote(productionId: number = null, noteDate: string = null): IProductionNote {
        const emptyProductionNote: {} = {
            id: productionId,
            production_id: null,
            production_contact_id: null,
            user_id: null,
            gender: null,
            firstname: null,
            lastname: null,
            email: null,
            phone_no: null,
            mobile_no: null,
            fax_no: null,
            department: null,
            title: null,
            comment: null,
            note_date: noteDate,
            creation_date: null,
            creation_user_id: null,
            creation_user_firstname: null,
            creation_user_lastname: null
        };
        return emptyProductionNote as IProductionNote;
    }

    static getEmptyProductionMeeting(productionId: number = null): IProductionMeeting {
        const emptyProductionMeeting: {} = {
            id: null,
            production_id: productionId,
            production_user_id: null,
            owner_user_id: null,
            meeting_type_id: null,
            is_option_meeting: false,
            title: null,
            description: null,
            start_date: Utils.getCurrentDate() + ' 09:00:00',
            end_date: Utils.getCurrentDate() + ' 18:00:00',
            production_contact_id: null,
            gender: null,
            firstname: null,
            lastname: null,
            email: null,
            phone_no: null,
            mobile_no: null,
            department: null,
            street: null,
            street_no: null,
            zip: null,
            city: null,
            country_id: null,
            report: null,
            first_reminder_sent: false,
            second_reminder_sent: false,
            report_done: false,
            report_reminder_sent: false,
            creation_date: null,
            v_participants: [],
            v_is_editable: true
        };
        return emptyProductionMeeting as IProductionMeeting;
    }

    static getEmptyService(): IService {
        const emptyService: {} = {
            id: null,
            old_plp_id: null,
            name: null,
            name_additional: null,
            street: null,
            street_no: null,
            zip: null,
            city: null,
            country_id: null,
            url: null,
            email: null,
            phone_no: null,
            mobile_no: null,
            fax_no: null,
            tax_no: null,
            invoice_mode: null,
            invoice_comment: null,
            invoice_key: null,
            comment: null,
            active: true,
        };
        return emptyService as IService;
    }

    static getEmptyServiceContact(serviceId: number = null): IServiceContact {
        const emptyServiceContact: {} = {
            id: null,
            service_id: serviceId,
            gender: null,
            firstname: null,
            lastname: null,
            email: null,
            phone_no: null,
            mobile_no: null,
            fax_no: null,
            department: null,
            date_of_birth: null,
            comment: null,
            street: null,
            street_no: null,
            zip: null,
            city: null,
            country_id: null,
            is_xmas_mail_recipient: false,
        };
        return emptyServiceContact as IServiceContact;
    }

    static getEmptyServiceNote(serviceId: number = null, noteDate: string = null): IServiceNote {
        const emptyProductionNote: {} = {
            id: serviceId,
            service_id: null,
            service_contact_id: null,
            user_id: null,
            gender: null,
            firstname: null,
            lastname: null,
            email: null,
            phone_no: null,
            mobile_no: null,
            fax_no: null,
            department: null,
            title: null,
            comment: null,
            note_date: noteDate,
            creation_date: null,
            creation_user_id: null,
            creation_user_firstname: null,
            creation_user_lastname: null
        };
        return emptyProductionNote as IServiceNote;
    }

    static getEmptyServiceMeeting(serviceId: number = null): IServiceMeeting {
        const emptyServiceMeeting: {} = {
            id: null,
            service_id: serviceId,
            service_user_id: null,
            owner_user_id: null,
            meeting_type_id: null,
            is_option_meeting: false,
            title: null,
            description: null,
            start_date: Utils.getCurrentDate() + ' 09:00:00',
            end_date: Utils.getCurrentDate() + ' 18:00:00',
            service_contact_id: null,
            gender: null,
            firstname: null,
            lastname: null,
            email: null,
            phone_no: null,
            mobile_no: null,
            department: null,
            street: null,
            street_no: null,
            zip: null,
            city: null,
            country_id: null,
            report: null,
            first_reminder_sent: false,
            second_reminder_sent: false,
            report_done: false,
            report_reminder_sent: false,
            creation_date: null,
            v_participants: [],
            v_is_editable: true
        };
        return emptyServiceMeeting as IServiceMeeting;
    }

    static getEmptyInternalMeeting(): IInternalMeeting {
        const emptyInternalMeeting: {} = {
            id: null,
            creation_user_id: null,
            owner_user_id: null,
            title: null,
            description: null,
            start_date: Utils.getCurrentDate() + ' 09:00:00',
            end_date: Utils.getCurrentDate() + ' 18:00:00',
            report: null,
            first_reminder_sent: false,
            second_reminder_sent: false,
            report_done: false,
            report_reminder_sent: false,
            creation_date: null,
            v_participants: [],
            v_is_editable: true
        };
        return emptyInternalMeeting as IInternalMeeting;
    }

    static getEmptyMeetingType(): IMeetingType {
        const emptyMeetingType: {} = {
            id: null,
            type: null,
            name: null,
        };
        return emptyMeetingType as IMeetingType;
    }

}
