Stel->>OrderSystem: Enter the number of hubs for the order
OrderSystem->>Database: Store order information with PENDING CONFIRMATION status
OrderSystem->>Factory: Submit hub order request(send mail to the Factory)
Factory-->>Stel: send mail to Confirm order receipt
Stel->>OrderSystem: Click Confirm button
OrderSystem->>Database: Change order status to CONFIRMED
Note over Factory: Manufacturing process
Factory->>Factory: Manufacture hubs
Factory->>Factory: Assign serial numbers and SIMs
Factory->>Factory: Prepare hubs for shipping
Factory->>Carrier: Ship hubs
Factory->>Stel: Send mail with shipping details (tracking number, carrier) of order and attach a CSV with hub serials and SIMs.
Stel->>OrderSystem: Enter shipping details and add CSV to the order; click the Ship button.
OrderSystem->>Database: Update order status to SHIPED and hub details from CSV to order
Carrier->>Stel: Deliver hubs
Stel->>OrderSystem: Click Complete button
OrderSystem->>Database: Update order status to COMPLETE
Note over OrderSystem: Automated processes after delivery confirmation
OrderSystem->>Database: Create hubs
Note over Hub: fleet provisioning process
Hub->>AWSIoTCore: Hub with claim certificate will publish to stel/provision/{hubId}/json topic with hub detail like revision version of 9160 Hardware
AWSIoTCore->>Lambda: Trigger fleet provisioning Lambda
Lambda->>Lambda: Create new certificate and new thing using provisioning template
Lambda->>Hub: Error: publish to stel/provision/{hubId}/rejected and Hub will set up the fleet provisioning again
Lambda->>Hub: Success: Break certificate into smaller chunks and Publish certificate chunks to stel/provision/{hubId}/accepted. Add hardware_version_9160 attribute to thing
Hub->>Hub: Persist certificate
Hub->>AWSIoTCore: Disconnect
Hub->>AWSIoTCore: Reconnect using new certificate