feat: moon add note sync services#1282
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds note sync services to the mono application by implementing note storage functionality in Jupiter and creating REST API endpoints for note synchronization. The changes also include database migration for notes table and regenerated entity files from SeaORM codegen.
- Adds note storage layer in Jupiter with CRUD operations for notes
- Implements REST API endpoints for retrieving and updating note sync state
- Creates database migration to add the notes table with proper indexing
Reviewed Changes
Copilot reviewed 52 out of 53 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| mono/src/server/https_server.rs | Adds SYNC_NOTES_STATE_TAG constant for API documentation |
| mono/src/api/notes/note_router.rs | Implements REST endpoints for note sync state (show/update) |
| mono/src/api/notes/model.rs | Defines request/response models for note API |
| mono/src/api/mod.rs | Integrates note storage into the main API service state |
| mono/src/api/api_router.rs | Registers note router with the main API router |
| jupiter/src/storage/note_storage.rs | Implements note storage layer with database operations |
| jupiter/src/storage/mod.rs | Integrates note storage into the storage service |
| jupiter/src/migration/m20250725_103004_add_note.rs | Database migration to create notes table with indexes |
| jupiter/callisto/src/notes.rs | Generated SeaORM entity for notes table |
| jupiter/callisto/* | Updated generated files from SeaORM codegen 1.1.14 |
| } | ||
|
|
||
| #[utoipa::path( | ||
| get, |
There was a problem hiding this comment.
The API path includes {org_slug} parameter but the function doesn't extract or validate it. This could lead to confusion about which organization the note belongs to.
| ) -> Result<Json<ShowResponse>, ApiError> { | ||
| let note = state.note_stg().get_note_by_id(id.into()).await?; | ||
| if note.is_none() { | ||
| return Err(ApiError::from(anyhow::anyhow!("Note not found"))); |
There was a problem hiding this comment.
The error message "Note not found" should be more specific and include the note ID for better debugging.
| return Err(ApiError::from(anyhow::anyhow!("Note not found"))); | |
| return Err(ApiError::from(anyhow::anyhow!(format!("Note not found with ID: {}", id)))); |
…, enrich error messages
|
link #1184 |
generated.tsand move it to moon