Space Works · How-to guides

Loan policy, renewal and reminders

The staff General settings page edits the optional MakerspaceLoanPolicy bundle. A GET does not create a policy. Saving creates it and opts the space into the reminder ladder. Missing rows preserve Makerspace.default_loan_days and the legacy single overdue reminder; default policy values are seven days, renewals off, maximum one renewal, seven-day extension, unlimited borrowing, offsets [0], and staff escalation disabled. Existing default-day API writes mirror an existing policy, and policy writes mirror the old field for older clients.

loans.renewals and loans.limits are opt-in features under request_workflow. No module is added. Renewal additionally needs policy mode auto; off refuses it. Staff-approval renewal states are not built yet. Staff use existing ACCEPT_REQUEST authority; members can renew only their own loan with the membership module live. Restricted/inactive borrowers, inactive or lapsed memberships, exhausted renewal counts, and another borrower's pending/accepted request for an outstanding item block both member and staff renewal.

Renewal extends the current due instant by loan_renewal_days, increments renewal_count, synchronizes any linked public/direct loan, and audits request.renewed. It changes no workflow status and consumes no inventory. The tenant row and then request row are locked: competing renewals cannot consume the same final slot. Return/issue paths share that lock order. Returns continue to require uploaded photo evidence and a remark.

Loan duration inherits product loan_days, category loan_days, then space policy. A bundle takes its shortest period. Renewal caps similarly inherit nullable product and category max_renewals, then space loan_max_renewals; the strictest outstanding item cap applies to a bundle. Zero renewals means none. Borrow ceilings loan_max_active / loan_max_items use zero for unlimited; a current membership plan's nullable values override the space. Limits run at request submission and again at physical handover; pending requests do not occupy active-loan slots. Rejected issue quantities and returned/damaged/missing units do not consume the outstanding item ceiling. Nullable item/category/plan overrides are exposed through the existing staff APIs; the bundle has a dedicated staff form.

Routes (authenticated, tenant-scoped; gate-off answers 400):

  • GET/PATCH /api/v1/admin/makerspace/{id}/return-policy requires MANAGE_MAKERSPACE.
  • POST /api/v1/member/makerspaces/{id}/loans/{request_id}/renew takes {}.
  • POST /api/v1/admin/makerspace/{id}/loans/{request_id}/renew takes {}.

Renewal returns request id, return_due_at, and renewal_count. Policy validation and renewal refusals answer 400; inaccessible rows answer 404 and unauthorized actors 403. Hand-written frontend mutations invalidate activity or staff queues. The OpenAPI serializers describe the added fields/routes; generated snapshots are regenerated by maintainers. Reminder scheduling and its at-most-once dispatch limits are documented in reminder-schedules.md.

From SpaceWorks/docs/loan-policy.md at c447a11, updated 2026-11-16. Suggest a change