Commit 44989620 authored by Venkata Rajesh Kumar Gajjala's avatar Venkata Rajesh Kumar Gajjala
parents d01cf57b 2047d62f
......@@ -111,7 +111,7 @@ INSERT INTO transaction_recorder VALUES ( uuid_generate_v4() ,
CREATE TABLE offer_metadata
(
offer_id serial PRIMARY KEY,
eligibilty VARCHAR(200),
eligibility VARCHAR(200),
discount_type VARCHAR(200),
status VARCHAR(50) NOT NULL,
start_time VARCHAR(20),
......
package com.nisum.offertransactionservice.controller;
import com.nisum.offertransactionservice.dto.EndOfSaleReq;
import com.nisum.offertransactionservice.dto.EndOfSaleResponse;
import com.nisum.offertransactionservice.dto.OfferTransactionRequest;
import com.nisum.offertransactionservice.dto.OfferTransactionResponse;
import com.nisum.offertransactionservice.service.EndOfSaleService;
......@@ -14,7 +15,7 @@ import javax.validation.Valid;
import java.io.IOException;
@RestController
@CrossOrigin
@CrossOrigin("*")
public class OfferTransactionController {
@Autowired
......@@ -35,16 +36,16 @@ public class OfferTransactionController {
@PostMapping("endOfSale")
public String endOfSale(@Valid @RequestBody EndOfSaleReq endOfSaleReq) throws IOException {
public EndOfSaleResponse endOfSale(@Valid @RequestBody EndOfSaleReq endOfSaleReq) throws IOException {
MDC.put("swy-res-unique-uuid", endOfSaleReq.getOfferTransactionResponse().getHhid());
MDC.put("user-id", endOfSaleReq.getOfferTransactionResponse().getHhid());
String transactionID = endOfSaleService.putEndofSaleResInDb(endOfSaleReq);
return transactionID;
EndOfSaleResponse endOfSaleResponse = new EndOfSaleResponse();
endOfSaleResponse.setUuId(transactionID);
return endOfSaleResponse;
}
@PostMapping("/endOfTransaction")
public String endOfTransaction(@Valid @RequestBody String uuid) {
MDC.put("swy-res-unique-uuid", uuid);
......
......@@ -35,6 +35,6 @@ public class EndOfSaleEntity {
@Type(type = "jsonb")
@Column(name = "offers")
String offers;
@Column(name = "isprocessed")
@Column(name = "finished")
Boolean isProcessed = Boolean.TRUE;
}
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