Skip to content

feat(channels): P4 community submission loop - #2157

Merged
jung-thomas merged 11 commits into
DEVfrom
channels-p4-submissions
Sep 4, 2026
Merged

feat(channels): P4 community submission loop#2157
jung-thomas merged 11 commits into
DEVfrom
channels-p4-submissions

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

P4 — Community submission loop (final phase of external-channels)

Logged-in users propose channel ADD / EDIT / REMOVE via a Vue island; admins moderate in a Fiori Elements queue that applies approve/reject to Channels.

What's included (8 tasks, TDD + per-task review + whole-branch review)

  1. ModelChannelSubmissions entity (db/channels.cds) + @cds.persistence.journal (db/persistence.cds) + machine-generated .hdbmigrationtable (version=1, zero hand-edit).
  2. Submit service@requires:'authenticated-user', @insertonly; before('CREATE') stamps server-controlled fields (submitterId/status/reviewerId/reviewNote) so a client can't spoof them.
  3. AdminService projection — approve/reject bound actions + FE DataFieldForAction annotations (bound FQN form, mirroring ContentModerationService).
  4. Approve/reject handlers — apply ADD/EDIT/REMOVE to Channels; PROPOSABLE field whitelist drops non-proposable keys; HANA-safe INSERT (ID: cds.utils.uuid()); 404 on unknown ID, 400 on non-PENDING.
  5. Approuter route^/channel-submissions/(.*)$ → srv-api, xsuaa, default CSRF-on.
  6. channel-submit Vue island — auth probe (JSON + authenticated, never bare res.ok) + csrfFetch POST; handles CAP 10 204 No Content (never reads POST body).
  7. Admin moderation-queue FE app + admin-shell registration (nav key channel-submissions, prefix csub).
  8. Post-deploy e2e nudge — self-skips without SMOKE_BASE_URL.

Verification

  • 22 P4 tests; full suite green: 9464 passed / 21 skipped / 2 todo, 0 failures.
  • Security: submit is authenticated-user; admin actions Admin-only (not weakened); server-wins on spoofed fields; whitelist proven to drop contentHash/sourceId; no secrets; no req.user without @requires.
  • HANA-safety: explicit UUID on INSERT, no raw SQL, no BLOB+metadata single query.
  • Migration: entity journaled; db/last-dev/csn.json + .hdbmigrationtable are the T1-paired machine-generated artifacts (a stray reserialization was discarded).
  • Whole-branch final review (opus): Ready to merge = Yes; only 3 Minor non-load-bearing nits (parked).

Draft — opened for human review. Not deployed. Targets DEV per branching policy.

…ly, server-stamped)

- srv/channel-submission-service.cds: @path '/channel-submissions', @requires 'authenticated-user', @insertonly Submissions projection on ims.ChannelSubmissions
- srv/channel-submission-service.js: before('CREATE') stamps submitterId=req.user.id, forces status='PENDING', nulls reviewerId/reviewNote
- test/channel-submission-service.test.js: 3 tests (anon 401, stamped fields via DB SELECT, read blocked)

CAP 10 returns 204 No Content for @insertonly creates (no SELECT round-trip); test verifies stamped fields via direct DB SELECT to match model-test patterns.
@jung-thomas
jung-thomas marked this pull request as ready for review September 4, 2026 22:52
@jung-thomas
jung-thomas merged commit 1646abb into DEV Sep 4, 2026
6 of 7 checks passed
@jung-thomas
jung-thomas deleted the channels-p4-submissions branch September 4, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant