# parthasarathyhmh/workday-middleware architecture

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

- Interactive diagram: https://gitdiagram.com/parthasarathyhmh/workday-middleware
- Repository: https://github.com/parthasarathyhmh/workday-middleware

## Overview

This is a Workday backup and integration API built with NestJS, alongside employee/job-post endpoints, authentication, and a Zoho e-sign webhook. The backup path includes scheduled orchestration, Workday report retrieval, domain-specific processing, and MongoDB log storage/export. Evidence is uneven: some service and controller files were not excerpted, so their behavior and call relationships are not inferred beyond the module wiring shown in the source index.

Main entry points: [`src/workday-backup.module.ts`](https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/workday-backup.module.ts) (Backup module), [`src/app.module.ts`](https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/app.module.ts) (Nest application), [`src/services`](https://github.com/parthasarathyhmh/workday-middleware/tree/main/src/services) (Backup domains), [`src/controllers/zoho-webhook.controller.ts`](https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/controllers/zoho-webhook.controller.ts) (Zoho webhook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and access"]
  node_app["Nest application<br/>[app.module.ts]"]
  node_auth["Authentication<br/>[auth.service.ts]"]
  node_users["User accounts<br/>[user.service.ts]"]
  node_jwt["JWT tokens<br/>[jwt.service.ts]"]
  node_jobposts["Job posts"]
  node_employees["Employees"]
end

subgraph group_backup["Workday backups"]
  node_backupmodule["Backup module"]
  node_scheduler["Backup scheduler"]
  node_backupservice["Backup service"]
  node_domains["Backup domains"]
end

subgraph group_storage["Logs and encryption"]
  node_mongodb[("MongoDB logs")]
  node_logdomains["Log schemas"]
  node_encryption["Field encryption"]
  node_crypto["Crypto utilities<br/>[crypto.utils.ts]"]
  node_exports["Log export"]
end

subgraph group_integrations["External integrations"]
  node_eventsscheduler["Workday event scheduler"]
  node_zoho["Zoho webhook"]
  node_zohoverify["Webhook validation"]
  node_workday["Workday service"]
  node_mail["Failure email<br/>[mail.service.ts]"]
end

node_clients(("API clients"))
node_smtp(("SMTP service"))

node_clients -->|"send requests"| node_app
node_app -->|"registers"| node_backupmodule
node_app -->|"registers"| node_jobposts
node_app -->|"registers"| node_employees
node_app -->|"registers"| node_zoho
node_auth -->|"looks up"| node_users
node_auth -->|"issues tokens"| node_jwt
node_backupmodule -->|"registers"| node_scheduler
node_backupmodule -->|"registers"| node_domains
node_backupmodule -->|"configures"| node_mongodb
node_backupmodule -->|"registers"| node_logdomains
node_backupmodule -->|"registers"| node_backupservice
node_backupmodule -->|"registers"| node_eventsscheduler
node_domains -->|"fetches report data"| node_backupservice
node_domains -->|"writes and queries"| node_mongodb
node_domains -->|"processes records"| node_encryption
node_encryption -->|"encrypts values"| node_crypto
node_domains -.->|"exports logs"| node_exports
node_zoho -->|"validates payload"| node_zohoverify
node_zoho -->|"forwards webhook"| node_workday
node_mail -->|"sends mail"| node_smtp

click node_app "https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/app.module.ts"
click node_auth "https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/services/auth.service.ts"
click node_users "https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/services/user.service.ts"
click node_jwt "https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/services/jwt.service.ts"
click node_jobposts "https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/controllers/jobpost.controller.ts"
click node_employees "https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/controllers/employee.controller.ts"
click node_backupmodule "https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/workday-backup.module.ts"
click node_scheduler "https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/schedulers/workday-backup.scheduler.ts"
click node_backupservice "https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/services/workday-backup.service.ts"
click node_domains "https://github.com/parthasarathyhmh/workday-middleware/tree/main/src/services"
click node_eventsscheduler "https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/schedulers/workday-events.scheduler.ts"
click node_zoho "https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/controllers/zoho-webhook.controller.ts"
click node_zohoverify "https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/services/zoho-webhook-validation.service.ts"
click node_workday "https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/services/workday-backup.service.ts"
click node_mongodb "https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/database/workday-backup-mongo.module.ts"
click node_logdomains "https://github.com/parthasarathyhmh/workday-middleware/tree/main/src/database/schemas"
click node_encryption "https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/database/plugins/encryption.plugin.ts"
click node_crypto "https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/utils/crypto.utils.ts"
click node_exports "https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/utils/backup-logs-export.utils.ts"
click node_mail "https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/mail/mail.service.ts"

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_auth,node_users,node_jwt,node_jobposts,node_employees,node_clients toneBlue
class node_backupmodule,node_scheduler,node_backupservice,node_domains toneAmber
class node_mongodb,node_logdomains,node_encryption,node_crypto,node_exports toneMint
class node_eventsscheduler,node_zoho,node_zohoverify,node_workday,node_mail toneRose
class node_smtp toneIndigo
```

## Components

### API and access

- [Nest application](https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/app.module.ts): `src/app.module.ts`
- [Authentication](https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/services/auth.service.ts): `src/services/auth.service.ts`
- [User accounts](https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/services/user.service.ts): `src/services/user.service.ts`
- [JWT tokens](https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/services/jwt.service.ts): `src/services/jwt.service.ts`
- [Job posts](https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/controllers/jobpost.controller.ts): `src/controllers/jobpost.controller.ts`
- [Employees](https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/controllers/employee.controller.ts): `src/controllers/employee.controller.ts`

### Workday backups

- [Backup module](https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/workday-backup.module.ts): `src/workday-backup.module.ts`
- [Backup scheduler](https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/schedulers/workday-backup.scheduler.ts): `src/schedulers/workday-backup.scheduler.ts`
- [Backup service](https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/services/workday-backup.service.ts): `src/services/workday-backup.service.ts`
- [Backup domains](https://github.com/parthasarathyhmh/workday-middleware/tree/main/src/services): `src/services`

### Logs and encryption

- [MongoDB logs](https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/database/workday-backup-mongo.module.ts): `src/database/workday-backup-mongo.module.ts`
- [Log schemas](https://github.com/parthasarathyhmh/workday-middleware/tree/main/src/database/schemas): `src/database/schemas`
- [Field encryption](https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/database/plugins/encryption.plugin.ts): `src/database/plugins/encryption.plugin.ts`
- [Crypto utilities](https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/utils/crypto.utils.ts): `src/utils/crypto.utils.ts`
- [Log export](https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/utils/backup-logs-export.utils.ts): `src/utils/backup-logs-export.utils.ts`

### External integrations

- [Workday event scheduler](https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/schedulers/workday-events.scheduler.ts): `src/schedulers/workday-events.scheduler.ts`
- [Zoho webhook](https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/controllers/zoho-webhook.controller.ts): `src/controllers/zoho-webhook.controller.ts`
- [Webhook validation](https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/services/zoho-webhook-validation.service.ts): `src/services/zoho-webhook-validation.service.ts`
- [Workday service](https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/services/workday-backup.service.ts): `src/services/workday-backup.service.ts`
- [Failure email](https://github.com/parthasarathyhmh/workday-middleware/blob/main/src/mail/mail.service.ts): `src/mail/mail.service.ts`

### Other components

- **API clients**
- **SMTP service**

## Connections

- API clients → Nest application: send requests
- Nest application → Backup module: registers (evidence: `src/app.module.ts`)
- Nest application → Job posts: registers (evidence: `src/app.module.ts`)
- Nest application → Employees: registers (evidence: `src/app.module.ts`)
- Nest application → Zoho webhook: registers (evidence: `src/app.module.ts`)
- Authentication → User accounts: looks up (evidence: `src/services/auth.service.ts`)
- Authentication → JWT tokens: issues tokens (evidence: `src/services/auth.service.ts`)
- Backup module → Backup scheduler: registers (evidence: `src/workday-backup.module.ts`)
- Backup module → Backup domains: registers (evidence: `src/workday-backup.module.ts`)
- Backup module → MongoDB logs: configures (evidence: `src/workday-backup.module.ts`)
- Backup module → Log schemas: registers (evidence: `src/workday-backup.module.ts`)
- Backup module → Backup service: registers (evidence: `src/workday-backup.module.ts`)
- Backup module → Workday event scheduler: registers
- Backup domains → Backup service: fetches report data (evidence: `src/services/spend-authorizations.service.ts`)
- Backup domains → MongoDB logs: writes and queries (evidence: `src/services/spend-authorizations.service.ts`)
- Backup domains → Field encryption: processes records (evidence: `src/services/spend-authorizations.service.ts`)
- Field encryption → Crypto utilities: encrypts values (evidence: `src/database/plugins/encryption.plugin.ts`)
- Backup domains → Log export: exports logs
- Zoho webhook → Webhook validation: validates payload (evidence: `src/controllers/zoho-webhook.controller.ts`)
- Zoho webhook → Workday service: forwards webhook (evidence: `src/controllers/zoho-webhook.controller.ts`)
- Failure email → SMTP service: sends mail (evidence: `src/mail/mail.service.ts`)
