Data and Screen Reference
A compact reference of screens, data records, routes, and supporting files found in the module package.
Screens and Views
Controllers
Notes
View files
- notes/file_preview.php
- notes/index.php
- notes/modal_form.php
- notes/view.php
Data Records
Models
- Notes_model.php
Database tables
- notes
Note categories
Every note carries a category in the notes.type column: note, scribble or journal. Notes created before this column existed are note. The category is set when the note is created and is not editable afterwards, on the web or through the API.
Where it is used
Each tab on the Notes page lists one category. The note lists embedded on client, lead and project pages are unfiltered and still show every category, with a small brush or book icon marking scribbles and journal entries.
Who can write which
The web creates all three. A scribble made on the web is drawn on the scribble pad; one made in the mobile app arrives as a finished image. Either way the picture is stored as an inline image at the start of notes.description, which is where every reader looks for it.
notes/analyze_scribble
Posts the drawn scene (never the picture) and returns AkbAI’s review of it as a small block of HTML. The prompt is composed on the server from the sanitised scene, so the browser supplies drawing data and never instructions, and the review reaches the note only when the writer chooses to insert it. Answers success:false with a readable message when the assistant is off or unconfigured. Audited in ci_assist_history under notes.scribble_analysis.
notes.scribble_data
The re-editable drawing behind a scribble, stored as JSON: the paper style plus the shapes, their positions, colours and labels. Empty means the drawing has no scene — a photographed whiteboard, a pasted screenshot — and the edit form then falls back to plain rich text. Both the web pad and the End-User API read and write it, through one shared validator (modules/Notes/libraries/Scribble_scene.php), so a drawing saved on either surface re-opens with its shapes intact on the other. The scene and the picture in notes.description are written as a pair: replacing the picture without a matching scene clears the scene, because one that no longer matches must not be replayed.
End-User API
GET /v1/api/me/notes?type=scribble filters by category, every note returned carries type, and POST accepts it (defaulting to note). Sending type to the update endpoint is rejected. A scribble’s drawing round-trips too: GET /v1/api/me/notes/{id} returns its scribble_data scene, and POST/PATCH accept one alongside the description it renders to. The listing omits scenes and reports has_scribble_scene instead, so one large drawing cannot bloat a page of 25.
Adding a category later
The column is a VARCHAR with the allowed values enforced in code, so a future category such as a meeting transcript needs no database change.
Journal entry dates
A journal entry carries notes.entry_date (DATE) — the day it is about, which is not necessarily the day it was written. It defaults to the writer's local day, stays editable, and is what the Journal feed groups by and the calendar counts. Entries written before the column existed were backfilled from their creation day; anything still NULL falls back to DATE(created_at) at read time.
Feed
The Journal tab pages through notes/journal_feed newest day first, ordered by entry date then creation time. Only journal entries you created appear.
Calendar
notes/journal_calendar returns one month of per-day entry counts — the dots on the rail — bounded to the month being viewed rather than the whole history.
Routes and Entry Points
| Route | Target |
|---|---|
notes | Notes/index |
notes/(:any) | Notes/$1 |
Supporting Files
Migrations
- 20260902142421_add_updated_at_to_notes
- 20260902144425_add_type_to_notes
- 20260902164247_add_entry_date_to_notes
- 20260903090652_add_scribble_data_to_notes
Seeders
- NotesDemoSeeder.php
Tests
- ScribbleSceneTest.php
Run with php erpat module:test Notes.
Helpers
No module helpers were found.
Libraries
- Scribble_scene.php
The drawing validator shared by the web pad and the End-User API.
API configs
No API config files were found.