fix(ocr): regenerate TypeScript types so TriggerSenderTrainingDTO.personId is non-optional #266

Closed
opened 2026-04-18 09:26:11 +02:00 by marcel · 0 comments
Owner

Background

Deferred during PR #265 review cycle 2.

Concern

The generated TypeScript type for TriggerSenderTrainingDTO shows personId?: string (optional) even though the Java record has @Schema(requiredMode = REQUIRED) and @NotNull. The running Docker backend is an older image without the feature branch code, so regenerating types was not possible during the PR review cycle.

Reviewer @Nora (security): "The personId field in TriggerSenderTrainingDTO is @NotNull on the backend but shows as optional (personId?: string) in the generated TypeScript — fix by regenerating types once the feature branch is merged."

Why deferred

Regenerating types requires:

  1. Building the feature branch JAR (./mvnw clean package -DskipTests)
  2. Starting it with --spring.profiles.active=dev — conflicts with the running Docker backend on port 8080
  3. Running npm run generate:api in frontend/

This is safe to do after the feature branch merges to main.

Steps

  1. Merge PR #265 to main
  2. Build backend: cd backend && ./mvnw clean package -DskipTests
  3. Stop docker backend: docker-compose stop backend
  4. Run: java -jar target/*.jar --spring.profiles.active=dev
  5. cd frontend && npm run generate:api
  6. Verify TriggerSenderTrainingDTO.personId is now personId: string (required)
  7. Commit the updated generated types

Reference

PR: http://heim-nas:3005/marcel/familienarchiv/pulls/265

## Background Deferred during PR #265 review cycle 2. ## Concern The generated TypeScript type for `TriggerSenderTrainingDTO` shows `personId?: string` (optional) even though the Java record has `@Schema(requiredMode = REQUIRED)` and `@NotNull`. The running Docker backend is an older image without the feature branch code, so regenerating types was not possible during the PR review cycle. Reviewer @Nora (security): "The `personId` field in `TriggerSenderTrainingDTO` is `@NotNull` on the backend but shows as optional (`personId?: string`) in the generated TypeScript — fix by regenerating types once the feature branch is merged." ## Why deferred Regenerating types requires: 1. Building the feature branch JAR (`./mvnw clean package -DskipTests`) 2. Starting it with `--spring.profiles.active=dev` — conflicts with the running Docker backend on port 8080 3. Running `npm run generate:api` in `frontend/` This is safe to do after the feature branch merges to main. ## Steps 1. Merge PR #265 to main 2. Build backend: `cd backend && ./mvnw clean package -DskipTests` 3. Stop docker backend: `docker-compose stop backend` 4. Run: `java -jar target/*.jar --spring.profiles.active=dev` 5. `cd frontend && npm run generate:api` 6. Verify `TriggerSenderTrainingDTO.personId` is now `personId: string` (required) 7. Commit the updated generated types ## Reference PR: http://heim-nas:3005/marcel/familienarchiv/pulls/265
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: marcel/familienarchiv#266