31 lines
837 B
JavaScript
31 lines
837 B
JavaScript
|
module.exports = Self => {
|
||
|
Self.remoteMethodCtx('getClockIn', {
|
||
|
description: 'Shows the clockings for each day, in columns per day',
|
||
|
accessType: 'READ',
|
||
|
accepts: [
|
||
|
{
|
||
|
arg: 'workerFk',
|
||
|
type: 'int',
|
||
|
required: true,
|
||
|
},
|
||
|
{
|
||
|
arg: 'key',
|
||
|
type: 'string',
|
||
|
}
|
||
|
],
|
||
|
http: {
|
||
|
path: `/getClockIn`,
|
||
|
verb: 'POST'
|
||
|
}
|
||
|
});
|
||
|
|
||
|
Self.getClockIn = async(ctx, workerFk, key, options) => {
|
||
|
const myOptions = {};
|
||
|
if (typeof options == 'object')
|
||
|
Object.assign(myOptions, options);
|
||
|
|
||
|
const query = `CALL vn.workerTimeControl_getClockIn(?, CURDATE())`;
|
||
|
return await Self.rawSql(query, [workerFk], myOptions);
|
||
|
};
|
||
|
};
|