From 5fcf732bd38dec1c94a5d8aed521a02b03efce44 Mon Sep 17 00:00:00 2001 From: jonathan zollinger Date: Sat, 10 Feb 2024 02:59:37 -0700 Subject: [PATCH 1/9] wip: introduce store_location_v1 endpoint Signed-off-by: jonathan zollinger --- src/main/java/com/graqr/threshr/Threshr.java | 6 ++--- .../java/com/graqr/threshr/ThreshrClient.java | 18 +++++++++++---- .../model/redsky/stores/Capability.java | 7 ++++++ .../model/redsky/stores/CapabilityHour.java | 9 ++++++++ .../redsky/stores/ContactInformation.java | 9 ++++++++ .../threshr/model/redsky/stores/Day.java | 7 +++--- .../threshr/model/redsky/stores/DriveUp.java | 3 +++ .../threshr/model/redsky/stores/Geofence.java | 3 +++ .../stores/GeographicSpecifications.java | 14 ++++++++++++ .../threshr/model/redsky/stores/Hour.java | 5 +++-- .../model/redsky/stores/MailingAddress.java | 13 ++++++----- .../model/redsky/stores/Miscellaneous.java | 5 +++++ .../redsky/stores/PhysicalSpecifications.java | 7 ++++++ .../redsky/stores/RollingOperatingHours.java | 9 ++++++-- .../threshr/model/redsky/stores/Store.java | 22 ++++++++++++++----- .../store/location/StoreLocationRoot.java | 5 +++++ .../stores/store/location/storeData.java | 6 +++++ .../graqr/threshr/ThreshrClientSpec.groovy | 6 ++--- 18 files changed, 127 insertions(+), 27 deletions(-) create mode 100644 src/main/java/com/graqr/threshr/model/redsky/stores/Capability.java create mode 100644 src/main/java/com/graqr/threshr/model/redsky/stores/CapabilityHour.java create mode 100644 src/main/java/com/graqr/threshr/model/redsky/stores/ContactInformation.java create mode 100644 src/main/java/com/graqr/threshr/model/redsky/stores/DriveUp.java create mode 100644 src/main/java/com/graqr/threshr/model/redsky/stores/Geofence.java create mode 100644 src/main/java/com/graqr/threshr/model/redsky/stores/GeographicSpecifications.java create mode 100644 src/main/java/com/graqr/threshr/model/redsky/stores/Miscellaneous.java create mode 100644 src/main/java/com/graqr/threshr/model/redsky/stores/PhysicalSpecifications.java create mode 100644 src/main/java/com/graqr/threshr/model/redsky/stores/store/location/StoreLocationRoot.java create mode 100644 src/main/java/com/graqr/threshr/model/redsky/stores/store/location/storeData.java diff --git a/src/main/java/com/graqr/threshr/Threshr.java b/src/main/java/com/graqr/threshr/Threshr.java index 737329b..a5238e6 100644 --- a/src/main/java/com/graqr/threshr/Threshr.java +++ b/src/main/java/com/graqr/threshr/Threshr.java @@ -24,7 +24,7 @@ public class Threshr { @Get("/product/summary-with-fulfillment") @SingleResult public List fetchProductSummaries(TargetStore targetStore, Tcin tcin) { - return Objects.requireNonNull(threshrClient.productSummaryWithFulfillment(targetStore, tcin).body()).data().productSummary(); + return Objects.requireNonNull(threshrClient.getProductSummary(targetStore, tcin).body()).data().productSummary(); } @Get("/product/summary-with-fulfillment") @@ -36,7 +36,7 @@ public List fetchProductSummaries(TargetStore targetStore, Strin @Get("/product/details") @SingleResult public Product fetchProductDetails(TargetStore targetStore, String tcin) { - return Objects.requireNonNull(threshrClient.productDetails(new TargetStorePdpSearch(targetStore), tcin).body()).data().product(); + return Objects.requireNonNull(threshrClient.getProductDetails(new TargetStorePdpSearch(targetStore), tcin).body()).data().product(); } @Get("/stores/locations-query") @@ -48,7 +48,7 @@ public NearbyStores queryStoreLocations(Place place) { @Get("/stores/locations-query") @SingleResult public NearbyStores queryStoreLocations(int limit, int within, Place place) { - return Objects.requireNonNull(threshrClient.queryNearbyStores(limit, within, place.getPlace()).body()).data().nearbyStores(); + return Objects.requireNonNull(threshrClient.getNearbyStores(limit, within, place.getPlace()).body()).data().nearbyStores(); } } \ No newline at end of file diff --git a/src/main/java/com/graqr/threshr/ThreshrClient.java b/src/main/java/com/graqr/threshr/ThreshrClient.java index 03ed3c7..92ba8d1 100644 --- a/src/main/java/com/graqr/threshr/ThreshrClient.java +++ b/src/main/java/com/graqr/threshr/ThreshrClient.java @@ -1,12 +1,12 @@ package com.graqr.threshr; -import com.graqr.threshr.model.queryparam.Place; import com.graqr.threshr.model.queryparam.TargetStore; import com.graqr.threshr.model.queryparam.TargetStorePdpSearch; import com.graqr.threshr.model.queryparam.Tcin; import com.graqr.threshr.model.redsky.products.pdp.client.PdpClientRoot; import com.graqr.threshr.model.redsky.products.summary.ProductSummaryRoot; import com.graqr.threshr.model.redsky.stores.NearbyStoresRoot; +import com.graqr.threshr.model.redsky.stores.store.location.StoreLocationRoot; import io.micronaut.http.HttpResponse; import io.micronaut.http.annotation.Get; import io.micronaut.http.annotation.Header; @@ -54,7 +54,7 @@ interface ThreshrClient { "{&tcins*}" + "{&targetStore*}" + "&CHANNEL=${threshr.channel}") - HttpResponse productSummaryWithFulfillment( + HttpResponse getProductSummary( TargetStore targetStore, Tcin tcins); @@ -67,7 +67,7 @@ HttpResponse productSummaryWithFulfillment( "?key=${threshr.key}" + "{&tcin}" + "{&targetStorePdpSearch*}") - HttpResponse productDetails( + HttpResponse getProductDetails( TargetStorePdpSearch targetStorePdpSearch, @Pattern(regexp = "(\\d{8})|(\\d{9})") String tcin); @@ -88,5 +88,15 @@ HttpResponse productDetails( "{&within}" + "{&place}" + "&CHANNEL=${threshr.channel}") - HttpResponse queryNearbyStores(int limit, int within, String place); + HttpResponse getNearbyStores(int limit, int within, String place); + + /** + * Get Store Information (ie store hours) for a specific Target Store + * @return Store object, generally with more information about the store than other store endpoints. + */ + @Get("store_location_v1" + + "?key=${threshr.key}" + + "{&storeId}") + HttpResponse getStoreInformation(String storeId); + } \ No newline at end of file diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/Capability.java b/src/main/java/com/graqr/threshr/model/redsky/stores/Capability.java new file mode 100644 index 0000000..b0a4e87 --- /dev/null +++ b/src/main/java/com/graqr/threshr/model/redsky/stores/Capability.java @@ -0,0 +1,7 @@ +package com.graqr.threshr.model.redsky.stores; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public record Capability(@JsonProperty("capability_code") String capabilityCode, + @JsonProperty("capability_name") String capabilityName, + @JsonProperty("effective_date") String effectiveDate) {} diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/CapabilityHour.java b/src/main/java/com/graqr/threshr/model/redsky/stores/CapabilityHour.java new file mode 100644 index 0000000..668abdc --- /dev/null +++ b/src/main/java/com/graqr/threshr/model/redsky/stores/CapabilityHour.java @@ -0,0 +1,9 @@ +package com.graqr.threshr.model.redsky.stores; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +public record CapabilityHour(@JsonProperty("capability_code") String capabilityCode, + List days) { +} diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/ContactInformation.java b/src/main/java/com/graqr/threshr/model/redsky/stores/ContactInformation.java new file mode 100644 index 0000000..a91a3d5 --- /dev/null +++ b/src/main/java/com/graqr/threshr/model/redsky/stores/ContactInformation.java @@ -0,0 +1,9 @@ +package com.graqr.threshr.model.redsky.stores; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public record ContactInformation(@JsonProperty("building_area") String buildingArea, + @JsonProperty("telephone_type") String telephoneType, + @JsonProperty("is_international_phone_number") Boolean isInternationalPhoneNumber, + @JsonProperty("telephone_number") String telephoneNumber, + String capability) {} diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/Day.java b/src/main/java/com/graqr/threshr/model/redsky/stores/Day.java index 50a9047..57241eb 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/stores/Day.java +++ b/src/main/java/com/graqr/threshr/model/redsky/stores/Day.java @@ -1,9 +1,8 @@ package com.graqr.threshr.model.redsky.stores; import com.fasterxml.jackson.annotation.JsonProperty; +import io.micronaut.core.annotation.Nullable; import io.micronaut.serde.annotation.Serdeable; -import lombok.AllArgsConstructor; -import lombok.Data; import java.util.List; @@ -13,5 +12,7 @@ public record Day( String date, @JsonProperty("day_name") String dayName, - List hours) { + List hours, + @Nullable @JsonProperty("sequence_number") + String sequenceNumber) { } \ No newline at end of file diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/DriveUp.java b/src/main/java/com/graqr/threshr/model/redsky/stores/DriveUp.java new file mode 100644 index 0000000..b686c76 --- /dev/null +++ b/src/main/java/com/graqr/threshr/model/redsky/stores/DriveUp.java @@ -0,0 +1,3 @@ +package com.graqr.threshr.model.redsky.stores; + +public record DriveUp(Double latitude, Double longitude, Long radius) {} diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/Geofence.java b/src/main/java/com/graqr/threshr/model/redsky/stores/Geofence.java new file mode 100644 index 0000000..ceae26d --- /dev/null +++ b/src/main/java/com/graqr/threshr/model/redsky/stores/Geofence.java @@ -0,0 +1,3 @@ +package com.graqr.threshr.model.redsky.stores; + +public record Geofence(Double latitude, Double longitude, Long radius) {} diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/GeographicSpecifications.java b/src/main/java/com/graqr/threshr/model/redsky/stores/GeographicSpecifications.java new file mode 100644 index 0000000..dffb466 --- /dev/null +++ b/src/main/java/com/graqr/threshr/model/redsky/stores/GeographicSpecifications.java @@ -0,0 +1,14 @@ +package com.graqr.threshr.model.redsky.stores; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public record GeographicSpecifications( + Double latitude, + Double longitude, + @JsonProperty("time_zone_code") String timeZoneCode, + @JsonProperty("time_zone_description") String timeZoneDescription, + @JsonProperty("time_zone_utc_offset_name") String timeZoneUtcOffsetName, + @JsonProperty("time_zone_offset_hours") String timeZoneOffsetHours, + @JsonProperty("is_daylight_savings_time_recognized") Boolean isDaylightSavingsTimeRecognized, + @JsonProperty("iso_time_zone_code") String isoTimeZoneCode) { +} diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/Hour.java b/src/main/java/com/graqr/threshr/model/redsky/stores/Hour.java index 6650810..f9bb407 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/stores/Hour.java +++ b/src/main/java/com/graqr/threshr/model/redsky/stores/Hour.java @@ -1,12 +1,13 @@ package com.graqr.threshr.model.redsky.stores; import com.fasterxml.jackson.annotation.JsonProperty; +import io.micronaut.core.annotation.Nullable; import io.micronaut.serde.annotation.Serdeable; -import lombok.AllArgsConstructor; -import lombok.Data; @Serdeable public record Hour( + @Nullable @JsonProperty("begin_date") + String beginDate, @JsonProperty("begin_time") String beginTime, @JsonProperty("end_date") String endDate, @JsonProperty("end_time") String endTime) { diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/MailingAddress.java b/src/main/java/com/graqr/threshr/model/redsky/stores/MailingAddress.java index 4028f4d..8ccf787 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/stores/MailingAddress.java +++ b/src/main/java/com/graqr/threshr/model/redsky/stores/MailingAddress.java @@ -1,16 +1,19 @@ package com.graqr.threshr.model.redsky.stores; import com.fasterxml.jackson.annotation.JsonProperty; +import io.micronaut.core.annotation.Nullable; import io.micronaut.serde.annotation.Serdeable; -import lombok.AllArgsConstructor; -import lombok.Data; @Serdeable public record MailingAddress( - @JsonProperty("address_line1") String addressLine1, + @JsonProperty("address_line1") + String addressLine1, String city, - @JsonProperty("country_code") String countryCode, + @JsonProperty("country_code") + String countryCode, String region, String state, - @JsonProperty("postal_code") String postalCode) { + @JsonProperty("postal_code") + String postalCode, + @Nullable String country) { } diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/Miscellaneous.java b/src/main/java/com/graqr/threshr/model/redsky/stores/Miscellaneous.java new file mode 100644 index 0000000..f75e8fd --- /dev/null +++ b/src/main/java/com/graqr/threshr/model/redsky/stores/Miscellaneous.java @@ -0,0 +1,5 @@ +package com.graqr.threshr.model.redsky.stores; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public record Miscellaneous(@JsonProperty("google_cid") String googleCid) {} diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/PhysicalSpecifications.java b/src/main/java/com/graqr/threshr/model/redsky/stores/PhysicalSpecifications.java new file mode 100644 index 0000000..a80bfc3 --- /dev/null +++ b/src/main/java/com/graqr/threshr/model/redsky/stores/PhysicalSpecifications.java @@ -0,0 +1,7 @@ +package com.graqr.threshr.model.redsky.stores; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public record PhysicalSpecifications(@JsonProperty("total_building_area") Long totalBuildingArea, + @JsonProperty("merchandise_level") Long merchandiseLevel, + String format) {} diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/RollingOperatingHours.java b/src/main/java/com/graqr/threshr/model/redsky/stores/RollingOperatingHours.java index c886605..7cf766a 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/stores/RollingOperatingHours.java +++ b/src/main/java/com/graqr/threshr/model/redsky/stores/RollingOperatingHours.java @@ -1,9 +1,14 @@ package com.graqr.threshr.model.redsky.stores; import com.fasterxml.jackson.annotation.JsonProperty; +import io.micronaut.core.annotation.Nullable; import io.micronaut.serde.annotation.Serdeable; -import lombok.Data; + +import java.util.List; @Serdeable -public record RollingOperatingHours(@JsonProperty("main_hours") MainHours mainHours) { +public record RollingOperatingHours( + @JsonProperty("main_hours") MainHours mainHours, + @Nullable @JsonProperty("capability_hours") + List capabilityHours) { } diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/Store.java b/src/main/java/com/graqr/threshr/model/redsky/stores/Store.java index b43b08e..64872cf 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/stores/Store.java +++ b/src/main/java/com/graqr/threshr/model/redsky/stores/Store.java @@ -1,15 +1,27 @@ package com.graqr.threshr.model.redsky.stores; import com.fasterxml.jackson.annotation.JsonProperty; +import io.micronaut.core.annotation.Nullable; import io.micronaut.serde.annotation.Serdeable; -import lombok.AllArgsConstructor; -import lombok.Data; + +import java.util.List; @Serdeable -public record Store(String status, @JsonProperty("store_id") String storeId, +public record Store(String status, + @JsonProperty("store_id") String storeId, @JsonProperty("location_name") String locationName, Double distance, @JsonProperty("main_voice_phone_number") String mainVoicePhoneNumber, @JsonProperty("mailing_address") MailingAddress mailingAddress, - @JsonProperty("rolling_operating_hours") RollingOperatingHours rollingOperatingHours) { -} + @JsonProperty("rolling_operating_hours") RollingOperatingHours rollingOperatingHours, + @Nullable Geofence geofence, + @Nullable List capabilities, + @Nullable @JsonProperty("drive_up") + DriveUp driveUp, + @Nullable @JsonProperty("contact_information") + List contactInformation, + @Nullable @JsonProperty("physical_specifications") + PhysicalSpecifications physicalSpecifications, + @Nullable @JsonProperty("geographic_specifications") + GeographicSpecifications geographicSpecifications, + @Nullable Miscellaneous miscellaneous) {} diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/store/location/StoreLocationRoot.java b/src/main/java/com/graqr/threshr/model/redsky/stores/store/location/StoreLocationRoot.java new file mode 100644 index 0000000..2c8bf65 --- /dev/null +++ b/src/main/java/com/graqr/threshr/model/redsky/stores/store/location/StoreLocationRoot.java @@ -0,0 +1,5 @@ +package com.graqr.threshr.model.redsky.stores.store.location; + +import com.graqr.threshr.model.redsky.stores.Data; + +public record StoreLocationRoot(Data data) {} diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/store/location/storeData.java b/src/main/java/com/graqr/threshr/model/redsky/stores/store/location/storeData.java new file mode 100644 index 0000000..da1f1d5 --- /dev/null +++ b/src/main/java/com/graqr/threshr/model/redsky/stores/store/location/storeData.java @@ -0,0 +1,6 @@ +package com.graqr.threshr.model.redsky.stores.store.location; + +import com.graqr.threshr.model.redsky.stores.Store; + +public record storeData(Store store) {} + diff --git a/src/test/groovy/com/graqr/threshr/ThreshrClientSpec.groovy b/src/test/groovy/com/graqr/threshr/ThreshrClientSpec.groovy index c3e4a70..d4bca1b 100644 --- a/src/test/groovy/com/graqr/threshr/ThreshrClientSpec.groovy +++ b/src/test/groovy/com/graqr/threshr/ThreshrClientSpec.groovy @@ -16,7 +16,7 @@ class ThreshrClientSpec extends ThreshrSpec { void "no error requesting product summaries"() { when: - HttpResponse response = threshrClient.productSummaryWithFulfillment( + HttpResponse response = threshrClient.getProductSummary( targetStore, tcin) then: @@ -26,7 +26,7 @@ class ThreshrClientSpec extends ThreshrSpec { void "no error calling pdp client search"() { when: - HttpResponse response = threshrClient.productDetails( + HttpResponse response = threshrClient.getProductDetails( new TargetStorePdpSearch(targetStore), tcin.getTcins().split(",")[0]) @@ -37,7 +37,7 @@ class ThreshrClientSpec extends ThreshrSpec { void 'querying "#place.getPlace()" returns the "#expectedLocationName" store'() { when: - HttpResponse response = threshrClient.queryNearbyStores(5,100, place.getPlace()) + HttpResponse response = threshrClient.getNearbyStores(5,100, place.getPlace()) then: response.body().data().nearbyStores().stores() From 36f47eebfdd8152782184fe170f524508418013b Mon Sep 17 00:00:00 2001 From: jonathan zollinger Date: Tue, 13 Feb 2024 15:19:34 -0700 Subject: [PATCH 2/9] fix(client): remove non-null requirement with check add private checkForNull() method Signed-off-by: jonathan zollinger --- src/main/java/com/graqr/threshr/Threshr.java | 31 +++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/graqr/threshr/Threshr.java b/src/main/java/com/graqr/threshr/Threshr.java index a5238e6..1fdc7c3 100644 --- a/src/main/java/com/graqr/threshr/Threshr.java +++ b/src/main/java/com/graqr/threshr/Threshr.java @@ -8,12 +8,12 @@ import com.graqr.threshr.model.redsky.products.ProductSummary; import com.graqr.threshr.model.redsky.stores.NearbyStores; import io.micronaut.core.async.annotation.SingleResult; +import io.micronaut.http.HttpResponse; import io.micronaut.http.annotation.Controller; import io.micronaut.http.annotation.Get; import jakarta.inject.Inject; import java.util.List; -import java.util.Objects; @Controller() public class Threshr { @@ -23,8 +23,10 @@ public class Threshr { @Get("/product/summary-with-fulfillment") @SingleResult - public List fetchProductSummaries(TargetStore targetStore, Tcin tcin) { - return Objects.requireNonNull(threshrClient.getProductSummary(targetStore, tcin).body()).data().productSummary(); + public List fetchProductSummaries(TargetStore targetStore, Tcin tcin) throws ThreshrException { + return checkForNull(threshrClient.getProductSummary(targetStore, tcin)) + .data() + .productSummary(); } @Get("/product/summary-with-fulfillment") @@ -35,20 +37,33 @@ public List fetchProductSummaries(TargetStore targetStore, Strin @Get("/product/details") @SingleResult - public Product fetchProductDetails(TargetStore targetStore, String tcin) { - return Objects.requireNonNull(threshrClient.getProductDetails(new TargetStorePdpSearch(targetStore), tcin).body()).data().product(); + public Product fetchProductDetails(TargetStore targetStore, String tcin) throws ThreshrException { + return checkForNull(threshrClient.getProductDetails(new TargetStorePdpSearch(targetStore), tcin)) + .data() + .product(); } @Get("/stores/locations-query") @SingleResult - public NearbyStores queryStoreLocations(Place place) { + public NearbyStores queryStoreLocations(Place place) throws ThreshrException { return queryStoreLocations(5, 100, place); } @Get("/stores/locations-query") @SingleResult - public NearbyStores queryStoreLocations(int limit, int within, Place place) { - return Objects.requireNonNull(threshrClient.getNearbyStores(limit, within, place.getPlace()).body()).data().nearbyStores(); + public NearbyStores queryStoreLocations(int limit, int within, Place place) throws ThreshrException { + return checkForNull(threshrClient.getNearbyStores(limit, within, place.getPlace())) + .data() + .nearbyStores(); } + private T checkForNull(HttpResponse response) throws ThreshrException { + if (null == response.body()) { + throw new ThreshrException(String.format("response body of HttpResponse<%s> is null", response + .body() + .getClass() + .getName())); + } + return response.body(); + } } \ No newline at end of file From 3fef2a58628a99a3e43464e87325a8fdb72330bb Mon Sep 17 00:00:00 2001 From: jonathan zollinger Date: Tue, 13 Feb 2024 21:50:01 -0700 Subject: [PATCH 3/9] refactor(style): trim whitespace Signed-off-by: jonathan zollinger --- src/main/java/com/graqr/threshr/model/queryparam/Place.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/com/graqr/threshr/model/queryparam/Place.java b/src/main/java/com/graqr/threshr/model/queryparam/Place.java index 30bb9aa..a3f748b 100644 --- a/src/main/java/com/graqr/threshr/model/queryparam/Place.java +++ b/src/main/java/com/graqr/threshr/model/queryparam/Place.java @@ -7,14 +7,12 @@ @Data public class Place { private final String place; - public Place(String zipcode) { if (!String.valueOf(zipcode).matches("^\\d{5}(-|\\s*)?(\\d{4})?$")) { throw new IllegalArgumentException("Invalid zipcode provided, \"" + zipcode + "\". Zipcode provided " + "must match this regex: \"^\\d{5}(-|\\s*)?(\\d{4})?$\""); } place = zipcode; - } public Place(String city, String state) { From a12292d718123d859cd4bed3db78e0c7c9cc81cc Mon Sep 17 00:00:00 2001 From: jonathan zollinger Date: Wed, 14 Feb 2024 12:33:13 -0700 Subject: [PATCH 4/9] refactor(directories): rename from plural to single Signed-off-by: jonathan zollinger --- src/main/java/com/graqr/threshr/Threshr.java | 6 +++--- src/main/java/com/graqr/threshr/ThreshrClient.java | 9 ++++----- .../model/redsky/{products => product}/AddOn.java | 2 +- .../model/redsky/{products => product}/Author.java | 2 +- .../model/redsky/{products => product}/Category.java | 2 +- .../model/redsky/{products => product}/Compliance.java | 2 +- .../model/redsky/{products => product}/ContentLabel.java | 2 +- .../model/redsky/{products => product}/Disclaimer.java | 2 +- .../model/redsky/{products => product}/Distribution.java | 2 +- .../redsky/{products => product}/EligibilityRules.java | 2 +- .../model/redsky/{products => product}/Enrichment.java | 2 +- .../{products => product}/EnvironmentalSegmentation.java | 2 +- .../model/redsky/{products => product}/Facet.java | 2 +- .../model/redsky/{products => product}/FindsPost.java | 2 +- .../model/redsky/{products => product}/FindsStory.java | 2 +- .../model/redsky/{products => product}/Fulfillment.java | 2 +- .../model/redsky/{products => product}/Grocery.java | 2 +- .../model/redsky/{products => product}/Handling.java | 2 +- .../threshr/model/redsky/{products => product}/Hold.java | 2 +- .../model/redsky/{products => product}/Image.java | 2 +- .../model/redsky/{products => product}/Images.java | 2 +- .../model/redsky/{products => product}/InStoreOnly.java | 2 +- .../InventoryNotificationToGuestExcluded.java | 2 +- .../threshr/model/redsky/{products => product}/Item.java | 2 +- .../model/redsky/{products => product}/ItemType.java | 2 +- .../{products => product}/MerchandiseClassification.java | 2 +- .../model/redsky/{products => product}/Metadata.java | 2 +- .../model/redsky/{products => product}/MostRecent.java | 2 +- .../model/redsky/{products => product}/Nutrient.java | 2 +- .../redsky/{products => product}/NutritionFacts.java | 2 +- .../model/redsky/{products => product}/Options.java | 2 +- .../model/redsky/{products => product}/OrderPickup.java | 2 +- .../redsky/{products => product}/PackageDimensions.java | 2 +- .../model/redsky/{products => product}/Price.java | 2 +- .../model/redsky/{products => product}/PrimaryBrand.java | 2 +- .../model/redsky/{products => product}/Product.java | 2 +- .../{products => product}/ProductClassification.java | 2 +- .../redsky/{products => product}/ProductDescription.java | 2 +- .../redsky/{products => product}/ProductSummary.java | 2 +- .../redsky/{products => product}/ProductVendor.java | 2 +- .../model/redsky/{products => product}/Rating.java | 2 +- .../redsky/{products => product}/RatingsAndReviews.java | 2 +- .../redsky/{products => product}/RelatedCategory.java | 2 +- .../model/redsky/{products => product}/ReturnPolicy.java | 2 +- .../redsky/{products => product}/ScheduledDelivery.java | 2 +- .../model/redsky/{products => product}/Search.java | 2 +- .../redsky/{products => product}/SearchQueryArgs.java | 2 +- .../{products => product}/SearchRecommendations.java | 2 +- .../redsky/{products => product}/SearchResponse.java | 2 +- .../redsky/{products => product}/SecondaryAverage.java | 2 +- .../redsky/{products => product}/ShippingOptions.java | 2 +- .../model/redsky/{products => product}/SoftBullet.java | 2 +- .../model/redsky/{products => product}/SoftBullets.java | 2 +- .../model/redsky/{products => product}/Statistics.java | 2 +- .../model/redsky/{products => product}/Store.java | 2 +- .../model/redsky/{products => product}/StoreOption.java | 2 +- .../threshr/model/redsky/{products => product}/User.java | 2 +- .../redsky/{products => product}/ValuePreparedList.java | 2 +- .../model/redsky/{products => product}/Video.java | 2 +- .../model/redsky/{products => product}/VideoCaption.java | 2 +- .../model/redsky/{products => product}/VideoFile.java | 2 +- .../threshr/model/redsky/product/pdp/client/Data.java | 8 ++++++++ .../{products => product}/pdp/client/PdpClientRoot.java | 2 +- .../threshr/model/redsky/product/plp/search/Data.java | 8 ++++++++ .../{products => product}/plp/search/plpSearchRoot.java | 2 +- .../model/redsky/{products => product}/summary/Data.java | 4 ++-- .../summary/ProductSummaryRoot.java | 2 +- .../threshr/model/redsky/products/pdp/client/Data.java | 8 -------- .../threshr/model/redsky/products/plp/search/Data.java | 8 -------- .../model/redsky/{stores => store}/Capability.java | 2 +- .../model/redsky/{stores => store}/CapabilityHour.java | 2 +- .../redsky/{stores => store}/ContactInformation.java | 2 +- .../threshr/model/redsky/{stores => store}/Data.java | 2 +- .../threshr/model/redsky/{stores => store}/Day.java | 2 +- .../threshr/model/redsky/{stores => store}/DriveUp.java | 2 +- .../threshr/model/redsky/{stores => store}/Geofence.java | 2 +- .../{stores => store}/GeographicSpecifications.java | 2 +- .../threshr/model/redsky/{stores => store}/Hour.java | 2 +- .../model/redsky/{stores => store}/MailingAddress.java | 2 +- .../model/redsky/{stores => store}/MainHours.java | 3 +-- .../model/redsky/{stores => store}/Miscellaneous.java | 2 +- .../model/redsky/{stores => store}/NearbyStores.java | 4 +--- .../model/redsky/{stores => store}/NearbyStoresRoot.java | 2 +- .../redsky/{stores => store}/PhysicalSpecifications.java | 2 +- .../redsky/{stores => store}/RollingOperatingHours.java | 2 +- .../threshr/model/redsky/{stores => store}/Store.java | 2 +- .../model/redsky/store/location/StoreLocationRoot.java | 5 +++++ .../redsky/stores/store/location/StoreLocationRoot.java | 5 ----- .../model/redsky/stores/store/location/storeData.java | 6 ------ .../groovy/com/graqr/threshr/ThreshrClientSpec.groovy | 6 +++--- src/test/groovy/com/graqr/threshr/ThreshrSpec.groovy | 6 +++--- 91 files changed, 115 insertions(+), 125 deletions(-) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/AddOn.java (80%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/Author.java (82%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/Category.java (83%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/Compliance.java (87%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/ContentLabel.java (80%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/Disclaimer.java (74%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/Distribution.java (80%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/EligibilityRules.java (90%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/Enrichment.java (89%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/EnvironmentalSegmentation.java (83%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/Facet.java (86%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/FindsPost.java (88%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/FindsStory.java (91%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/Fulfillment.java (94%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/Grocery.java (79%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/Handling.java (82%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/Hold.java (78%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/Image.java (86%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/Images.java (93%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/InStoreOnly.java (82%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/InventoryNotificationToGuestExcluded.java (82%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/Item.java (97%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/ItemType.java (72%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/MerchandiseClassification.java (87%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/Metadata.java (93%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/MostRecent.java (80%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/Nutrient.java (87%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/NutritionFacts.java (88%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/Options.java (90%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/OrderPickup.java (91%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/PackageDimensions.java (88%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/Price.java (94%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/PrimaryBrand.java (85%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/Product.java (92%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/ProductClassification.java (90%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/ProductDescription.java (90%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/ProductSummary.java (87%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/ProductVendor.java (82%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/Rating.java (91%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/RatingsAndReviews.java (87%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/RelatedCategory.java (73%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/ReturnPolicy.java (82%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/ScheduledDelivery.java (88%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/Search.java (86%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/SearchQueryArgs.java (94%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/SearchRecommendations.java (86%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/SearchResponse.java (87%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/SecondaryAverage.java (76%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/ShippingOptions.java (88%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/SoftBullet.java (74%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/SoftBullets.java (75%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/Statistics.java (90%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/Store.java (81%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/StoreOption.java (92%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/User.java (87%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/ValuePreparedList.java (90%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/Video.java (92%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/VideoCaption.java (82%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/VideoFile.java (86%) create mode 100644 src/main/java/com/graqr/threshr/model/redsky/product/pdp/client/Data.java rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/pdp/client/PdpClientRoot.java (63%) create mode 100644 src/main/java/com/graqr/threshr/model/redsky/product/plp/search/Data.java rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/plp/search/plpSearchRoot.java (63%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/summary/Data.java (66%) rename src/main/java/com/graqr/threshr/model/redsky/{products => product}/summary/ProductSummaryRoot.java (65%) delete mode 100644 src/main/java/com/graqr/threshr/model/redsky/products/pdp/client/Data.java delete mode 100644 src/main/java/com/graqr/threshr/model/redsky/products/plp/search/Data.java rename src/main/java/com/graqr/threshr/model/redsky/{stores => store}/Capability.java (86%) rename src/main/java/com/graqr/threshr/model/redsky/{stores => store}/CapabilityHour.java (81%) rename src/main/java/com/graqr/threshr/model/redsky/{stores => store}/ContactInformation.java (91%) rename src/main/java/com/graqr/threshr/model/redsky/{stores => store}/Data.java (80%) rename src/main/java/com/graqr/threshr/model/redsky/{stores => store}/Day.java (90%) rename src/main/java/com/graqr/threshr/model/redsky/{stores => store}/DriveUp.java (61%) rename src/main/java/com/graqr/threshr/model/redsky/{stores => store}/Geofence.java (61%) rename src/main/java/com/graqr/threshr/model/redsky/{stores => store}/GeographicSpecifications.java (92%) rename src/main/java/com/graqr/threshr/model/redsky/{stores => store}/Hour.java (89%) rename src/main/java/com/graqr/threshr/model/redsky/{stores => store}/MailingAddress.java (91%) rename src/main/java/com/graqr/threshr/model/redsky/{stores => store}/MainHours.java (65%) rename src/main/java/com/graqr/threshr/model/redsky/{stores => store}/Miscellaneous.java (73%) rename src/main/java/com/graqr/threshr/model/redsky/{stores => store}/NearbyStores.java (59%) rename src/main/java/com/graqr/threshr/model/redsky/{stores => store}/NearbyStoresRoot.java (69%) rename src/main/java/com/graqr/threshr/model/redsky/{stores => store}/PhysicalSpecifications.java (86%) rename src/main/java/com/graqr/threshr/model/redsky/{stores => store}/RollingOperatingHours.java (89%) rename src/main/java/com/graqr/threshr/model/redsky/{stores => store}/Store.java (96%) create mode 100644 src/main/java/com/graqr/threshr/model/redsky/store/location/StoreLocationRoot.java delete mode 100644 src/main/java/com/graqr/threshr/model/redsky/stores/store/location/StoreLocationRoot.java delete mode 100644 src/main/java/com/graqr/threshr/model/redsky/stores/store/location/storeData.java diff --git a/src/main/java/com/graqr/threshr/Threshr.java b/src/main/java/com/graqr/threshr/Threshr.java index 1fdc7c3..174dfd8 100644 --- a/src/main/java/com/graqr/threshr/Threshr.java +++ b/src/main/java/com/graqr/threshr/Threshr.java @@ -4,9 +4,9 @@ import com.graqr.threshr.model.queryparam.TargetStore; import com.graqr.threshr.model.queryparam.TargetStorePdpSearch; import com.graqr.threshr.model.queryparam.Tcin; -import com.graqr.threshr.model.redsky.products.Product; -import com.graqr.threshr.model.redsky.products.ProductSummary; -import com.graqr.threshr.model.redsky.stores.NearbyStores; +import com.graqr.threshr.model.redsky.product.Product; +import com.graqr.threshr.model.redsky.product.ProductSummary; +import com.graqr.threshr.model.redsky.store.NearbyStores; import io.micronaut.core.async.annotation.SingleResult; import io.micronaut.http.HttpResponse; import io.micronaut.http.annotation.Controller; diff --git a/src/main/java/com/graqr/threshr/ThreshrClient.java b/src/main/java/com/graqr/threshr/ThreshrClient.java index 92ba8d1..2d29035 100644 --- a/src/main/java/com/graqr/threshr/ThreshrClient.java +++ b/src/main/java/com/graqr/threshr/ThreshrClient.java @@ -3,10 +3,9 @@ import com.graqr.threshr.model.queryparam.TargetStore; import com.graqr.threshr.model.queryparam.TargetStorePdpSearch; import com.graqr.threshr.model.queryparam.Tcin; -import com.graqr.threshr.model.redsky.products.pdp.client.PdpClientRoot; -import com.graqr.threshr.model.redsky.products.summary.ProductSummaryRoot; -import com.graqr.threshr.model.redsky.stores.NearbyStoresRoot; -import com.graqr.threshr.model.redsky.stores.store.location.StoreLocationRoot; +import com.graqr.threshr.model.redsky.product.pdp.client.PdpClientRoot; +import com.graqr.threshr.model.redsky.product.summary.ProductSummaryRoot; +import com.graqr.threshr.model.redsky.store.NearbyStoresRoot; import io.micronaut.http.HttpResponse; import io.micronaut.http.annotation.Get; import io.micronaut.http.annotation.Header; @@ -97,6 +96,6 @@ HttpResponse getProductDetails( @Get("store_location_v1" + "?key=${threshr.key}" + "{&storeId}") - HttpResponse getStoreInformation(String storeId); + HttpResponse getStoreInformation(String storeId); } \ No newline at end of file diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/AddOn.java b/src/main/java/com/graqr/threshr/model/redsky/product/AddOn.java similarity index 80% rename from src/main/java/com/graqr/threshr/model/redsky/products/AddOn.java rename to src/main/java/com/graqr/threshr/model/redsky/product/AddOn.java index 4bfd831..4669235 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/AddOn.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/AddOn.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/Author.java b/src/main/java/com/graqr/threshr/model/redsky/product/Author.java similarity index 82% rename from src/main/java/com/graqr/threshr/model/redsky/products/Author.java rename to src/main/java/com/graqr/threshr/model/redsky/product/Author.java index 3c6aa6a..7e1daa8 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/Author.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/Author.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/Category.java b/src/main/java/com/graqr/threshr/model/redsky/product/Category.java similarity index 83% rename from src/main/java/com/graqr/threshr/model/redsky/products/Category.java rename to src/main/java/com/graqr/threshr/model/redsky/product/Category.java index d03c4c3..bb257db 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/Category.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/Category.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/Compliance.java b/src/main/java/com/graqr/threshr/model/redsky/product/Compliance.java similarity index 87% rename from src/main/java/com/graqr/threshr/model/redsky/products/Compliance.java rename to src/main/java/com/graqr/threshr/model/redsky/product/Compliance.java index 6a6a295..2ffd21c 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/Compliance.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/Compliance.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/ContentLabel.java b/src/main/java/com/graqr/threshr/model/redsky/product/ContentLabel.java similarity index 80% rename from src/main/java/com/graqr/threshr/model/redsky/products/ContentLabel.java rename to src/main/java/com/graqr/threshr/model/redsky/product/ContentLabel.java index 09afcf2..c8b1ed1 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/ContentLabel.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/ContentLabel.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/Disclaimer.java b/src/main/java/com/graqr/threshr/model/redsky/product/Disclaimer.java similarity index 74% rename from src/main/java/com/graqr/threshr/model/redsky/products/Disclaimer.java rename to src/main/java/com/graqr/threshr/model/redsky/product/Disclaimer.java index 451754f..1e75459 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/Disclaimer.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/Disclaimer.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/Distribution.java b/src/main/java/com/graqr/threshr/model/redsky/product/Distribution.java similarity index 80% rename from src/main/java/com/graqr/threshr/model/redsky/products/Distribution.java rename to src/main/java/com/graqr/threshr/model/redsky/product/Distribution.java index 81ba7f6..116feee 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/Distribution.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/Distribution.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/EligibilityRules.java b/src/main/java/com/graqr/threshr/model/redsky/product/EligibilityRules.java similarity index 90% rename from src/main/java/com/graqr/threshr/model/redsky/products/EligibilityRules.java rename to src/main/java/com/graqr/threshr/model/redsky/product/EligibilityRules.java index ddd4e01..7914039 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/EligibilityRules.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/EligibilityRules.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/Enrichment.java b/src/main/java/com/graqr/threshr/model/redsky/product/Enrichment.java similarity index 89% rename from src/main/java/com/graqr/threshr/model/redsky/products/Enrichment.java rename to src/main/java/com/graqr/threshr/model/redsky/product/Enrichment.java index 48e0550..f76b8ed 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/Enrichment.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/Enrichment.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/EnvironmentalSegmentation.java b/src/main/java/com/graqr/threshr/model/redsky/product/EnvironmentalSegmentation.java similarity index 83% rename from src/main/java/com/graqr/threshr/model/redsky/products/EnvironmentalSegmentation.java rename to src/main/java/com/graqr/threshr/model/redsky/product/EnvironmentalSegmentation.java index bf82f09..4442031 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/EnvironmentalSegmentation.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/EnvironmentalSegmentation.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/Facet.java b/src/main/java/com/graqr/threshr/model/redsky/product/Facet.java similarity index 86% rename from src/main/java/com/graqr/threshr/model/redsky/products/Facet.java rename to src/main/java/com/graqr/threshr/model/redsky/product/Facet.java index c2bc7a0..9c74b08 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/Facet.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/Facet.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/FindsPost.java b/src/main/java/com/graqr/threshr/model/redsky/product/FindsPost.java similarity index 88% rename from src/main/java/com/graqr/threshr/model/redsky/products/FindsPost.java rename to src/main/java/com/graqr/threshr/model/redsky/product/FindsPost.java index 8f0308d..52553b4 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/FindsPost.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/FindsPost.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/FindsStory.java b/src/main/java/com/graqr/threshr/model/redsky/product/FindsStory.java similarity index 91% rename from src/main/java/com/graqr/threshr/model/redsky/products/FindsStory.java rename to src/main/java/com/graqr/threshr/model/redsky/product/FindsStory.java index a639f5d..b13600e 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/FindsStory.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/FindsStory.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/Fulfillment.java b/src/main/java/com/graqr/threshr/model/redsky/product/Fulfillment.java similarity index 94% rename from src/main/java/com/graqr/threshr/model/redsky/products/Fulfillment.java rename to src/main/java/com/graqr/threshr/model/redsky/product/Fulfillment.java index 064e870..30dc688 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/Fulfillment.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/Fulfillment.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.core.annotation.Nullable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/Grocery.java b/src/main/java/com/graqr/threshr/model/redsky/product/Grocery.java similarity index 79% rename from src/main/java/com/graqr/threshr/model/redsky/products/Grocery.java rename to src/main/java/com/graqr/threshr/model/redsky/product/Grocery.java index 990a58c..e821e51 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/Grocery.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/Grocery.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/Handling.java b/src/main/java/com/graqr/threshr/model/redsky/product/Handling.java similarity index 82% rename from src/main/java/com/graqr/threshr/model/redsky/products/Handling.java rename to src/main/java/com/graqr/threshr/model/redsky/product/Handling.java index 03e6613..7307cd4 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/Handling.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/Handling.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/Hold.java b/src/main/java/com/graqr/threshr/model/redsky/product/Hold.java similarity index 78% rename from src/main/java/com/graqr/threshr/model/redsky/products/Hold.java rename to src/main/java/com/graqr/threshr/model/redsky/product/Hold.java index 53ccb07..17ef35a 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/Hold.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/Hold.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/Image.java b/src/main/java/com/graqr/threshr/model/redsky/product/Image.java similarity index 86% rename from src/main/java/com/graqr/threshr/model/redsky/products/Image.java rename to src/main/java/com/graqr/threshr/model/redsky/product/Image.java index df75639..ce0f88d 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/Image.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/Image.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/Images.java b/src/main/java/com/graqr/threshr/model/redsky/product/Images.java similarity index 93% rename from src/main/java/com/graqr/threshr/model/redsky/products/Images.java rename to src/main/java/com/graqr/threshr/model/redsky/product/Images.java index b89c261..b52d32f 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/Images.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/Images.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.core.annotation.Nullable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/InStoreOnly.java b/src/main/java/com/graqr/threshr/model/redsky/product/InStoreOnly.java similarity index 82% rename from src/main/java/com/graqr/threshr/model/redsky/products/InStoreOnly.java rename to src/main/java/com/graqr/threshr/model/redsky/product/InStoreOnly.java index fb01fed..34d9936 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/InStoreOnly.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/InStoreOnly.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/InventoryNotificationToGuestExcluded.java b/src/main/java/com/graqr/threshr/model/redsky/product/InventoryNotificationToGuestExcluded.java similarity index 82% rename from src/main/java/com/graqr/threshr/model/redsky/products/InventoryNotificationToGuestExcluded.java rename to src/main/java/com/graqr/threshr/model/redsky/product/InventoryNotificationToGuestExcluded.java index 587e77c..658f5a5 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/InventoryNotificationToGuestExcluded.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/InventoryNotificationToGuestExcluded.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/Item.java b/src/main/java/com/graqr/threshr/model/redsky/product/Item.java similarity index 97% rename from src/main/java/com/graqr/threshr/model/redsky/products/Item.java rename to src/main/java/com/graqr/threshr/model/redsky/product/Item.java index f36f7dc..c4422a3 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/Item.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/Item.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.core.annotation.Nullable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/ItemType.java b/src/main/java/com/graqr/threshr/model/redsky/product/ItemType.java similarity index 72% rename from src/main/java/com/graqr/threshr/model/redsky/products/ItemType.java rename to src/main/java/com/graqr/threshr/model/redsky/product/ItemType.java index 1789e65..1fca48a 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/ItemType.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/ItemType.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/MerchandiseClassification.java b/src/main/java/com/graqr/threshr/model/redsky/product/MerchandiseClassification.java similarity index 87% rename from src/main/java/com/graqr/threshr/model/redsky/products/MerchandiseClassification.java rename to src/main/java/com/graqr/threshr/model/redsky/product/MerchandiseClassification.java index 591c2b5..2638579 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/MerchandiseClassification.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/MerchandiseClassification.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/Metadata.java b/src/main/java/com/graqr/threshr/model/redsky/product/Metadata.java similarity index 93% rename from src/main/java/com/graqr/threshr/model/redsky/products/Metadata.java rename to src/main/java/com/graqr/threshr/model/redsky/product/Metadata.java index 6dea575..de4b63e 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/Metadata.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/Metadata.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.core.annotation.Nullable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/MostRecent.java b/src/main/java/com/graqr/threshr/model/redsky/product/MostRecent.java similarity index 80% rename from src/main/java/com/graqr/threshr/model/redsky/products/MostRecent.java rename to src/main/java/com/graqr/threshr/model/redsky/product/MostRecent.java index 85e2ea7..c78994b 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/MostRecent.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/MostRecent.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/Nutrient.java b/src/main/java/com/graqr/threshr/model/redsky/product/Nutrient.java similarity index 87% rename from src/main/java/com/graqr/threshr/model/redsky/products/Nutrient.java rename to src/main/java/com/graqr/threshr/model/redsky/product/Nutrient.java index b642606..1081bc5 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/Nutrient.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/Nutrient.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/NutritionFacts.java b/src/main/java/com/graqr/threshr/model/redsky/product/NutritionFacts.java similarity index 88% rename from src/main/java/com/graqr/threshr/model/redsky/products/NutritionFacts.java rename to src/main/java/com/graqr/threshr/model/redsky/product/NutritionFacts.java index 83503af..c72358d 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/NutritionFacts.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/NutritionFacts.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/Options.java b/src/main/java/com/graqr/threshr/model/redsky/product/Options.java similarity index 90% rename from src/main/java/com/graqr/threshr/model/redsky/products/Options.java rename to src/main/java/com/graqr/threshr/model/redsky/product/Options.java index 332427a..67330dc 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/Options.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/Options.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.core.annotation.Nullable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/OrderPickup.java b/src/main/java/com/graqr/threshr/model/redsky/product/OrderPickup.java similarity index 91% rename from src/main/java/com/graqr/threshr/model/redsky/products/OrderPickup.java rename to src/main/java/com/graqr/threshr/model/redsky/product/OrderPickup.java index e0a1e04..1855c28 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/OrderPickup.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/OrderPickup.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.core.annotation.Nullable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/PackageDimensions.java b/src/main/java/com/graqr/threshr/model/redsky/product/PackageDimensions.java similarity index 88% rename from src/main/java/com/graqr/threshr/model/redsky/products/PackageDimensions.java rename to src/main/java/com/graqr/threshr/model/redsky/product/PackageDimensions.java index e2bcc85..a24b304 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/PackageDimensions.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/PackageDimensions.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/Price.java b/src/main/java/com/graqr/threshr/model/redsky/product/Price.java similarity index 94% rename from src/main/java/com/graqr/threshr/model/redsky/products/Price.java rename to src/main/java/com/graqr/threshr/model/redsky/product/Price.java index 3384d3a..e2a1a55 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/Price.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/Price.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/PrimaryBrand.java b/src/main/java/com/graqr/threshr/model/redsky/product/PrimaryBrand.java similarity index 85% rename from src/main/java/com/graqr/threshr/model/redsky/products/PrimaryBrand.java rename to src/main/java/com/graqr/threshr/model/redsky/product/PrimaryBrand.java index 263944b..f33c779 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/PrimaryBrand.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/PrimaryBrand.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/Product.java b/src/main/java/com/graqr/threshr/model/redsky/product/Product.java similarity index 92% rename from src/main/java/com/graqr/threshr/model/redsky/products/Product.java rename to src/main/java/com/graqr/threshr/model/redsky/product/Product.java index 1ea1b9b..c2bcfc6 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/Product.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/Product.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/ProductClassification.java b/src/main/java/com/graqr/threshr/model/redsky/product/ProductClassification.java similarity index 90% rename from src/main/java/com/graqr/threshr/model/redsky/products/ProductClassification.java rename to src/main/java/com/graqr/threshr/model/redsky/product/ProductClassification.java index 0502488..b200e05 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/ProductClassification.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/ProductClassification.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.core.annotation.Nullable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/ProductDescription.java b/src/main/java/com/graqr/threshr/model/redsky/product/ProductDescription.java similarity index 90% rename from src/main/java/com/graqr/threshr/model/redsky/products/ProductDescription.java rename to src/main/java/com/graqr/threshr/model/redsky/product/ProductDescription.java index 1dacd42..c145c90 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/ProductDescription.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/ProductDescription.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/ProductSummary.java b/src/main/java/com/graqr/threshr/model/redsky/product/ProductSummary.java similarity index 87% rename from src/main/java/com/graqr/threshr/model/redsky/products/ProductSummary.java rename to src/main/java/com/graqr/threshr/model/redsky/product/ProductSummary.java index 731655b..259a5b2 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/ProductSummary.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/ProductSummary.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.core.annotation.Nullable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/ProductVendor.java b/src/main/java/com/graqr/threshr/model/redsky/product/ProductVendor.java similarity index 82% rename from src/main/java/com/graqr/threshr/model/redsky/products/ProductVendor.java rename to src/main/java/com/graqr/threshr/model/redsky/product/ProductVendor.java index 0290999..5ea86f3 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/ProductVendor.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/ProductVendor.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/Rating.java b/src/main/java/com/graqr/threshr/model/redsky/product/Rating.java similarity index 91% rename from src/main/java/com/graqr/threshr/model/redsky/products/Rating.java rename to src/main/java/com/graqr/threshr/model/redsky/product/Rating.java index 7aa6a70..68a2148 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/Rating.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/Rating.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.core.annotation.Nullable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/RatingsAndReviews.java b/src/main/java/com/graqr/threshr/model/redsky/product/RatingsAndReviews.java similarity index 87% rename from src/main/java/com/graqr/threshr/model/redsky/products/RatingsAndReviews.java rename to src/main/java/com/graqr/threshr/model/redsky/product/RatingsAndReviews.java index ae78c95..f68a2b7 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/RatingsAndReviews.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/RatingsAndReviews.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/RelatedCategory.java b/src/main/java/com/graqr/threshr/model/redsky/product/RelatedCategory.java similarity index 73% rename from src/main/java/com/graqr/threshr/model/redsky/products/RelatedCategory.java rename to src/main/java/com/graqr/threshr/model/redsky/product/RelatedCategory.java index 9c951f0..e9fc4eb 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/RelatedCategory.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/RelatedCategory.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/ReturnPolicy.java b/src/main/java/com/graqr/threshr/model/redsky/product/ReturnPolicy.java similarity index 82% rename from src/main/java/com/graqr/threshr/model/redsky/products/ReturnPolicy.java rename to src/main/java/com/graqr/threshr/model/redsky/product/ReturnPolicy.java index 6bf3e91..6c62316 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/ReturnPolicy.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/ReturnPolicy.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/ScheduledDelivery.java b/src/main/java/com/graqr/threshr/model/redsky/product/ScheduledDelivery.java similarity index 88% rename from src/main/java/com/graqr/threshr/model/redsky/products/ScheduledDelivery.java rename to src/main/java/com/graqr/threshr/model/redsky/product/ScheduledDelivery.java index 2733359..4e20adc 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/ScheduledDelivery.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/ScheduledDelivery.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.core.annotation.Nullable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/Search.java b/src/main/java/com/graqr/threshr/model/redsky/product/Search.java similarity index 86% rename from src/main/java/com/graqr/threshr/model/redsky/products/Search.java rename to src/main/java/com/graqr/threshr/model/redsky/product/Search.java index 8353943..0b7b45f 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/Search.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/Search.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/SearchQueryArgs.java b/src/main/java/com/graqr/threshr/model/redsky/product/SearchQueryArgs.java similarity index 94% rename from src/main/java/com/graqr/threshr/model/redsky/products/SearchQueryArgs.java rename to src/main/java/com/graqr/threshr/model/redsky/product/SearchQueryArgs.java index 4e678b5..431001d 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/SearchQueryArgs.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/SearchQueryArgs.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import io.micronaut.core.annotation.Introspected; import io.micronaut.core.annotation.Nullable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/SearchRecommendations.java b/src/main/java/com/graqr/threshr/model/redsky/product/SearchRecommendations.java similarity index 86% rename from src/main/java/com/graqr/threshr/model/redsky/products/SearchRecommendations.java rename to src/main/java/com/graqr/threshr/model/redsky/product/SearchRecommendations.java index 737308b..439c53a 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/SearchRecommendations.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/SearchRecommendations.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/SearchResponse.java b/src/main/java/com/graqr/threshr/model/redsky/product/SearchResponse.java similarity index 87% rename from src/main/java/com/graqr/threshr/model/redsky/products/SearchResponse.java rename to src/main/java/com/graqr/threshr/model/redsky/product/SearchResponse.java index 22a0c7e..c39ed48 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/SearchResponse.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/SearchResponse.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/SecondaryAverage.java b/src/main/java/com/graqr/threshr/model/redsky/product/SecondaryAverage.java similarity index 76% rename from src/main/java/com/graqr/threshr/model/redsky/products/SecondaryAverage.java rename to src/main/java/com/graqr/threshr/model/redsky/product/SecondaryAverage.java index 0a0ebd6..65689af 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/SecondaryAverage.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/SecondaryAverage.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/ShippingOptions.java b/src/main/java/com/graqr/threshr/model/redsky/product/ShippingOptions.java similarity index 88% rename from src/main/java/com/graqr/threshr/model/redsky/products/ShippingOptions.java rename to src/main/java/com/graqr/threshr/model/redsky/product/ShippingOptions.java index edc74ce..fa979ca 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/ShippingOptions.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/ShippingOptions.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/SoftBullet.java b/src/main/java/com/graqr/threshr/model/redsky/product/SoftBullet.java similarity index 74% rename from src/main/java/com/graqr/threshr/model/redsky/products/SoftBullet.java rename to src/main/java/com/graqr/threshr/model/redsky/product/SoftBullet.java index 723ba7a..eba5551 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/SoftBullet.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/SoftBullet.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/SoftBullets.java b/src/main/java/com/graqr/threshr/model/redsky/product/SoftBullets.java similarity index 75% rename from src/main/java/com/graqr/threshr/model/redsky/products/SoftBullets.java rename to src/main/java/com/graqr/threshr/model/redsky/product/SoftBullets.java index 5f2af36..dc31349 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/SoftBullets.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/SoftBullets.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/Statistics.java b/src/main/java/com/graqr/threshr/model/redsky/product/Statistics.java similarity index 90% rename from src/main/java/com/graqr/threshr/model/redsky/products/Statistics.java rename to src/main/java/com/graqr/threshr/model/redsky/product/Statistics.java index 757111f..075e8a3 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/Statistics.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/Statistics.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/Store.java b/src/main/java/com/graqr/threshr/model/redsky/product/Store.java similarity index 81% rename from src/main/java/com/graqr/threshr/model/redsky/products/Store.java rename to src/main/java/com/graqr/threshr/model/redsky/product/Store.java index 807f636..ee2d9b7 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/Store.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/Store.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/StoreOption.java b/src/main/java/com/graqr/threshr/model/redsky/product/StoreOption.java similarity index 92% rename from src/main/java/com/graqr/threshr/model/redsky/products/StoreOption.java rename to src/main/java/com/graqr/threshr/model/redsky/product/StoreOption.java index 83db6e3..92b9280 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/StoreOption.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/StoreOption.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/User.java b/src/main/java/com/graqr/threshr/model/redsky/product/User.java similarity index 87% rename from src/main/java/com/graqr/threshr/model/redsky/products/User.java rename to src/main/java/com/graqr/threshr/model/redsky/product/User.java index daa5eb1..d5c600a 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/User.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/User.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/ValuePreparedList.java b/src/main/java/com/graqr/threshr/model/redsky/product/ValuePreparedList.java similarity index 90% rename from src/main/java/com/graqr/threshr/model/redsky/products/ValuePreparedList.java rename to src/main/java/com/graqr/threshr/model/redsky/product/ValuePreparedList.java index ec4c892..5c80471 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/ValuePreparedList.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/ValuePreparedList.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/Video.java b/src/main/java/com/graqr/threshr/model/redsky/product/Video.java similarity index 92% rename from src/main/java/com/graqr/threshr/model/redsky/products/Video.java rename to src/main/java/com/graqr/threshr/model/redsky/product/Video.java index 0c23958..8013b65 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/Video.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/Video.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/VideoCaption.java b/src/main/java/com/graqr/threshr/model/redsky/product/VideoCaption.java similarity index 82% rename from src/main/java/com/graqr/threshr/model/redsky/products/VideoCaption.java rename to src/main/java/com/graqr/threshr/model/redsky/product/VideoCaption.java index 19aed43..b4d5f38 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/VideoCaption.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/VideoCaption.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/VideoFile.java b/src/main/java/com/graqr/threshr/model/redsky/product/VideoFile.java similarity index 86% rename from src/main/java/com/graqr/threshr/model/redsky/products/VideoFile.java rename to src/main/java/com/graqr/threshr/model/redsky/product/VideoFile.java index 0f857b5..fb8323b 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/VideoFile.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/VideoFile.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products; +package com.graqr.threshr.model.redsky.product; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/product/pdp/client/Data.java b/src/main/java/com/graqr/threshr/model/redsky/product/pdp/client/Data.java new file mode 100644 index 0000000..b0778ae --- /dev/null +++ b/src/main/java/com/graqr/threshr/model/redsky/product/pdp/client/Data.java @@ -0,0 +1,8 @@ +package com.graqr.threshr.model.redsky.product.pdp.client; + +import com.graqr.threshr.model.redsky.product.Product; +import io.micronaut.serde.annotation.Serdeable; + +@Serdeable +public record Data(Product product) { +} diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/pdp/client/PdpClientRoot.java b/src/main/java/com/graqr/threshr/model/redsky/product/pdp/client/PdpClientRoot.java similarity index 63% rename from src/main/java/com/graqr/threshr/model/redsky/products/pdp/client/PdpClientRoot.java rename to src/main/java/com/graqr/threshr/model/redsky/product/pdp/client/PdpClientRoot.java index 2a3f2da..11fdfed 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/pdp/client/PdpClientRoot.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/pdp/client/PdpClientRoot.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products.pdp.client; +package com.graqr.threshr.model.redsky.product.pdp.client; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/product/plp/search/Data.java b/src/main/java/com/graqr/threshr/model/redsky/product/plp/search/Data.java new file mode 100644 index 0000000..2d41fae --- /dev/null +++ b/src/main/java/com/graqr/threshr/model/redsky/product/plp/search/Data.java @@ -0,0 +1,8 @@ +package com.graqr.threshr.model.redsky.product.plp.search; + +import com.graqr.threshr.model.redsky.product.Search; +import io.micronaut.serde.annotation.Serdeable; + +@Serdeable +public record Data(Search search) { +} diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/plp/search/plpSearchRoot.java b/src/main/java/com/graqr/threshr/model/redsky/product/plp/search/plpSearchRoot.java similarity index 63% rename from src/main/java/com/graqr/threshr/model/redsky/products/plp/search/plpSearchRoot.java rename to src/main/java/com/graqr/threshr/model/redsky/product/plp/search/plpSearchRoot.java index ef55211..1951746 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/plp/search/plpSearchRoot.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/plp/search/plpSearchRoot.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products.plp.search; +package com.graqr.threshr.model.redsky.product.plp.search; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/summary/Data.java b/src/main/java/com/graqr/threshr/model/redsky/product/summary/Data.java similarity index 66% rename from src/main/java/com/graqr/threshr/model/redsky/products/summary/Data.java rename to src/main/java/com/graqr/threshr/model/redsky/product/summary/Data.java index fd0f7b2..a472129 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/summary/Data.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/summary/Data.java @@ -1,7 +1,7 @@ -package com.graqr.threshr.model.redsky.products.summary; +package com.graqr.threshr.model.redsky.product.summary; import com.fasterxml.jackson.annotation.JsonProperty; -import com.graqr.threshr.model.redsky.products.ProductSummary; +import com.graqr.threshr.model.redsky.product.ProductSummary; import io.micronaut.serde.annotation.Serdeable; import java.util.List; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/summary/ProductSummaryRoot.java b/src/main/java/com/graqr/threshr/model/redsky/product/summary/ProductSummaryRoot.java similarity index 65% rename from src/main/java/com/graqr/threshr/model/redsky/products/summary/ProductSummaryRoot.java rename to src/main/java/com/graqr/threshr/model/redsky/product/summary/ProductSummaryRoot.java index 65a4d41..d602848 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/products/summary/ProductSummaryRoot.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/summary/ProductSummaryRoot.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.products.summary; +package com.graqr.threshr.model.redsky.product.summary; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/pdp/client/Data.java b/src/main/java/com/graqr/threshr/model/redsky/products/pdp/client/Data.java deleted file mode 100644 index 94284e5..0000000 --- a/src/main/java/com/graqr/threshr/model/redsky/products/pdp/client/Data.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.graqr.threshr.model.redsky.products.pdp.client; - -import com.graqr.threshr.model.redsky.products.Product; -import io.micronaut.serde.annotation.Serdeable; - -@Serdeable -public record Data(Product product) { -} diff --git a/src/main/java/com/graqr/threshr/model/redsky/products/plp/search/Data.java b/src/main/java/com/graqr/threshr/model/redsky/products/plp/search/Data.java deleted file mode 100644 index 7d24883..0000000 --- a/src/main/java/com/graqr/threshr/model/redsky/products/plp/search/Data.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.graqr.threshr.model.redsky.products.plp.search; - -import com.graqr.threshr.model.redsky.products.Search; -import io.micronaut.serde.annotation.Serdeable; - -@Serdeable -public record Data(Search search) { -} diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/Capability.java b/src/main/java/com/graqr/threshr/model/redsky/store/Capability.java similarity index 86% rename from src/main/java/com/graqr/threshr/model/redsky/stores/Capability.java rename to src/main/java/com/graqr/threshr/model/redsky/store/Capability.java index b0a4e87..3ad0b63 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/stores/Capability.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/Capability.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.stores; +package com.graqr.threshr.model.redsky.store; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/CapabilityHour.java b/src/main/java/com/graqr/threshr/model/redsky/store/CapabilityHour.java similarity index 81% rename from src/main/java/com/graqr/threshr/model/redsky/stores/CapabilityHour.java rename to src/main/java/com/graqr/threshr/model/redsky/store/CapabilityHour.java index 668abdc..710e37d 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/stores/CapabilityHour.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/CapabilityHour.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.stores; +package com.graqr.threshr.model.redsky.store; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/ContactInformation.java b/src/main/java/com/graqr/threshr/model/redsky/store/ContactInformation.java similarity index 91% rename from src/main/java/com/graqr/threshr/model/redsky/stores/ContactInformation.java rename to src/main/java/com/graqr/threshr/model/redsky/store/ContactInformation.java index a91a3d5..3617702 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/stores/ContactInformation.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/ContactInformation.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.stores; +package com.graqr.threshr.model.redsky.store; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/Data.java b/src/main/java/com/graqr/threshr/model/redsky/store/Data.java similarity index 80% rename from src/main/java/com/graqr/threshr/model/redsky/stores/Data.java rename to src/main/java/com/graqr/threshr/model/redsky/store/Data.java index aa8618a..8999021 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/stores/Data.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/Data.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.stores; +package com.graqr.threshr.model.redsky.store; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/Day.java b/src/main/java/com/graqr/threshr/model/redsky/store/Day.java similarity index 90% rename from src/main/java/com/graqr/threshr/model/redsky/stores/Day.java rename to src/main/java/com/graqr/threshr/model/redsky/store/Day.java index 57241eb..8f6e4fd 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/stores/Day.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/Day.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.stores; +package com.graqr.threshr.model.redsky.store; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.core.annotation.Nullable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/DriveUp.java b/src/main/java/com/graqr/threshr/model/redsky/store/DriveUp.java similarity index 61% rename from src/main/java/com/graqr/threshr/model/redsky/stores/DriveUp.java rename to src/main/java/com/graqr/threshr/model/redsky/store/DriveUp.java index b686c76..664eea3 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/stores/DriveUp.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/DriveUp.java @@ -1,3 +1,3 @@ -package com.graqr.threshr.model.redsky.stores; +package com.graqr.threshr.model.redsky.store; public record DriveUp(Double latitude, Double longitude, Long radius) {} diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/Geofence.java b/src/main/java/com/graqr/threshr/model/redsky/store/Geofence.java similarity index 61% rename from src/main/java/com/graqr/threshr/model/redsky/stores/Geofence.java rename to src/main/java/com/graqr/threshr/model/redsky/store/Geofence.java index ceae26d..2f01d39 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/stores/Geofence.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/Geofence.java @@ -1,3 +1,3 @@ -package com.graqr.threshr.model.redsky.stores; +package com.graqr.threshr.model.redsky.store; public record Geofence(Double latitude, Double longitude, Long radius) {} diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/GeographicSpecifications.java b/src/main/java/com/graqr/threshr/model/redsky/store/GeographicSpecifications.java similarity index 92% rename from src/main/java/com/graqr/threshr/model/redsky/stores/GeographicSpecifications.java rename to src/main/java/com/graqr/threshr/model/redsky/store/GeographicSpecifications.java index dffb466..0145abc 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/stores/GeographicSpecifications.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/GeographicSpecifications.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.stores; +package com.graqr.threshr.model.redsky.store; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/Hour.java b/src/main/java/com/graqr/threshr/model/redsky/store/Hour.java similarity index 89% rename from src/main/java/com/graqr/threshr/model/redsky/stores/Hour.java rename to src/main/java/com/graqr/threshr/model/redsky/store/Hour.java index f9bb407..1d47826 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/stores/Hour.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/Hour.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.stores; +package com.graqr.threshr.model.redsky.store; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.core.annotation.Nullable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/MailingAddress.java b/src/main/java/com/graqr/threshr/model/redsky/store/MailingAddress.java similarity index 91% rename from src/main/java/com/graqr/threshr/model/redsky/stores/MailingAddress.java rename to src/main/java/com/graqr/threshr/model/redsky/store/MailingAddress.java index 8ccf787..d4e392c 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/stores/MailingAddress.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/MailingAddress.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.stores; +package com.graqr.threshr.model.redsky.store; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.core.annotation.Nullable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/MainHours.java b/src/main/java/com/graqr/threshr/model/redsky/store/MainHours.java similarity index 65% rename from src/main/java/com/graqr/threshr/model/redsky/stores/MainHours.java rename to src/main/java/com/graqr/threshr/model/redsky/store/MainHours.java index 8a6d57d..117f03b 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/stores/MainHours.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/MainHours.java @@ -1,7 +1,6 @@ -package com.graqr.threshr.model.redsky.stores; +package com.graqr.threshr.model.redsky.store; import io.micronaut.serde.annotation.Serdeable; -import lombok.Data; import java.util.List; diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/Miscellaneous.java b/src/main/java/com/graqr/threshr/model/redsky/store/Miscellaneous.java similarity index 73% rename from src/main/java/com/graqr/threshr/model/redsky/stores/Miscellaneous.java rename to src/main/java/com/graqr/threshr/model/redsky/store/Miscellaneous.java index f75e8fd..6631cc3 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/stores/Miscellaneous.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/Miscellaneous.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.stores; +package com.graqr.threshr.model.redsky.store; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/NearbyStores.java b/src/main/java/com/graqr/threshr/model/redsky/store/NearbyStores.java similarity index 59% rename from src/main/java/com/graqr/threshr/model/redsky/stores/NearbyStores.java rename to src/main/java/com/graqr/threshr/model/redsky/store/NearbyStores.java index 6a2910b..6f22894 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/stores/NearbyStores.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/NearbyStores.java @@ -1,8 +1,6 @@ -package com.graqr.threshr.model.redsky.stores; +package com.graqr.threshr.model.redsky.store; import io.micronaut.serde.annotation.Serdeable; -import lombok.AllArgsConstructor; -import lombok.Data; import java.util.List; diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/NearbyStoresRoot.java b/src/main/java/com/graqr/threshr/model/redsky/store/NearbyStoresRoot.java similarity index 69% rename from src/main/java/com/graqr/threshr/model/redsky/stores/NearbyStoresRoot.java rename to src/main/java/com/graqr/threshr/model/redsky/store/NearbyStoresRoot.java index 2f105f6..f45cd9a 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/stores/NearbyStoresRoot.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/NearbyStoresRoot.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.stores; +package com.graqr.threshr.model.redsky.store; import io.micronaut.serde.annotation.Serdeable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/PhysicalSpecifications.java b/src/main/java/com/graqr/threshr/model/redsky/store/PhysicalSpecifications.java similarity index 86% rename from src/main/java/com/graqr/threshr/model/redsky/stores/PhysicalSpecifications.java rename to src/main/java/com/graqr/threshr/model/redsky/store/PhysicalSpecifications.java index a80bfc3..37364ff 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/stores/PhysicalSpecifications.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/PhysicalSpecifications.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.stores; +package com.graqr.threshr.model.redsky.store; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/RollingOperatingHours.java b/src/main/java/com/graqr/threshr/model/redsky/store/RollingOperatingHours.java similarity index 89% rename from src/main/java/com/graqr/threshr/model/redsky/stores/RollingOperatingHours.java rename to src/main/java/com/graqr/threshr/model/redsky/store/RollingOperatingHours.java index 7cf766a..0fdf3a0 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/stores/RollingOperatingHours.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/RollingOperatingHours.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.stores; +package com.graqr.threshr.model.redsky.store; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.core.annotation.Nullable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/Store.java b/src/main/java/com/graqr/threshr/model/redsky/store/Store.java similarity index 96% rename from src/main/java/com/graqr/threshr/model/redsky/stores/Store.java rename to src/main/java/com/graqr/threshr/model/redsky/store/Store.java index 64872cf..842bc39 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/stores/Store.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/Store.java @@ -1,4 +1,4 @@ -package com.graqr.threshr.model.redsky.stores; +package com.graqr.threshr.model.redsky.store; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.core.annotation.Nullable; diff --git a/src/main/java/com/graqr/threshr/model/redsky/store/location/StoreLocationRoot.java b/src/main/java/com/graqr/threshr/model/redsky/store/location/StoreLocationRoot.java new file mode 100644 index 0000000..e69ca36 --- /dev/null +++ b/src/main/java/com/graqr/threshr/model/redsky/store/location/StoreLocationRoot.java @@ -0,0 +1,5 @@ +package com.graqr.threshr.model.redsky.store.location; + +import com.graqr.threshr.model.redsky.store.Data; + +public record StoreLocationRoot(Data data) {} diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/store/location/StoreLocationRoot.java b/src/main/java/com/graqr/threshr/model/redsky/stores/store/location/StoreLocationRoot.java deleted file mode 100644 index 2c8bf65..0000000 --- a/src/main/java/com/graqr/threshr/model/redsky/stores/store/location/StoreLocationRoot.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.graqr.threshr.model.redsky.stores.store.location; - -import com.graqr.threshr.model.redsky.stores.Data; - -public record StoreLocationRoot(Data data) {} diff --git a/src/main/java/com/graqr/threshr/model/redsky/stores/store/location/storeData.java b/src/main/java/com/graqr/threshr/model/redsky/stores/store/location/storeData.java deleted file mode 100644 index da1f1d5..0000000 --- a/src/main/java/com/graqr/threshr/model/redsky/stores/store/location/storeData.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.graqr.threshr.model.redsky.stores.store.location; - -import com.graqr.threshr.model.redsky.stores.Store; - -public record storeData(Store store) {} - diff --git a/src/test/groovy/com/graqr/threshr/ThreshrClientSpec.groovy b/src/test/groovy/com/graqr/threshr/ThreshrClientSpec.groovy index d4bca1b..1fb7899 100644 --- a/src/test/groovy/com/graqr/threshr/ThreshrClientSpec.groovy +++ b/src/test/groovy/com/graqr/threshr/ThreshrClientSpec.groovy @@ -2,9 +2,9 @@ package com.graqr.threshr import com.graqr.threshr.model.queryparam.Place import com.graqr.threshr.model.queryparam.TargetStorePdpSearch -import com.graqr.threshr.model.redsky.products.pdp.client.PdpClientRoot -import com.graqr.threshr.model.redsky.products.summary.ProductSummaryRoot -import com.graqr.threshr.model.redsky.stores.NearbyStoresRoot +import com.graqr.threshr.model.redsky.product.pdp.client.PdpClientRoot +import com.graqr.threshr.model.redsky.product.summary.ProductSummaryRoot +import com.graqr.threshr.model.redsky.store.NearbyStoresRoot import io.micronaut.http.HttpResponse import java.util.stream.Collectors diff --git a/src/test/groovy/com/graqr/threshr/ThreshrSpec.groovy b/src/test/groovy/com/graqr/threshr/ThreshrSpec.groovy index abe0875..4b7be74 100644 --- a/src/test/groovy/com/graqr/threshr/ThreshrSpec.groovy +++ b/src/test/groovy/com/graqr/threshr/ThreshrSpec.groovy @@ -3,9 +3,9 @@ package com.graqr.threshr import com.graqr.threshr.model.queryparam.Place import com.graqr.threshr.model.queryparam.TargetStore import com.graqr.threshr.model.queryparam.Tcin -import com.graqr.threshr.model.redsky.stores.NearbyStores -import com.graqr.threshr.model.redsky.stores.NearbyStoresRoot -import com.graqr.threshr.model.redsky.stores.Store +import com.graqr.threshr.model.redsky.store.NearbyStores +import com.graqr.threshr.model.redsky.store.NearbyStoresRoot +import com.graqr.threshr.model.redsky.store.Store import io.micronaut.context.annotation.Value import io.micronaut.core.io.ResourceLoader import io.micronaut.serde.ObjectMapper From 26241816ca130db85a382b03c95e12b107c125c5 Mon Sep 17 00:00:00 2001 From: jonathan zollinger Date: Thu, 15 Feb 2024 10:37:52 -0700 Subject: [PATCH 5/9] drop me: sync feb 15 am --- src/main/java/com/graqr/threshr/Threshr.java | 13 ++- .../java/com/graqr/threshr/ThreshrClient.java | 11 ++- .../graqr/threshr/model/queryparam/Page.java | 40 ++++++++ .../threshr/model/redsky/product/Store.java | 4 + .../threshr/model/redsky/store/Data.java | 9 -- .../{NearbyStores.java => NearbyStore.java} | 2 +- .../model/redsky/store/NearbyStoresRoot.java | 8 -- .../model/redsky/store/location/Data.java | 6 ++ .../store/location/StoreLocationRoot.java | 2 +- .../model/redsky/store/nearby/Data.java | 10 ++ .../redsky/store/nearby/NearbyStoreRoot.java | 8 ++ .../graqr/threshr/ThreshrClientSpec.groovy | 4 +- .../com/graqr/threshr/ThreshrSpec.groovy | 46 +++------ .../com/graqr/threshr/ThreshrUtils.groovy | 34 +++++++ .../threshr/model/queryparam/PageSpec.groovy | 25 +++++ .../{ => model/queryparam}/PlaceSpec.groovy | 34 ++++++- src/test/resources/target_categories.txt | 94 +++++++++++++++++++ 17 files changed, 287 insertions(+), 63 deletions(-) create mode 100644 src/main/java/com/graqr/threshr/model/queryparam/Page.java delete mode 100644 src/main/java/com/graqr/threshr/model/redsky/store/Data.java rename src/main/java/com/graqr/threshr/model/redsky/store/{NearbyStores.java => NearbyStore.java} (68%) delete mode 100644 src/main/java/com/graqr/threshr/model/redsky/store/NearbyStoresRoot.java create mode 100644 src/main/java/com/graqr/threshr/model/redsky/store/location/Data.java create mode 100644 src/main/java/com/graqr/threshr/model/redsky/store/nearby/Data.java create mode 100644 src/main/java/com/graqr/threshr/model/redsky/store/nearby/NearbyStoreRoot.java create mode 100644 src/test/groovy/com/graqr/threshr/ThreshrUtils.groovy create mode 100644 src/test/groovy/com/graqr/threshr/model/queryparam/PageSpec.groovy rename src/test/groovy/com/graqr/threshr/{ => model/queryparam}/PlaceSpec.groovy (52%) create mode 100644 src/test/resources/target_categories.txt diff --git a/src/main/java/com/graqr/threshr/Threshr.java b/src/main/java/com/graqr/threshr/Threshr.java index 174dfd8..d8c8c2a 100644 --- a/src/main/java/com/graqr/threshr/Threshr.java +++ b/src/main/java/com/graqr/threshr/Threshr.java @@ -6,21 +6,28 @@ import com.graqr.threshr.model.queryparam.Tcin; import com.graqr.threshr.model.redsky.product.Product; import com.graqr.threshr.model.redsky.product.ProductSummary; -import com.graqr.threshr.model.redsky.store.NearbyStores; +import com.graqr.threshr.model.redsky.store.NearbyStore; import io.micronaut.core.async.annotation.SingleResult; import io.micronaut.http.HttpResponse; import io.micronaut.http.annotation.Controller; import io.micronaut.http.annotation.Get; import jakarta.inject.Inject; +import lombok.Getter; +import lombok.Setter; import java.util.List; @Controller() public class Threshr { + @Setter + @Getter + private String channel = "WEB"; + @Inject ThreshrClient threshrClient; + @Get("/product/summary-with-fulfillment") @SingleResult public List fetchProductSummaries(TargetStore targetStore, Tcin tcin) throws ThreshrException { @@ -45,13 +52,13 @@ public Product fetchProductDetails(TargetStore targetStore, String tcin) throws @Get("/stores/locations-query") @SingleResult - public NearbyStores queryStoreLocations(Place place) throws ThreshrException { + public NearbyStore queryStoreLocations(Place place) throws ThreshrException { return queryStoreLocations(5, 100, place); } @Get("/stores/locations-query") @SingleResult - public NearbyStores queryStoreLocations(int limit, int within, Place place) throws ThreshrException { + public NearbyStore queryStoreLocations(int limit, int within, Place place) throws ThreshrException { return checkForNull(threshrClient.getNearbyStores(limit, within, place.getPlace())) .data() .nearbyStores(); diff --git a/src/main/java/com/graqr/threshr/ThreshrClient.java b/src/main/java/com/graqr/threshr/ThreshrClient.java index 2d29035..4bcfdbe 100644 --- a/src/main/java/com/graqr/threshr/ThreshrClient.java +++ b/src/main/java/com/graqr/threshr/ThreshrClient.java @@ -5,7 +5,8 @@ import com.graqr.threshr.model.queryparam.Tcin; import com.graqr.threshr.model.redsky.product.pdp.client.PdpClientRoot; import com.graqr.threshr.model.redsky.product.summary.ProductSummaryRoot; -import com.graqr.threshr.model.redsky.store.NearbyStoresRoot; +import com.graqr.threshr.model.redsky.store.location.StoreLocationRoot; +import com.graqr.threshr.model.redsky.store.nearby.NearbyStoreRoot; import io.micronaut.http.HttpResponse; import io.micronaut.http.annotation.Get; import io.micronaut.http.annotation.Header; @@ -38,7 +39,6 @@ @Header(name = ACCEPT, value = "application/vnd.github.v3+json, application/json") interface ThreshrClient { - /** * Queries target's product summaries from of the given tcins at a given target store. * A product summary does not include pricing. @@ -87,7 +87,7 @@ HttpResponse getProductDetails( "{&within}" + "{&place}" + "&CHANNEL=${threshr.channel}") - HttpResponse getNearbyStores(int limit, int within, String place); + HttpResponse getNearbyStores(int limit, int within, String place); /** * Get Store Information (ie store hours) for a specific Target Store @@ -95,7 +95,8 @@ HttpResponse getProductDetails( */ @Get("store_location_v1" + "?key=${threshr.key}" + - "{&storeId}") - HttpResponse getStoreInformation(String storeId); + "{&storeId}" + + "{&channel}") + HttpResponse getStoreInformation(String storeId, String channel, String page); } \ No newline at end of file diff --git a/src/main/java/com/graqr/threshr/model/queryparam/Page.java b/src/main/java/com/graqr/threshr/model/queryparam/Page.java new file mode 100644 index 0000000..59a321a --- /dev/null +++ b/src/main/java/com/graqr/threshr/model/queryparam/Page.java @@ -0,0 +1,40 @@ +package com.graqr.threshr.model.queryparam; + +import com.graqr.threshr.ThreshrException; +import lombok.Getter; + +/** + * Query parameter in redsky api. Specifies from where an api call is made in the browser. + */ +@Getter +public class Page { + private String page; + + /** + * Sets string value as "/c/" + provided value. + * + * @param page Query parameter in redsky api to specify from where an api call is made in the browser + * @throws ThreshrException if string contains anything other than letters or is empty + */ + public Page(String page) throws ThreshrException { + setPage(page); + } + + /** + * Sets string value as "/c/" + provided value. + * + * @param page Query parameter in redsky api to specify from where an api call is made in the browser + * @throws ThreshrException if string contains anything other than letters or is empty + */ + public void setPage(String page) throws ThreshrException { + String tempPage = page.trim().toLowerCase(); + if (tempPage.startsWith("/c/")) { + tempPage = tempPage.substring(2); + } + if (tempPage.matches("[^a-z]") || tempPage.isEmpty()) { + throw new ThreshrException(String.format( + "Expected only letters for the page value, but received \"%s\".", tempPage)); + } + this.page = page; + } +} diff --git a/src/main/java/com/graqr/threshr/model/redsky/product/Store.java b/src/main/java/com/graqr/threshr/model/redsky/product/Store.java index ee2d9b7..7edd569 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/product/Store.java +++ b/src/main/java/com/graqr/threshr/model/redsky/product/Store.java @@ -3,6 +3,10 @@ import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; +/** + * This class is kept separate from ...redsky.store.Store as this object only has a location name + * @param locationName + */ @Serdeable public record Store(@JsonProperty("location_name") String locationName) { diff --git a/src/main/java/com/graqr/threshr/model/redsky/store/Data.java b/src/main/java/com/graqr/threshr/model/redsky/store/Data.java deleted file mode 100644 index 8999021..0000000 --- a/src/main/java/com/graqr/threshr/model/redsky/store/Data.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.graqr.threshr.model.redsky.store; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.micronaut.serde.annotation.Serdeable; - -@Serdeable -public record Data(@JsonProperty("nearby_stores") NearbyStores nearbyStores) { -} - diff --git a/src/main/java/com/graqr/threshr/model/redsky/store/NearbyStores.java b/src/main/java/com/graqr/threshr/model/redsky/store/NearbyStore.java similarity index 68% rename from src/main/java/com/graqr/threshr/model/redsky/store/NearbyStores.java rename to src/main/java/com/graqr/threshr/model/redsky/store/NearbyStore.java index 6f22894..cd0a416 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/store/NearbyStores.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/NearbyStore.java @@ -5,5 +5,5 @@ import java.util.List; @Serdeable -public record NearbyStores(Long count, List stores) { +public record NearbyStore(Long count, List stores) { } diff --git a/src/main/java/com/graqr/threshr/model/redsky/store/NearbyStoresRoot.java b/src/main/java/com/graqr/threshr/model/redsky/store/NearbyStoresRoot.java deleted file mode 100644 index f45cd9a..0000000 --- a/src/main/java/com/graqr/threshr/model/redsky/store/NearbyStoresRoot.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.graqr.threshr.model.redsky.store; - -import io.micronaut.serde.annotation.Serdeable; - -@Serdeable -public record NearbyStoresRoot(Data data) { -} - diff --git a/src/main/java/com/graqr/threshr/model/redsky/store/location/Data.java b/src/main/java/com/graqr/threshr/model/redsky/store/location/Data.java new file mode 100644 index 0000000..9791fb3 --- /dev/null +++ b/src/main/java/com/graqr/threshr/model/redsky/store/location/Data.java @@ -0,0 +1,6 @@ +package com.graqr.threshr.model.redsky.store.location; + +import com.graqr.threshr.model.redsky.store.Store; + +public record Data(Store store) { +} diff --git a/src/main/java/com/graqr/threshr/model/redsky/store/location/StoreLocationRoot.java b/src/main/java/com/graqr/threshr/model/redsky/store/location/StoreLocationRoot.java index e69ca36..b5d0fb4 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/store/location/StoreLocationRoot.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/location/StoreLocationRoot.java @@ -1,5 +1,5 @@ package com.graqr.threshr.model.redsky.store.location; -import com.graqr.threshr.model.redsky.store.Data; +import com.graqr.threshr.model.redsky.store.nearby.Data; public record StoreLocationRoot(Data data) {} diff --git a/src/main/java/com/graqr/threshr/model/redsky/store/nearby/Data.java b/src/main/java/com/graqr/threshr/model/redsky/store/nearby/Data.java new file mode 100644 index 0000000..7efc6ae --- /dev/null +++ b/src/main/java/com/graqr/threshr/model/redsky/store/nearby/Data.java @@ -0,0 +1,10 @@ +package com.graqr.threshr.model.redsky.store.nearby; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.graqr.threshr.model.redsky.store.NearbyStore; +import io.micronaut.serde.annotation.Serdeable; + +@Serdeable +public record Data(@JsonProperty("nearby_stores") NearbyStore nearbyStores) { +} + diff --git a/src/main/java/com/graqr/threshr/model/redsky/store/nearby/NearbyStoreRoot.java b/src/main/java/com/graqr/threshr/model/redsky/store/nearby/NearbyStoreRoot.java new file mode 100644 index 0000000..e26afcd --- /dev/null +++ b/src/main/java/com/graqr/threshr/model/redsky/store/nearby/NearbyStoreRoot.java @@ -0,0 +1,8 @@ +package com.graqr.threshr.model.redsky.store.nearby; + +import io.micronaut.serde.annotation.Serdeable; + +@Serdeable +public record NearbyStoreRoot(Data data) { +} + diff --git a/src/test/groovy/com/graqr/threshr/ThreshrClientSpec.groovy b/src/test/groovy/com/graqr/threshr/ThreshrClientSpec.groovy index 1fb7899..623a093 100644 --- a/src/test/groovy/com/graqr/threshr/ThreshrClientSpec.groovy +++ b/src/test/groovy/com/graqr/threshr/ThreshrClientSpec.groovy @@ -4,7 +4,7 @@ import com.graqr.threshr.model.queryparam.Place import com.graqr.threshr.model.queryparam.TargetStorePdpSearch import com.graqr.threshr.model.redsky.product.pdp.client.PdpClientRoot import com.graqr.threshr.model.redsky.product.summary.ProductSummaryRoot -import com.graqr.threshr.model.redsky.store.NearbyStoresRoot +import com.graqr.threshr.model.redsky.store.nearby.NearbyStoreRoot import io.micronaut.http.HttpResponse import java.util.stream.Collectors @@ -37,7 +37,7 @@ class ThreshrClientSpec extends ThreshrSpec { void 'querying "#place.getPlace()" returns the "#expectedLocationName" store'() { when: - HttpResponse response = threshrClient.getNearbyStores(5,100, place.getPlace()) + HttpResponse response = threshrClient.getNearbyStores(5,100, place.getPlace()) then: response.body().data().nearbyStores().stores() diff --git a/src/test/groovy/com/graqr/threshr/ThreshrSpec.groovy b/src/test/groovy/com/graqr/threshr/ThreshrSpec.groovy index 4b7be74..f133bc2 100644 --- a/src/test/groovy/com/graqr/threshr/ThreshrSpec.groovy +++ b/src/test/groovy/com/graqr/threshr/ThreshrSpec.groovy @@ -3,8 +3,8 @@ package com.graqr.threshr import com.graqr.threshr.model.queryparam.Place import com.graqr.threshr.model.queryparam.TargetStore import com.graqr.threshr.model.queryparam.Tcin -import com.graqr.threshr.model.redsky.store.NearbyStores -import com.graqr.threshr.model.redsky.store.NearbyStoresRoot +import com.graqr.threshr.model.redsky.store.NearbyStore +import com.graqr.threshr.model.redsky.store.nearby.NearbyStoreRoot import com.graqr.threshr.model.redsky.store.Store import io.micronaut.context.annotation.Value import io.micronaut.core.io.ResourceLoader @@ -30,45 +30,29 @@ class ThreshrSpec extends Specification { @Shared ThreshrClient threshrClient - @Shared - Faker faker = new Faker() - @Shared - List zipCodesPlus4 = Stream.generate(faker.address()::zipCodePlus4).distinct().limit(50).collect(Collectors.toList()) - @Shared - List zipCodes = Stream.generate(faker.address()::zipCode).distinct().limit(50).collect(Collectors.toList()) - @Shared - List cities = Stream.generate(faker.address()::cityName).limit(50).collect(Collectors.toList()) - @Shared - List states = Stream.generate(faker.address()::state).limit(50).collect(Collectors.toList()) - @Shared - List emptyStrings = Collections.nCopies(26, "").toList() + (Collections.nCopies(26, " ")) - @Inject @Shared ResourceLoader resourceLoader - @Inject @Shared + @Inject + ThreshrUtils threshrUtils; + + @Inject + @Shared ObjectMapper mapper - @Shared @Value('${threshr.test.data.stores}') // $env:THRESHR_TEST_DATA_STORES + @Shared + @Value('${threshr.test.data.stores}') // $env:THRESHR_TEST_DATA_STORES String storesFilePath @Shared List expectedStores void setupSpec() { - expectedStores = getExpectedLocations(String.format("classpath:%s", storesFilePath)) - } - - List getExpectedLocations(String filePath) { - mapper.readValue(getResourceFromFile(filePath), NearbyStoresRoot.class).data().nearbyStores().stores() - } - - byte[] getResourceFromFile(String filepath) { - try { - return resourceLoader.getResourceAsStream(filepath).get().readAllBytes() - } catch (NoSuchElementException e) { - throw new ThreshrException(String.format("failed to load '%s' for %s.", filepath, this.class.name), e) - } + expectedStores = threshrUtils + .readFileToObject(String.format("classpath:%s", storesFilePath), NearbyStoreRoot) + .data() + .nearbyStores() + .stores() } @Shared @@ -89,7 +73,7 @@ class ThreshrSpec extends Specification { void 'querying "#place.getPlace()" returns the "#expectedLocationName" store'() { when: - NearbyStores response = threshrController.queryStoreLocations(place) + NearbyStore response = threshrController.queryStoreLocations(place) then: response.stores() diff --git a/src/test/groovy/com/graqr/threshr/ThreshrUtils.groovy b/src/test/groovy/com/graqr/threshr/ThreshrUtils.groovy new file mode 100644 index 0000000..92e0863 --- /dev/null +++ b/src/test/groovy/com/graqr/threshr/ThreshrUtils.groovy @@ -0,0 +1,34 @@ +package com.graqr.threshr + + +import io.micronaut.core.io.ResourceLoader +import io.micronaut.serde.ObjectMapper +import jakarta.inject.Inject +import jakarta.inject.Singleton + +@Singleton +class ThreshrUtils { + + @Inject + ResourceLoader resourceLoader + + @Inject + ObjectMapper mapper + + T readFileToObject(String filepath, T t) { + return mapper.readValue(getResourceFromFile(filepath), t.class) as T + } + + /** + * + * @param filepath + * @return + */ + byte[] getResourceFromFile(String filepath) { + try { + return resourceLoader.getResourceAsStream(filepath).get().readAllBytes() + } catch (NoSuchElementException e) { + throw new ThreshrException(String.format("failed to load '%s'.", filepath), e) + } + } +} diff --git a/src/test/groovy/com/graqr/threshr/model/queryparam/PageSpec.groovy b/src/test/groovy/com/graqr/threshr/model/queryparam/PageSpec.groovy new file mode 100644 index 0000000..2fda6f2 --- /dev/null +++ b/src/test/groovy/com/graqr/threshr/model/queryparam/PageSpec.groovy @@ -0,0 +1,25 @@ +package com.graqr.threshr.model.queryparam + +import io.micronaut.test.extensions.spock.annotation.MicronautTest +import spock.lang.Specification + +@MicronautTest +class PageSpec extends Specification { + + + def "test creating a page and re-assigning a page"() { + given: + Page page + + when: + page = new Page("page") + + then: + page.getPage() == "" + + where: + pageValue << Arrays.asList('root', 'Fresh Groceries', '') + + + } +} \ No newline at end of file diff --git a/src/test/groovy/com/graqr/threshr/PlaceSpec.groovy b/src/test/groovy/com/graqr/threshr/model/queryparam/PlaceSpec.groovy similarity index 52% rename from src/test/groovy/com/graqr/threshr/PlaceSpec.groovy rename to src/test/groovy/com/graqr/threshr/model/queryparam/PlaceSpec.groovy index 93e78f7..1e674ed 100644 --- a/src/test/groovy/com/graqr/threshr/PlaceSpec.groovy +++ b/src/test/groovy/com/graqr/threshr/model/queryparam/PlaceSpec.groovy @@ -1,11 +1,39 @@ -package com.graqr.threshr - +package com.graqr.threshr.model.queryparam +import com.graqr.threshr.ThreshrSpec import com.graqr.threshr.model.queryparam.Place import io.micronaut.test.extensions.spock.annotation.MicronautTest +import net.datafaker.Faker +import spock.lang.Shared +import spock.lang.Specification + +import java.util.stream.Collectors +import java.util.stream.Stream @MicronautTest -class PlaceSpec extends ThreshrSpec { +class PlaceSpec extends Specification { + + @Shared + Faker faker = new Faker() + + // TODO: https://g.co/gemini/share/8af67cd35757 + @Shared + List zipCodesPlus4 = Stream.generate(faker.address()::zipCodePlus4) + .distinct() + .limit(50) + .collect(Collectors.toList()) + + @Shared + List zipCodes = Stream.generate(faker.address()::zipCode) + .distinct() + .limit(50) + .collect(Collectors.toList()) + @Shared + List cities = Stream.generate(faker.address()::cityName).limit(50).collect(Collectors.toList()) + @Shared + List states = Stream.generate(faker.address()::state).limit(50).collect(Collectors.toList()) + @Shared + List emptyStrings = Collections.nCopies(26, "").toList() + (Collections.nCopies(26, " ")) void 'creating a Place object with "#badZipCode" throws an error'() { when: diff --git a/src/test/resources/target_categories.txt b/src/test/resources/target_categories.txt new file mode 100644 index 0000000..1c679cf --- /dev/null +++ b/src/test/resources/target_categories.txt @@ -0,0 +1,94 @@ +/c/shop-all-categories/-/N-5xsxf?prehydrateClick=true +/c/weekly-deals/-/N-4xw74?prehydrateClick=true +/c/target-new-arrivals/-/N-o9rnh?prehydrateClick=true +/c/order-pickup/-/N-ng0a0?l1_nid=5xt1a&prehydrateClick=true +/c/women/-/N-5xtd3 +/c/men/-/N-18y1l +/c/young-adult/-/N-qh1tf +/c/kids/-/N-xcoz4 +/c/shoes/-/N-55b0t +/c/family-outfits/-/N-gi92u +/c/home/-/N-5xtvd +/c/patio-garden/-/N-5xtq9 +/c/kitchen-dining/-/N-hz89j +/c/storage-organization-home/-/N-5xto8 +/c/furniture/-/N-5xtnr +/c/bath-home/-/N-5xtvc +/c/baby/-/N-5xtly +/c/car-seats-baby/-/N-5xtlx +/c/strollers-baby/-/N-5xtk7 +/c/diapering-baby/-/N-5xtlp +/c/nursery-baby/-/N-54v3g +/c/gear-activity-baby/-/N-5xtjv +/c/electronics/-/N-5xtg6 +/c/video-games/-/N-5xtg5 +/c/tvs-home-theater-electronics/-/N-5xtdw +/c/cell-phones-electronics/-/N-5xte8 +/c/wearable-technology-electronics/-/N-551ss +/c/computers-office-electronics/-/N-5xtfc +/c/school-office-supplies/-/N-5xsxr +/c/desk-organization-school-office-supplies/-/N-5xtnz +/c/kids-back-to-school/-/N-5xtyp +/c/on-to-college/-/N-5q0g0 +/c/at-home-learning/-/N-wiae5 +/c/home-office-ideas/-/N-4sm54 +/c/toys/-/N-5xtb0 +/c/character-shop/-/N-5oux8 +/c/stuffed-animals-plush-toys/-/N-5xtat +/c/dolls-toys/-/N-5xt90 +/c/outdoor-toys/-/N-5xtai +/c/sports-outdoors/-/N-5xt85 +/c/exercise-fitness-sports-outdoors/-/N-5xt7d +/c/sports-equipment-outdoors/-/N-5xt52 +/c/swimming-pools-camping-outdoor-recreation-sports-outdoors/-/N-5xt5e +/c/bikes-sports-outdoors/-/N-5xt83 +/c/camping-outdoors-sports/-/N-5xt6e +/c/movies-music-books/-/N-5xsx0 +/c/tv-shows-movies-music-books/-/N-5xswt +/c/music-movies-books/-/N-5xswr +/c/books-movies-music/-/N-5xsxd +/c/ulta-beauty-at-target/-/N-ueo8r +/c/beauty/-/N-55r1x +/c/personal-care/-/N-5xtzq +/c/makeup-beauty/-/N-5xu1e +/c/hair-care-beauty/-/N-5xu0k +/c/skin-care-beauty/-/N-5xtzj +/c/health/-/N-5xu1n +/c/vitamins-supplements-health/-/N-5xu07 +/c/medicines-treatments-health/-/N-5xu09 +/c/nutrition-weight-loss-health/-/N-5xu0d +/c/first-aid-health/-/N-5xu0c +/c/home-health-care/-/N-5xu0a +/c/household-essentials/-/N-5xsz1 +/c/laundry-care-household-essentials/-/N-5xsyr +/c/paper-towels-household-essentials/-/N-4y1o4 +/c/tissue-toilet-paper-household-essentials/-/N-5xsyk +/c/cleaning-supplies-household-essentials/-/N-5xsyy +/c/pets/-/N-5xt44 +/c/dog-supplies-pets/-/N-5xt3t +/c/cat-supplies-pets/-/N-5xt42 +/c/small-animal-supplies-pets/-/N-5xt3d +/c/bird-supplies-pets/-/N-5xt43 +/c/fish-supplies-pets/-/N-5xt3e +/c/grocery/-/N-5xt1a +/c/produce-grocery/-/N-u7fty +/c/meat-seafood-grocery/-/N-5xsyh +/c/dairy-grocery/-/N-5xszm +/c/frozen-foods-grocery/-/N-5xszd +/c/snacks-grocery/-/N-5xsy9 +/c/gift-ideas/-/N-96d2i +/c/party-supplies/-/N-5xt3c +/c/halloween/-/N-5xt2o +/c/christmas/-/N-5xt30 +/c/easter/-/N-5xt1n +/c/gift-ideas-for-mothers/-/N-fh5dt +/c/top-deals/-/N-4xw74 +/c/clearance/-/N-5q0ga +/c/gift-cards/-/N-5xsxu +/c/bullseye-s-playground/-/N-tr36l +/c/target-black-friday/-/N-5q0f2 +/c/furniture-assembly-powered-by-handy/-/N-xluim +/c/optical/-/N-4y8o9 +/c/easy-install/-/N-raym1 +/c/new-parent-services-by-tot-squad/-/N-vorfo +/c/target-privacy-policy/-/N-4sr7p From 3556a3864cb5f6688d2cf64252b880e708da1adb Mon Sep 17 00:00:00 2001 From: jonathan zollinger Date: Thu, 15 Feb 2024 22:36:56 -0700 Subject: [PATCH 6/9] refactor(readability): extract faker list method Signed-off-by: jonathan zollinger --- .../threshr/model/queryparam/PlaceSpec.groovy | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/test/groovy/com/graqr/threshr/model/queryparam/PlaceSpec.groovy b/src/test/groovy/com/graqr/threshr/model/queryparam/PlaceSpec.groovy index 1e674ed..75fe4b0 100644 --- a/src/test/groovy/com/graqr/threshr/model/queryparam/PlaceSpec.groovy +++ b/src/test/groovy/com/graqr/threshr/model/queryparam/PlaceSpec.groovy @@ -1,12 +1,12 @@ package com.graqr.threshr.model.queryparam -import com.graqr.threshr.ThreshrSpec -import com.graqr.threshr.model.queryparam.Place + import io.micronaut.test.extensions.spock.annotation.MicronautTest import net.datafaker.Faker import spock.lang.Shared import spock.lang.Specification +import java.util.function.Function import java.util.stream.Collectors import java.util.stream.Stream @@ -16,22 +16,22 @@ class PlaceSpec extends Specification { @Shared Faker faker = new Faker() + Function, List> getDistinctList = stream -> + stream.distinct().limit(50).collect(Collectors.toList()) + // TODO: https://g.co/gemini/share/8af67cd35757 @Shared - List zipCodesPlus4 = Stream.generate(faker.address()::zipCodePlus4) - .distinct() - .limit(50) - .collect(Collectors.toList()) + List zipCodesPlus4 = getDistinctList(faker.address()::zipCodePlus4) @Shared - List zipCodes = Stream.generate(faker.address()::zipCode) - .distinct() - .limit(50) - .collect(Collectors.toList()) + List zipCodes = getDistinctList(faker.address()::zipCode) + @Shared - List cities = Stream.generate(faker.address()::cityName).limit(50).collect(Collectors.toList()) + List cities = getDistinctList(faker.address()::cityName) + @Shared - List states = Stream.generate(faker.address()::state).limit(50).collect(Collectors.toList()) + List states = getDistinctList(faker.address()::state) + @Shared List emptyStrings = Collections.nCopies(26, "").toList() + (Collections.nCopies(26, " ")) From 552c0350875ab55914ab3777979e815e0e586395 Mon Sep 17 00:00:00 2001 From: jonathan zollinger Date: Fri, 16 Feb 2024 00:08:32 -0700 Subject: [PATCH 7/9] fix: set new pojo's as 'serdeable' Signed-off-by: jonathan zollinger --- .../java/com/graqr/threshr/model/redsky/store/Capability.java | 2 ++ .../com/graqr/threshr/model/redsky/store/CapabilityHour.java | 2 ++ .../graqr/threshr/model/redsky/store/ContactInformation.java | 2 ++ .../java/com/graqr/threshr/model/redsky/store/DriveUp.java | 2 ++ .../java/com/graqr/threshr/model/redsky/store/Geofence.java | 3 +++ .../threshr/model/redsky/store/GeographicSpecifications.java | 2 ++ .../com/graqr/threshr/model/redsky/store/Miscellaneous.java | 2 ++ .../threshr/model/redsky/store/PhysicalSpecifications.java | 2 ++ .../com/graqr/threshr/model/redsky/store/location/Data.java | 2 ++ .../threshr/model/redsky/store/location/StoreLocationRoot.java | 2 ++ .../threshr/model/redsky/store/nearby/NearbyStoreRoot.java | 2 ++ 11 files changed, 23 insertions(+) diff --git a/src/main/java/com/graqr/threshr/model/redsky/store/Capability.java b/src/main/java/com/graqr/threshr/model/redsky/store/Capability.java index 3ad0b63..4036f6f 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/store/Capability.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/Capability.java @@ -1,7 +1,9 @@ package com.graqr.threshr.model.redsky.store; import com.fasterxml.jackson.annotation.JsonProperty; +import io.micronaut.serde.annotation.Serdeable; +@Serdeable public record Capability(@JsonProperty("capability_code") String capabilityCode, @JsonProperty("capability_name") String capabilityName, @JsonProperty("effective_date") String effectiveDate) {} diff --git a/src/main/java/com/graqr/threshr/model/redsky/store/CapabilityHour.java b/src/main/java/com/graqr/threshr/model/redsky/store/CapabilityHour.java index 710e37d..ac56dba 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/store/CapabilityHour.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/CapabilityHour.java @@ -1,9 +1,11 @@ package com.graqr.threshr.model.redsky.store; import com.fasterxml.jackson.annotation.JsonProperty; +import io.micronaut.serde.annotation.Serdeable; import java.util.List; +@Serdeable public record CapabilityHour(@JsonProperty("capability_code") String capabilityCode, List days) { } diff --git a/src/main/java/com/graqr/threshr/model/redsky/store/ContactInformation.java b/src/main/java/com/graqr/threshr/model/redsky/store/ContactInformation.java index 3617702..b4314ee 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/store/ContactInformation.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/ContactInformation.java @@ -1,7 +1,9 @@ package com.graqr.threshr.model.redsky.store; import com.fasterxml.jackson.annotation.JsonProperty; +import io.micronaut.serde.annotation.Serdeable; +@Serdeable public record ContactInformation(@JsonProperty("building_area") String buildingArea, @JsonProperty("telephone_type") String telephoneType, @JsonProperty("is_international_phone_number") Boolean isInternationalPhoneNumber, diff --git a/src/main/java/com/graqr/threshr/model/redsky/store/DriveUp.java b/src/main/java/com/graqr/threshr/model/redsky/store/DriveUp.java index 664eea3..49531c9 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/store/DriveUp.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/DriveUp.java @@ -1,3 +1,5 @@ package com.graqr.threshr.model.redsky.store; +import io.micronaut.serde.annotation.Serdeable; +@Serdeable public record DriveUp(Double latitude, Double longitude, Long radius) {} diff --git a/src/main/java/com/graqr/threshr/model/redsky/store/Geofence.java b/src/main/java/com/graqr/threshr/model/redsky/store/Geofence.java index 2f01d39..015a94c 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/store/Geofence.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/Geofence.java @@ -1,3 +1,6 @@ package com.graqr.threshr.model.redsky.store; +import io.micronaut.serde.annotation.Serdeable; + +@Serdeable public record Geofence(Double latitude, Double longitude, Long radius) {} diff --git a/src/main/java/com/graqr/threshr/model/redsky/store/GeographicSpecifications.java b/src/main/java/com/graqr/threshr/model/redsky/store/GeographicSpecifications.java index 0145abc..7ca801f 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/store/GeographicSpecifications.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/GeographicSpecifications.java @@ -1,7 +1,9 @@ package com.graqr.threshr.model.redsky.store; import com.fasterxml.jackson.annotation.JsonProperty; +import io.micronaut.serde.annotation.Serdeable; +@Serdeable public record GeographicSpecifications( Double latitude, Double longitude, diff --git a/src/main/java/com/graqr/threshr/model/redsky/store/Miscellaneous.java b/src/main/java/com/graqr/threshr/model/redsky/store/Miscellaneous.java index 6631cc3..4f36253 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/store/Miscellaneous.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/Miscellaneous.java @@ -1,5 +1,7 @@ package com.graqr.threshr.model.redsky.store; import com.fasterxml.jackson.annotation.JsonProperty; +import io.micronaut.serde.annotation.Serdeable; +@Serdeable public record Miscellaneous(@JsonProperty("google_cid") String googleCid) {} diff --git a/src/main/java/com/graqr/threshr/model/redsky/store/PhysicalSpecifications.java b/src/main/java/com/graqr/threshr/model/redsky/store/PhysicalSpecifications.java index 37364ff..a708c87 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/store/PhysicalSpecifications.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/PhysicalSpecifications.java @@ -1,7 +1,9 @@ package com.graqr.threshr.model.redsky.store; import com.fasterxml.jackson.annotation.JsonProperty; +import io.micronaut.serde.annotation.Serdeable; +@Serdeable public record PhysicalSpecifications(@JsonProperty("total_building_area") Long totalBuildingArea, @JsonProperty("merchandise_level") Long merchandiseLevel, String format) {} diff --git a/src/main/java/com/graqr/threshr/model/redsky/store/location/Data.java b/src/main/java/com/graqr/threshr/model/redsky/store/location/Data.java index 9791fb3..1dde818 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/store/location/Data.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/location/Data.java @@ -1,6 +1,8 @@ package com.graqr.threshr.model.redsky.store.location; import com.graqr.threshr.model.redsky.store.Store; +import io.micronaut.serde.annotation.Serdeable; +@Serdeable public record Data(Store store) { } diff --git a/src/main/java/com/graqr/threshr/model/redsky/store/location/StoreLocationRoot.java b/src/main/java/com/graqr/threshr/model/redsky/store/location/StoreLocationRoot.java index b5d0fb4..a00eeb9 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/store/location/StoreLocationRoot.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/location/StoreLocationRoot.java @@ -1,5 +1,7 @@ package com.graqr.threshr.model.redsky.store.location; import com.graqr.threshr.model.redsky.store.nearby.Data; +import io.micronaut.serde.annotation.Serdeable; +@Serdeable public record StoreLocationRoot(Data data) {} diff --git a/src/main/java/com/graqr/threshr/model/redsky/store/nearby/NearbyStoreRoot.java b/src/main/java/com/graqr/threshr/model/redsky/store/nearby/NearbyStoreRoot.java index e26afcd..e3e3527 100644 --- a/src/main/java/com/graqr/threshr/model/redsky/store/nearby/NearbyStoreRoot.java +++ b/src/main/java/com/graqr/threshr/model/redsky/store/nearby/NearbyStoreRoot.java @@ -1,8 +1,10 @@ package com.graqr.threshr.model.redsky.store.nearby; +import io.micronaut.core.annotation.Introspected; import io.micronaut.serde.annotation.Serdeable; @Serdeable +@Introspected public record NearbyStoreRoot(Data data) { } From 7a7063ff378d764db0ac719bd7cf9daac7c44185 Mon Sep 17 00:00:00 2001 From: jonathan zollinger Date: Fri, 16 Feb 2024 00:09:59 -0700 Subject: [PATCH 8/9] revert consolidating to a test utils class Signed-off-by: jonathan zollinger --- .../com/graqr/threshr/ThreshrSpec.groovy | 27 +++++++++------ .../com/graqr/threshr/ThreshrUtils.groovy | 34 ------------------- .../threshr/model/queryparam/PlaceSpec.groovy | 22 +++++++++--- 3 files changed, 33 insertions(+), 50 deletions(-) delete mode 100644 src/test/groovy/com/graqr/threshr/ThreshrUtils.groovy diff --git a/src/test/groovy/com/graqr/threshr/ThreshrSpec.groovy b/src/test/groovy/com/graqr/threshr/ThreshrSpec.groovy index f133bc2..bb3fe03 100644 --- a/src/test/groovy/com/graqr/threshr/ThreshrSpec.groovy +++ b/src/test/groovy/com/graqr/threshr/ThreshrSpec.groovy @@ -4,19 +4,17 @@ import com.graqr.threshr.model.queryparam.Place import com.graqr.threshr.model.queryparam.TargetStore import com.graqr.threshr.model.queryparam.Tcin import com.graqr.threshr.model.redsky.store.NearbyStore -import com.graqr.threshr.model.redsky.store.nearby.NearbyStoreRoot import com.graqr.threshr.model.redsky.store.Store +import com.graqr.threshr.model.redsky.store.nearby.NearbyStoreRoot import io.micronaut.context.annotation.Value import io.micronaut.core.io.ResourceLoader import io.micronaut.serde.ObjectMapper import io.micronaut.test.extensions.spock.annotation.MicronautTest import jakarta.inject.Inject -import net.datafaker.Faker import spock.lang.Shared import spock.lang.Specification import java.util.stream.Collectors -import java.util.stream.Stream @MicronautTest class ThreshrSpec extends Specification { @@ -30,26 +28,33 @@ class ThreshrSpec extends Specification { @Shared ThreshrClient threshrClient - @Inject @Shared - ResourceLoader resourceLoader - @Inject - ThreshrUtils threshrUtils; + @Shared + ObjectMapper mapper @Inject @Shared - ObjectMapper mapper + ResourceLoader resourceLoader @Shared - @Value('${threshr.test.data.stores}') // $env:THRESHR_TEST_DATA_STORES + @Value('${threshr.test.data.stores}') + // $env:THRESHR_TEST_DATA_STORES String storesFilePath @Shared List expectedStores + byte[] getResourceFromFile(String filepath) { + try { + return resourceLoader.getResourceAsStream(filepath).get().readAllBytes() + } catch (IOException e) { + throw new ThreshrException(String.format("failed to load '%s'.", filepath), e) + } + } + + void setupSpec() { - expectedStores = threshrUtils - .readFileToObject(String.format("classpath:%s", storesFilePath), NearbyStoreRoot) + expectedStores = mapper.readValue(getResourceFromFile("classpath:" + storesFilePath), NearbyStoreRoot.class) .data() .nearbyStores() .stores() diff --git a/src/test/groovy/com/graqr/threshr/ThreshrUtils.groovy b/src/test/groovy/com/graqr/threshr/ThreshrUtils.groovy deleted file mode 100644 index 92e0863..0000000 --- a/src/test/groovy/com/graqr/threshr/ThreshrUtils.groovy +++ /dev/null @@ -1,34 +0,0 @@ -package com.graqr.threshr - - -import io.micronaut.core.io.ResourceLoader -import io.micronaut.serde.ObjectMapper -import jakarta.inject.Inject -import jakarta.inject.Singleton - -@Singleton -class ThreshrUtils { - - @Inject - ResourceLoader resourceLoader - - @Inject - ObjectMapper mapper - - T readFileToObject(String filepath, T t) { - return mapper.readValue(getResourceFromFile(filepath), t.class) as T - } - - /** - * - * @param filepath - * @return - */ - byte[] getResourceFromFile(String filepath) { - try { - return resourceLoader.getResourceAsStream(filepath).get().readAllBytes() - } catch (NoSuchElementException e) { - throw new ThreshrException(String.format("failed to load '%s'.", filepath), e) - } - } -} diff --git a/src/test/groovy/com/graqr/threshr/model/queryparam/PlaceSpec.groovy b/src/test/groovy/com/graqr/threshr/model/queryparam/PlaceSpec.groovy index 75fe4b0..92341c7 100644 --- a/src/test/groovy/com/graqr/threshr/model/queryparam/PlaceSpec.groovy +++ b/src/test/groovy/com/graqr/threshr/model/queryparam/PlaceSpec.groovy @@ -1,12 +1,11 @@ package com.graqr.threshr.model.queryparam - import io.micronaut.test.extensions.spock.annotation.MicronautTest import net.datafaker.Faker import spock.lang.Shared import spock.lang.Specification -import java.util.function.Function +import java.util.function.Supplier import java.util.stream.Collectors import java.util.stream.Stream @@ -16,10 +15,23 @@ class PlaceSpec extends Specification { @Shared Faker faker = new Faker() - Function, List> getDistinctList = stream -> - stream.distinct().limit(50).collect(Collectors.toList()) + /** + * @param supplier source for string values + * @return list of 50 Strings + */ + List getDistinctList(Supplier supplier) { + return getDistinctList(supplier, 50) + } + + /** + * @param supplier source for string values + * @param count list size to be returned + * @return list of Strings of a given size. + */ + List getDistinctList(Supplier supplier, int count) { + return Stream.generate(supplier).distinct().limit(count).collect(Collectors.toList()) + } - // TODO: https://g.co/gemini/share/8af67cd35757 @Shared List zipCodesPlus4 = getDistinctList(faker.address()::zipCodePlus4) From aa52d7facb1dd81b2ea1aa5ef5a710bdc1350565 Mon Sep 17 00:00:00 2001 From: jonathan zollinger Date: Mon, 19 Feb 2024 23:52:55 -0700 Subject: [PATCH 9/9] Test(page): finish pageSpec also flesh out testing instructions Signed-off-by: jonathan zollinger --- README.md | 27 +--- .../redsky_network-tab_firefox.gif | Bin .../graqr/threshr/model/queryparam/Page.java | 6 +- src/main/resources/application.yml | 3 +- src/test/groovy/com/graqr/threshr/README.md | 120 ++++++++++++++++++ .../com/graqr/threshr/ThreshrSpec.groovy | 1 - .../threshr/model/queryparam/PageSpec.groovy | 85 ++++++++++++- 7 files changed, 208 insertions(+), 34 deletions(-) rename {images => media}/redsky_network-tab_firefox.gif (100%) create mode 100644 src/test/groovy/com/graqr/threshr/README.md diff --git a/README.md b/README.md index ae8302b..a282b7f 100644 --- a/README.md +++ b/README.md @@ -45,12 +45,12 @@ You'll need to add api `key` and `CHANNEL` values to environment variables `THRE THRESHR_KEY=BatKey THRESHR_CHANNEL=WEB ``` - +> :warning: Environment Variables on windows must be assigned as an environment variable, ie `$env:foo`.
How to find a key for the redsky api
    In the network tab in your browser's dev tools, search for any endpoints from the `redsky.target.com` domain. Below I'm in firefox, from whose context menu I'm given the option to copy an api call's parameters. -![redsky_network-tab_firefox.gif](images%2Fredsky_network-tab_firefox.gif) +![redsky_network-tab_firefox.gif](media%2Fredsky_network-tab_firefox.gif)
## Usage @@ -59,7 +59,6 @@ Threshr doesn't support all redsky endpoints (not yet). There are three endpoint ```java List fetchProductSummaries(TargetStore targetStore, Tcin tcin); - List fetchProductSummaries(TargetStore targetStore, String... tcin) throws ThreshrException; ``` ```java @@ -67,34 +66,14 @@ Product fetchProductDetails(TargetStore targetStore, String tcin); ``` ```java NearbyStores queryStoreLocations(Place place); // default values for limit and within - NearbyStores queryStoreLocations(int limit, int within, Place place); ``` - -### Using threshr pojo's - -```java -/** - * Queries the availability of products at a target store. - * - * @param store location to query - * @param tcin one or more target product item numbers as string values - * - * returns a set of boolean values reflecting a product's availability. - */ -public Set isProductInStock(TargetStore store, String ... tcin) { - ProductSummary summary = threshr.fetchProductSummaries(store, tcin); - return summary().stream().map(it -> - it.fulfillment().soldOut()) - .collect(Collectors.toSet()); -} -``` ___ ### Want to get involved? -See our [contributing] doc before taking a whack at any [open issues]. We'd love for you to work with us! +See our [contributing] doc before taking a whack at any [open issues]. Also be sure to read the [Testing README](src/test/groovy/com/graqr/threshr/README.md) for some tips and tricks. We'd love for you to work with us! [these instructions]:https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry diff --git a/images/redsky_network-tab_firefox.gif b/media/redsky_network-tab_firefox.gif similarity index 100% rename from images/redsky_network-tab_firefox.gif rename to media/redsky_network-tab_firefox.gif diff --git a/src/main/java/com/graqr/threshr/model/queryparam/Page.java b/src/main/java/com/graqr/threshr/model/queryparam/Page.java index 59a321a..5c2acd5 100644 --- a/src/main/java/com/graqr/threshr/model/queryparam/Page.java +++ b/src/main/java/com/graqr/threshr/model/queryparam/Page.java @@ -29,12 +29,12 @@ public Page(String page) throws ThreshrException { public void setPage(String page) throws ThreshrException { String tempPage = page.trim().toLowerCase(); if (tempPage.startsWith("/c/")) { - tempPage = tempPage.substring(2); + tempPage = tempPage.substring(3); } - if (tempPage.matches("[^a-z]") || tempPage.isEmpty()) { + if (tempPage.matches(".+([^(a-z|\\-)]).+") || tempPage.isEmpty()) { throw new ThreshrException(String.format( "Expected only letters for the page value, but received \"%s\".", tempPage)); } - this.page = page; + this.page = "/c/" + tempPage; } } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 2757772..22e80cf 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -12,4 +12,5 @@ threshr: channel: test: data: - stores: ${TEST_STORE_FILE_DATA:nearby_stores.json} \ No newline at end of file + stores: ${TEST_DATA_STORES:nearby_stores.json} + categories: ${TEST_DATA_CATEGORIES:target_categories.txt} \ No newline at end of file diff --git a/src/test/groovy/com/graqr/threshr/README.md b/src/test/groovy/com/graqr/threshr/README.md new file mode 100644 index 0000000..3882439 --- /dev/null +++ b/src/test/groovy/com/graqr/threshr/README.md @@ -0,0 +1,120 @@ +# Threshr Tests +Assuming your environment is setup to build a graalvm image and all that goes with building Threshr, these tests require file inputs. + +### Environment Variables +Aside from the environment variables needed to build threshr, variables can be used to specify data to use in testing. These variables are found in `application.yml` at the repo's resource root directory. + +
Tip for Windows Users +
    +
      + +> :warning: You'll need Windows Terminal and winget on your machine for this setup. In good news, you may have these installed and not know it. + +
    +The GraalVM requires the visual studio sdk in order to work. Graal has some instructions on getting this all setup. I'd suggest going through with the winget installer, it does the same thing doesn't require your input. +
      + +```PowerShell +winget install Microsoft.VisualStudio.2022.Community +``` +
    +After installing, your Windows terminal will have a couple new profiles, one named `Develop PowerShell for VS 2022`. Begin adding a new profile based on this new one to find the commandline executable used for this profile. It will read something like: +
      + +```sh +powershell.exe -NoExit -Command \ + "&{Import-Module """C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"""; \ + Enter-VsDevShell a33f35bb \ + -SkipAutomaticLocation \ + -DevCmdArguments """-arch=x64 -host_arch=x64"""}" +``` +
    + +All we need from this entry is that string given after the `Enter-VsDevShell` command (in the previous example, `a33f35bb`). This relies on Add-ToPath. +
      + +```PowerShell +function Start-DevTerminal { + <# + .SYNOPSIS + Configures shell to use a fully fledged java dev environment + + .DESCRIPTION + Adds JAVA_HOME, GRAALVM_HOME and MAVEN_HOME variables and verifies they're each on system's PATH. + Imports VScode dev shell module and calls Enter-VsDevShell + + .PARAMETER Java + Path to graalvm directory, defaults to ~\.jdks\graalvm-ce-17 + + .PARAMETER Maven + Path to maven directory, defaults to 'C:\Program Files\Apache Maven\' + + .EXAMPLE + # Valid use could be as simple as calling with no args + Start-DevTerminal + + #> + [CmdletBinding()] + param ( + [Parameter()] + [String] + [ValidateScript({ Test-Path -Path $_ -PathType Container })] + $Java = "$($HOME)\.jdks\graalvm-ce-17", + [Parameter()] + [String] + [ValidateScript({ Test-Path -Path $_ -PathType Container })] + $Maven = "C:\Program Files\Apache Maven\" + ) + @("JAVA_HOME", "GRAALVM_HOME") | ForEach-Object { + [System.Environment]::SetEnvironmentVariable($_, $Java) + } + [System.Environment]::SetEnvironmentVariable("MAVEN_HOME", "C:\Program Files\Apache Maven\") + $devShellGeneratedName = "a33f35bb" + Add-ToPath "$env:JAVA_HOME\bin" + Add-ToPath "$env:MAVEN_HOME\bin" + + Import-Module "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\Microsoft.VisualStudio.DevShell.dll" + Enter-VsDevShell $devShellGeneratedName -SkipAutomaticLocation -DevCmdArguments "-arch=x64 -host_arch=x64" +} +``` +
    +
+
+ +### Default values and Test Data + +
Check out my source function to make using a .env file easier on windows.
+ +
+ + + + + + + + + + + + + + + + + +
Variable NameDefault ValueFile Content
TEST_DATA_STORESnearby_stores.jsonEmulated return json from the redsky `nearby_stores_v1` endpoint
TEST_DATA_CATEGORIEStarget_categories.txtTarget categories scraped from html on target's "all categories" page
+ +### Run Tests + +From the root directory, populate the environment variables and use the maven wrapper to execute the tests. +```PowerShell +source .env +Start-DevTerminal +./mvnw test +``` +#### Log Levels +By default, Threshr's log level is set to Info. You can define log levels for packages by defining the variable package name as a variable, swapping `.` for `_` and prepending with `LOGGER_LEVELS`. As an example, to enable debug logging for the micronaut httpclient you'd create this variable and assignment: +```properties +LOGGER_LEVELS_IO_MICRONAUT_HTTP_CLIENT=DEBUG +``` diff --git a/src/test/groovy/com/graqr/threshr/ThreshrSpec.groovy b/src/test/groovy/com/graqr/threshr/ThreshrSpec.groovy index bb3fe03..274b9b2 100644 --- a/src/test/groovy/com/graqr/threshr/ThreshrSpec.groovy +++ b/src/test/groovy/com/graqr/threshr/ThreshrSpec.groovy @@ -38,7 +38,6 @@ class ThreshrSpec extends Specification { @Shared @Value('${threshr.test.data.stores}') - // $env:THRESHR_TEST_DATA_STORES String storesFilePath @Shared diff --git a/src/test/groovy/com/graqr/threshr/model/queryparam/PageSpec.groovy b/src/test/groovy/com/graqr/threshr/model/queryparam/PageSpec.groovy index 2fda6f2..5be9ae7 100644 --- a/src/test/groovy/com/graqr/threshr/model/queryparam/PageSpec.groovy +++ b/src/test/groovy/com/graqr/threshr/model/queryparam/PageSpec.groovy @@ -1,25 +1,100 @@ package com.graqr.threshr.model.queryparam +import com.graqr.threshr.ThreshrException +import io.micronaut.context.annotation.Value +import io.micronaut.core.io.ResourceLoader import io.micronaut.test.extensions.spock.annotation.MicronautTest +import jakarta.inject.Inject +import spock.lang.Shared import spock.lang.Specification +import java.util.function.Function +import java.util.stream.Stream + @MicronautTest class PageSpec extends Specification { + @Shared + @Value('${threshr.test.data.categories}') + String pagesFilepath + + @Shared + String[] expectedPages + + /** + * Removes any trailing directories in the url. + * + * Example: + * "/c/laundry-care-household-essentials/-/N-5xsyr" is trimmed to "/c/laundry-care-household-essentials" + * "laundry-care-household-essentials/-/N-5xsyr" is trimmed to "laundry-care-household-essentials" + * + */ + @Shared + Function trimExcessPath = original -> { + int endStart = original.trim().startsWith("/c/") ? 3 : 0 + return (original.substring(endStart).contains("/") ? + original.substring(0, original.indexOf("/", endStart)) : + original) + } + + @Inject + @Shared + ResourceLoader resourceLoader + + String[] getLinesFromFile(String filepath) { + try (ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(getResourceFromFile(filepath))) { + try (InputStreamReader inputStreamReader = new InputStreamReader(byteArrayInputStream)) { + try (BufferedReader bufferedReader = new BufferedReader(inputStreamReader)) { + return bufferedReader.lines().toArray(String[]::new) + } + } + } + } - def "test creating a page and re-assigning a page"() { + /** + * Reads in a file as a byte array. + * + * @param filepath prepend "classpath:" if path is in test resource root dir + * @return byte array of the file contents + */ + byte[] getResourceFromFile(String filepath) { + try { + return resourceLoader.getResourceAsStream(filepath).get().readAllBytes() + } catch (NoSuchElementException e) { + throw new ThreshrException(String.format("failed to load '%s'. ", filepath) + e.getMessage(), e) + } + } + + def setupSpec() { + expectedPages = getLinesFromFile("classpath:" + pagesFilepath) + } + + + def "test create new Page from #pageValue seed data creates object with expected value"() { given: + pageValue = trimExcessPath.apply(pageValue as String) Page page when: - page = new Page("page") + page = new Page(pageValue) //assumed data has "/c/" prepended to string then: - page.getPage() == "" + page.getPage() == pageValue - where: - pageValue << Arrays.asList('root', 'Fresh Groceries', '') + and: + page.setPage(pageValue.replace("/c/", "")) + then: + page.getPage() == pageValue + where: + pageValue << Stream.of(expectedPages).map(it -> { + String tempPage = (it as String).trim() + int start = tempPage.startsWith("/c/") ? 3 : 0 + if (tempPage.indexOf("/", start + 1)) { + return tempPage.substring(0, tempPage.indexOf("/", start + 1)) + } + return tempPage + }).toArray(String[]::new) } } \ No newline at end of file