Skip to content

feat: answer time range per avatar template and organization background colour - #198

Merged
micio86dev merged 6 commits into
developfrom
feature/org-background-color
Oct 16, 2026
Merged

micio86dev merged 6 commits into
developfrom
feature/org-background-color

Conversation

@micio86dev

Copy link
Copy Markdown
Owner

What

Two additive features on one stacked branch (both native-review approved):

  1. Answer time range per avatar template: avatar_templates.answer_min_seconds (default 90) and answer_max_seconds (default 150), NOT NULL with database defaults and a CHECK (10..600, min < max). Editable through the template write endpoints (422 on a violation, including the concurrent race), duplicate and import/export (omitted keys default, explicit null or a missing record key is refused), and delivered in the candidate session start response next to interview_max_seconds. Admin-only for T-EXPOSE-001.
  2. Organization background colour: organizations.background_color nullable #rrggbb (anchored regex + DB CHECK), settable by admins and managed clients, delivered in branding.background_color to the candidate frontend. Emails keep the primary colour only; public API v1 untouched.

Both migrations are additive (new columns, defaults fill existing rows).

Checks

  • Full Pest suite on the stacked branch: 9779 tests, 9767 passed, 12 skipped. Later fixes re-ran AvatarTemplates, C14, PublicApi, OpenApi and Arch suites. Pint and PHPStan clean.
  • openapi.json exported against Postgres; openapi.v1.json unchanged.
  • Fixed on the way: BaselineRevisionMigrationTest inserted a template through the model on a rolled-back schema.

Two per-template columns, answer_min_seconds (default 90) and
answer_max_seconds (default 150), bounded 10..600 with min < max
(validated on create/update, import, and a DB CHECK). Exposed on the
admin template resources, copied by duplicate, carried by export/import
(older files fall back to the defaults) and delivered in the candidate
session response next to interview_max_seconds.
…he old schema

The baseline revision test rolls the schema back, so creating the template
through the model also named the answer range columns added later.
…h a 422

Translate the avatar_templates_answer_range CHECK violation into the same
422 on answer_max_seconds the ordering helper raises, on both update paths,
and cover the import type, bounds and defaulting branches.
Nullable #rrggbb organizations.background_color with a CHECK, writable by
admins and superadmins, exposed to the candidate in branding.background_color
and classified admin-only for T-EXPOSE-001. openapi.json regenerated.
@micio86dev
micio86dev merged commit 97e0d52 into develop Oct 16, 2026
4 checks passed
@micio86dev
micio86dev deleted the feature/org-background-color branch October 16, 2026 13: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