# jjserranogarcia/pipeline_auditoria_confirming architecture

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

- Interactive diagram: https://gitdiagram.com/jjserranogarcia/pipeline_auditoria_confirming
- Repository: https://github.com/jjserranogarcia/pipeline_auditoria_confirming

## Overview

Grupo Prisma’s confirming-bonus audit pipeline replaces manual spreadsheet checks. On a scheduled run, it obtains pending documents from Google Drive, identifies the bank, company and date, extracts and normalizes document data, recalculates the company’s commission and interest, and compares the result with the bank’s reported amount. It produces Excel and PDF results, updates a CSV history, archives originals, and creates a run-monitoring PDF. The main implementation is a single Python file; the graph separates its documented responsibilities. Source excerpts are partial, so several stage links rely on the README rather than inspected call sites.

Main entry points: [`Pipeline_Auditoria_Confirming.py`](https://github.com/jjserranogarcia/pipeline_auditoria_confirming/blob/main/Pipeline_Auditoria_Confirming.py) (Audit pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Input and extraction"]
  node_drive[("Google Drive")]
  node_identify["Document identification"]
  node_extract["Document extraction"]
  node_ocr["PDF OCR tools"]
end

subgraph group_audit["Audit processing"]
  node_normalize["Data normalization"]
  node_recalculate["Commission and interest"]
  node_compare["Bank amount check"]
end

subgraph group_outputs["Outputs and records"]
  node_excel["Processed Excel"]
  node_pdf["Processed PDF"]
  node_history[("CSV history")]
  node_archive[("Original archive")]
  node_monitor["Run monitoring PDF"]
end

subgraph group_runtime["Scheduled runtime"]
  node_pipeline["Audit pipeline"]
end

node_scheduler(("Monthly schedule"))

node_scheduler -->|"triggers"| node_pipeline
node_pipeline -->|"reads documents"| node_drive
node_pipeline -->|"identifies"| node_identify
node_identify -->|"routes extraction"| node_extract
node_extract -->|"invokes OCR"| node_ocr
node_extract -->|"provides data"| node_normalize
node_normalize -->|"supplies values"| node_recalculate
node_recalculate -->|"provides calculation"| node_compare
node_pipeline -->|"generates"| node_excel
node_pipeline -->|"generates"| node_pdf
node_pipeline -->|"updates"| node_history
node_pipeline -->|"archives originals"| node_archive
node_pipeline -->|"creates report"| node_monitor
node_pipeline -->|"uploads outputs"| node_drive

click node_pipeline "https://github.com/jjserranogarcia/pipeline_auditoria_confirming/blob/main/Pipeline_Auditoria_Confirming.py"
click node_identify "https://github.com/jjserranogarcia/pipeline_auditoria_confirming/blob/main/Pipeline_Auditoria_Confirming.py"
click node_extract "https://github.com/jjserranogarcia/pipeline_auditoria_confirming/blob/main/Pipeline_Auditoria_Confirming.py"
click node_normalize "https://github.com/jjserranogarcia/pipeline_auditoria_confirming/blob/main/Pipeline_Auditoria_Confirming.py"
click node_recalculate "https://github.com/jjserranogarcia/pipeline_auditoria_confirming/blob/main/Pipeline_Auditoria_Confirming.py"
click node_compare "https://github.com/jjserranogarcia/pipeline_auditoria_confirming/blob/main/Pipeline_Auditoria_Confirming.py"
click node_excel "https://github.com/jjserranogarcia/pipeline_auditoria_confirming/blob/main/Pipeline_Auditoria_Confirming.py"
click node_pdf "https://github.com/jjserranogarcia/pipeline_auditoria_confirming/blob/main/Pipeline_Auditoria_Confirming.py"
click node_history "https://github.com/jjserranogarcia/pipeline_auditoria_confirming/blob/main/Pipeline_Auditoria_Confirming.py"
click node_archive "https://github.com/jjserranogarcia/pipeline_auditoria_confirming/blob/main/Pipeline_Auditoria_Confirming.py"
click node_monitor "https://github.com/jjserranogarcia/pipeline_auditoria_confirming/blob/main/Pipeline_Auditoria_Confirming.py"

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_drive,node_identify,node_extract,node_ocr toneBlue
class node_normalize,node_recalculate,node_compare toneAmber
class node_excel,node_pdf,node_history,node_archive,node_monitor toneMint
class node_pipeline toneRose
class node_scheduler toneIndigo
```

## Components

### Input and extraction

- **Google Drive**
- [Document identification](https://github.com/jjserranogarcia/pipeline_auditoria_confirming/blob/main/Pipeline_Auditoria_Confirming.py): `Pipeline_Auditoria_Confirming.py`
- [Document extraction](https://github.com/jjserranogarcia/pipeline_auditoria_confirming/blob/main/Pipeline_Auditoria_Confirming.py): `Pipeline_Auditoria_Confirming.py`
- **PDF OCR tools**

### Audit processing

- [Data normalization](https://github.com/jjserranogarcia/pipeline_auditoria_confirming/blob/main/Pipeline_Auditoria_Confirming.py): `Pipeline_Auditoria_Confirming.py`
- [Commission and interest](https://github.com/jjserranogarcia/pipeline_auditoria_confirming/blob/main/Pipeline_Auditoria_Confirming.py): `Pipeline_Auditoria_Confirming.py`
- [Bank amount check](https://github.com/jjserranogarcia/pipeline_auditoria_confirming/blob/main/Pipeline_Auditoria_Confirming.py): `Pipeline_Auditoria_Confirming.py`

### Outputs and records

- [Processed Excel](https://github.com/jjserranogarcia/pipeline_auditoria_confirming/blob/main/Pipeline_Auditoria_Confirming.py): `Pipeline_Auditoria_Confirming.py`
- [Processed PDF](https://github.com/jjserranogarcia/pipeline_auditoria_confirming/blob/main/Pipeline_Auditoria_Confirming.py): `Pipeline_Auditoria_Confirming.py`
- [CSV history](https://github.com/jjserranogarcia/pipeline_auditoria_confirming/blob/main/Pipeline_Auditoria_Confirming.py): `Pipeline_Auditoria_Confirming.py`
- [Original archive](https://github.com/jjserranogarcia/pipeline_auditoria_confirming/blob/main/Pipeline_Auditoria_Confirming.py): `Pipeline_Auditoria_Confirming.py`
- [Run monitoring PDF](https://github.com/jjserranogarcia/pipeline_auditoria_confirming/blob/main/Pipeline_Auditoria_Confirming.py): `Pipeline_Auditoria_Confirming.py`

### Scheduled runtime

- [Audit pipeline](https://github.com/jjserranogarcia/pipeline_auditoria_confirming/blob/main/Pipeline_Auditoria_Confirming.py): `Pipeline_Auditoria_Confirming.py`

### Other components

- **Monthly schedule**

## Connections

- Monthly schedule → Audit pipeline: triggers (evidence: `README.md`)
- Audit pipeline → Google Drive: reads documents (evidence: `README.md`)
- Audit pipeline → Document identification: identifies (evidence: `README.md`)
- Document identification → Document extraction: routes extraction (evidence: `README.md`)
- Document extraction → PDF OCR tools: invokes OCR (evidence: `Pipeline_Auditoria_Confirming.py`)
- Document extraction → Data normalization: provides data (evidence: `README.md`)
- Data normalization → Commission and interest: supplies values (evidence: `README.md`)
- Commission and interest → Bank amount check: provides calculation (evidence: `README.md`)
- Audit pipeline → Processed Excel: generates (evidence: `README.md`)
- Audit pipeline → Processed PDF: generates (evidence: `README.md`)
- Audit pipeline → CSV history: updates (evidence: `README.md`)
- Audit pipeline → Original archive: archives originals (evidence: `README.md`)
- Audit pipeline → Run monitoring PDF: creates report (evidence: `README.md`)
- Audit pipeline → Google Drive: uploads outputs (evidence: `README.md`)
