import { BaseOutput } from '~/core/entities/output/baseOutput';
import { czechStringfromDate } from '../../utils/myFunctions';

export class WarehouseItemReservationAllOutput extends BaseOutput {
    /* tslint:disable variable-name */
    ID: number;
    ID_User: number;
    User: string;
    UserName: string;
    ID_Warehouse: number;
    Warehouse: string;
    ID_WarehouseItem: number;
    WarehouseItem: string;
    ID_WarehouseItemReservationState: string;
    WarehouseItemReservationState: string;
    EstimatedStartDate: string;
    EstimatedEndDate: string;
    RealStartDate: string;
    RealEndDate: string;
    Person: string;
    Email: string;
    Phone: string;
    Unit: string;
    UnitRegistrationNumber: string;
    Note: string;

    idForDisplay: number;
    expanded: boolean;
    /* tslint:enable variable-name */

    constructor(id = 0, userId = 0, user = '', userName = '', warehouseId = 0, warehouse = '', itemId = 0, item = '', stateId = '', state = '',
                estStartDate = '', estEndDate = '', realStartDate = '', realEndDate = '', person = '', email = '', phone = '', unit = '', unitNumber = '', note = '') {
        super();
        this.ID = id;
        this.ID_User = userId;
        this.User = user;
        this.UserName = userName;
        this.ID_Warehouse = warehouseId;
        this.Warehouse = warehouse;
        this.ID_WarehouseItem = itemId;
        this.WarehouseItem = item;
        this.ID_WarehouseItemReservationState = stateId;
        this.WarehouseItemReservationState = state;
        this.EstimatedStartDate = estStartDate;
        this.EstimatedEndDate = estEndDate;
        this.RealStartDate = realStartDate;
        this.RealEndDate = realEndDate;
        this.Person = person;
        this.Email = email;
        this.Phone = phone;
        this.Unit = unit;
        this.UnitRegistrationNumber = unitNumber;
        this.Note = note;

        this.idForDisplay = 0;
        this.expanded = false;

    }

    toString() {
        return this.idForDisplay + '. ' + this.UserName + ' (' + czechStringfromDate(new Date(this.EstimatedStartDate)) + ')';
    }

    toFullString() {
        return `ID = ${this.ID};
ID_User = ${this.ID_User};
User = ${this.User};
UserName = ${this.UserName};
ID_Warehouse = ${this.ID_Warehouse};
Warehouse = ${this.Warehouse};
ID_WarehouseItem = ${this.ID_WarehouseItem};
WarehouseItem = ${this.WarehouseItem};
ID_WarehouseItemReservationState = ${this.ID_WarehouseItemReservationState};
WarehouseItemReservationState = ${this.WarehouseItemReservationState};
EstimatedStartDate = ${this.EstimatedStartDate};
EstimatedEndDate = ${this.EstimatedEndDate};
RealStartDate = ${this.RealStartDate};
RealEndDate = ${this.RealEndDate};
Person = ${this.Person};
Email = ${this.Email};
Phone = ${this.Phone};
Unit = ${this.Unit};
UnitRegistrationNumber = ${this.UnitRegistrationNumber};
expanded = ${this.expanded};`;
    }
}
