Skip to content

Enhancement: Strengthen Program Module CRUD Validation and Robustness #26

@agaesh

Description

@agaesh

Description:
The current Program module covers basic CRUD functionality but lacks full validation, edge case handling, and resilience against potential system or misuse scenarios.
Enhancing these areas will make the API more reliable, predictable, and user-friendly.

Proposed Enhancements:

Create Program

  • Validation for Missing Fields → Return clear error when required fields (e.g., code, name) are missing.

  • Invalid Data Types → Reject wrong data types (e.g., numeric value for code instead of string).

  • Boundary Value Handling:

    • Minimum: Very short code (e.g., "A")
    • Maximum: Extremely long name or code
    • Special characters in fields
  • Case Sensitivity Check → Decide whether "ABC" and "abc" should be treated as duplicates or separate entries, and implement accordingly.


Update Program

  • Partial Updates → Allow updating only specific fields without requiring all fields.
  • Invalid Data Types/Values → Reject wrong types or values exceeding limits.
  • No Change Updates → Decide whether identical updates are allowed or skipped.
  • Update After Deletion → Return "Not Found" if trying to update a deleted program.

Delete Program

  • Delete Already Deleted Program → Return "Not Found".

  • Soft Delete Support (if implemented)

    • Deleted program should be hidden from active list.
    • Option to restore soft-deleted program.

General & System Scenarios

  • Unauthorized Access → Return proper error if authentication/authorization fails.
  • Database/Service Failure Simulation → Mock DB/service errors to ensure correct error responses.
  • Bulk Operations (Optional) → Add support for creating, updating, or deleting multiple programs in one request.

Expected Outcome:

  • More robust validation and error handling for all CRUD endpoints.
  • Clearer feedback for API consumers.
  • Reduced chance of data inconsistency or unhandled edge cases.

If you want, I can also combine this with the “Better Error Messages” enhancement we wrote earlier so it becomes one unified “CRUD Improvement” milestone. That would make project tracking cleaner.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions