Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • L Library
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Красночуб Максим Сергеевич
  • Library
  • Merge requests
  • !1

Open
Created Sep 17, 2026 by Красночуб Максим Сергеевич@KMS.24Owner
  • Report abuse
Report abuse

Implement borrowing deadlines, overdue restrictions, and loan history

  • Overview 0
  • Commits 1
  • Changes 12

Summary

This MR introduces a book borrowing tracking system with deadlines, penalty restrictions for overdue readers, and visual console styling.

Key Changes

  • Borrowing Records & Persistence:
    • Created BorrowRecord to track borrow_date, due_date, and return_date.
    • Added persistent storage for records in records.json via DataManager.
  • Loan Rules & Penalties:
    • Configured a 14-day loan period upon borrowing.
    • Implemented hasOverdueBooks check in LibrarySystem.
    • Restricted borrowing and browsing catalog for users with overdue books.
  • UI / UX Improvements:
    • Centralized ANSI color definitions in Console.hpp.
    • Blocked menu options are grayed out dynamically in the Reader's cabinet.
    • Active loans now display due dates (highlighted in red if overdue).
    • Completed loan history now shows formatted borrow and return dates.

How to Test

  1. Log in as a reader (reader / reader / 3).
  2. Borrow a book and verify that it appears in "View My Current Borrowed Books" with a due date (+14 days).
  3. Simulate an overdue state (modify due_date or borrow_date in records.json to an earlier timestamp).
  4. Verify that options 1 and 4 in the Reader menu become grayed out and cannot be selected.
  5. Return the book and check "View My Borrowing History" to ensure return dates are displayed correctly.
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: feat/add-time