Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
35504 vikas 1
package com.spice.profitmandi.shopify.models;
2
 
3
import com.spice.profitmandi.dao.model.MediaPojo;
4
import java.util.List;
5
import java.util.Map;
6
import java.util.Objects;
7
 
8
/**
9
 * Represents the Shopify ProductInput used for productCreate/productUpdate mutations.
10
 * This model mirrors Shopify's ProductInput schema.
11
 */
12
public class ProductInputModel {
13
    private String id; // optional, for updates
14
    private String title;
15
    private String bodyHtml;
16
    private String vendor;
17
    private String tags;
18
    private String productType;
19
    private String handle;
20
    private String status;
21
    private String templateSuffix;
22
    private String seoTitle;
23
    private String seoDescription;
24
 
25
    // Collections
26
    private List<String> collectionIds; // gid://shopify/Collection/xxxxxx
27
 
28
    // Options
29
    private List<Map<String, Object>> options; // e.g. [{ name: "Color", values: ["Red", "Blue"] }]
30
 
31
    // Variants
32
    private List<Map<String, Object>> variants; // e.g. [{ sku: "SKU123", price: "999", option1: "Red" }]
33
 
34
    // Images
35
    private List<MediaPojo> images;
36
 
37
    // Inventory (optional if managed externally)
38
    private Integer inventoryQuantity;
39
    private String inventoryPolicy;      // "DENY" or "CONTINUE"
40
    private String inventoryManagement;  // "SHOPIFY" or null
41
    private String locationGid;          // gid://shopify/Location/xxxxxx
42
 
43
    // Pricing
44
    private String price;
45
    private String compareAtPrice;
46
    private String costPerItem;
47
 
48
    // Visibility
49
    private Boolean published;
50
    private String publishedAt;
51
 
52
    public ProductInputModel() {}
53
 
54
    // --- Getters and Setters ---
55
 
56
    public String getId() { return id; }
57
    public void setId(String id) { this.id = id; }
58
 
59
    public String getTitle() { return title; }
60
    public void setTitle(String title) { this.title = title; }
61
 
62
    public String getBodyHtml() { return bodyHtml; }
63
    public void setBodyHtml(String bodyHtml) { this.bodyHtml = bodyHtml; }
64
 
65
    public String getVendor() { return vendor; }
66
    public void setVendor(String vendor) { this.vendor = vendor; }
67
 
68
    public String getTags() { return tags; }
69
    public void setTags(String tags) { this.tags = tags; }
70
 
71
    public String getProductType() { return productType; }
72
    public void setProductType(String productType) { this.productType = productType; }
73
 
74
    public String getHandle() { return handle; }
75
    public void setHandle(String handle) { this.handle = handle; }
76
 
77
    public String getStatus() { return status; }
78
    public void setStatus(String status) { this.status = status; }
79
 
80
    public String getTemplateSuffix() { return templateSuffix; }
81
    public void setTemplateSuffix(String templateSuffix) { this.templateSuffix = templateSuffix; }
82
 
83
    public String getSeoTitle() { return seoTitle; }
84
    public void setSeoTitle(String seoTitle) { this.seoTitle = seoTitle; }
85
 
86
    public String getSeoDescription() { return seoDescription; }
87
    public void setSeoDescription(String seoDescription) { this.seoDescription = seoDescription; }
88
 
89
    public List<String> getCollectionIds() { return collectionIds; }
90
    public void setCollectionIds(List<String> collectionIds) { this.collectionIds = collectionIds; }
91
 
92
    public List<Map<String, Object>> getOptions() { return options; }
93
    public void setOptions(List<Map<String, Object>> options) { this.options = options; }
94
 
95
    public List<Map<String, Object>> getVariants() { return variants; }
96
    public void setVariants(List<Map<String, Object>> variants) { this.variants = variants; }
97
 
98
    public List<MediaPojo> getImages() { return images; }
99
    public void setImages(List<MediaPojo> images) { this.images = images; }
100
 
101
    public Integer getInventoryQuantity() { return inventoryQuantity; }
102
    public void setInventoryQuantity(Integer inventoryQuantity) { this.inventoryQuantity = inventoryQuantity; }
103
 
104
    public String getInventoryPolicy() { return inventoryPolicy; }
105
    public void setInventoryPolicy(String inventoryPolicy) { this.inventoryPolicy = inventoryPolicy; }
106
 
107
    public String getInventoryManagement() { return inventoryManagement; }
108
    public void setInventoryManagement(String inventoryManagement) { this.inventoryManagement = inventoryManagement; }
109
 
110
    public String getLocationGid() { return locationGid; }
111
    public void setLocationGid(String locationGid) { this.locationGid = locationGid; }
112
 
113
    public String getPrice() { return price; }
114
    public void setPrice(String price) { this.price = price; }
115
 
116
    public String getCompareAtPrice() { return compareAtPrice; }
117
    public void setCompareAtPrice(String compareAtPrice) { this.compareAtPrice = compareAtPrice; }
118
 
119
    public String getCostPerItem() { return costPerItem; }
120
    public void setCostPerItem(String costPerItem) { this.costPerItem = costPerItem; }
121
 
122
    public Boolean getPublished() { return published; }
123
    public void setPublished(Boolean published) { this.published = published; }
124
 
125
    public String getPublishedAt() { return publishedAt; }
126
    public void setPublishedAt(String publishedAt) { this.publishedAt = publishedAt; }
127
 
128
    @Override
129
    public boolean equals(Object o) {
130
        if (!(o instanceof ProductInputModel)) return false;
131
        ProductInputModel that = (ProductInputModel) o;
132
        return Objects.equals(id, that.id) && Objects.equals(title, that.title) && Objects.equals(bodyHtml, that.bodyHtml) && Objects.equals(vendor, that.vendor) && Objects.equals(tags, that.tags) && Objects.equals(productType, that.productType) && Objects.equals(handle, that.handle) && Objects.equals(status, that.status) && Objects.equals(templateSuffix, that.templateSuffix) && Objects.equals(seoTitle, that.seoTitle) && Objects.equals(seoDescription, that.seoDescription) && Objects.equals(collectionIds, that.collectionIds) && Objects.equals(options, that.options) && Objects.equals(variants, that.variants) && Objects.equals(images, that.images) && Objects.equals(inventoryQuantity, that.inventoryQuantity) && Objects.equals(inventoryPolicy, that.inventoryPolicy) && Objects.equals(inventoryManagement, that.inventoryManagement) && Objects.equals(locationGid, that.locationGid) && Objects.equals(price, that.price) && Objects.equals(compareAtPrice, that.compareAtPrice) && Objects.equals(costPerItem, that.costPerItem) && Objects.equals(published, that.published) && Objects.equals(publishedAt, that.publishedAt);
133
    }
134
 
135
    @Override
136
    public int hashCode() {
137
        return Objects.hash(id, title, bodyHtml, vendor, tags, productType, handle, status, templateSuffix, seoTitle, seoDescription, collectionIds, options, variants, images, inventoryQuantity, inventoryPolicy, inventoryManagement, locationGid, price, compareAtPrice, costPerItem, published, publishedAt);
138
    }
139
 
140
    @Override
141
    public String toString() {
142
        return "ProductInputModel{" +
143
                "id='" + id + '\'' +
144
                ", title='" + title + '\'' +
145
                ", bodyHtml='" + bodyHtml + '\'' +
146
                ", vendor='" + vendor + '\'' +
147
                ", tags='" + tags + '\'' +
148
                ", productType='" + productType + '\'' +
149
                ", handle='" + handle + '\'' +
150
                ", status='" + status + '\'' +
151
                ", templateSuffix='" + templateSuffix + '\'' +
152
                ", seoTitle='" + seoTitle + '\'' +
153
                ", seoDescription='" + seoDescription + '\'' +
154
                ", collectionIds=" + collectionIds +
155
                ", options=" + options +
156
                ", variants=" + variants +
157
                ", images=" + images +
158
                ", inventoryQuantity=" + inventoryQuantity +
159
                ", inventoryPolicy='" + inventoryPolicy + '\'' +
160
                ", inventoryManagement='" + inventoryManagement + '\'' +
161
                ", locationGid='" + locationGid + '\'' +
162
                ", price='" + price + '\'' +
163
                ", compareAtPrice='" + compareAtPrice + '\'' +
164
                ", costPerItem='" + costPerItem + '\'' +
165
                ", published=" + published +
166
                ", publishedAt='" + publishedAt + '\'' +
167
                '}';
168
    }
169
}