Commit Graph

4 Commits

Author SHA1 Message Date
0c002edefa Add getByTaskId() and getByDbId() methods.
`getByTaskId()` takes an array of strings. It is parsed into task prefix (e.g.
"TA") and task_id. The database is then queried on an array of task_ids.
The result is wrapped in an object with a status code. Currently, the
code is hardcoded as "ok", but can be fleshed out when additional
features are implemented.

There are a few features missing:
- Validation that each string is the right length
- Validation that syntactically valid prefixes and ids were passed
- A check that all requested records are returned
- A check that task prefixes actually exist in the config (requires
  implementing the config module)
- Proper status codes

`getByDbId()` takes and array of id numbers. The database is then
queried with this array. The results are wrapped as above.

Missing features:
- A check that all requested records are returned
- Proper status codes

Both methods return `{status: "failed", error}` when the database
request throws an error.
2025-09-28 16:08:15 -05:00
b68935a11e Update getAll() method to include relations. 2025-09-27 23:21:24 -05:00
0331042b8b Change return value of getAll() failure. 2025-09-27 14:39:57 -05:00
a0d12d4661 Add task service.
Database interactions will be handled by service classes. Service
classes will be called by page load functions as well as by API
endpoints. This will allow one source of truth for authorization and
data validation.
2025-09-27 14:03:18 -05:00