Skip to content

feat(core): add guardrails to update template endpoint#51

Open
evebrnd wants to merge 3 commits intomainfrom
feat/add-guardrails-on-update-template-endpoint
Open

feat(core): add guardrails to update template endpoint#51
evebrnd wants to merge 3 commits intomainfrom
feat/add-guardrails-on-update-template-endpoint

Conversation

@evebrnd
Copy link
Copy Markdown
Collaborator

@evebrnd evebrnd commented May 7, 2026

PR Description

What this PR Provides

Enforce the following business rules:

  • All PropertyDefinition names within a single template must be unique
  • All RelationDefinition names within a single template must be unique
  • The targetTemplateIdentifier of a RelationDefinition must reference an existing EntityTemplate
  • All type changes of PropertyDefinition are blocked. Once a property is created, the type cannot be changed

Review

The reviewer must double-check these points:

  • The reviewer has tested the feature
  • The reviewer has reviewed the implementation of the feature
  • The documentation has been updated
  • The feature implementation respects the Technical Doc / ADR previously produced

How to test

Happy Path

  • Removing a property or renaming it (delete and create) must return a 200 OK. The system must purge associated property values in the database for existing entities (no orphan data).
  • Database integrity - Upon a successful remove operation, a GET on the entity property/relation tables must not return any rows for the old identifiers

Error Path

  • Duplicate properties: A PUT request with two properties with the same name must return 400 Bad Request.
  • Wrong Relations: If targetTemplateIdentifier references a template that does not exist in the entity_templates table, the request must return 400 Bad Request.
  • Type change: If the type of a property is changed, PUT request must return 400 Bad Request.

Breaking changes

N/A

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 7, 2026

@evebrnd evebrnd marked this pull request as ready for review May 7, 2026 15:40
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