LF-5214: RTK Query API layer and i18n#4092
LF-5214: RTK Query API layer and i18n#4092litefarm-pr-bot wants to merge 1 commit intointegrationfrom
Conversation
Adds the data layer foundation for the Farm Notes / noticeboard feature: URL constants, TypeScript types, RTK Query endpoint definitions, and English locale strings in translation.json and message.json. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| @@ -1,4 +1,5 @@ | |||
| { | |||
| "{undefined}": "MISSING", | |||
There was a problem hiding this comment.
Oh yes, we do have this problem running pnpm i18n! I could add instructions to the agent to manually remove it, although it would be better to just fix. Do you happen to remember why this happens @SayakaOno?
Edit: I can whip up a little ticket as this kind of limited scope thing the bot is pretty good at. Update: PR is opened here: #4094
| "WIDTH": "Watercourse width" | ||
| } | ||
| }, | ||
| "FARM_NOTE": { |
There was a problem hiding this comment.
I wasn't sure if I liked this pattern or not (strings separate) so I let it go through as a test. I thought maybe it would be easier to update CrowdIn this way?
But then the next agent automatically added the strings it needed for its PR, so one or the other will have to get deleted! Probably it's better to just keep strings with their UI elements.
Description
This PR establishes the data layer foundation that all other Farm Notes UI PRs depend on. The
farm_noteandfarm_notes_readroutes did not previously exist in the frontend at all — this adds the URL constants, TypeScript types, and RTK Query endpoint definitions that downstream components will consume directly as hooks.The two RTK Query API files follow the
marketDirectoryInfoApi.ts/supportTicketApi.tspatterns already in use:farmNoteApi.tsinjects four endpoints (GET list, POST with optionalFormDatafile upload, PATCH by ID, DELETE by ID) andfarmNotesReadApi.tsinjects a GET and a no-argument PATCH. TheFarmNotetype includes ato_sync?: booleanclient-only field (never returned by the API) which future offline-optimistic PRs will use to render a "Pending sync" indicator. English locale strings are added totranslation.json(UI labels) andmessage.json(snackbar messages) and sorted viapnpm i18n.No saga, no Redux slice — RTK Query handles caching and invalidation entirely.
onQueryStartedoptimistic updates for offline support are out of scope here and will be added in the offline PR.Jira link: https://lite-farm.atlassian.net/browse/LF-5214
Type of change
How Has This Been Tested?
Data layer only — no UI rendered. TypeScript types and RTK Query endpoint definitions reviewed in source.
pnpm i18nrun to confirm locale keys are valid and alphabetized. No local server running; visual review not applicable.Checklist:
pnpm i18nto help with this)