diff options
author | bnewbold <bnewbold@robocracy.org> | 2012-04-17 20:12:19 -0400 |
---|---|---|
committer | bnewbold <bnewbold@robocracy.org> | 2012-04-17 20:12:19 -0400 |
commit | 03f6d8e51152b1862b2d999b79b90a088b06037f (patch) | |
tree | 43eea3f6f47558682985daf2ca014e3231653cb7 /core.go | |
parent | 78b207a40436d0c15a2b806171914d802cd20661 (diff) | |
download | bommom-03f6d8e51152b1862b2d999b79b90a088b06037f.tar.gz bommom-03f6d8e51152b1862b2d999b79b90a088b06037f.zip |
listing
Diffstat (limited to 'core.go')
-rw-r--r-- | core.go | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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 +} |