# parikesitdotnet/tugas-akhir-kelompok12 architecture

> Architecture diagram of the GitHub repository parikesitdotnet/tugas-akhir-kelompok12, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/parikesitdotnet/tugas-akhir-kelompok12
- Repository: https://github.com/parikesitdotnet/tugas-akhir-kelompok12

## Overview

This is a Qt desktop application for pharmacy medicine inventory and expiry monitoring. A user enters or selects a medicine in the main window; the application reads form data, updates its in-memory inventory, and refreshes the table and expiry summaries. Expiry classification is based on the current date and a 90-day threshold, with visual status indicators. The README also describes FEFO dispensing, but the sampled dispense handler is empty, so that capability’s implementation and connection to inventory operations are unverified.

Main entry points: [`src/mainwindow.cpp`](https://github.com/parikesitdotnet/tugas-akhir-kelompok12/blob/main/src/mainwindow.cpp) (Add and update), [`src/utils/time.cpp`](https://github.com/parikesitdotnet/tugas-akhir-kelompok12/blob/main/src/utils/time.cpp) (Expiry classification), [`src/main.cpp`](https://github.com/parikesitdotnet/tugas-akhir-kelompok12/blob/main/src/main.cpp) (Application startup), [`src/utils/inputData.cpp`](https://github.com/parikesitdotnet/tugas-akhir-kelompok12/blob/main/src/utils/inputData.cpp) (Medicine form data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop interface"]
  node_app["Application startup<br/>[main.cpp]"]
  node_window["Main window<br/>[mainwindow.cpp]"]
  node_form["Medicine form data<br/>[inputData.cpp]"]
  node_alerts["Warning dialog<br/>[modalDialog.cpp]"]
end

subgraph group_inventory["Inventory operations"]
  node_inventory_state["In-memory inventory<br/>[mainwindow.cpp]"]
  node_inventory_actions["Add and update<br/>[mainwindow.cpp]"]
  node_inventory_table["Inventory table<br/>[mainwindow.cpp]"]
  node_fefo["FEFO dispensing<br/>[mainwindow.cpp]"]
end

subgraph group_expiry["Expiry monitoring"]
  node_expiry_classifier["Expiry classification<br/>[time.cpp]"]
  node_expiry_display["Expiry indicators<br/>[mainwindow.cpp]"]
  node_expiry_summary["Expiry summaries<br/>[mainwindow.cpp]"]
end

node_user(("Pharmacy user"))

node_user -->|"launches"| node_app
node_app -->|"creates"| node_window
node_user -->|"uses"| node_window
node_window -->|"reads fields"| node_form
node_window -->|"handles actions"| node_inventory_actions
node_inventory_actions -->|"updates"| node_inventory_state
node_inventory_actions -->|"refreshes"| node_inventory_table
node_inventory_actions -->|"refreshes"| node_expiry_summary
node_inventory_actions -->|"warns"| node_alerts
node_window -->|"renders"| node_inventory_table
node_inventory_table -->|"checks dates"| node_expiry_classifier
node_expiry_classifier -->|"sets status"| node_expiry_display
node_expiry_summary -->|"counts status"| node_expiry_classifier
node_inventory_state -.->|"guides dispensing"| node_fefo

click node_app "https://github.com/parikesitdotnet/tugas-akhir-kelompok12/blob/main/src/main.cpp"
click node_window "https://github.com/parikesitdotnet/tugas-akhir-kelompok12/blob/main/src/mainwindow.cpp"
click node_form "https://github.com/parikesitdotnet/tugas-akhir-kelompok12/blob/main/src/utils/inputData.cpp"
click node_alerts "https://github.com/parikesitdotnet/tugas-akhir-kelompok12/blob/main/src/utils/modalDialog.cpp"
click node_inventory_state "https://github.com/parikesitdotnet/tugas-akhir-kelompok12/blob/main/src/mainwindow.cpp"
click node_inventory_actions "https://github.com/parikesitdotnet/tugas-akhir-kelompok12/blob/main/src/mainwindow.cpp"
click node_inventory_table "https://github.com/parikesitdotnet/tugas-akhir-kelompok12/blob/main/src/mainwindow.cpp"
click node_fefo "https://github.com/parikesitdotnet/tugas-akhir-kelompok12/blob/main/src/mainwindow.cpp"
click node_expiry_classifier "https://github.com/parikesitdotnet/tugas-akhir-kelompok12/blob/main/src/utils/time.cpp"
click node_expiry_display "https://github.com/parikesitdotnet/tugas-akhir-kelompok12/blob/main/src/mainwindow.cpp"
click node_expiry_summary "https://github.com/parikesitdotnet/tugas-akhir-kelompok12/blob/main/src/mainwindow.cpp"

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_app,node_window,node_form,node_alerts,node_user toneBlue
class node_inventory_state,node_inventory_actions,node_inventory_table,node_fefo toneAmber
class node_expiry_classifier,node_expiry_display,node_expiry_summary toneMint
```

## Components

### Desktop interface

- [Application startup](https://github.com/parikesitdotnet/tugas-akhir-kelompok12/blob/main/src/main.cpp): `src/main.cpp`
- [Main window](https://github.com/parikesitdotnet/tugas-akhir-kelompok12/blob/main/src/mainwindow.cpp): `src/mainwindow.cpp`
- [Medicine form data](https://github.com/parikesitdotnet/tugas-akhir-kelompok12/blob/main/src/utils/inputData.cpp): `src/utils/inputData.cpp`
- [Warning dialog](https://github.com/parikesitdotnet/tugas-akhir-kelompok12/blob/main/src/utils/modalDialog.cpp): `src/utils/modalDialog.cpp`

### Inventory operations

- [In-memory inventory](https://github.com/parikesitdotnet/tugas-akhir-kelompok12/blob/main/src/mainwindow.cpp): `src/mainwindow.cpp`
- [Add and update](https://github.com/parikesitdotnet/tugas-akhir-kelompok12/blob/main/src/mainwindow.cpp): `src/mainwindow.cpp`
- [Inventory table](https://github.com/parikesitdotnet/tugas-akhir-kelompok12/blob/main/src/mainwindow.cpp): `src/mainwindow.cpp`
- [FEFO dispensing](https://github.com/parikesitdotnet/tugas-akhir-kelompok12/blob/main/src/mainwindow.cpp): `src/mainwindow.cpp`

### Expiry monitoring

- [Expiry classification](https://github.com/parikesitdotnet/tugas-akhir-kelompok12/blob/main/src/utils/time.cpp): `src/utils/time.cpp`
- [Expiry indicators](https://github.com/parikesitdotnet/tugas-akhir-kelompok12/blob/main/src/mainwindow.cpp): `src/mainwindow.cpp`
- [Expiry summaries](https://github.com/parikesitdotnet/tugas-akhir-kelompok12/blob/main/src/mainwindow.cpp): `src/mainwindow.cpp`

### Other components

- **Pharmacy user**

## Connections

- Pharmacy user → Application startup: launches (evidence: `README.md`)
- Application startup → Main window: creates (evidence: `src/main.cpp`)
- Pharmacy user → Main window: uses (evidence: `README.md`)
- Main window → Medicine form data: reads fields (evidence: `src/mainwindow.cpp`)
- Main window → Add and update: handles actions (evidence: `src/mainwindow.cpp`)
- Add and update → In-memory inventory: updates (evidence: `src/mainwindow.cpp`)
- Add and update → Inventory table: refreshes (evidence: `src/mainwindow.cpp`)
- Add and update → Expiry summaries: refreshes (evidence: `src/mainwindow.cpp`)
- Add and update → Warning dialog: warns (evidence: `src/mainwindow.cpp`)
- Main window → Inventory table: renders (evidence: `src/mainwindow.cpp`)
- Inventory table → Expiry classification: checks dates (evidence: `src/mainwindow.cpp`)
- Expiry classification → Expiry indicators: sets status (evidence: `src/mainwindow.cpp`)
- Expiry summaries → Expiry classification: counts status (evidence: `src/mainwindow.cpp`)
- In-memory inventory → FEFO dispensing: guides dispensing (evidence: `README.md`)
