import { APP_ID } from '~/constants/api.constants';
import { BaseInput } from '~/core/entities/input/baseInput';

export class WarehouseUpdate extends BaseInput {
    /* tslint:disable variable-name */
    ID_Login: string;
    ID: number;
    DisplayName: string; //
    ID_WarehouseType: string;
    WarehouseType: string;
    ID_Unit: string;
    Unit: string;
    RegistrationNumber: string;
    UnitFullName: string;
    ID_WarehouseMain: string;
    WarehouseMain: string;
    ID_UnitWarehouseMain: number;
    Street: string; //
    City: string; //
    Postcode: string; //
    Note: string; //

    ID_Event: number;
    ID_District: number;
    GpsLatitude: number;
    GpsLongtitude: number;
    ID_UnitCentral: number;

    wrapper: string;

    /* tslint:enable variable-name */

    constructor(appId = APP_ID, login = null, id = null, displayName = null, warhTypeId = null, warhType = null,
                unitId = null, unit = null, regNumber = null, unitFullName = null, warMainId = undefined, warehouseMain = null,
                street = null, city = null, postcode = null, note = null, eventId = undefined,
                districtId = undefined, gpsLat = undefined, gpsLong = undefined, unitCentralId = undefined) {
        super(appId);
        this.ID_Login = login;
        this.ID = id;
        this.DisplayName = displayName;
        this.ID_WarehouseType = warhTypeId;
        this.WarehouseType = warhType;
        this.ID_Unit = unitId;
        this.Unit = unit;
        this.RegistrationNumber = regNumber;
        this.UnitFullName = unitFullName;
        this.ID_WarehouseMain = warMainId;
        this.WarehouseMain = warehouseMain;
        this.ID_UnitWarehouseMain = undefined;
        this.Street = street;
        this.City = city;
        this.Postcode = postcode;
        this.Note = note;

        this.ID_Event = eventId;
        this.ID_District = districtId;
        this.GpsLatitude = gpsLat;
        this.GpsLongtitude = gpsLong;
        this.ID_UnitCentral = unitCentralId;

        this.wrapper = 'warehouse';
    }

    toString() {
        return this.DisplayName + ' ' + this.ID;
    }

    toFullString() {
        return `ID_Login: ${this.ID_Login}
ID: ${this.ID}
DisplayName: ${this.DisplayName}
ID_WarehouseMain: ${this.ID_WarehouseMain}
ID_Unit: ${this.ID_Unit}
RegistrationNumber: ${this.RegistrationNumber}
ID_WarehouseType: ${this.ID_WarehouseType}
Street: ${this.Street}
City: ${this.City}
Postcode: ${this.Postcode}
Note: ${this.Note}`;
    }
}
