Commit Graph

51 Commits

Author SHA1 Message Date
5c8ef1fde5 Create empty service respone property. 2025-10-10 11:19:47 -05:00
077d63c175 Enable the vite/svelte inspector. 2025-10-10 11:17:03 -05:00
d8cbeb05f1 Add zod for data validation 2025-10-10 11:14:04 -05:00
675cb0b3ca File rename. 2025-10-04 02:09:41 -05:00
82400adfc2 Updates. 2025-10-04 02:08:48 -05:00
a6b3ab15cc Add documentation. 2025-10-04 01:08:19 -05:00
fd92f8d803 Enable experimental remote functions and async. 2025-10-03 23:04:48 -05:00
74d65236f4 Update outdated packages. 2025-10-03 23:04:28 -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
b2d7b4983a Update to match the schema changes. 2025-10-03 21:56:11 -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
f63f5ccc5a Rework data fetching and error handling.
Added server-side error handling for obvious total failure cases. If
a task is missing or has unexpected duplicates, SveltKit with now throw
a built in http error.

Added support for parent and child task fetching. Serverside, the raw
response object is passed to the client. The client is now able to
handle the parent and child response objects.
2025-10-01 23:04:04 -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
e2d902d9ca Get dprint working with svelte. 2025-09-29 22:53:48 -05:00
fb5a45587a Formatting. 2025-09-29 22:43:20 -05:00
9c219054d3 Implement changes from TaskService. 2025-09-29 22:42:42 -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
14ece0bed0 Add link to ticket detail page. 2025-09-29 00:42:15 -05:00
e41f651e00 Add route to view a single task. 2025-09-29 00:33:04 -05:00
8c0970a19a Update calls to TaskService. 2025-09-28 16:16:49 -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
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