# bhawna2123/workday-payroll-simulation architecture

> Architecture diagram of the GitHub repository bhawna2123/workday-payroll-simulation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bhawna2123/workday-payroll-simulation
- Repository: https://github.com/bhawna2123/workday-payroll-simulation

## Overview

##### Project type and purpose
- This is a Java-based integration simulation project that bridges Workday-style outbound XML data to a third-party payroll system.
- It consists of two main parts:
- A command-line “Workday to Payroll” integration pipeline (workday-payroll-integration/)
- A mock Spring Boot REST API server (payroll-api-server/) that receives transformed payroll XML

##### File structure
- Top-level modules:
- workday-payroll-integration/: holds input data, XSLT, output logs, and all Java source for the integration client
- payroll-api-server/: a standard Maven/Spring Boot project with controllers and application config
- Within workday-payroll-integration/:
- data/employees.xml – sample Workday outbound data
- xslt/transform.xslt – XSLT stylesheet that maps Workday XML → payroll format
- src/*.java – Java classes:
– Main.java (orchestrates the flow)
– EmployeeDataService.java (loads/parses XML)
– XSLTTransformer.java (applies XSLT)
– RestClient.java (HTTP POST client)
– LoggerUtil.java (logging & error capture)
- output/ – directory for transformed XML and error.log
- Within payroll-api-server/:
- src/main/java/com/example/payroll/PayrollApplication.java – Spring Boot entrypoint
- PayrollController.java – REST endpoint (/api/payroll/upload)
- application.properties – server config (port, logging, etc.)

##### README for additional insights
- Integration flow:
1. Read employees.xml
2. Transform via XSLT
3. POST transformed XML to mock API
4. Log results/errors
- Technologies: Java 8+, XSLT, Spring Boot REST, Maven
- Usage: run the Spring Boot server, then compile/run the integration client

##### Diagramming recommendations
- Use clear labels for every component (e.g., “XSLTTransformer”, “PayrollController”)

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Integration Pipeline"
        XML["employees.xml"]:::storage
        click XML "https://github.com/bhawna2123/workday-payroll-simulation/blob/main/workday-payroll-integration/data/employees.xml"

        Main["Main (Orchestrator)"]:::java
        click Main "https://github.com/bhawna2123/workday-payroll-simulation/blob/main/workday-payroll-integration/src/Main.java"

        EDS["EmployeeDataService"]:::java
        click EDS "https://github.com/bhawna2123/workday-payroll-simulation/blob/main/workday-payroll-integration/src/EmployeeDataService.java"

        Stylesheet["transform.xslt"]:::xslt
        click Stylesheet "https://github.com/bhawna2123/workday-payroll-simulation/blob/main/workday-payroll-integration/xslt/transform.xslt"

        XSLT["XSLTTransformer"]:::java
        click XSLT "https://github.com/bhawna2123/workday-payroll-simulation/blob/main/workday-payroll-integration/src/XSLTTransformer.java"

        RestC["RestClient"]:::java
        click RestC "https://github.com/bhawna2123/workday-payroll-simulation/blob/main/workday-payroll-integration/src/RestClient.java"

        Logger["LoggerUtil"]:::java
        click Logger "https://github.com/bhawna2123/workday-payroll-simulation/blob/main/workday-payroll-integration/src/LoggerUtil.java"

        OutputXML["payroll_transformed.xml"]:::storage
        click OutputXML "https://github.com/bhawna2123/workday-payroll-simulation/blob/main/workday-payroll-integration/output/payroll_transformed.xml"

        ErrorLog["error.log"]:::storage
        click ErrorLog "https://github.com/bhawna2123/workday-payroll-simulation/blob/main/workday-payroll-integration/output/error.log"
    end

    subgraph "Mock Payroll API Server"
        PA["PayrollApplication"]:::java
        click PA "https://github.com/bhawna2123/workday-payroll-simulation/blob/main/payroll-api-server/src/main/java/com/example/payroll/PayrollApplication.java"

        Controller["PayrollController (/api/payroll/upload)"]:::service
        click Controller "https://github.com/bhawna2123/workday-payroll-simulation/blob/main/payroll-api-server/src/main/java/com/PayrollController.java"

        Config["application.properties"]:::storage
        click Config "https://github.com/bhawna2123/workday-payroll-simulation/blob/main/payroll-api-server/src/main/resources/application.properties"

        PA --> Controller
    end

    XML -->|"Load XML"| Main
    Main -->|"parse() call"| EDS
    EDS -->|"DOM/XML Stream"| XSLT
    Stylesheet -->|"XSLT Stylesheet"| XSLT
    XSLT -->|"Transformed XML"| OutputXML
    XSLT -->|"Transformed XML"| RestC
    RestC -->|"POST XML over HTTP/POST"| Controller
    Controller -->|"HTTP 200/4xx"| Logger
    Logger -->|"write success"| OutputXML
    Logger -->|"write errors"| ErrorLog

    classDef javaModule fill:#add8e6,stroke:#000,stroke-width:1px
    classDef java fill:#add8e6,stroke:#000,stroke-width:1px
    classDef xslt fill:#90ee90,stroke:#000,stroke-width:1px
    classDef service fill:#ffa500,stroke:#000,stroke-width:1px
    classDef storage fill:#d3d3d3,stroke:#000,stroke-width:1px

    class Main,EDS,XSLT,RestC,Logger,PA java
    class Stylesheet xslt
    class Controller service
    class XML,OutputXML,ErrorLog,Config storage
```
