From 03f6d8e51152b1862b2d999b79b90a088b06037f Mon Sep 17 00:00:00 2001 From: bnewbold Date: Tue, 17 Apr 2012 20:12:19 -0400 Subject: listing --- core.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'core.go') diff --git a/core.go b/core.go index 3b756d8..5d76f71 100644 --- a/core.go +++ b/core.go @@ -65,3 +65,20 @@ func (b *Bom) AddLineItem(li *LineItem) error { b.LineItems = append(b.LineItems, *li) return nil } + +// ---------- testing +func makeTestBom() *Bom { + op1 := OfferPrice{Currency: "usd", Price: 1.0, MinQty: 1} + op2 := OfferPrice{Currency: "usd", Price: 0.8, MinQty: 100} + o := Offer{Sku: "A123", Distributor: "Acme", Prices: []OfferPrice{op1, op2}} + //o.AddOfferPrice(op1) + //o.AddOfferPrice(op2) + li := LineItem{Mfg: "WidgetCo", + Mpn: "WIDG0001", + Elements: []string{"W1", "W2"}, + Offers: []Offer{o}} + //li.AddOffer(o) + b := NewBom("test01") + b.AddLineItem(&li) + return b +} -- cgit v1.2.3