# amandaaccioly/projetopoo architecture

> Architecture diagram of the GitHub repository amandaaccioly/projetopoo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/amandaaccioly/projetopoo
- Repository: https://github.com/amandaaccioly/projetopoo

## Overview

ProjetoPOO is a console-based lending system for an equipment collection. A user can list items and loans, register a loan by item code and person ID, or return an item; the application loads the collection and people from CSV files. Loan handling checks availability and borrower identity, tracks due dates, and calculates late fees through item-specific rules. The excerpts show the console orchestration, services, domain model, and file repositories; other domain implementations are included where the source index identifies their responsibilities.

Main entry points: [`src/Main.java`](https://github.com/amandaaccioly/projetopoo/blob/main/src/Main.java) (Console application), [`src/servico/ServicoEmprestimo.java`](https://github.com/amandaaccioly/projetopoo/blob/main/src/servico/ServicoEmprestimo.java) (Loan service), [`src/persistencia/RepositorioAcervoArquivo.java`](https://github.com/amandaaccioly/projetopoo/blob/main/src/persistencia/RepositorioAcervoArquivo.java) (Catalog CSV repository), [`src/persistencia/RepositorioPessoasArquivo.java`](https://github.com/amandaaccioly/projetopoo/blob/main/src/persistencia/RepositorioPessoasArquivo.java) (People CSV repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_console["Console interface"]
  node_main["Console application<br/>[Main.java]"]
end

subgraph group_services["Application services"]
  node_item_service["Item service<br/>[ServicoItem.java]"]
  node_loan_service["Loan service"]
end

subgraph group_domain["Loan domain"]
  node_loan["Loan record<br/>[Emprestimo.java]"]
  node_item["Collection item<br/>[Item.java]"]
  node_item_types["Item types"]
  node_person["Borrower<br/>[Pessoa.java]"]
  node_penalty_rules["Penalty rules"]
end

subgraph group_persistence["CSV persistence"]
  node_catalog_interface["Catalog repository API"]
  node_catalog_repo["Catalog CSV repository"]
  node_people_interface["People repository API"]
  node_people_repo["People CSV repository"]
  node_catalog_csv["Catalog CSV<br/>[acervo.csv]"]
  node_people_csv["People CSV<br/>[pessoas.csv]"]
end

node_user(("Operator"))

node_user -->|"chooses actions"| node_main
node_main -->|"lists items"| node_item_service
node_main -->|"manages loans"| node_loan_service
node_main -->|"creates repository"| node_catalog_repo
node_main -->|"loads people"| node_people_repo
node_main -->|"configures path"| node_catalog_csv
node_main -->|"configures path"| node_people_csv
node_item_service -->|"loads and saves"| node_catalog_interface
node_catalog_repo -->|"implements"| node_catalog_interface
node_people_repo -->|"implements"| node_people_interface
node_people_repo -.->|"reads"| node_people_csv
node_catalog_repo -.->|"reads and appends"| node_catalog_csv
node_loan_service -->|"finds item"| node_item_service
node_loan_service -->|"finds borrower"| node_people_interface
node_loan_service -->|"creates and updates"| node_loan
node_loan_service -->|"checks and changes status"| node_item
node_loan -->|"calculates penalty through"| node_item
node_item -->|"calculates penalty via"| node_penalty_rules
node_catalog_repo -->|"creates by type"| node_item_types

click node_main "https://github.com/amandaaccioly/projetopoo/blob/main/src/Main.java"
click node_item_service "https://github.com/amandaaccioly/projetopoo/blob/main/src/servico/ServicoItem.java"
click node_loan_service "https://github.com/amandaaccioly/projetopoo/blob/main/src/servico/ServicoEmprestimo.java"
click node_loan "https://github.com/amandaaccioly/projetopoo/blob/main/src/modelo/entidade/Emprestimo.java"
click node_item "https://github.com/amandaaccioly/projetopoo/blob/main/src/modelo/entidade/Item.java"
click node_item_types "https://github.com/amandaaccioly/projetopoo/tree/main/src/modelo/entidade"
click node_person "https://github.com/amandaaccioly/projetopoo/blob/main/src/modelo/entidade/Pessoa.java"
click node_penalty_rules "https://github.com/amandaaccioly/projetopoo/tree/main/src/modelo/multa"
click node_catalog_interface "https://github.com/amandaaccioly/projetopoo/blob/main/src/persistencia/IRepositorioAcervo.java"
click node_catalog_repo "https://github.com/amandaaccioly/projetopoo/blob/main/src/persistencia/RepositorioAcervoArquivo.java"
click node_people_interface "https://github.com/amandaaccioly/projetopoo/blob/main/src/persistencia/IRepositorioPessoas.java"
click node_people_repo "https://github.com/amandaaccioly/projetopoo/blob/main/src/persistencia/RepositorioPessoasArquivo.java"
click node_catalog_csv "https://github.com/amandaaccioly/projetopoo/blob/main/dados/acervo.csv"
click node_people_csv "https://github.com/amandaaccioly/projetopoo/blob/main/dados/pessoas.csv"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main toneBlue
class node_item_service,node_loan_service toneAmber
class node_loan,node_item,node_item_types,node_person,node_penalty_rules toneMint
class node_catalog_interface,node_catalog_repo,node_people_interface,node_people_repo,node_catalog_csv,node_people_csv toneRose
class node_user toneIndigo
```

## Components

### Console interface

- [Console application](https://github.com/amandaaccioly/projetopoo/blob/main/src/Main.java): `src/Main.java`

### Application services

- [Item service](https://github.com/amandaaccioly/projetopoo/blob/main/src/servico/ServicoItem.java): `src/servico/ServicoItem.java`
- [Loan service](https://github.com/amandaaccioly/projetopoo/blob/main/src/servico/ServicoEmprestimo.java): `src/servico/ServicoEmprestimo.java`

### Loan domain

- [Loan record](https://github.com/amandaaccioly/projetopoo/blob/main/src/modelo/entidade/Emprestimo.java): `src/modelo/entidade/Emprestimo.java`
- [Collection item](https://github.com/amandaaccioly/projetopoo/blob/main/src/modelo/entidade/Item.java): `src/modelo/entidade/Item.java`
- [Item types](https://github.com/amandaaccioly/projetopoo/tree/main/src/modelo/entidade): `src/modelo/entidade`
- [Borrower](https://github.com/amandaaccioly/projetopoo/blob/main/src/modelo/entidade/Pessoa.java): `src/modelo/entidade/Pessoa.java`
- [Penalty rules](https://github.com/amandaaccioly/projetopoo/tree/main/src/modelo/multa): `src/modelo/multa`

### CSV persistence

- [Catalog repository API](https://github.com/amandaaccioly/projetopoo/blob/main/src/persistencia/IRepositorioAcervo.java): `src/persistencia/IRepositorioAcervo.java`
- [Catalog CSV repository](https://github.com/amandaaccioly/projetopoo/blob/main/src/persistencia/RepositorioAcervoArquivo.java): `src/persistencia/RepositorioAcervoArquivo.java`
- [People repository API](https://github.com/amandaaccioly/projetopoo/blob/main/src/persistencia/IRepositorioPessoas.java): `src/persistencia/IRepositorioPessoas.java`
- [People CSV repository](https://github.com/amandaaccioly/projetopoo/blob/main/src/persistencia/RepositorioPessoasArquivo.java): `src/persistencia/RepositorioPessoasArquivo.java`
- [Catalog CSV](https://github.com/amandaaccioly/projetopoo/blob/main/dados/acervo.csv): `dados/acervo.csv`
- [People CSV](https://github.com/amandaaccioly/projetopoo/blob/main/dados/pessoas.csv): `dados/pessoas.csv`

### Other components

- **Operator**

## Connections

- Operator → Console application: chooses actions (evidence: `src/Main.java`)
- Console application → Item service: lists items (evidence: `src/Main.java`)
- Console application → Loan service: manages loans (evidence: `src/Main.java`)
- Console application → Catalog CSV repository: creates repository (evidence: `src/Main.java`)
- Console application → People CSV repository: loads people (evidence: `src/Main.java`)
- Console application → Catalog CSV: configures path (evidence: `src/Main.java`)
- Console application → People CSV: configures path (evidence: `src/Main.java`)
- Item service → Catalog repository API: loads and saves (evidence: `src/servico/ServicoItem.java`)
- Catalog CSV repository → Catalog repository API: implements (evidence: `src/persistencia/RepositorioAcervoArquivo.java`)
- People CSV repository → People repository API: implements (evidence: `src/persistencia/RepositorioPessoasArquivo.java`)
- People CSV repository → People CSV: reads
- Catalog CSV repository → Catalog CSV: reads and appends
- Loan service → Item service: finds item (evidence: `src/servico/ServicoEmprestimo.java`)
- Loan service → People repository API: finds borrower (evidence: `src/servico/ServicoEmprestimo.java`)
- Loan service → Loan record: creates and updates (evidence: `src/servico/ServicoEmprestimo.java`)
- Loan service → Collection item: checks and changes status (evidence: `src/servico/ServicoEmprestimo.java`)
- Loan record → Collection item: calculates penalty through (evidence: `src/modelo/entidade/Emprestimo.java`)
- Collection item → Penalty rules: calculates penalty via (evidence: `src/modelo/entidade/Item.java`)
- Catalog CSV repository → Item types: creates by type (evidence: `src/persistencia/RepositorioAcervoArquivo.java`)
