Commit Graph

29 Commits

Author SHA1 Message Date
9883e643e6 Convert tasks list and task view to Remote Function queries. 2025-10-10 11:31:27 -05:00
5c8ef1fde5 Create empty service respone property. 2025-10-10 11:19:47 -05:00
675cb0b3ca File rename. 2025-10-04 02:09:41 -05:00
a6b3ab15cc Add documentation. 2025-10-04 01:08:19 -05:00
b13cee614e Task editing proof of concept.
This method uses url query params to detect when the page should be in
edit mode. There are two issues with the current approach:

1. The url query param is actually a pretty unintuitive pattern. It's
   disorienting to hit the back button and have it take you from edit
   mode to view mode rather than returning to the main task list.
2. The submit button does return the user to view mode, but caching
   results in the need for a refresh to see the updated task record.
   This can be solved.
2025-10-03 22:41:27 -05:00
bee3fdf2ca Update error handling and logging. 2025-10-03 22:35:16 -05:00
2962c3aace Change tasks schema.
Existing date fields in the tasks table have been changed from TEXT to
INTEGER with mode set to timestamp. This will simplify date storage.
There were a number of issues encountered with storing dates as typed
strings.
2025-10-03 21:53:37 -05:00
eddaf02824 Add method to intelligently insert/update.
The `upsert()` method can both create and update tasks. The method
checks for an `id` propery to determine whether to `INSERT` or `UPDATE`.

A successful operation returns a `ServiceResponse` object with the
inserted task `id`, which can be used to fetch updated information if
needed.

The `NewTask` type is exported for use in form actions, etc.
2025-10-02 00:01:52 -05:00
19ff88c661 Add TaskView component. 2025-10-01 23:04:04 -05:00
95826cde40 Add method to search by parent_id. 2025-10-01 01:07:20 -05:00
a4a09380b6 Export task types. 2025-09-29 23:10:03 -05:00
5bc27f6061 Improve typing and internal abstraction.
The only breaking change here is the 'tasks' field is now 'data'. All
other changes were made to improve TypeScripts ability to infer complex
types or internal abstractions that don't affect client consumption.
2025-09-29 22:39:25 -05:00
0990cf5c56 Add service response types for standardizing returns.
Typescript is currently having difficulty parsing Service class return
types. Providing more explicit return types should improve the
situation.
2025-09-29 21:38:19 -05:00
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
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
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
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
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