Skip to content

[Lease] Implement Lease CRUD Operations #5

Description

@NeftaliYagua

Description

Implement RESTful API endpoints for lease management (Create, Read, Update, Delete operations).

Acceptance Criteria

  • POST /api/leases - Create new lease
  • GET /api/leases - List leases with pagination and filtering
  • GET /api/leases/{id} - Get lease details
  • PUT /api/leases/{id} - Update lease
  • DELETE /api/leases/{id} - Soft delete lease
  • PATCH /api/leases/{id}/activate - Activate lease
  • PATCH /api/leases/{id}/terminate - Terminate lease
  • Input validation with FluentValidation
  • Proper HTTP status codes
  • Unit and integration tests
  • API documentation in Swagger

Subtasks

  • Create LeaseController with CRUD endpoints
  • Implement command handlers (CQRS)
  • Create query handlers for lease retrieval
  • Add input validation
  • Implement authorization checks
  • Add filtering and sorting
  • Create DTOs and mapping profiles
  • Write integration tests
  • Add API documentation
  • Handle concurrency conflicts

Technical Notes

  • Use MediatR for CQRS pattern
  • Implement repository pattern
  • Use AutoMapper for DTO mapping
  • Add optimistic concurrency with row version
  • Return proper ProblemDetails for errors

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

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions