4658-createWorker #1236

Merged
alexm merged 35 commits from 4658-createWorker into dev 2023-01-23 07:30:52 +00:00
4 changed files with 12 additions and 16 deletions
Showing only changes of commit 7c75eaadce - Show all commits

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">
<h1>{{ $t('title', [id]) }}</h1>
<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>
</email-body>

View File

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