Skip to content

Protect immutable book fields and lock updates while on loan #4

@NikosPoly

Description

@NikosPoly

Currently PUT and PATCH on books allow updating fields that should never change,
and don't check if the book is currently on loan before applying updates.

Tasks

  • Block isbn and type from being updated in both PUT and PATCH
  • Block all PUT and PATCH operations if book available = false (book is physically on loan)
  • Validate type mismatch on PATCH — if DTO type doesn't match existing book type throw an error
    e.g. patching a HistoryBook with ScienceBookDTO should return a clear error

Metadata

Metadata

Assignees

No one assigned

    Labels

    business logicEnforces real world library domain rules and constraints

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions