# sameday-courier/woocommerce-plugin architecture

> Architecture diagram of the GitHub repository sameday-courier/woocommerce-plugin, 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/sameday-courier/woocommerce-plugin
- Repository: https://github.com/sameday-courier/woocommerce-plugin

## Overview

This is a WooCommerce shipping plugin that exposes Sameday Courier delivery at checkout and gives store administrators tools to manage courier data and AWBs. The customer flow is choosing a Sameday service during checkout and placing an order; the administrator flow then generates an AWB and can add parcels, view its PDF or history, or remove it. Separate capabilities include importing services and delivery locations, managing pickup points, and configuring the shipping method. The excerpts show selected controller, import, and shipping-method interactions; other links reflect README-documented capabilities.

Main entry points: [`classes/Infrastructure/Wordpress/Http/Controllers/Import/AllImportController.php`](https://github.com/sameday-courier/woocommerce-plugin/blob/master/classes/Infrastructure/Wordpress/Http/Controllers/Import/AllImportController.php) (Bulk import), [`classes/Infrastructure/Woo/Shipping/Method/SamedayCourier.php`](https://github.com/sameday-courier/woocommerce-plugin/blob/master/classes/Infrastructure/Woo/Shipping/Method/SamedayCourier.php) (Shipping method), [`classes/Infrastructure/Wordpress/Http/Controllers/Awb`](https://github.com/sameday-courier/woocommerce-plugin/tree/master/classes/Infrastructure/Wordpress/Http/Controllers/Awb) (AWB administration), [`classes/Infrastructure/Woo/Admin/Grid/Service/Services.php`](https://github.com/sameday-courier/woocommerce-plugin/blob/master/classes/Infrastructure/Woo/Admin/Grid/Service/Services.php) (Admin catalog grids)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_checkout["Checkout shipping"]
  node_checkout_method["Shipping method<br/>[SamedayCourier.php]"]
end

subgraph group_admin["Admin operations"]
  node_awb_admin["AWB administration"]
  node_bulk_import["Bulk import"]
  node_admin_grids["Admin catalog grids<br/>[Services.php]"]
end

subgraph group_app["Application workflows"]
  node_awb_workflows["AWB workflows"]
  node_bulk_steps["Import workflows"]
  node_catalog_refresh["Catalog refresh<br/>[RefreshService.php]"]
  node_location_refresh["Location refresh"]
  node_pickup_admin["Pickup point management"]
end

subgraph group_domain["Courier domain"]
  node_service_selection["Service selection"]
  node_service_model["Carrier services<br/>[CarrierService.php]"]
  node_service_rules["Service rules"]
end

subgraph group_integration["Platform integration"]
  node_admin_controllers["Admin controllers"]
  node_job_store[("Bulk job state")]
end

node_shopper(("Shopper"))
node_store_admin(("Store admin"))
node_courier_api{{"Sameday Courier"}}
node_woo_platform{{"WooCommerce"}}

node_shopper -->|"chooses service"| node_checkout_method
node_checkout_method -->|"selects eligible"| node_service_selection
node_service_selection -->|"returns services"| node_service_model
node_checkout_method -.->|"registers shipping"| node_woo_platform
node_store_admin -->|"submits actions"| node_admin_controllers
node_admin_controllers -.->|"routes requests"| node_awb_admin
node_awb_admin -.->|"executes AWB actions"| node_awb_workflows
node_awb_workflows -.->|"manages AWBs"| node_courier_api
node_store_admin -->|"starts import"| node_bulk_import
node_bulk_import -->|"processes import"| node_bulk_steps
node_bulk_import -->|"executes refresh"| node_catalog_refresh
node_bulk_import -->|"executes refresh"| node_location_refresh
node_bulk_import -.->|"stores job state"| node_job_store
node_catalog_refresh -.->|"loads services"| node_courier_api
node_location_refresh -.->|"loads locations"| node_courier_api
node_store_admin -->|"manages pickup points"| node_pickup_admin
node_pickup_admin -.->|"updates pickup point"| node_courier_api
node_store_admin -->|"reviews services"| node_admin_grids
node_admin_grids -->|"displays catalog"| node_service_model

click node_checkout_method "https://github.com/sameday-courier/woocommerce-plugin/blob/master/classes/Infrastructure/Woo/Shipping/Method/SamedayCourier.php"
click node_service_selection "https://github.com/sameday-courier/woocommerce-plugin/blob/master/classes/Domain/CarrierServiceSelector.php"
click node_service_model "https://github.com/sameday-courier/woocommerce-plugin/blob/master/classes/Domain/Models/CarrierService.php"
click node_service_rules "https://github.com/sameday-courier/woocommerce-plugin/blob/master/classes/Domain/CarrierServiceRules.php"
click node_admin_controllers "https://github.com/sameday-courier/woocommerce-plugin/blob/master/classes/Infrastructure/Wordpress/Http/Controllers/AbstractController.php"
click node_awb_workflows "https://github.com/sameday-courier/woocommerce-plugin/tree/master/classes/Application/UseCases/Awb"
click node_awb_admin "https://github.com/sameday-courier/woocommerce-plugin/tree/master/classes/Infrastructure/Wordpress/Http/Controllers/Awb"
click node_bulk_import "https://github.com/sameday-courier/woocommerce-plugin/blob/master/classes/Infrastructure/Wordpress/Http/Controllers/Import/AllImportController.php"
click node_bulk_steps "https://github.com/sameday-courier/woocommerce-plugin/tree/master/classes/Application/UseCases/Import/StartAllImport"
click node_catalog_refresh "https://github.com/sameday-courier/woocommerce-plugin/blob/master/classes/Application/UseCases/Service/Refresh/RefreshService.php"
click node_location_refresh "https://github.com/sameday-courier/woocommerce-plugin/tree/master/classes/Application/UseCases/City/Refresh"
click node_pickup_admin "https://github.com/sameday-courier/woocommerce-plugin/tree/master/classes/Application/UseCases/PickupPoint"
click node_admin_grids "https://github.com/sameday-courier/woocommerce-plugin/blob/master/classes/Infrastructure/Woo/Admin/Grid/Service/Services.php"
click node_job_store "https://github.com/sameday-courier/woocommerce-plugin/blob/master/classes/Infrastructure/Wordpress/Http/Controllers/AbstractRecursiveBulkController.php"

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_checkout_method toneBlue
class node_awb_admin,node_bulk_import,node_admin_grids toneAmber
class node_awb_workflows,node_bulk_steps,node_catalog_refresh,node_location_refresh,node_pickup_admin toneMint
class node_service_selection,node_service_model,node_service_rules toneRose
class node_admin_controllers,node_job_store,node_shopper,node_store_admin,node_courier_api,node_woo_platform toneIndigo
```

## Components

### Checkout shipping

- [Shipping method](https://github.com/sameday-courier/woocommerce-plugin/blob/master/classes/Infrastructure/Woo/Shipping/Method/SamedayCourier.php): `classes/Infrastructure/Woo/Shipping/Method/SamedayCourier.php`

### Admin operations

- [AWB administration](https://github.com/sameday-courier/woocommerce-plugin/tree/master/classes/Infrastructure/Wordpress/Http/Controllers/Awb): `classes/Infrastructure/Wordpress/Http/Controllers/Awb`
- [Bulk import](https://github.com/sameday-courier/woocommerce-plugin/blob/master/classes/Infrastructure/Wordpress/Http/Controllers/Import/AllImportController.php): `classes/Infrastructure/Wordpress/Http/Controllers/Import/AllImportController.php`
- [Admin catalog grids](https://github.com/sameday-courier/woocommerce-plugin/blob/master/classes/Infrastructure/Woo/Admin/Grid/Service/Services.php): `classes/Infrastructure/Woo/Admin/Grid/Service/Services.php`

### Application workflows

- [AWB workflows](https://github.com/sameday-courier/woocommerce-plugin/tree/master/classes/Application/UseCases/Awb): `classes/Application/UseCases/Awb`
- [Import workflows](https://github.com/sameday-courier/woocommerce-plugin/tree/master/classes/Application/UseCases/Import/StartAllImport): `classes/Application/UseCases/Import/StartAllImport`
- [Catalog refresh](https://github.com/sameday-courier/woocommerce-plugin/blob/master/classes/Application/UseCases/Service/Refresh/RefreshService.php): `classes/Application/UseCases/Service/Refresh/RefreshService.php`
- [Location refresh](https://github.com/sameday-courier/woocommerce-plugin/tree/master/classes/Application/UseCases/City/Refresh): `classes/Application/UseCases/City/Refresh`
- [Pickup point management](https://github.com/sameday-courier/woocommerce-plugin/tree/master/classes/Application/UseCases/PickupPoint): `classes/Application/UseCases/PickupPoint`

### Courier domain

- [Service selection](https://github.com/sameday-courier/woocommerce-plugin/blob/master/classes/Domain/CarrierServiceSelector.php): `classes/Domain/CarrierServiceSelector.php`
- [Carrier services](https://github.com/sameday-courier/woocommerce-plugin/blob/master/classes/Domain/Models/CarrierService.php): `classes/Domain/Models/CarrierService.php`
- [Service rules](https://github.com/sameday-courier/woocommerce-plugin/blob/master/classes/Domain/CarrierServiceRules.php): `classes/Domain/CarrierServiceRules.php`

### Platform integration

- [Admin controllers](https://github.com/sameday-courier/woocommerce-plugin/blob/master/classes/Infrastructure/Wordpress/Http/Controllers/AbstractController.php): `classes/Infrastructure/Wordpress/Http/Controllers/AbstractController.php`
- [Bulk job state](https://github.com/sameday-courier/woocommerce-plugin/blob/master/classes/Infrastructure/Wordpress/Http/Controllers/AbstractRecursiveBulkController.php): `classes/Infrastructure/Wordpress/Http/Controllers/AbstractRecursiveBulkController.php`

### Other components

- **Shopper**
- **Store admin**
- **Sameday Courier**
- **WooCommerce**

## Connections

- Shopper → Shipping method: chooses service
- Shipping method → Service selection: selects eligible (evidence: `classes/Infrastructure/Woo/Shipping/Method/SamedayCourier.php`)
- Service selection → Carrier services: returns services
- Shipping method → WooCommerce: registers shipping
- Store admin → Admin controllers: submits actions
- Admin controllers → AWB administration: routes requests
- AWB administration → AWB workflows: executes AWB actions
- AWB workflows → Sameday Courier: manages AWBs
- Store admin → Bulk import: starts import
- Bulk import → Import workflows: processes import (evidence: `classes/Infrastructure/Wordpress/Http/Controllers/Import/AllImportController.php`)
- Bulk import → Catalog refresh: executes refresh (evidence: `classes/Infrastructure/Wordpress/Http/Controllers/Import/AllImportController.php`)
- Bulk import → Location refresh: executes refresh (evidence: `classes/Infrastructure/Wordpress/Http/Controllers/Import/AllImportController.php`)
- Bulk import → Bulk job state: stores job state (evidence: `classes/Infrastructure/Wordpress/Http/Controllers/AbstractRecursiveBulkController.php`)
- Catalog refresh → Sameday Courier: loads services
- Location refresh → Sameday Courier: loads locations
- Store admin → Pickup point management: manages pickup points
- Pickup point management → Sameday Courier: updates pickup point
- Store admin → Admin catalog grids: reviews services
- Admin catalog grids → Carrier services: displays catalog (evidence: `classes/Infrastructure/Woo/Admin/Grid/Service/Services.php`)
