# rshashank20/vastra-returns-fix architecture

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

- Interactive diagram: https://gitdiagram.com/rshashank20/vastra-returns-fix
- Repository: https://github.com/rshashank20/vastra-returns-fix

## Overview

Vastra Returns Fix is a synthetic-data business analysis of return costs and refund delays, not an operational returns platform. Its main workflow is to generate data, analyze return economics and process bottlenecks in SQL, then use workbooks and a recommendation memo to evaluate actions; a separate dashboard builder queries a local database and produces the web dashboard. The README documents the analytical capabilities and proposed policy/process changes. SQL, workbook, and document internals are represented at their documented subsystem level; their execution wiring is not shown.

Main entry points: [`data_generator.py`](https://github.com/rshashank20/vastra-returns-fix/blob/main/data_generator.py) (Synthetic data), [`dashboard/build_dashboard.py`](https://github.com/rshashank20/vastra-returns-fix/blob/main/dashboard/build_dashboard.py) (Dashboard builder), [`recommendation_memo.md`](https://github.com/rshashank20/vastra-returns-fix/blob/main/recommendation_memo.md) (Recommendation), [`dashboard/index.html`](https://github.com/rshashank20/vastra-returns-fix/blob/main/dashboard/index.html) (Interactive dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data generation"]
  node_generator["Synthetic data<br/>[data_generator.py]"]
  node_localdb[("Local dataset")]
end

subgraph group_analysis["Returns analysis"]
  node_cost["Return cost<br/>[00_cost_view.sql]"]
  node_reasons["Return reasons<br/>[03_true_reason.sql]"]
  node_bracketing["Bracketing<br/>[04_bracketing.sql]"]
  node_concentration["Cost concentration"]
  node_toxicity["SKU toxicity<br/>[06_toxicity.sql]"]
  node_exchange["Exchange economics"]
  node_cohorts["Cohort analysis<br/>[08_cohorts.sql]"]
  node_journey["Journey bottlenecks"]
  node_sla["SLA breaches"]
  node_wismo["WISMO analysis<br/>[11_wismo.sql]"]
  node_operations["QC and pickups<br/>[12_qc_backlog.sql]"]
end

subgraph group_insight["Decision support"]
  node_workbooks["Scenario models"]
  node_deliverables["BA deliverables"]
  node_memo["Recommendation"]
end

subgraph group_dashboard["Dashboard"]
  node_dashboard_builder["Dashboard builder<br/>[build_dashboard.py]"]
  node_dashboard["Interactive dashboard<br/>[index.html]"]
end

node_analyst(("Analyst"))
node_leadership(("Leadership"))

node_analyst -->|"runs"| node_generator
node_generator -->|"generates data"| node_localdb
node_localdb -->|"analyzes"| node_cost
node_localdb -->|"analyzes"| node_reasons
node_localdb -->|"analyzes"| node_bracketing
node_localdb -->|"analyzes"| node_concentration
node_localdb -->|"analyzes"| node_toxicity
node_localdb -->|"analyzes"| node_exchange
node_localdb -->|"analyzes"| node_cohorts
node_localdb -->|"analyzes"| node_journey
node_localdb -->|"analyzes"| node_sla
node_localdb -->|"analyzes"| node_wismo
node_localdb -->|"analyzes"| node_operations
node_analyst -->|"models options"| node_workbooks
node_analyst -->|"documents findings"| node_deliverables
node_analyst -->|"synthesizes"| node_memo
node_localdb -->|"queries"| node_dashboard_builder
node_dashboard_builder -->|"writes"| node_dashboard
node_leadership -->|"reviews"| node_dashboard
node_leadership -->|"reviews"| node_memo

click node_generator "https://github.com/rshashank20/vastra-returns-fix/blob/main/data_generator.py"
click node_cost "https://github.com/rshashank20/vastra-returns-fix/blob/main/sql/00_cost_view.sql"
click node_reasons "https://github.com/rshashank20/vastra-returns-fix/blob/main/sql/03_true_reason.sql"
click node_bracketing "https://github.com/rshashank20/vastra-returns-fix/blob/main/sql/04_bracketing.sql"
click node_concentration "https://github.com/rshashank20/vastra-returns-fix/blob/main/sql/05_concentration.sql"
click node_toxicity "https://github.com/rshashank20/vastra-returns-fix/blob/main/sql/06_toxicity.sql"
click node_exchange "https://github.com/rshashank20/vastra-returns-fix/blob/main/sql/07_exchange_economics.sql"
click node_cohorts "https://github.com/rshashank20/vastra-returns-fix/blob/main/sql/08_cohorts.sql"
click node_journey "https://github.com/rshashank20/vastra-returns-fix/blob/main/sql/09_journey_bottleneck.sql"
click node_sla "https://github.com/rshashank20/vastra-returns-fix/blob/main/sql/10_breach_anatomy.sql"
click node_wismo "https://github.com/rshashank20/vastra-returns-fix/blob/main/sql/11_wismo.sql"
click node_operations "https://github.com/rshashank20/vastra-returns-fix/blob/main/sql/12_qc_backlog.sql"
click node_workbooks "https://github.com/rshashank20/vastra-returns-fix/tree/main/excel"
click node_deliverables "https://github.com/rshashank20/vastra-returns-fix/tree/main/docs"
click node_memo "https://github.com/rshashank20/vastra-returns-fix/blob/main/recommendation_memo.md"
click node_dashboard_builder "https://github.com/rshashank20/vastra-returns-fix/blob/main/dashboard/build_dashboard.py"
click node_dashboard "https://github.com/rshashank20/vastra-returns-fix/blob/main/dashboard/index.html"

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_generator,node_localdb toneBlue
class node_cost,node_reasons,node_bracketing,node_concentration,node_toxicity,node_exchange,node_cohorts,node_journey,node_sla,node_wismo,node_operations toneAmber
class node_workbooks,node_deliverables,node_memo toneMint
class node_dashboard_builder,node_dashboard toneRose
class node_analyst,node_leadership toneIndigo
```

## Components

### Data generation

- [Synthetic data](https://github.com/rshashank20/vastra-returns-fix/blob/main/data_generator.py): `data_generator.py`
- **Local dataset**

### Returns analysis

- [Return cost](https://github.com/rshashank20/vastra-returns-fix/blob/main/sql/00_cost_view.sql): `sql/00_cost_view.sql`
- [Return reasons](https://github.com/rshashank20/vastra-returns-fix/blob/main/sql/03_true_reason.sql): `sql/03_true_reason.sql`
- [Bracketing](https://github.com/rshashank20/vastra-returns-fix/blob/main/sql/04_bracketing.sql): `sql/04_bracketing.sql`
- [Cost concentration](https://github.com/rshashank20/vastra-returns-fix/blob/main/sql/05_concentration.sql): `sql/05_concentration.sql`
- [SKU toxicity](https://github.com/rshashank20/vastra-returns-fix/blob/main/sql/06_toxicity.sql): `sql/06_toxicity.sql`
- [Exchange economics](https://github.com/rshashank20/vastra-returns-fix/blob/main/sql/07_exchange_economics.sql): `sql/07_exchange_economics.sql`
- [Cohort analysis](https://github.com/rshashank20/vastra-returns-fix/blob/main/sql/08_cohorts.sql): `sql/08_cohorts.sql`
- [Journey bottlenecks](https://github.com/rshashank20/vastra-returns-fix/blob/main/sql/09_journey_bottleneck.sql): `sql/09_journey_bottleneck.sql`
- [SLA breaches](https://github.com/rshashank20/vastra-returns-fix/blob/main/sql/10_breach_anatomy.sql): `sql/10_breach_anatomy.sql`
- [WISMO analysis](https://github.com/rshashank20/vastra-returns-fix/blob/main/sql/11_wismo.sql): `sql/11_wismo.sql`
- [QC and pickups](https://github.com/rshashank20/vastra-returns-fix/blob/main/sql/12_qc_backlog.sql): `sql/12_qc_backlog.sql`

### Decision support

- [Scenario models](https://github.com/rshashank20/vastra-returns-fix/tree/main/excel): `excel`
- [BA deliverables](https://github.com/rshashank20/vastra-returns-fix/tree/main/docs): `docs`
- [Recommendation](https://github.com/rshashank20/vastra-returns-fix/blob/main/recommendation_memo.md): `recommendation_memo.md`

### Dashboard

- [Dashboard builder](https://github.com/rshashank20/vastra-returns-fix/blob/main/dashboard/build_dashboard.py): `dashboard/build_dashboard.py`
- [Interactive dashboard](https://github.com/rshashank20/vastra-returns-fix/blob/main/dashboard/index.html): `dashboard/index.html`

### Other components

- **Analyst**
- **Leadership**

## Connections

- Analyst → Synthetic data: runs (evidence: `README.md`)
- Synthetic data → Local dataset: generates data (evidence: `README.md`)
- Local dataset → Return cost: analyzes (evidence: `README.md`)
- Local dataset → Return reasons: analyzes (evidence: `README.md`)
- Local dataset → Bracketing: analyzes (evidence: `README.md`)
- Local dataset → Cost concentration: analyzes (evidence: `README.md`)
- Local dataset → SKU toxicity: analyzes (evidence: `README.md`)
- Local dataset → Exchange economics: analyzes (evidence: `README.md`)
- Local dataset → Cohort analysis: analyzes (evidence: `README.md`)
- Local dataset → Journey bottlenecks: analyzes (evidence: `README.md`)
- Local dataset → SLA breaches: analyzes (evidence: `README.md`)
- Local dataset → WISMO analysis: analyzes (evidence: `README.md`)
- Local dataset → QC and pickups: analyzes (evidence: `README.md`)
- Analyst → Scenario models: models options (evidence: `README.md`)
- Analyst → BA deliverables: documents findings (evidence: `README.md`)
- Analyst → Recommendation: synthesizes (evidence: `README.md`)
- Local dataset → Dashboard builder: queries (evidence: `dashboard/build_dashboard.py`)
- Dashboard builder → Interactive dashboard: writes (evidence: `dashboard/build_dashboard.py`)
- Leadership → Interactive dashboard: reviews (evidence: `README.md`)
- Leadership → Recommendation: reviews (evidence: `README.md`)
