Submit reimbursements

This commit is contained in:
2020-10-01 12:48:01 +02:00
parent c1eb93c596
commit c7b6f9e3e7
5 changed files with 71 additions and 29 deletions
+17
View File
@@ -577,6 +577,23 @@ export default Service.extend({
return obj;
},
addReimbursement (attributes) {
console.debug('[kredits] add reimbursement', attributes);
return this.kredits.Reimbursement.add(attributes, { gasLimit: 300000 })
.then(data => {
console.debug('[kredits] add reimbursement response', data);
const reimbursement = Reimbursement.create(processReimbursementData(data));
reimbursement.setProperties({
contributor: this.contributors.findBy('id', attributes.contributorId),
pendingTx: data,
confirmedAtBlock: this.currentBlock + 40320
});
this.reimbursements.pushObject(reimbursement);
return reimbursement;
});
},
//
// Contract events
//