namespace Websom.Standard.CommerceSystem {} header relative Websom.Standard.CommerceSystem.Module { Websom.Adapters.Database.Collection orders = null; Websom.Adapters.Database.Collection products = null; Websom.Adapters.Database.Collection carts = null; Websom.Adapters.Database.Collection zones = null; [ForceAsync] Websom.Standard.CommerceSystem.Cart getCart(Websom.Standard.UserSystem.User user) {} [ForceAsync] bool addToCart(Websom.Standard.UserSystem.User user, Websom.Standard.CommerceSystem.OrderItem item) {} } header relative Websom.Standard.CommerceSystem.Order { field Websom.Standard.UserSystem.User user = null; field string firstName = ""; field string lastName = ""; field string department = ""; field string company = ""; field string addressLine1 = ""; field string addressLine2 = ""; field string city = ""; field string state = ""; field string country = ""; field string postCode = ""; field Websom.Time created = null; field Websom.Time denied = null; field Websom.Time shipped = null; field Websom.Time completed = null; field string ip = ""; field float total = 0; field float subTotal = 0; field float tax = 0; field float shipping = 0; field float discount = 0; field array items = null; } header class Websom.Standard.CommerceSystem.OrderItem extends Websom.Serializable { void @construct() {} field Websom.Standard.CommerceSystem.Product product = null; field int quantity = 0; field float total = 0; field string instructions = ""; field map variation = null; } header relative Websom.Standard.CommerceSystem.Product { field string name = ""; field string description = ""; field string sku = ""; field string upc = ""; field int stock = 0; field string stock = 0; field float regularPrice = 0; field float salePrice = 0; field bool noDiscounts = false; field string status = "in-stock"; // back-order, out-of-stock field int limit = 0; field string type = ""; field float weight = 0; // kg field float length = 0; field float width = 0; field float height = 0; field string shippingClass = ""; field bool enabled = true; field bool downloadable = true; field bool virtual = true; field array attributes = new map(); field array variations = new array(); Websom.Standard.CommerceSystem.OrderItem pick(int quantity, map variation) { let item = new Websom.Standard.CommerceSystem.OrderItem(); item.quantity = quantity; item.total = this.salePrice * quantity; item.variation = variation; item.product = this; return item; } } header relative Websom.Standard.CommerceSystem.Cart { field Websom.Standard.UserSystem.User user = null; field float subTotal = 0; field float total = 0; field float tax = 0; field float discount = 0; field Websom.Time created = null; field Websom.Time completed = null; field array coupons = null; field array items = null; } header relative Websom.Standard.CommerceSystem.ShippingClass { field string name = ""; field string description = ""; field int products = 0; field string meta = ""; } header relative Websom.Standard.CommerceSystem.ShippingZone { field string name = ""; field array regions = ""; field array methods = new array(); } header class Websom.Standard.CommerceSystem.ShippingMethod extends Websom.Serializable { void @construct() { } field string name = ""; field string description = ""; field bool enabled = true; field string type = ""; field string price = ""; field map shippingClassOverrides = new map(); }