forked from PipedreamHQ/pipedream
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleaning up example actions and adding common ones (Beebole team) (Pi…
…pedreamHQ#11615) * [master] Clean up example services. Added run-report and list-untimed-employees * [master] es-linted * [master] versioning update * Version bumps post-merge --------- Co-authored-by: GTFalcao <[email protected]>
- Loading branch information
1 parent
857dd22
commit ba17a2c
Showing
7 changed files
with
426 additions
and
98 deletions.
There are no files selected for viewing
33 changes: 0 additions & 33 deletions
33
components/beebole_app/actions/create-company/create-company.mjs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
components/beebole_app/actions/list-untimed-employees/list-untimed-employees.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import app from "../../beebole_app.app.mjs"; | ||
|
||
export default { | ||
name: "List untimed employees", | ||
description: "Get a list of employees without any time entry for a given period of time", | ||
key: "beebole_app-list-untimed-employees", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
app, | ||
begda: { | ||
propDefinition: [ | ||
app, | ||
"begda", | ||
], | ||
}, | ||
endda: { | ||
propDefinition: [ | ||
app, | ||
"endda", | ||
], | ||
}, | ||
}, | ||
async run({ $ }) { | ||
let response, | ||
people = []; | ||
|
||
try { | ||
response = await this.app.apiRequest({ | ||
$, | ||
data: { | ||
service: "time.get_people_timesheets", | ||
undoc: true, | ||
from: this.begda.split("-"), | ||
to: this.endda.split("-"), | ||
show: "all", | ||
statusFilters: [ | ||
"d", | ||
], | ||
showAll: true, | ||
details: [], | ||
}, | ||
}); | ||
|
||
$.export("$summary", `Successfully generated list for ${response.items[0].people.length} people`); | ||
|
||
response.items[0].people.forEach((element) => { | ||
people.push({ | ||
name: element.doc.name, | ||
eid: element.eid, | ||
draft: element.hours.sum, | ||
}); | ||
}); | ||
return people; | ||
} catch (errors) { | ||
return errors; | ||
} | ||
}, | ||
}; |
Oops, something went wrong.