Commit Graph

26 Commits

Author SHA1 Message Date
fca17a796d Update getAll() to return status codes. 2025-09-28 16:12:07 -05:00
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
136b58c44f Add /tasks route to load all tasks.
Currently just a proof of concept. The data is pulled from the database
and a few fields display in a table.
2025-09-27 23:28:57 -05:00
5fddf2f394 Create seeding script.
The script updates task related tables only at this time.

Arguments "seed" and "reset" can be passed. "seed" accepts a flag
"--count" which specifies a custom number of task entries to generate.
"task_types" are currently fixed at TA and PC.

To account for db adapter limitations, the script will automatically
batch databse entries by 500 requests.
2025-09-27 23:24:20 -05:00
b6c6f74576 Add drizzle-seed and faker-js for database seeding. 2025-09-27 23:23:21 -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
8fe8ba68f8 Fix logger log level for development. 2025-09-27 14:22:38 -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
2c9b855d2a Add database type. 2025-09-27 11:02:17 -05:00
22c782c3ec Remove drizzle directory from repo. 2025-09-26 21:52:49 -05:00
450bcf173f Add task related tables.
Pivoting from "records" to a combination of "tasks", "micro-tasks",
"assets", and a few others.
2025-09-26 21:49:36 -05:00
009b1925e6 Add logger and gitignore output.
Since the current workflow includes running files directly, SvelteKit's
$dev env won't work. Using Node envs directly.
2025-09-26 13:09:54 -05:00
2c3f9be58f Add pino and pino-pretty. 2025-09-26 12:08:19 -05:00
c8560810fc Formatting pass. 2025-09-25 22:47:41 -05:00
eb6c1a84b7 Add schema to db.ts. 2025-09-25 17:21:35 -05:00
daa85abc8c Fix invalid SQL syntax for index creation.
One of the sql generations mistakenly looked for a field value of '?'.
Whatever code was causing this to occur is no longer an issue. This does
highlight the difficulty of needing to delete or modify faulty migration
files.
2025-09-25 15:57:52 -05:00
7cb0621585 Get drizzle-kit working. 2025-09-25 15:34:19 -05:00
1fcddc2892 Change .gitignore to ignore all ".db" files. 2025-09-25 15:31:36 -05:00
cea75fcf85 Add dprint config. 2025-09-25 15:14:03 -05:00
862cf4fe5d Add drizzle.config.ts. 2025-09-25 15:13:51 -05:00
6df86a1691 Add recordTypes table with relations and auto-created indexes. 2025-09-25 15:04:27 -05:00
86fdbb9ac5 Add recordTypes schema file. 2025-09-25 00:38:33 -05:00
bd01e0223d Add drizzle. 2025-09-25 00:38:16 -05:00
d347ec21d1 Initialize Sveltekit. 2025-09-25 00:06:52 -05:00
1f16325828 Initial commit 2025-09-25 00:02:02 -05:00