import { BaseOutput } from '~/core/entities/output/baseOutput';

export class WarehouseItemAllOutput extends BaseOutput {
    /* tslint:disable variable-name */
    ID: number;
    DisplayName: string;
    ID_Warehouse: number;
    InventoryNumber: string;
    WarehouseItemCategory: string;
    Description: string;
    Note: string;
    PurchaseType: string;
    PurchasePrice: number;
    InWarehouse: boolean;
    PurchaseDate: string;
    InventoryDate: string;
    ID_Document: number;
    ID_DocumentSmall: number;
    ID_DocumentBig: number;
    PhotoExtension: string;
    // for update item properties
    ID_WarehouseItemCategory: string;

    CommercialRent: boolean;
    UnitRent: boolean;
    EventRent: boolean;
    RentPrice: number;
    RentNote: string;
    ID_PurchaseType: string;
    PurchaseNote: string;
    SerialNumber: string;
    AccountNumber: string;
    ActualPrice: number;
    DeletionDate: string;
    DeletionNote: string;

    // fields below are not received from server and are used only locally by app
    localChange: boolean;   // for offline inventory
    expanded: boolean;      // for expand panel
    idLastInventory: number;    // to prevent from multiple inventorizing
    // image: Image;    // uncomment (or change) when functionality for images will be added
    /* tslint:enable variable-name */

    constructor() {
        super();
        this.ID = null;
        this.DisplayName = null;
        this.ID_Warehouse = null;
        this.InventoryNumber = null;
        this.WarehouseItemCategory = null;
        this.Description = null;
        this.Note = null;
        this.PurchaseType = null;
        this.PurchasePrice = null;
        this.InWarehouse = null;
        this.PurchaseDate = null;
        this.InventoryDate = null;
        this.ID_Document = null;
        this.ID_DocumentSmall = null;
        this.ID_DocumentBig = null;
        this.PhotoExtension = null;

        this.ID_WarehouseItemCategory = null;
        this.CommercialRent = null;
        this.UnitRent = null;
        this.EventRent = null;
        this.RentPrice = null;
        this.RentNote = null;
        this.ID_PurchaseType = null;
        this.PurchaseNote = null;
        this.SerialNumber = null;
        this.AccountNumber = null;
        this.ActualPrice = null;
        this.DeletionDate = null;
        this.DeletionNote = null;

        this.localChange = false;
        this.expanded = false;
        this.idLastInventory = null;
    }

    toFullString() {
        return `ID: ${this.ID}
DisplayName: ${this.DisplayName}
ID_Warehouse: ${this.ID_Warehouse}
InventoryNumber: ${this.InventoryNumber}
WarehouseItemCategory: ${this.WarehouseItemCategory}
Description: ${this.Description}
Note: ${this.Note}
PurchaseType: ${this.PurchaseType}
PurchasePrice: ${this.PurchasePrice}
InWarehouse: ${this.InWarehouse}
PurchaseDate: ${this.PurchaseDate}
InventoryDate: ${this.InventoryDate}
ID_Document: ${this.ID_Document}
PhotoExtension: ${this.PhotoExtension}
ID_WarehouseItemCategory:  ${this.ID_WarehouseItemCategory}
CommercialRent:  ${this.CommercialRent}
UnitRent:  ${this.UnitRent}
EventRent:  ${this.EventRent}
RentPrice: ${this.RentPrice}
RentNote: ${this.RentNote}
ID_PurchaseType:  ${this.ID_PurchaseType}
PurchaseNote:  ${this.PurchaseNote}
SerialNumber:  ${this.SerialNumber}
AccountNumber:  ${this.AccountNumber}
ActualPrice: ${this.ActualPrice}
expanded: ${this.expanded}
localChange: ${this.localChange}
idLastInventory: ${this.idLastInventory}`;

    }
}
