feat: worker-welcome
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Alex Moreno 2022-11-21 15:15:25 +01:00
parent 7a7da9508f
commit 7c75eaadce
4 changed files with 12 additions and 16 deletions

View File

@ -1,11 +0,0 @@
SELECT
c.id,
u.name AS userName,
CONCAT(w.lastName, ' ', w.firstName) salesPersonName,
w.phone AS salesPersonPhone,
CONCAT(wu.name, '@verdnatura.es') AS salesPersonEmail
FROM client c
JOIN account.user u ON u.id = c.id
LEFT JOIN worker w ON w.id = c.salesPersonFk
LEFT JOIN account.user wu ON wu.id = w.userFk
WHERE c.id = ?

View File

@ -0,0 +1,7 @@
SELECT
u.id,
u.name AS userName,
e.email
FROM account.user u
LEFT JOIN account.emailUser e ON e.userFk = u.id
WHERE u.id = ?;

View File

@ -3,7 +3,7 @@
<div class="grid-block vn-pa-ml"> <div class="grid-block vn-pa-ml">
<h1>{{ $t('title', [id]) }}</h1> <h1>{{ $t('title', [id]) }}</h1>
<p>{{ $t('description.dearWorker') }},</p> <p>{{ $t('description.dearWorker') }},</p>
<p>{{ $t('workerData', this.user.name, this.url) }}</p> <p>{{ $t('workerData', this.worker.name, this.url) }}</p>
</div> </div>
</div> </div>
</email-body> </email-body>

View File

@ -2,13 +2,13 @@ const Component = require(`vn-print/core/component`);
const emailBody = new Component('email-body'); const emailBody = new Component('email-body');
module.exports = { module.exports = {
name: 'client-welcome', name: 'worker-welcome',
async serverPrefetch() { async serverPrefetch() {
this.client = await this.fetchClient(this.id); this.worker = await this.fetchWorker(this.id);
}, },
methods: { methods: {
fetchClient(id) { fetchWorker(id) {
return this.findOneFromDef('client', [id]); return this.findOneFromDef('worker', [id]);
}, },
}, },
components: { components: {