feat: refs #8293 include zone data
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
JOSE ANTONIO TUBAU RODRIGUEZ 2024-12-16 08:34:53 +01:00
parent 8e61160aeb
commit 9c32dc5707
1 changed files with 14 additions and 2 deletions

View File

@ -80,6 +80,12 @@ module.exports = Self => {
description: 'The claimResponsible id',
http: {source: 'query'}
},
{
arg: 'zoneFk',
type: 'string',
description: 'The zone name',
http: {source: 'query'}
},
{
arg: 'myTeam',
type: 'boolean',
@ -174,6 +180,8 @@ module.exports = Self => {
to.setHours(23, 59, 59, 999);
return {'cl.created': {between: [value, to]}};
case 'zoneFk':
return {'t.zoneFk': value};
case 'myTeam':
if (value)
return {'cl.workerFk': {inq: teamMembersId}};
@ -195,11 +203,15 @@ module.exports = Self => {
u.name AS workerName,
cs.code stateCode,
cs.description stateDescription,
cl.created
cl.created,
z.name zoneName,
z.id zoneId
FROM claim cl
LEFT JOIN client c ON c.id = cl.clientFk
LEFT JOIN account.user u ON u.id = cl.workerFk
LEFT JOIN claimState cs ON cs.id = cl.claimStateFk`
LEFT JOIN claimState cs ON cs.id = cl.claimStateFk
LEFT JOIN ticket t ON t.id = cl.ticketFk
LEFT JOIN zone z ON z.id = t.zoneFk`
);
stmt.merge(conn.makeSuffix(filter));