48 lines
1.3 KiB
JavaScript
48 lines
1.3 KiB
JavaScript
module.exports = Self => {
|
|
Self.remoteMethodCtx('clientDebtStatementHtml', {
|
|
description: 'Returns the client debt statement email preview',
|
|
accessType: 'READ',
|
|
accepts: [
|
|
{
|
|
arg: 'id',
|
|
type: 'number',
|
|
required: true,
|
|
description: 'The client id',
|
|
http: {source: 'path'}
|
|
},
|
|
{
|
|
arg: 'recipientId',
|
|
type: 'number',
|
|
description: 'The recipient id',
|
|
required: false
|
|
},
|
|
{
|
|
arg: 'from',
|
|
type: 'string',
|
|
required: true
|
|
}
|
|
],
|
|
returns: [
|
|
{
|
|
arg: 'body',
|
|
type: 'file',
|
|
root: true
|
|
}, {
|
|
arg: 'Content-Type',
|
|
type: 'String',
|
|
http: {target: 'header'}
|
|
}, {
|
|
arg: 'Content-Disposition',
|
|
type: 'String',
|
|
http: {target: 'header'}
|
|
}
|
|
],
|
|
http: {
|
|
path: '/:id/client-debt-statement-html',
|
|
verb: 'GET'
|
|
}
|
|
});
|
|
|
|
Self.clientDebtStatementHtml = (ctx, id) => Self.printEmail(ctx, id, 'client-debt-statement');
|
|
};
|