-
Notifications
You must be signed in to change notification settings - Fork 2
ShippingModule.Class.ShippingService
tgreyuk edited this page Apr 25, 2024
·
1 revision
github-wiki-example / ShippingModule / ShippingService
Service for managing shipping records. Provides methods to handle the logistics of order shipments, including recording and tracking shipments.
new ShippingService():
ShippingService
Property | Modifier | Type | Default value | Description |
---|---|---|---|---|
shipments |
private |
ShippingRecord [] |
[] |
Stores all shipment records. This array acts as a database to keep track of all shipments handled by the service. |
getAllShipments():
ShippingRecord
[]
Retrieves all shipping records managed by the service. Useful for tracking, auditing, and providing customers with updates on their shipment statuses.
An array of all shipping records.
shipping.ts:60
shipOrder(
shipment
):ShippingRecord
Ships an order by creating a shipping record and adding it to the list of shipments. This method simulates the action of shipping an order in a real-world scenario.
Parameter | Type | Description |
---|---|---|
shipment |
ShippingRecord |
The shipment record to be added. |
The shipment record that was added to the shipments list.
shipping.ts:50