Axigrate Platform Overview
Comprehensive business integration platform for book publishing and distribution
Quick Start:
application options/swagger-ui.html/v3/api-docs/v3/api-docs.yamlWhat is Axigrate?
Axigrate is a Spring Boot microservice that serves as a comprehensive business integration platform, connecting various external systems with a core AS400/IBM i system running Bookmaster ERP. The application handles sales order processing, purchasing workflows, accounting transactions, and courier integrations for the book publishing and distribution industry.
Key Features
EDI Processing
X12 4010 850 and EDIFACT ORDERS v6.0 support with Smooks framework
AS400 Integration
Direct connection to Bookmaster ERP via JTOpen (jt400) driver
File Transfer
Embedded FTP/SFTP servers with automated file processing
Api
Support for transactions via RESTful Api's, eg. Sales Orders
Supply Chain Process Flow
System Architecture
Layered architecture with comprehensive service layer structure
Service Layer Structure
| Service Package | Purpose | Key Components |
|---|---|---|
/service/ |
Core Services | AS400Service, SalesService, PurchasingService, AccountingService, CourierService |
/service/comms/ |
Communication | EmailService, FTPService, SftpJSchService |
/service/digest/ |
Data Processing | EDI parsing and data transformation |
/service/distr/ |
Distribution | Order processing, inventory management |
/service/accg/ |
Accounting | Financial transactions, AR/GL processing |
Technology Stack
Framework
Spring Boot 3.3.3, Java 17+
Database
IBM i DB2, PostgreSQL, MySQL, SQL Server
Integration
Apache Camel 4.6.0, Spring Integration
EDI Processing
Smooks 2.2.1, EDI Reader 4.7.3
Security
JWT, Spring Security, API Keys
UI Framework
JSF with JoinFaces, PrimeFaces
Item Catalog Management
Product information, pricing, and inventory management
Catalog Data Sources
The item catalog is primarily maintained in the Bookmaster ERP system on AS400/IBM i and synchronized with external systems.
Key Database Tables:
- Item Master: Core product information (ISBN, title, author, publisher)
- Item Classification: Product categorization and groupings
- Item Templates: Default settings for new products
- Warehouse Item Balance: Stock levels across warehouses
- Special Price Files: Customer-specific pricing
Catalog Services
Data Synchronization
Catalog data is synchronized with external systems through various mechanisms:
Scheduled Updates
Automated catalog feeds to major customers (Amazon, Van Schaik)
Real-time API
REST endpoints for immediate catalog lookups
File Exports
CSV/XML exports via FTP/SFTP for batch processing
EDI Integration
Product catalog data embedded in EDI transactions
ItemClassificationService, ItemTemplateService, and WarehouseItemBalanceService classes.
Customer Orders (Inbound)
Processing incoming orders from various channels and formats
Order Input Channels
EDI Orders
X12 4010 850 and EDIFACT ORDERS v6.0 via FTP/SFTP
Web API
REST API for real-time order submission
File Uploads
CSV/Excel file uploads via embedded FTP server
Manual Entry
Web interface for direct order entry
Order Processing Workflow
Processing Steps:
- Order Receipt: Orders received via various channels are queued for processing
- Format Validation: EDI parsing and data structure validation
- Customer Validation: Customer account verification and credit checks
- Item Validation: ISBN/product code verification and availability
- Pricing Calculation: Apply customer-specific pricing and discounts
- AS400 Integration: Create order in Bookmaster ERP system
EDI Order Processing
Specialized handling for EDI order formats:
| Format | Configuration | Processing Service | Status |
|---|---|---|---|
| X12 4010 850 | smooks-config-ediX12-850-order.xml | SalesDigestX12Service | Active |
| EDIFACT ORDERS v6.0 | smooks-config-edifact-orders-v6.0.xml | SalesDigestEdifactService | Active |
| EDIFACT Custom | smooks-config-edifact-orders-v6.0-custom.xml | SalesDigestEdifactCustomService | Development |
Order Interface Tables
Orders are staged in interface tables before AS400 processing:
- OrderInterfaceDetailRepository: Order line items
- OrderInterfaceHeaderSupplementRepository: Order header information
- OrderInterfaceDetailSupplementRepository: Additional line details
- OrderInterfaceBillingRepository: Billing information
- OrderInterfaceTextRepository: Order notes and comments
@Scheduled annotations.
Order Acknowledgements (Outbound)
Confirming order receipt and providing delivery information to customers
Acknowledgement Types
EDI Acknowledgements
EDI 855 Purchase Order Acknowledgement
Email Confirmations
HTML/Text email templates for order confirmation
File Exports
CSV/XML acknowledgement files via FTP
API Responses
Real-time acknowledgements for API orders
Acknowledgement Processing Flow
Processing Logic:
- Trigger: Acknowledgement triggered when order is successfully created in AS400
- Data Gathering: Collect order details, customer information, and delivery estimates
- Format Selection: Determine acknowledgement format based on customer preferences
- Template Processing: Apply appropriate templates for formatting
- Delivery: Send via configured delivery method (EDI, email, FTP)
Acknowledgement Templates
Email acknowledgements use Freemarker templates located in src/main/resources/templates/:
| Template | Purpose | Format |
|---|---|---|
| order-confirmation.html.ftl | HTML email confirmation | Rich HTML with styling |
| order-confirmation.txt.ftl | Plain text confirmation | Simple text format |
Customer-Specific Configurations
Customer
EDI 855 + Email confirmations
Amazon
EDI 855 acknowledgements via AS2
Van Schaik
Custom XML format via SFTP
Customer
CSV acknowledgements via FTP
JavaMailSender with configurable SMTP settings for each customer profile.
Purchase Orders (Outbound)
Automated purchase order generation and supplier communication
Purchase Order Triggers
Stock Replenishment
Automatic POs when inventory falls below reorder points
Customer Orders
Direct supplier orders for items not in stock
Manual Creation
User-initiated purchase orders via web interface
Scheduled Ordering
Regular orders based on forecasting and demand
Purchase Order Processing Flow
Key Processing Steps:
- PO Generation: System generates purchase orders based on triggers
- Supplier Lookup: Identify primary and alternate suppliers
- Format Selection: Choose appropriate format (EDI, email, fax)
- Approval Workflow: Route for approval if required
- Transmission: Send to supplier via configured method
- Tracking: Monitor for acknowledgements and updates
Purchase Order Database Tables
| Table/Repository | Purpose | Key Fields |
|---|---|---|
| PurchaseOrderDetailRepository | PO line items | Item, Quantity, Price, Delivery Date |
| PurchasingItemSupplierRepository | Item-supplier relationships | Supplier preferences, lead times |
| PurchaseOrderToOrderLinkRepository | Links POs to customer orders | Traceability and allocation |
| PurchaseLandingChargeDetailRepository | Shipping and handling costs | Freight, duties, insurance |
Supplier Communication Methods
EDI 850
Electronic Data Interchange for large suppliers
PDF attachments or formatted HTML emails
FTP/SFTP
File-based PO transmission
Web Services
API integration with supplier systems
purchasing.outbound.scheduled property.
Supplier Acknowledgements (Inbound)
Processing supplier responses to purchase orders
Acknowledgement Types
EDI 855
Purchase Order Acknowledgement via EDI
Email Responses
Email confirmations with structured data
File Uploads
CSV/Excel files via FTP/SFTP
API Updates
Real-time acknowledgements via web services
Acknowledgement Processing Flow
Processing Logic:
- Receipt: Acknowledgement received via configured channel
- Parsing: Extract structured data from various formats
- Matching: Match acknowledgement to original purchase order
- Status Update: Update PO status and delivery dates
- Exception Handling: Process rejections, changes, and partial accepts
- Notification: Alert purchasing team of status changes
Acknowledgement Status Types
| Status | Description | Action Required | Notification |
|---|---|---|---|
| Accepted | PO accepted as submitted | None | Confirmation email |
| Changed | PO accepted with modifications | Review changes | Alert to purchasing |
| Partial | Only some items accepted | Handle rejected items | Exception report |
| Rejected | PO rejected entirely | Find alternate supplier | Urgent alert |
Shipment Receipt Processing
The system also processes advance ship notices (ASN) and goods receipt confirmations:
- ShipmentReceiptRepository: Tracks incoming shipments
- Automated Matching: Links receipts to purchase orders
- Inventory Updates: Updates stock levels upon receipt
- Quality Control: Manages inspection and acceptance processes
Courier Collection Requests
Automated courier booking and collection management
Courier Integration Partners
Dawn Wing
Primary courier for JBP shipments
Fastway
Alternative courier service
PostNet
Local and regional deliveries
Custom Carriers
Customer-specific courier preferences
Collection Request Flow
Automated Workflow:
- Order Ready: System detects orders ready for shipment
- Carrier Selection: Choose carrier based on customer, destination, and service level
- Booking Request: Submit collection request to courier API
- Scheduling: Receive collection slot and tracking information
- Label Generation: Generate shipping labels and documentation
- Dispatch: Update order status and notify customer
Courier Service Management
The CourierService manages all courier-related operations:
| Function | Description | Repository |
|---|---|---|
| Carrier Management | Maintain courier company details | CarrierRepository |
| Collection Booking | Submit collection requests | CourierService API |
| Label Printing | Generate shipping labels | Integrated label service |
| Tracking Updates | Monitor shipment progress | Webhook/polling service |
Collection Request Configuration
Service Levels
Standard, Express, Overnight delivery options
Address Validation
Automated address verification and correction
Rate Calculation
Real-time shipping cost calculation
Insurance Options
Automatic insurance based on order value
Courier Backstamps
Processing delivery confirmations and proof of delivery
Backstamp Data Sources
Courier APIs
Real-time delivery status via webhook
File Uploads
Daily backstamp files via FTP/SFTP
Email Updates
Delivery notifications parsed from emails
Manual Entry
Operations team manual status updates
Backstamp Processing Flow
Processing Workflow:
- Status Receipt: Delivery status received from various sources
- Tracking Match: Match tracking number to original order
- Order Update: Update order status in AS400 system
- Customer Notification: Send delivery confirmation to customer
- Invoice Trigger: Trigger invoicing process if applicable
- Analytics: Update delivery performance metrics
Delivery Status Types
| Status | Description | Customer Notification | Next Action |
|---|---|---|---|
| Delivered | Package successfully delivered | Delivery confirmation email | Trigger invoice |
| Failed Delivery | Delivery attempt unsuccessful | Delivery attempt notification | Schedule redelivery |
| In Transit | Package in courier network | Tracking update (optional) | Continue monitoring |
| Exception | Delivery exception occurred | Exception alert | Manual intervention |
Proof of Delivery (POD)
The system captures and stores proof of delivery information:
- Digital Signatures: Electronic signature capture
- Photo Evidence: Delivery photos from courier
- GPS Coordinates: Delivery location verification
- Recipient Details: Name and time of person who received
- Delivery Notes: Special instructions or exceptions
Integration with Business Processes
Invoicing
Automatic invoice generation upon delivery
Customer Service
Real-time delivery status for inquiries
Returns Processing
Failed delivery handling and returns
Performance Analytics
Delivery performance metrics and KPIs
Claims Processing
Managing returns, damages, and customer claims
Types of Claims
Damage Claims
Items damaged in transit or storage
Return Claims
Customer returns and exchanges
Short Shipments
Orders shipped incomplete
Wrong Items
Incorrect items shipped to customer
Claims Processing Workflow
Detailed Process:
- Claim Initiation: Customer or internal team initiates claim
- Documentation: Collect evidence (photos, delivery proof, etc.)
- Investigation: Research order history and determine cause
- Resolution Decision: Approve/deny claim and determine remedy
- Credit/Replacement: Process refund or ship replacement
- Case Closure: Close claim and update customer record
Claims Database Structure
| Repository | Purpose | Key Fields |
|---|---|---|
| ClaimReturnInputHeaderRepository | Claim header information | Claim ID, Customer, Date, Status |
| ClaimReturnInputDetailRepository | Individual claim items | Item, Quantity, Reason, Resolution |
Claim Status Management
| Status | Description | Actions Available | Next Steps |
|---|---|---|---|
| Open | Claim submitted, awaiting review | Investigate, Request Info | Document review |
| Under Investigation | Claim being researched | Approve, Deny, Request More Info | Investigation completion |
| Approved | Claim approved for resolution | Process Credit, Ship Replacement | Resolution processing |
| Denied | Claim denied | Customer notification | Case closure |
| Resolved | Claim resolution completed | Close case | Case closure |
Resolution Types
Full Refund
Complete refund of purchase price
Credit Note
Account credit for future purchases
Replacement
Ship replacement item at no charge
Partial Credit
Partial refund for damaged items
Claims Analytics and Reporting
The system provides comprehensive claims analytics:
- Claims by Reason: Track common claim causes
- Claims by Customer: Identify problematic accounts
- Claims by Supplier: Quality issues by supplier
- Resolution Time: Average time to resolve claims
- Cost Analysis: Financial impact of claims
- Trend Analysis: Claims trends over time
API Endpoints
RESTful API endpoints for system integration
Core API Endpoints
Documentation and Testing
Swagger UI
Interactive API documentation at /swagger-ui.html
OpenAPI 3.0
API specification at /v3/api-docs
Health Checks
Spring Boot Actuator endpoints for monitoring
Security
JWT authentication for all endpoints
Database Schema
Multi-database architecture with AS400 as primary data source
Database Connections
| Database | Driver | Purpose | Status |
|---|---|---|---|
| IBM i DB2 | AS400JDBCDriver | Primary ERP data (Bookmaster) | Active |
| PostgreSQL | PostgreSQL JDBC | Integration data and logs | Optional |
| MySQL | MySQL Connector | Web application data | Optional |
| SQL Server | SQLServer JDBC | Legacy system integration | Optional |
Key AS400 Tables
Core business data tables in the Bookmaster ERP system:
- DSED* Tables: Sales order processing and customer data
- DSPO* Tables: Purchase order and supplier management
- XACTD00P: User management and authentication
- AXI_EVENT: System messaging and notifications
External Integrations
Third-party system connections and data exchange
Customer-Specific Integrations
Customer
Amazon, Van Schaik, Exclusive Books, Takealot
Customer
LexisNexis, MyGate payments, Fraxion, Takealot
Customer
Academic distribution channels
Courier Services
Dawn Wing, Fastway, PostNet
Deployment Guide
Installation and deployment instructions
Windows Customers!!!!, Update and Build Commands
Click on axigrate service, stop the service, then exit. As administrator on terminal, cd to to the root of the project and run update.bat. Click on axigrate service again, start the service, then exit.
rem Clean and build the application
@echo off
SETLOCAL
rem Update the axigrate project (branch = master)
git pull
rem Build the axigrate project
mvn clean package spring-boot:repackage
ENDLOCAL
Build Commands
# Clean and build the application
mvn clean spring-boot:repackage
# Run the application
java -jar target/axigrate-0.0.1-SNAPSHOT.jar
# Run with specific profile
java -jar target/axigrate-0.0.1-SNAPSHOT.jar --spring.profiles.active=jbp_jbt
Docker Deployment
# Build Docker image
docker build -t ax-axigrate .
# Run with Docker Compose
docker compose up -d
docker compose logs -f
Configuration
Application configuration and environment setup
Environment Profiles
| Profile | Customer | Environment | Configuration File |
|---|---|---|---|
| cst_env | Customer | Live | application-cst_env.properties |
Key Configuration Properties
# Database Configuration
spring.datasource.url=jdbc:as400://hostname:port/library
spring.datasource.username=${DB_USER}
spring.datasource.password=${DB_PASSWORD}
# Scheduling Configuration
sales.inbound.scheduled=true
purchasing.outbound.scheduled=true
# Integration Settings
app.root.dir=/path/to/data/directory
email.smtp.host=mail.company.com