Skip to content

Commit

Permalink
feat: Method stub for last invoices list.
Browse files Browse the repository at this point in the history
  • Loading branch information
zoernert committed Feb 13, 2024
1 parent 4d1fe72 commit f3e85ef
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion framework/services/debit.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,16 @@ module.exports = {
* Actions
*/
actions: {

invoices: {
rest: {
method: "GET",
path: "/invoices"
},
async handler(ctx) {
let res = await ctx.call("invoice_model.find",{query:{},sort:"-_id",limit:100});
return res;
}
},
assets: {
rest: {
method: "GET",
Expand Down Expand Up @@ -340,6 +349,7 @@ module.exports = {
delete current_debit._id;

current_debit.clearing = await ctx.call("clearing.commit",transient_clearing);
current_debit.handle = await ctx.call("access.randomString",{length:12});
current_debit.jwt = await ctx.call("access.createInvoiceJWT",current_debit);
await ctx.call("invoice_model.insert",{entity:current_debit});
await ctx.broker.emit("invoice.created", current_debit);
Expand Down

0 comments on commit f3e85ef

Please sign in to comment.