Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
35054 amit 1
package com.spice.profitmandi.dao.model;
2
 
3
import com.spice.profitmandi.dao.enumuration.inventory.CatalogMovingEnum;
4
 
5
import java.time.Duration;
6
import java.time.LocalDateTime;
7
 
8
public class WarehouseItemAgeingModel {
9
    private int itemId;
10
    private int purchaseId;
11
    private String brand;
12
    private String supplierName;
13
    private String modelNumber;
14
    private String modelName;
15
    private String color;
16
    private LocalDateTime invoiceDate;
17
    private LocalDateTime created;
18
    private String warehouseName;
19
    private CatalogMovingEnum status;
20
    private long currentQuantity;
21
 
22
    public WarehouseItemAgeingModel(int itemId, int purchaseId, String brand, String supplierName,
23
                                    String modelNumber, String modelName, String color, LocalDateTime invoiceDate,
24
                                    LocalDateTime created, String warehouseName, CatalogMovingEnum status, long currentQuantity) {
25
        this.itemId = itemId;
26
        this.purchaseId = purchaseId;
27
        this.brand = brand;
28
        this.supplierName = supplierName;
29
        this.modelNumber = modelNumber;
30
        this.modelName = modelName;
31
        this.color = color;
32
        this.invoiceDate = invoiceDate;
33
        this.created = created;
34
        this.warehouseName = warehouseName;
35
        this.status = status;
36
        this.currentQuantity = currentQuantity;
37
    }
38
 
39
    // Getters and setters
40
    public int getItemId() { return itemId; }
41
    public void setItemId(int itemId) { this.itemId = itemId; }
42
 
43
    public int getPurchaseId() { return purchaseId; }
44
    public void setPurchaseId(int purchaseId) { this.purchaseId = purchaseId; }
45
 
46
    public String getBrand() { return brand; }
47
    public void setBrand(String brand) { this.brand = brand; }
48
 
49
    public String getSupplierName() { return supplierName; }
50
    public void setSupplierName(String supplierName) { this.supplierName = supplierName; }
51
 
52
    public String getModelNumber() { return modelNumber; }
53
    public void setModelNumber(String modelNumber) { this.modelNumber = modelNumber; }
54
 
55
    public String getModelName() { return modelName; }
56
    public void setModelName(String modelName) { this.modelName = modelName; }
57
 
58
    public String getColor() { return color; }
59
    public void setColor(String color) { this.color = color; }
60
 
61
    public LocalDateTime getInvoiceDate() { return invoiceDate; }
62
    public void setInvoiceDate(LocalDateTime invoiceDate) { this.invoiceDate = invoiceDate; }
63
 
64
    public LocalDateTime getCreated() { return created; }
65
    public void setCreated(LocalDateTime created) { this.created = created; }
66
 
67
    public String getWarehouseName() { return warehouseName; }
68
    public void setWarehouseName(String warehouseName) { this.warehouseName = warehouseName; }
69
 
70
    public CatalogMovingEnum getStatus() { return status; }
71
    public void setStatus(CatalogMovingEnum status) { this.status = status; }
72
 
73
    public long getCurrentQuantity() { return currentQuantity; }
74
    public void setCurrentQuantity(long currentQuantity) { this.currentQuantity = currentQuantity; }
75
 
76
    @Override
77
    public String toString() {
78
        return "WarehouseItemAgeingModel{" +
79
                "itemId=" + itemId +
80
                ", purchaseId=" + purchaseId +
81
                ", brand='" + brand + '\'' +
82
                ", supplierName='" + supplierName + '\'' +
83
                ", modelNumber='" + modelNumber + '\'' +
84
                ", modelName='" + modelName + '\'' +
85
                ", color='" + color + '\'' +
86
                ", invoiceDate=" + invoiceDate +
87
                ", created=" + created +
88
                ", warehouseName='" + warehouseName + '\'' +
89
                ", status=" + status +
90
                ", currentQuantity=" + currentQuantity +
91
                '}';
92
    }
93
 
94
    public int getAge() {
95
        return (int) Duration.between(this.invoiceDate, LocalDateTime.now()).toDays();
96
    }
97
}