cognovi-ai / the-cdj

The Cognitive Distortion Journal (CDJ) is a smart journaling tool that helps remedy distorted thinking. It can feel impossible to follow the CBT technique of labeling and reframing distorted thinking when you've been thinking this way your whole life. The CDJ can help with that 🧠✨ -- v2 is in development!
https://thecdj.app
4 stars 0 forks source link

refactor: update entry services refactoring #190

Closed davidzlu closed 1 week ago

davidzlu commented 2 weeks ago

This PR refactors update operations in controllers/entry into separate functions and moves them to a new file /models/services/entry/entry.ts. It also adds unit tests for the update service functions.

This PR also refactors EntryAnalysis.getAnalysisContent and EntryChat.getChatContent by moving them from their model files and into a new service file, /models/services/CdGpt.ts, which will act as the interface with the LLM. Unit tests were moved from the models into a new test file for /models/services/CdGpt.ts.

davidzlu commented 1 week ago

Will be rebasing this branch onto 139-ts-migration after #187 and #185 merged into it