Function
| Static Public Summary | ||
| public |
addProduct(id: number, title: string, price: number) adds a product to the products object |
|
| public |
formatAddress(customerEmail: string): address returns an customer address in a format appropriate for putting on an envelope |
|
| public |
productById(productId: number): Object takes a |
|
| public |
productCost(productId: number): number takes a |
|
| public |
Returns the title of the shop |
|
| public |
returns the total cost of an order which is the sum of all products contained in an order |
|
| public |
updateProductPrice(id: number, newPrice: number) updates the price of a product in the products object |
|
| public |
Coverts a string to uppercase |
|
| public |
Returns the shop title in uppercase. |
|
Static Public
public addProduct(id: number, title: string, price: number) source
adds a product to the products object
public formatAddress(customerEmail: string): address source
returns an customer address in a format appropriate for putting on an envelope
Params:
| Name | Type | Attribute | Description |
| customerEmail | string | a customer email which is the key for a customer record |
public productById(productId: number): Object source
takes a productId and returns the product corresponding to that id.
Params:
| Name | Type | Attribute | Description |
| productId | number | an id for a product |
public productCost(productId: number): number source
takes a productId and returns the price of the product corresponding to that id.
Params:
| Name | Type | Attribute | Description |
| productId | number | an id for a product |
public totalCost(customerEmail: string, orderId: number): number source
returns the total cost of an order which is the sum of all products contained in an order
public updateProductPrice(id: number, newPrice: number) source
updates the price of a product in the products object