Skip to content

feat(web): manage freshman page content - #84

Merged
lorenzocorallo merged 7 commits into
mainfrom
bia/freshmans
Oct 22, 2026
Merged

lorenzocorallo merged 7 commits into
mainfrom
bia/freshmans

Conversation

@BIA3IA

@BIA3IA BIA3IA commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Adds web.freshman (getContent, updateCard, moveCard, selectFaq) and migration
0026_freshman_content, which creates the card slots and featured FAQ positions and seeds
them with the current website content (reusing matching FAQs from the catalog).

  • Public read for the website, web:content:write for edits.
  • Deleting a featured FAQ or its category returns FEATURED_FAQ.
  • The dev seed initializes the slots and selections.

Note: tests/esign-service.test.ts fails on main as well (fixed clock 2026-10-17 vs a
certificate valid from "yesterday"); unrelated to this PR.

Renumber the freshman content migration from 0022 to 0026, after the
e-signing migrations 0022-0025 now on main. Its schema statements were
regenerated with drizzle-kit from main's snapshots and are unchanged; the
data statements are carried over as they were.
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 29 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 69f71389-4cfa-46b1-8136-db46f80ae4a2
📥 Commits

Reviewing files that changed from the base of the PR and between 203fb44 and 32a2692.

📒 Files selected for processing: 16
  • README.md
  • drizzle/0026_freshman_content.sql
  • drizzle/meta/0026_snapshot.json
  • drizzle/meta/_journal.json
  • scripts/seed-db.ts
  • src/db/schema/web/freshman.ts
  • src/db/schema/web/index.ts
  • src/routers/web/faqs.ts
  • src/routers/web/freshman.ts
  • src/routers/web/freshman/constants.ts
  • src/routers/web/freshman/seed.ts
  • src/routers/web/freshman/validation.ts
  • src/routers/web/index.ts
  • tests/fixtures/freshman-integration.ts
  • tests/freshman.integration.test.ts
  • tests/freshman.test.ts

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3e2d24af-6f74-4136-a039-88130eaa6f4d
📥 Commits

Reviewing files that changed from the base of the PR and between 946ac1a and 203fb44.

📒 Files selected for processing: 16
  • README.md
  • drizzle/0026_freshman_content.sql
  • drizzle/meta/0026_snapshot.json
  • drizzle/meta/_journal.json
  • scripts/seed-db.ts
  • src/db/schema/web/freshman.ts
  • src/db/schema/web/index.ts
  • src/routers/web/faqs.ts
  • src/routers/web/freshman.ts
  • src/routers/web/freshman/constants.ts
  • src/routers/web/freshman/seed.ts
  • src/routers/web/freshman/validation.ts
  • src/routers/web/index.ts
  • tests/fixtures/freshman-integration.ts
  • tests/freshman.integration.test.ts
  • tests/freshman.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The change adds fixed-slot Freshman content storage and initialization, public content retrieval, protected editing procedures, and safeguards for featured FAQs. Unit and PostgreSQL integration tests cover validation, access, concurrent operations, and deletion behavior.

Changes

Freshman content

Layer / File(s) Summary
Fixed-slot schema and initialization
src/routers/web/freshman/constants.ts, src/db/schema/web/freshman.ts, src/db/schema/web/index.ts, drizzle/0026_freshman_content.sql, drizzle/meta/_journal.json, src/routers/web/freshman/seed.ts, scripts/seed-db.ts, README.md
Adds fixed card slots and five FAQ positions to the web schema. The migration seeds 18 cards and reuses or creates the “Matricole” category and five FAQs. Development seeding adds default cards and initializes FAQ selections when none exist.
Content API and FAQ protection
src/routers/web/freshman/validation.ts, src/routers/web/freshman.ts, src/routers/web/index.ts, src/routers/web/faqs.ts, tests/freshman.test.ts
Adds validated content retrieval and protected card and FAQ mutations. Card moves are limited to adjacent slots in the same section. FAQ and category deletion return FEATURED_FAQ when featured content is affected. Unit tests cover validation, access, and authorship.
Database integration checks
tests/fixtures/freshman-integration.ts, tests/freshman.integration.test.ts
Adds an isolated PostgreSQL fixture that checks migration and content behavior, edits, concurrent operations, FAQ propagation, and deletion protection. The integration test runs when FRESHMAN_TEST_DB_PORT is set.

Sequence Diagram(s)

sequenceDiagram
  participant DashboardEditor
  participant webRouter
  participant freshmanRouter
  participant PostgreSQL
  DashboardEditor->>webRouter: Submit selectFaq input
  webRouter->>freshmanRouter: Route protected mutation
  freshmanRouter->>PostgreSQL: Lock featured slots and validate selection
  PostgreSQL-->>freshmanRouter: Current FAQ selections
  freshmanRouter->>PostgreSQL: Swap or update selected FAQ
  PostgreSQL-->>freshmanRouter: Updated selection
  freshmanRouter-->>DashboardEditor: Return mutation result
Loading

Priority: ➖ Normal

Change: Feature

Merge Risk: ⚪ Minimal · up to 203fb

This adds Freshman content management with public reads, permission-protected edits and safeguards against deleting featured FAQs. No concrete merge-blocking risk was found in the supplied change.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 12 files. (3 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: adding management for freshman page content in the web application.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 12 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@toto04
toto04 force-pushed the main branch 2 times, most recently from e989be7 to 43854c5 Compare October 21, 2026 19:43
lorenzocorallo and others added 2 commits October 22, 2026 12:19
#88 removed the legacy author argument from authorOf, so freshman writes now
use tokenOnly policies like the other web content mutations. The legacy
modifiedBy input is still accepted and ignored.
@lorenzocorallo
lorenzocorallo merged commit 67edf6e into main Oct 22, 2026
2 checks passed
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.

3 participants