# meaganmcgourty-phd/oddballtechassessment architecture

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

- Interactive diagram: https://gitdiagram.com/meaganmcgourty-phd/oddballtechassessment
- Repository: https://github.com/meaganmcgourty-phd/oddballtechassessment

## Overview

1. This repository is a small, file-based R data pipeline rather than a multi-service application. The entire workflow is centered in a single R Markdown document that reads raw CSVs, applies monthly deltas, builds final tables, and renders a report.

2. The input boundary is the `data/initial` folder plus monthly delta files in `data/delta`. The initial extract represents the January 2025 starting state, and the February/March delta files encode changes that must be applied chronologically across four datasets: `agents`, `contact_centers`, `service_categories`, and `interactions`.

3. The main processing subsystem is the RMarkdown pipeline itself. It uses standard tidyverse-style data wrangling libraries (`dplyr`, `readr`, `lubridate`, `tidyr`) to load, transform, and combine the CSVs. The repository does not show a separate package or service layer; the report document is both orchestration and documentation.

4. The data model is split into dimension-like tables and a fact-like table. `agents`, `contact_centers`, and `service_categories` behave as reference tables that are updated over time, while `interactions` is the event table that carries the actual support activity to be analyzed.

5. A key architectural behavior is chronological delta application. The pipeline starts from the initial snapshots, then applies February and March changes in order, producing “final” versions of each table in `data/output`. This makes the final state reproducible from raw inputs rather than manually curated outputs.

6. Time handling is part of the transformation boundary. Source timestamps are in UTC, but the pipeline converts them to America/New_York before monthly grouping. That local-time conversion affects reporting correctness because it determines which month each interaction belongs to.

7. The reporting layer aggregates the transformed interaction data into `support_report.csv`, grouped by month, contact center, and department. This is the business-facing output used to answer the quarter-level questions about volume and average call duration.

8. There is explicit handling for incomplete or broken reference data. If a delta deletes a dimension record that is still referenced by an interaction, the interaction is preserved and the missing dimension value is labeled `Unknown` rather than dropping the row. That design keeps fact counts intact and avoids data loss in the report.

9. Missing monthly deltas are treated as a normal condition, not an error. For example, there is no February delta for `contact_centers`, so the pipeline must support “no change this month” without breaking the full run.

10. The output boundary is the `data/output` folder. It contains the finalized table extracts (`final_agents.csv`, `final_contact_centers.csv`, `final_service_categories.csv`, `final_interactions.csv`) plus the aggregate report (`support_report.csv`). The generated PDF in the repo shows that the same RMarkdown document also serves as the presentation/reporting artifact.

11. The runtime/tooling requirements are local and lightweight: R 4.0+ with RStudio, plus `tinytex` for PDF rendering. `flextable` is used for presentation-quality tables in the knitted report, while `styler` suggests the author intended the code in the Rmd to be formatted/readable as part of the deliverable.

12. In architecture-diagram terms, the flow is: raw CSV inputs → RMarkdown transformation engine → cleaned/enriched final dimension and fact tables → monthly aggregate report → CSV/PDF outputs. The important boundaries are raw vs. transformed data, dimensions vs. fact data, and UTC source time vs. local reporting time.

