package com.utopiaindustries.qualitychecker.models;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;

public class InspectionItemCheckPoint implements Serializable {

    private static final long serialVersionUID = 1L;
    private long id;
    private long inspectionItemId;
    private String title;
    private boolean checked;
    private String remarks;
    // wrapper
    private List<String> defectSeverites;
    private List<String> defectTitles;
    private List<Float> quantities;
    private List<InspectionItemDefect> defects;
    private byte[] file;
    private String imagePath;
    private UUID uuid;
    private List<byte[]> files = new ArrayList<>();

    public InspectionItemCheckPoint(){
        this.uuid = UUID.randomUUID(); // Generate a random UUID
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public boolean getChecked() {
        return checked;
    }

    public void setChecked(boolean checked) {
        this.checked = checked;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getInspectionItemId() {
        return inspectionItemId;
    }

    public void setInspectionItemId(long inspectionItemId) {
        this.inspectionItemId = inspectionItemId;
    }

    public byte[] getFile() {
        return file;
    }

    public void setFile(byte[] file) {
        this.file = file;
    }



    public List<InspectionItemDefect> getDefects(){
        return defects;
    }

    public void setDefects(List<InspectionItemDefect> defects) {
        this.defects = defects;
    }

    public String getImagePath() {
        return imagePath;
    }

    public void setImagePath(String imagePath) {
        this.imagePath = imagePath;
    }

    public UUID getUuid() {
        return uuid;
    }

    public List<String> getDefectSeverites() {
        return defectSeverites;
    }

    public void setDefectSeverites(List<String> defectSeverites) {
        this.defectSeverites = defectSeverites;
    }

    public List<String> getDefectTitles() {
        return defectTitles;
    }

    public void setDefectTitles(List<String> defectTitles) {
        this.defectTitles = defectTitles;
    }

    public List<Float> getQuantities() {
        return quantities;
    }

    public void setQuantities(List<Float> quantities) {
        this.quantities = quantities;
    }

    public List<byte[]> getFiles() {
        return files;
    }

    public void addImageList(byte[] image) {
        this.files.add(image);
    }

    @Override
    public String toString() {
        return "InspectionItemCheckPoint{" +
                "id=" + id +
                ", inspectionItemId=" + inspectionItemId +
                ", title='" + title + '\'' +
                ", checked=" + checked +
                ", remarks='" + remarks + '\'' +
                ", defectSeverites=" + defectSeverites +
                ", defectTitles=" + defectTitles +
                ", quantities=" + quantities +
                ", defects=" + defects +
                ", file=" + Arrays.toString(file) +
                ", imagePath='" + imagePath + '\'' +
                ", uuid=" + uuid +
                ", imageList=" + files +
                '}';
    }


}
