Skip to content

BEJ-103 R1: manual trial entry backend foundation - #342

Merged
asku1990 merged 5 commits into
feature/bej-103-admin-trial-event-and-result-creationfrom
feature/bej-103-r1-manual-result-backend
Jul 22, 2026
Merged

BEJ-103 R1: manual trial entry backend foundation#342
asku1990 merged 5 commits into
feature/bej-103-admin-trial-event-and-result-creationfrom
feature/bej-103-r1-manual-result-backend

Conversation

@asku1990

@asku1990 asku1990 commented Jul 22, 2026

Copy link
Copy Markdown
Owner

ref bej-103

Summary

Implements the BEJ-103 R1 backend foundation for manual trial entry creation.

This gate establishes the complete backend contract for manual trial results without exposing a user interface. It introduces the shared contracts, validation, canonical registration handling, persistence, and reconciliation behavior that the R2 UI will consume.

Changes

  • Add manual trial entry request and response contracts.
  • Add an authenticated admin Server Action for manual trial entry creation.
  • Introduce shared registration normalization and validation for canonical dog registration identifiers.
  • Implement backend validation and canonical registration handling.
  • Implement atomic creation of:
    • TrialEntry
    • TrialEra
    • TrialEraLisatieto
  • Link manual entries to an existing Dog through DogRegistration when available while allowing unknown registrations to remain unlinked.
  • Introduce canonical manual identity:
    • SKL:|REG:
  • Add duplicate protection with stable conflict handling.
  • Add MANUAL_ADMIN as a canonical trial source.
  • Define authoritative reconciliation where later Koiratietokanta imports replace manual business data while preserving technical identity.
  • Move trial event dates to PostgreSQL DATE semantics with timezone-free handling.
  • Add backend, database, service, integration, and Server Action tests.
  • Update architecture, schema, feature, and planning documentation, including the R1/R2 implementation split.

Notes

  • This PR intentionally exposes no manual trial creation UI.
  • Existing trial editing behavior is unchanged.
  • The complete manual result workflow and user interface will be implemented in the follow-up R2 gate.

Checklist

  • This PR includes user-visible changes.
  • This PR is internal-only and does not require a CHANGELOG entry.

@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
beagle-db-v2 Ignored Ignored Preview Jul 22, 2026 5:54pm

@asku1990
asku1990 marked this pull request as draft July 22, 2026 15:54
asku1990 added 2 commits July 22, 2026 19:01
  - add contracts, server action, service, and atomic persistence for
    manual trial entries
  - share normalized entry validation between create and update flows
  - reject duplicate registrations, lisätieto rows, and per-era
    lisätieto values
  - link manually created results to known dog registrations
  - allow API upserts to replace matching manual results authoritatively
  - store trial event dates as PostgreSQL DATE values
  - add MANUAL_ADMIN trial source tagging and update trial documentation
  - cover creation, validation, identity, date-only, and API overwrite
    behavior

ref bej-103
@asku1990 asku1990 changed the title trial entry planning docs BEJ-103 R1: manual trial entry backend foundation Jul 22, 2026
@asku1990
asku1990 marked this pull request as ready for review July 22, 2026 17:54
@asku1990
asku1990 merged commit 8fa7c3f into feature/bej-103-admin-trial-event-and-result-creation Jul 22, 2026
5 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.

1 participant