diff --git a/designdocs/sku.pod b/designdocs/sku.pod new file mode 100644 index 000000000..295b39341 --- /dev/null +++ b/designdocs/sku.pod @@ -0,0 +1,69 @@ +=head1 SKU (base product class) + +The SKU class is what all other products will be subclassed from. It +needs to be simple so it can be extended to fit any need. + +=head2 Data Dictionary + +The following fields are needed to construct this assets table called +EE<128>E<156>SKUEE<128>E<157>. + +Field Schema Description +assetId guid The unique id assigned to this sku that may never change. It's with all assets +sku varchar(35) unique The unique id that the shop keeper assigns to this item. It may be changed by the shop keeper. By default this is set equal to assetId. +vendorId guid The unique id of the vendor associated with this sku, if any + +=head2 Method Dictionary + +The following methods will be available from the WebGUI::Asset::Sku +class. + +=head3 addToCart + +Adds this sku to the shopping cart. + +=head3 applyOptions + +Accepts a configuration data hash reference that can configure a sku a +certain way. For example, EE<128>E<156>a size XL red +t-shirtEE<128>E<157> instead of just EE<128>E<156>a +t-shirtEE<128>E<157>. + +param: options EE<128>E<147> a hash reference containing the +configuration properties returned from getConfiguration() + +=head3 getOptions + +Returns a hash reference of configuration data that can return this sku +to a configured state. See applyConfiguration() for details. + +=head3 getMaxAllowedInCart + +By default returns 99999999. Should be overridden by subclasses. For +unique items should return 1. For items that have a count in stock, +should return the number that are currently in stock. + +=head3 getPrice + +By default return 0.00. Should be overridden by subclasses. + +=head3 isShippingRequired + +By default return 0. Should be overridden by subclasses. + +=head3 newBySku + +Instanciates based on an existing sku, rather than an assetId. + +param: session EE<128>E<147> a reference to the current session + +param: sku EE<128>E<147> the sku to instanciate + +=head3 processStyle + +Looks up the style from the container and and wrappers the product in +it. + +param: html EE<128>E<147> the HTML output to be wrapped by the +style +