enhancement: add check() validation to PostTable and TemplateTable #229
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
PostTableandTemplateTablehave nocheck()method, unlikeServiceTablewhich validates required fields, generates aliases, and sets timestamps. This allows invalid data to be stored.Current State
src/Table/ServiceTable.php): Has robustcheck()-- validates title, service_type, generates alias, sets created/modified timestamps, ensures valid JSON for credentials/paramssrc/Table/PostTable.php): Empty -- no validation at allsrc/Table/TemplateTable.php): Empty -- no validation at allRecommended Validation
PostTable::check()
article_idis required and > 0service_idis required and > 0statusmust be one of: queued, posting, posted, failed, scheduled, deleted, permanently_failed, cancelledcreated/modifiedtimestampsretry_countto 0platform_post_id,platform_response,error_messageto empty stringTemplateTable::check()
service_typeis requiredtitleis requiredtemplate_bodyis required (non-empty)created/modifiedtimestampsImpact
PostModel::prepareTable()already handles some of this for new posts via the admin form, but direct DB inserts (QueueProcessor, CrossPostDispatcher, DispatchController) bypass itBranch created:
feature/229-enhancement-add-check-validation-to-post