File tree Expand file tree Collapse file tree
client/src/main/java/net/corda/samples/auction/client Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ available in the `Active Auction` section.
111111
1121125 . Place one more bid by switching to PartyC.
113113
114- 6 . What for the auction to end.
114+ 6 . Wait for the auction to end.
115115
1161167 . Once the auction is ended its ready to be settled. Settlement can be initiated by the
117117highest bidder. Considering PartyC is the highest bidder, switch to PartyC.
Original file line number Diff line number Diff line change 1414import org .springframework .beans .factory .annotation .Qualifier ;
1515import org .springframework .web .bind .annotation .*;
1616
17+ import java .text .SimpleDateFormat ;
1718import java .time .LocalDateTime ;
18- import java .time .format . DateTimeFormatter ;
19+ import java .time .ZoneId ;
1920import java .util .List ;
2021import java .util .UUID ;
2122import java .util .concurrent .ExecutionException ;
@@ -71,11 +72,12 @@ public APIResponse<Void> createAsset(@RequestBody Forms.AssetForm assetForm){
7172 @ PostMapping ("create" )
7273 public APIResponse <Void > createAuction (@ RequestBody Forms .CreateAuctionForm auctionForm ){
7374 try {
75+ SimpleDateFormat dateFormatter = new SimpleDateFormat ("dd-MM-yyyy hh:mm:ss a" );
76+ LocalDateTime formattedDeadline = LocalDateTime .ofInstant (dateFormatter .parse (auctionForm .getDeadline ()).toInstant (), ZoneId .systemDefault ());
7477 activeParty .startFlowDynamic (CreateAuctionFlow .CreateAuctionInitiator .class ,
7578 Amount .parseCurrency (auctionForm .getBasePrice () + " USD" ),
7679 UUID .fromString (auctionForm .getAssetId ()),
77- LocalDateTime .parse (auctionForm .getDeadline (),
78- DateTimeFormatter .ofPattern ("dd-MM-yyyy hh:mm:ss a" ))).getReturnValue ().get ();
80+ formattedDeadline ).getReturnValue ().get ();
7981 return APIResponse .success ();
8082 }catch (ExecutionException e ){
8183 if (e .getCause () != null && e .getCause ().getClass ().equals (TransactionVerificationException .ContractRejection .class )){
You can’t perform that action at this time.
0 commit comments