25 lines
620 B
JavaScript
Executable File
25 lines
620 B
JavaScript
Executable File
const vnReport = require('../../../core/mixins/vn-report.js');
|
|
|
|
module.exports = {
|
|
name: 'campaign-metrics',
|
|
mixins: [vnReport],
|
|
async serverPrefetch() {
|
|
this.client = await this.findOneFromDef('client', [this.id]);
|
|
this.checkMainEntity(this.client);
|
|
this.sales = await this.rawSqlFromDef('sales', [this.id, this.from, this.to]);
|
|
},
|
|
props: {
|
|
id: {
|
|
type: Number,
|
|
required: true,
|
|
description: 'The client id'
|
|
},
|
|
from: {
|
|
required: true
|
|
},
|
|
to: {
|
|
required: true
|
|
}
|
|
}
|
|
};
|