This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.

For information on migrating to InterSystems IRIS, see Why Migrate to InterSystems IRIS?

Wasabi.OrderEntry.API.Session

class Wasabi.OrderEntry.API.Session extends %Library.RegisteredObject, %XML.Adaptor

Usage of %occIO for public consumption?....to be detemined

This class is designed to be an SOA interface, or Service, to use the Wasabi.OrderEntry.Data.Cart Wasabi.OrderEntry.Data.Orders and Wasabi.OrderEntry.Data.Invoice structures to provide the business logic for a Sample Retail Order Entry system.

This does not preclude the usage of the Wasabi.OrderEntry.Data.Cart Wasabi.OrderEntry.Data.Orders and Wasabi.OrderEntry.Data.Invoice classes directly, but this presuppose that it is the only active interface to modifying (Create, Update, Delete) any of these classes.

Direct read only access to the Wasabi.OrderEntry.Data.Car Wasabi.OrderEntry.Data.Orders and Wasabi.OrderEntry.Data.Invoice classes is assumed for reporting, and real time Business Intelegence.

Property Inventory

Method Inventory

Properties

property BillingAddress as Wasabi.Data.AddressSerial;
Holding Area for Billing Address If this is left blank, than the "Customer" address will be used
Property methods: BillingAddressGet(), BillingAddressGetObject(), BillingAddressGetObjectId(), BillingAddressGetSwizzled(), BillingAddressIsEmpty(), BillingAddressIsValid(), BillingAddressNewObject(), BillingAddressSet(), BillingAddressSetObject(), BillingAddressSetObjectId(), BillingAddressUnSwizzle()
property Customer as Wasabi.Data.Customer;
Holding area for Active Customer
Property methods: CustomerGet(), CustomerGetObject(), CustomerGetObjectId(), CustomerGetSwizzled(), CustomerIsValid(), CustomerNewObject(), CustomerSet(), CustomerSetObject(), CustomerSetObjectId(), CustomerUnSwizzle()
property ShippingAddress as Wasabi.Data.AddressSerial;
Holding Area for Shipping Address If this is left blank, than the "Customer" address will be used
Property methods: ShippingAddressGet(), ShippingAddressGetObject(), ShippingAddressGetObjectId(), ShippingAddressGetSwizzled(), ShippingAddressIsEmpty(), ShippingAddressIsValid(), ShippingAddressNewObject(), ShippingAddressSet(), ShippingAddressSetObject(), ShippingAddressSetObjectId(), ShippingAddressUnSwizzle()

Methods

method ActivateCart(CustomerToken As %String) as %Status
Locates last SaveCart() created Check Point for the cart that was marked with the CustomerToken key and sets it as the internal Wasabi.OrderEntry.Data.Cart instance.
method AddToCart(Product As Wasabi.ProductManagement.Data.Product, Quantity As %Integer = 1) as %Status
Inserts a Product into the active Cart if the "Quantity" is 0, the item will be removed
classmethod CartIterator(User As Wasabi.Data.Customer, ByRef Results As %Library.IResultSet) as %Status
signature not defined
method ClearCart() as %Status
Clears ALL Items from the internal Wasabi.OrderEntry.Data.Cart instance.
method ConfirmOrder(AcceptPartialOrder As %Boolean = 1)
This method: Commits inventory to this Order Changes the Order status to "ACCEPTED" Removes the "Cart" thus disallowing any further changes to the Order return true if order is fully confirmed as is, false if more interaction is required Arguments: Returns: Throws: Wasabi.OrderEntry.Exception Wasabi.OrderEntry.CriticalException

This method is called as an indication that the "Offer Order" has been accepted by the customer.

If there is no Order, or the active Order is NOT in a "NEW" status, then this method should fail

method CreateCart(CustomerToken As %String, Customer As Wasabi.Data.Customer) as %Status
Customer is required, and for "unknown" customer there needs to be some sort of record with a unique.
method CreateInvoice(PicklistFullfilled)
Converts the the internal Wasabi.OrderEntry.Data.Orders instance into an the internal Wasabi.OrderEntry.Data.Invoice instance
method CreateOrder(SalesPerson As Wasabi.Data.SalesPerson) as %Boolean
Converts the the internal Wasabi.OrderEntry.Data.Cart instance into an the internal Wasabi.OrderEntry.Data.Orders instance

This method assumes that this is a "fixed quote" for an order, with the undiscounted prices being replicated from each Cart item, along with the discription also being replicated into the Order record. This is done to record the details of the quote and make this snapshot of information be protected from future changes to products and prices.

Creating an order does not remove the Cart, since this is not an commited contract between seller and customer, changes could be made and new "quote" Orders may be create or perhaps even abandoned.

classmethod FindOrders(User As Wasabi.Data.Customer, ByRef Results As %Library.IResultSet) as %Status
method ListCart(ByRef Results As %Library.IResultSet) as %Status
Returns a Result Set of the Product, Quantity, Price from the internal Wasabi.OrderEntry.Data.Cart instance.
method RevertCart() as %Status
Reloads the internal Wasabi.OrderEntry.Data.Cart instance back to the last "Checkpoint" that was created by the SaveCart()
method SaveCart() as %Status
Create a "Cart Check Point" by saving the internal Wasabi.OrderEntry.Data.Cart instance
method SetCartCustomer(Customer As Wasabi.Data.Customer) as %Status
Allows the calling layer to switch from an "Unknown Customer" customer to a REAL Customer

Inherited Members

Inherited Methods

Feedback