Skip to content

[BE-39] Implement asset borrowing check-out and check-in endpoints #604

@yusuftomilola

Description

@yusuftomilola

Overview

Implement a borrowing/check-out system that allows users to borrow assets for a set period inside backend/contrib/.

Location

All work must be inside backend/contrib/src/borrowing/.

Acceptance Criteria

  • Borrowing entity: id, assetId, borrowedBy (FK → User), checkedOutAt, expectedReturnAt, returnedAt (nullable), notes, status (ACTIVE, RETURNED, OVERDUE)
  • POST /assets/:id/checkoutCheckOutDto: expectedReturnAt*, notes?; sets asset status to ASSIGNED
  • POST /assets/:id/checkin — marks borrowing as RETURNED, sets returnedAt, restores asset status to ACTIVE
  • GET /borrowings — lists all borrowing records with optional filters (status, userId)
  • All endpoints protected by JwtAuthGuard

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions