8179-testToMaster #3176

Merged
alexm merged 407 commits from 8179-testToMaster into master 2024-11-12 06:41:52 +00:00
1 changed files with 30 additions and 3 deletions
Showing only changes of commit 4d0bb81632 - Show all commits

View File

@ -67,6 +67,18 @@ module.exports = Self => {
type: 'String',
description: 'The worker user name',
http: {source: 'query'}
},
{
arg: 'SSN',
type: 'String',
description: 'The worker SSN',
http: {source: 'query'}
},
{
arg: 'email',
type: 'String',
description: 'The user email',
http: {source: 'query'}
}
],
returns: {
@ -99,6 +111,8 @@ module.exports = Self => {
return {'w.firstName': {like: `%${value}%`}};
case 'lastName':
return {'w.lastName': {like: `%${value}%`}};
case 'nickname':
return {'u.nickname': {like: `%${value}%`}};
case 'extension':
return {'p.extension': value};
case 'fi':
@ -107,6 +121,10 @@ module.exports = Self => {
return {'d.id': value};
case 'userName':
return {'u.name': {like: `%${value}%`}};
case 'email':
return {'eu.email': {like: `%${value}%`}};
case 'SSN':
return {'w.SSN': value};
}
});
@ -116,15 +134,24 @@ module.exports = Self => {
let stmt;
stmt = new ParameterizedSQL(
`SELECT w.id, u.email, p.extension, u.name as userName,
d.name AS department, w.lastName, u.nickname, mu.email
`SELECT w.id,
w.lastName,
w.firstName,
w.SSN,
u.email,
u.nickname,
p.extension,
u.name as userName,
d.name AS department,
eu.email,
c.fi
FROM worker w
LEFT JOIN workerDepartment wd ON wd.workerFk = w.id
LEFT JOIN department d ON d.id = wd.departmentFk
LEFT JOIN client c ON c.id = w.id
LEFT JOIN account.user u ON u.id = w.id
LEFT JOIN pbx.sip p ON p.user_id = u.id
LEFT JOIN account.emailUser mu ON mu.userFk = u.id`
LEFT JOIN account.emailUser eu ON eu.userFk = u.id`
);
stmt.merge(conn.makeSuffix(filter));