Main entry points: [`Oddball Technical Assessment Pipeline - Customer Support Report.Rmd`](https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/HEAD/Oddball%20Technical%20Assessment%20Pipeline%20-%20Customer%20Support%20Report.Rmd) (R Markdown), [`data/initial`](https://github.com/meaganmcgourty-phd/oddballtechassessment/tree/main/data/initial) (Initial data), [`data/delta/agents_delta_202502.csv`](https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/data/delta/agents_delta_202502.csv) (Agents delta), [`data/delta/agents_delta_202503.csv`](https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/data/delta/agents_delta_202503.csv) (Agents delta)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Inputs"]
  node_initial_extract[("Initial data<br/>csv snapshot")]
  node_delta_agents_feb["Agents delta<br/>monthly change"]
  node_delta_agents_mar["Agents delta<br/>monthly change"]
  node_delta_centers_mar["Centers delta<br/>monthly change"]
  node_delta_services_feb["Services delta<br/>monthly change"]
  node_delta_services_mar["Services delta<br/>monthly change"]
  node_delta_interactions_feb["Interactions delta<br/>monthly change"]
  node_delta_interactions_mar["Interactions delta<br/>monthly change"]
end

subgraph group_pipeline["R Markdown pipeline"]
  node_rmd_doc["R Markdown<br/>orchestrator"]
  node_load_transform["Load & wrangle<br/>tidyverse ETL"]
  node_apply_deltas["Apply deltas<br/>chronological merge"]
  node_time_normalize["Time normalize<br/>UTC to local"]
  node_agent_table[("Agents<br/>dimension table")]
  node_center_table[("Contact centers<br/>dimension table")]
  node_service_table[("Service categories<br/>dimension table")]
  node_interaction_table[("Interactions<br/>fact table")]
  node_unknown_fallback(("Unknown fallback<br/>missing-reference guard"))
  node_monthly_report["Monthly report<br/>aggregate"]
end

subgraph group_outputs["Outputs"]
  node_final_agents["Final agents<br/>output csv<br/>[final_agents.csv]"]
  node_final_centers["Final centers<br/>output csv"]
  node_final_services["Final services<br/>output csv"]
  node_final_interactions["Final interactions<br/>output csv"]
  node_support_report["Support report<br/>output csv<br/>[support_report.csv]"]
  node_pdf_report["PDF report<br/>rendered artifact"]
end

node_initial_extract -->|"seed data"| node_load_transform
node_delta_agents_feb -->|"agents Feb"| node_apply_deltas
node_delta_agents_mar -->|"agents Mar"| node_apply_deltas
node_delta_centers_mar -->|"centers Mar"| node_apply_deltas
node_delta_services_feb -->|"services Feb"| node_apply_deltas
node_delta_services_mar -->|"services Mar"| node_apply_deltas
node_delta_interactions_feb -->|"interactions Feb"| node_apply_deltas
node_delta_interactions_mar -->|"interactions Mar"| node_apply_deltas
node_rmd_doc -->|"drives"| node_load_transform
node_load_transform -->|"hands off"| node_apply_deltas
node_apply_deltas -->|"prepare facts"| node_time_normalize
node_apply_deltas -->|"build"| node_agent_table
node_apply_deltas -->|"build"| node_center_table
node_apply_deltas -->|"build"| node_service_table
node_apply_deltas -->|"build"| node_interaction_table
node_interaction_table -->|"guard"| node_unknown_fallback
node_unknown_fallback -->|"preserve counts"| node_monthly_report
node_time_normalize -->|"group by month"| node_monthly_report
node_center_table -->|"join dims"| node_monthly_report
node_agent_table -->|"join dims"| node_monthly_report
node_service_table -->|"join dims"| node_monthly_report
node_agent_table -->|"write"| node_final_agents
node_center_table -->|"write"| node_final_centers
node_service_table -->|"write"| node_final_services
node_interaction_table -->|"write"| node_final_interactions
node_monthly_report -->|"write"| node_support_report
node_rmd_doc -->|"render"| node_pdf_report

click node_initial_extract "https://github.com/meaganmcgourty-phd/oddballtechassessment/tree/main/data/initial"
click node_delta_agents_feb "https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/data/delta/agents_delta_202502.csv"
click node_delta_agents_mar "https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/data/delta/agents_delta_202503.csv"
click node_delta_centers_mar "https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/data/delta/contact_centers_delta_202503.csv"
click node_delta_services_feb "https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/data/delta/service_categories_delta_202502.csv"
click node_delta_services_mar "https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/data/delta/service_categories_delta_202503.csv"
click node_delta_interactions_feb "https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/data/delta/interactions_delta_202502.csv"
click node_delta_interactions_mar "https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/data/delta/interactions_delta_202503.csv"
click node_rmd_doc "https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/Oddball Technical Assessment Pipeline - Customer Support Report.Rmd"
click node_final_agents "https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/data/output/final_agents.csv"
click node_final_centers "https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/data/output/final_contact_centers.csv"
click node_final_services "https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/data/output/final_service_categories.csv"
click node_final_interactions "https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/data/output/final_interactions.csv"
click node_support_report "https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/data/output/support_report.csv"
click node_pdf_report "https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/Oddball-Technical-Assessment-Pipeline---Customer-Support-Report.pdf"

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_initial_extract,node_delta_agents_feb,node_delta_agents_mar,node_delta_centers_mar,node_delta_services_feb,node_delta_services_mar,node_delta_interactions_feb,node_delta_interactions_mar toneBlue
class node_rmd_doc,node_load_transform,node_apply_deltas,node_time_normalize,node_agent_table,node_center_table,node_service_table,node_interaction_table,node_unknown_fallback,node_monthly_report toneAmber
class node_final_agents,node_final_centers,node_final_services,node_final_interactions,node_support_report,node_pdf_report toneMint
```

## Components

### Inputs

Raw snapshots and monthly change files

- [Initial data](https://github.com/meaganmcgourty-phd/oddballtechassessment/tree/main/data/initial): csv snapshot · January 2025 starting state for all core tables · `data/initial`
- [Agents delta](https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/data/delta/agents_delta_202502.csv): monthly change · February update for agents · `data/delta/agents_delta_202502.csv`
- [Agents delta](https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/data/delta/agents_delta_202503.csv): monthly change · March update for agents · `data/delta/agents_delta_202503.csv`
- [Centers delta](https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/data/delta/contact_centers_delta_202503.csv): monthly change · March update for contact centers; February has no change file · `data/delta/contact_centers_delta_202503.csv`
- [Services delta](https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/data/delta/service_categories_delta_202502.csv): monthly change · February update for service categories · `data/delta/service_categories_delta_202502.csv`
- [Services delta](https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/data/delta/service_categories_delta_202503.csv): monthly change · March update for service categories · `data/delta/service_categories_delta_202503.csv`
- [Interactions delta](https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/data/delta/interactions_delta_202502.csv): monthly change · February event updates · `data/delta/interactions_delta_202502.csv`
- [Interactions delta](https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/data/delta/interactions_delta_202503.csv): monthly change · March event updates · `data/delta/interactions_delta_202503.csv`

### R Markdown pipeline

Single-document transformation and reporting flow

- [R Markdown](https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/HEAD/Oddball%20Technical%20Assessment%20Pipeline%20-%20Customer%20Support%20Report.Rmd): orchestrator · Single document that runs the pipeline and renders the report · `Oddball Technical Assessment Pipeline - Customer Support Report.Rmd`
- **Load & wrangle**: tidyverse ETL · Reads CSVs and applies dplyr/readr/tidyr transformations
- **Apply deltas**: chronological merge · Replays monthly changes in order to reconstruct final tables
- **Time normalize**: UTC to local · Converts source timestamps from UTC to America/New_York before grouping
- **Agents**: dimension table · Current reference state for agents
- **Contact centers**: dimension table · Current reference state for contact centers
- **Service categories**: dimension table · Current reference state for service categories
- **Interactions**: fact table · Event table carrying support activity
- **Unknown fallback**: missing-reference guard · Preserves interactions when a referenced dimension row is deleted
- **Monthly report**: aggregate · Groups interactions by month, contact center, and department

### Outputs

Final CSV extracts and rendered report

- [Final agents](https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/data/output/final_agents.csv): output csv · Reconstructed agent table · `data/output/final_agents.csv`
- [Final centers](https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/data/output/final_contact_centers.csv): output csv · Reconstructed contact center table · `data/output/final_contact_centers.csv`
- [Final services](https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/data/output/final_service_categories.csv): output csv · Reconstructed service category table · `data/output/final_service_categories.csv`
- [Final interactions](https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/data/output/final_interactions.csv): output csv · Reconstructed interaction table · `data/output/final_interactions.csv`
- [Support report](https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/data/output/support_report.csv): output csv · Business-facing monthly summary · `data/output/support_report.csv`
- [PDF report](https://github.com/meaganmcgourty-phd/oddballtechassessment/blob/main/Oddball-Technical-Assessment-Pipeline---Customer-Support-Report.pdf): rendered artifact · Knitted presentation copy of the R Markdown report · `Oddball-Technical-Assessment-Pipeline---Customer-Support-Report.pdf`

## Connections

- Initial data → Load & wrangle: seed data · Base snapshots initialize the pipeline
- Agents delta → Apply deltas: agents Feb · February agent changes
- Agents delta → Apply deltas: agents Mar · March agent changes
- Centers delta → Apply deltas: centers Mar · March contact center changes
- Services delta → Apply deltas: services Feb · February service category changes
- Services delta → Apply deltas: services Mar · March service category changes
- Interactions delta → Apply deltas: interactions Feb · February interaction changes
- Interactions delta → Apply deltas: interactions Mar · March interaction changes
- R Markdown → Load & wrangle: drives · The R Markdown document orchestrates loading and wrangling
- Load & wrangle → Apply deltas: hands off · Normalized inputs feed chronological reconstruction
- Apply deltas → Time normalize: prepare facts · Interaction timestamps are adjusted before aggregation
- Apply deltas → Agents: build · Produces final agent dimension
- Apply deltas → Contact centers: build · Produces final contact center dimension
- Apply deltas → Service categories: build · Produces final service category dimension
- Apply deltas → Interactions: build · Produces final interaction fact table
- Interactions → Unknown fallback: guard · Missing references are labeled Unknown instead of dropping rows
- Unknown fallback → Monthly report: preserve counts · Keeps fact rows available for reporting
- Time normalize → Monthly report: group by month · Local-time conversion determines monthly buckets
- Contact centers → Monthly report: join dims · Contact center names enrich the report
- Agents → Monthly report: join dims · Agent reference data supports reporting context
- Service categories → Monthly report: join dims · Service category reference data supports reporting context
- Agents → Final agents: write · Final agent extract is written to output
- Contact centers → Final centers: write · Final contact center extract is written to output
- Service categories → Final services: write · Final service category extract is written to output
- Interactions → Final interactions: write · Final interaction extract is written to output
- Monthly report → Support report: write · Monthly aggregate CSV is produced for business use
- R Markdown → PDF report: render · The same document is knitted to PDF
