Commit 285acc44 authored by Naren Medarametla's avatar Naren Medarametla

changed data type in offerlookup entity

parent a6d55bdd
...@@ -10,10 +10,10 @@ import javax.swing.text.html.Option; ...@@ -10,10 +10,10 @@ import javax.swing.text.html.Option;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
public interface OfferLookupRepo extends JpaRepository<OfferLookup,Long> { public interface OfferLookupRepo extends JpaRepository<OfferLookup,String> {
@Query(value= "SELECT * FROM offer_lookup WHERE id=:hhid" , nativeQuery = true) @Query(value= "SELECT * FROM offer_lookup WHERE id=:hhid" , nativeQuery = true)
public List<OfferLookup> findByHhId(Long hhid); public List<OfferLookup> findByHhId(String hhid);
......
...@@ -18,7 +18,7 @@ import javax.persistence.EmbeddedId; ...@@ -18,7 +18,7 @@ import javax.persistence.EmbeddedId;
public class OfferLookupDTO { public class OfferLookupDTO {
Long id; String id;
String idType; String idType;
Long offerId; Long offerId;
String storeId; String storeId;
......
...@@ -21,7 +21,7 @@ import static com.google.common.collect.Lists.newArrayList; ...@@ -21,7 +21,7 @@ import static com.google.common.collect.Lists.newArrayList;
public class OfferTransactionRequest { public class OfferTransactionRequest {
@NotNull @NotNull
Long hhId; String hhId;
String transactionId= UUID.randomUUID().toString(); String transactionId= UUID.randomUUID().toString();
......
...@@ -19,7 +19,7 @@ public class OfferLookup { ...@@ -19,7 +19,7 @@ public class OfferLookup {
@Id @Id
@Column(name = "id") @Column(name = "id")
Long id; String id;
@Id @Id
@Column(name ="offer_type") @Column(name ="offer_type")
......
...@@ -19,7 +19,7 @@ public class OfferLookupComposite implements Serializable { ...@@ -19,7 +19,7 @@ public class OfferLookupComposite implements Serializable {
@Column(name = "id") @Column(name = "id")
Long id; String id;
@Column(name ="offer_type") @Column(name ="offer_type")
String idType; String idType;
......
spring.datasource.url=jdbc:postgresql://127.0.0.1:5432/storedb spring.datasource.url=jdbc:postgresql://127.0.0.1:5432/storedb
spring.datasource.username=postgres spring.datasource.username=postgres
spring.datasource.password=dbpwd spring.datasource.password=welcome123
endpoint.url.promotionEngineUrl=/promotionEngine/calculateDiscount endpoint.url.promotionEngineUrl=/promotionEngine/calculateDiscount
endpoint.url.peBaseUrl=http://localhost:7073 endpoint.url.peBaseUrl=http://localhost:7073
endpoint.url.storeProducerUrl=/store/producer endpoint.url.storeProducerUrl=/store/producer
......
...@@ -81,8 +81,8 @@ class OfferTransactionControllerTest { ...@@ -81,8 +81,8 @@ class OfferTransactionControllerTest {
} }
private List<OfferLookup> getOffers() { private List<OfferLookup> getOffers() {
OfferLookup offerLookup1 = new OfferLookup(1L, "12", 234L, "02", "AND", "BOGO"); OfferLookup offerLookup1 = new OfferLookup("123", "12", 234L, "02", "AND", "BOGO");
OfferLookup offerLookup2 = new OfferLookup(2L, "13", 234L, "02", "OR", "BXGY"); OfferLookup offerLookup2 = new OfferLookup("1213", "13", 234L, "02", "OR", "BXGY");
List<OfferLookup> offerLookups = new ArrayList<>(); List<OfferLookup> offerLookups = new ArrayList<>();
offerLookups.add(offerLookup1); offerLookups.add(offerLookup1);
offerLookups.add(offerLookup2); offerLookups.add(offerLookup2);
...@@ -139,7 +139,7 @@ class OfferTransactionControllerTest { ...@@ -139,7 +139,7 @@ class OfferTransactionControllerTest {
private List<OfferLookupDTO> getOfferLookupDto(){ private List<OfferLookupDTO> getOfferLookupDto(){
OfferLookupDTO offerLookupDTO = new OfferLookupDTO(); OfferLookupDTO offerLookupDTO = new OfferLookupDTO();
offerLookupDTO.setId(123456L); offerLookupDTO.setId("123");
offerLookupDTO.setIdType("1234"); offerLookupDTO.setIdType("1234");
offerLookupDTO.setOfferId(1L); offerLookupDTO.setOfferId(1L);
offerLookupDTO.setPreCondition("And"); offerLookupDTO.setPreCondition("And");
...@@ -161,7 +161,7 @@ class OfferTransactionControllerTest { ...@@ -161,7 +161,7 @@ class OfferTransactionControllerTest {
OfferLookupDTO offerLookupDTO1 = new OfferLookupDTO(); OfferLookupDTO offerLookupDTO1 = new OfferLookupDTO();
offerLookupDTO1.setId(123456L); offerLookupDTO1.setId("123");
offerLookupDTO1.setIdType("1234"); offerLookupDTO1.setIdType("1234");
offerLookupDTO1.setOfferId(1L); offerLookupDTO1.setOfferId(1L);
offerLookupDTO1.setPreCondition("And"); offerLookupDTO1.setPreCondition("And");
......
...@@ -93,8 +93,8 @@ public class EndOfSaleTest { ...@@ -93,8 +93,8 @@ public class EndOfSaleTest {
} }
public List<OfferLookup> returnOffers() { public List<OfferLookup> returnOffers() {
OfferLookup offerLookup1 = new OfferLookup(1L, "12", 23L, "02", "AND", "BOGO"); OfferLookup offerLookup1 = new OfferLookup("1", "12", 23L, "02", "AND", "BOGO");
OfferLookup offerLookup2 = new OfferLookup(2L, "13", 24L, "02", "OR", "BXGY"); OfferLookup offerLookup2 = new OfferLookup("2", "13", 24L, "02", "OR", "BXGY");
List<OfferLookup> offerLookups = new ArrayList<>(); List<OfferLookup> offerLookups = new ArrayList<>();
offerLookups.add(offerLookup1); offerLookups.add(offerLookup1);
offerLookups.add(offerLookup2); offerLookups.add(offerLookup2);
......
...@@ -103,7 +103,7 @@ public class OfferServiceTest { ...@@ -103,7 +103,7 @@ public class OfferServiceTest {
private OfferTransactionRequest getOfferTransactionRequest() { private OfferTransactionRequest getOfferTransactionRequest() {
OfferTransactionRequest offerTransactionRequest = new OfferTransactionRequest(); OfferTransactionRequest offerTransactionRequest = new OfferTransactionRequest();
offerTransactionRequest.setHhId(123L); offerTransactionRequest.setHhId("123");
List<Item> itemList = new ArrayList<>(); List<Item> itemList = new ArrayList<>();
Item item1 = new Item("Coke", "12", 6.05); Item item1 = new Item("Coke", "12", 6.05);
Item item2 = new Item("Thumpsup", "11", 12.32); Item item2 = new Item("Thumpsup", "11", 12.32);
...@@ -114,8 +114,8 @@ public class OfferServiceTest { ...@@ -114,8 +114,8 @@ public class OfferServiceTest {
} }
public List<OfferLookup> returnOffers() { public List<OfferLookup> returnOffers() {
OfferLookup offerLookup1 = new OfferLookup(1L, "12", 20L, "02", "AND", "BOGO"); OfferLookup offerLookup1 = new OfferLookup("1", "12", 20L, "02", "AND", "BOGO");
OfferLookup offerLookup2 = new OfferLookup(2L, "13", 23L, "02", "OR", "BXGY"); OfferLookup offerLookup2 = new OfferLookup("2", "13", 23L, "02", "OR", "BXGY");
List<OfferLookup> offerLookups = new ArrayList<>(); List<OfferLookup> offerLookups = new ArrayList<>();
offerLookups.add(offerLookup1); offerLookups.add(offerLookup1);
offerLookups.add(offerLookup2); offerLookups.add(offerLookup2);
...@@ -141,7 +141,7 @@ public class OfferServiceTest { ...@@ -141,7 +141,7 @@ public class OfferServiceTest {
private List<OfferLookupDTO> getOfferLookupDto(){ private List<OfferLookupDTO> getOfferLookupDto(){
OfferLookupDTO offerLookupDTO = new OfferLookupDTO(); OfferLookupDTO offerLookupDTO = new OfferLookupDTO();
offerLookupDTO.setId(123456L); offerLookupDTO.setId("12345");
offerLookupDTO.setIdType("1234"); offerLookupDTO.setIdType("1234");
offerLookupDTO.setOfferId(1L); offerLookupDTO.setOfferId(1L);
offerLookupDTO.setPreCondition("And"); offerLookupDTO.setPreCondition("And");
...@@ -163,7 +163,7 @@ public class OfferServiceTest { ...@@ -163,7 +163,7 @@ public class OfferServiceTest {
OfferLookupDTO offerLookupDTO1 = new OfferLookupDTO(); OfferLookupDTO offerLookupDTO1 = new OfferLookupDTO();
offerLookupDTO1.setId(123456L); offerLookupDTO1.setId("12345");
offerLookupDTO1.setIdType("1234"); offerLookupDTO1.setIdType("1234");
offerLookupDTO1.setOfferId(1L); offerLookupDTO1.setOfferId(1L);
offerLookupDTO1.setPreCondition("And"); offerLookupDTO1.setPreCondition("And");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment