Skip to content
Corex

SubmissionsSource

Corex\Config\Data\SubmissionsSource · class · Config layer

The reference DataSource: stored form submissions (corex_submission posts). Shapes each record into id/date/form/summary; the WP_Query + meta access lives in the injected reader so this shaping is unit-tested headlessly (spec 030). A submission has three shapes here, each for one reader: the table’s row (a summary of the answers), the detail view’s record (each answer, labelled) and the export’s row (each answer under the field declared for it). They are shaped in this class and nowhere else.

Not from here. A submission is removed in the inbox, which checks who may, writes it into the submission’s history and records it (spec 105, FR-022); this used to trash it the WordPress way with none of that. The answer is the interface’s own “not permitted”.

The real field schema: the fixed record id / submitted date / form columns plus the actual submitted payload keys discovered across recent submissions, each given a meaningful type (id/datetime/form/email/textarea/tel/text). No invented fields — when no submissions exist only the three fixed fields are returned.

Real per-day submission counts for the last $days days, oldest first, every day present (missing days are a truthful zero — never fabricated).