Skip to content

fix: Centralize magic strings in Constants.cs#278

Closed
nbhansen wants to merge 1 commit intoaau-giraf:dev-mainfrom
nbhansen:fix/backend-constants
Closed

fix: Centralize magic strings in Constants.cs#278
nbhansen wants to merge 1 commit intoaau-giraf:dev-mainfrom
nbhansen:fix/backend-constants

Conversation

@nbhansen
Copy link
Contributor

@nbhansen nbhansen commented Feb 4, 2026

Summary

  • Introduces Constants.cs to centralize magic strings used across the backend
  • Replaces hardcoded strings for default board name, session artefact category, and asset directories
  • Improves maintainability by having a single source of truth for these values

Constants introduced:

  • Constants.DefaultBoardName ("Board1")
  • Constants.SessionArtefactCategory ("Session-Artefact")
  • Constants.ImageFilePrefix ("image_")
  • Constants.AssetDirectories.Artefacts, .Categories, .Sounds

Test plan

  • Build passes
  • All 98 existing tests pass
  • Tests updated to use constants for assertions

- Create VTA.API.Constants with DefaultBoardName, SessionArtefactCategory,
  ImageFilePrefix, and AssetDirectories constants
- Replace hardcoded "Board1" in UsersController with Constants.DefaultBoardName
- Replace hardcoded "Session-Artefact" in SavedArtefactsController
- Replace hardcoded asset directory names in Program.cs
- Replace hardcoded "image_" prefix in ImageUtilities
- Update BoardsControllerTests to use constants for assertions

All 98 tests passing.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@nbhansen nbhansen force-pushed the fix/backend-constants branch from e37e641 to 2fd8af2 Compare February 4, 2026 14:06
@nbhansen nbhansen closed this Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant