From 5c1f0fdaf480b175f3a79c84fcfba2c4c2964f0f Mon Sep 17 00:00:00 2001 From: Andrew Hurt <31732124+awjh-ibm@users.noreply.github.com> Date: Fri, 1 Jun 2018 15:29:49 +0100 Subject: [PATCH] fix for 144 (#145) Signed-off-by: awjh-ibm --- .../LetterOfCredit/LetterOfCredit.js | 24 +++++-------------- .../src/components/LoCCard/LoCCard.js | 2 +- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/packages/letters-of-credit/src/components/LetterOfCredit/LetterOfCredit.js b/packages/letters-of-credit/src/components/LetterOfCredit/LetterOfCredit.js index c42574dd..876a7ff6 100644 --- a/packages/letters-of-credit/src/components/LetterOfCredit/LetterOfCredit.js +++ b/packages/letters-of-credit/src/components/LetterOfCredit/LetterOfCredit.js @@ -181,11 +181,8 @@ class LetterOfCredit extends Component { "$class": "org.example.loc.ProductDetails", "productType": type, "quantity": quantity, - "pricePerUnit": price.toFixed(2), - "id": "string" - }, - "transactionId": "", - "timestamp": "2018-03-13T11:35:00.218Z" // the transactions seem to need this field filled in; when submitted the correct time will replace this value + "pricePerUnit": price.toFixed(2) + } }) .then(() => { this.setState({ @@ -219,9 +216,7 @@ class LetterOfCredit extends Component { axios.post(this.config.restServer.httpURL+'/Approve', { "$class": "org.example.loc.Approve", "loc": letter, - "approvingParty": resourceURL+approvingParty, - "transactionId": "", - "timestamp": "2018-03-13T11:25:08.043Z" // the transactions seem to need this field filled in; when submitted the correct time will replace this value + "approvingParty": resourceURL+approvingParty }) .then(() => { this.setState({ @@ -243,9 +238,7 @@ class LetterOfCredit extends Component { axios.post(this.config.restServer.httpURL+'/Reject', { "$class": "org.example.loc.Reject", "loc": letter, - "closeReason": "Letter has been rejected", - "transactionId": "", - "timestamp": "2018-03-13T11:35:00.281Z" // the transactions seem to need this field filled in; when submitted the correct time will replace this value + "closeReason": "Letter has been rejected" }) .then(() => { this.setState({ @@ -265,10 +258,7 @@ class LetterOfCredit extends Component { let letter = "resource:org.example.loc.LetterOfCredit#" + letterId; axios.post(this.config.restServer.httpURL+'/ReadyForPayment', { "$class" : "org.example.loc.ReadyForPayment", - "loc": letter, - 'beneficiary': "resource:org.example.loc.Customer#bob", - "transactionId": "", - "timestamp": "2018-03-13T11:35:00.281Z" // the transactions seem to need this field filled in; when submitted the correct time will replace this value + "loc": letter }) .then(() => { this.setState({ @@ -289,9 +279,7 @@ class LetterOfCredit extends Component { axios.post(this.config.restServer.httpURL+'/Close', { "$class": "org.example.loc.Close", "loc": letter, - "closeReason": "Letter has been completed.", - "transactionId": "", - "timestamp": "2018-03-13T11:35:00.139Z" // the transactions seem to need this field filled in; when submitted the correct time will replace this value + "closeReason": "Letter has been completed." }) .then(() => { this.setState({ diff --git a/packages/letters-of-credit/src/components/LoCCard/LoCCard.js b/packages/letters-of-credit/src/components/LoCCard/LoCCard.js index 62d53c64..db398d95 100644 --- a/packages/letters-of-credit/src/components/LoCCard/LoCCard.js +++ b/packages/letters-of-credit/src/components/LoCCard/LoCCard.js @@ -162,7 +162,7 @@ class LoCCard extends Component { ); } } else { - if (letter.status !== 'AWAITING_APPROVAL' && letter.status !== 'APPROVED') { + if (letter.status !== 'AWAITING_APPROVAL' && letter.status !== 'APPROVED' && letter.status !== 'REJECTED') { // generating a hash from the timestamp shippingText = "Receive Product"; if (letter.status !== 'SHIPPED') {