User stories

Data layer

High-level

rentals

A rental tracks a single individual renting one physical copy.

It should point to the exact copy being checked out, not just the item/title, so availability, return history, and inventory state stay tied to the correct physical object.

Rental policy rules (due_date is computed from checkout_date using the applicable policy by item type; may be manually overridden for approved exceptions):

Column name Type Notes Example
id UUID primary key
non-null
copy_id UUID foreign key to copies.id
non-null
indexed
renter_email string [email]
non-null
indexed gfeng@uwaterloo.ca
renting_club_idorganization string nullable (club / organization if applicable) nullable FK to clubs.id if rented on behalf of a club/organization CSC
checkout_date datetime non-null March 7, 2026
due_date datetime non-null; computed from rental policy by item type, but can be manually overriden for approved exceptions April 1, 2026
date_returned datetime nullable until returned March 25, 2026
status enum: ACTIVE, RETURNED, OVERDUE, CANCELLED non-null (makes filtering rentals easier) ACTIVE
created_at datetime non-null
updated_at datetime non-null
deleted_at datetime nullable