Skip to content

Commit

Permalink
#23 Add operation text for Credit Offer Deal Expired
Browse files Browse the repository at this point in the history
  • Loading branch information
ihorml committed Nov 7, 2022
1 parent 80a7313 commit 54c24a4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions app/core/app.utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@
object: (objectId) => ({
text: objectId,
href: `/#/objects/${objectId}`
}),
offer: (offerId) => ({
text: offerId,
href: `/#/credit-offers/${offerId}`
})
})

Expand Down Expand Up @@ -1559,6 +1563,23 @@
})
}

else if (operation_type === 74) { // Expired Credit Deal
console.log('debug expired', operation)
const operation_account = operation.borrower;
const unpaid = operation.unpaid_amount;
getAccount(operation_account).then((account_name) => {
getAsset(unpaid.asset_id, unpaid.amount).then((unpaidAsset) => {
operation_text = $filter('translateWithLinks')('Operation Credit Deal Expired', {
accountLink : getLink().account(account_name),
amount : unpaidAsset.amount,
offerLink : getLink().offer(operation.offer_id),
assetLink : getLink().asset(unpaidAsset.symbol),
});
callback(operation_text)
});
})
}

else {

operation_text = $filter('translate')('Operation Beautifier Missing Description', {
Expand Down
2 changes: 1 addition & 1 deletion app/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
"Operation Credit Offer Update": "{{accountLink}} update a credit offer #{{offerId}}",
"Operation Credit Offer Accept": "{{accountLink}} borrows {{amount}} {{assetLink}} from credit offer #{{offerId}}",
"Operation Credit Deal Repay": "{{accountLink}} repays {{amount}} {{assetLink}} to credit offer with fee {{feeAmount}} {{feeAssetLink}}",
"Operation Credit Deal Expired": "{{accountLink}} create a credit offer of {{amount}} {{assetLink}} with fee rate {{fee}}%",
"Operation Credit Deal Expired": "{{accountLink}} credit deal for offer {{offerLink}} has expired. Unpaid amount: {{amount}} {{assetLink}}",
"Operation Ticket Create Description": "{{accountLink}} locked away {{amount}} {{assetLink}} in a voting ticket",
"Operation Ticket Update Description": "{{accountLink}} changed the locked away amount to {{amount}} {{assetLink}} of ticket {{ticket}}",

Expand Down

0 comments on commit 54c24a4

Please sign in to comment.