Skip to content

_🛠️ Refactor suggestion_ #73

Description

@gitnasr

🛠️ Refactor suggestion

Introduce validation attributes
Decorate critical fields with DataAnnotations (e.g., [Required], [StringLength(...)], [Range(0, …)]) or implement a FluentValidation validator to enforce business rules on Title, Description, Price, Condition, Street, City, and ExpireDate.

🤖 Prompt for AI Agents
In Dentizone.Application/DTOs/PostDTO/UpdatePostDTO.cs between lines 12 and 18,
the properties lack validation attributes. Add appropriate DataAnnotations such
as [Required] for mandatory fields, [StringLength] to limit text length on
Title, Description, Street, and City, [Range(0, max)] for Price to ensure
non-negative values, and consider validation for Condition and ExpireDate as
needed. This will enforce business rules and improve data integrity.

Originally posted by @coderabbitai[bot] in #72 (comment)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions