|
1 | 1 | # require './db/seeds'
|
2 | 2 |
|
3 | 3 | # 製品加工
|
4 |
| -product = Bouquet::Product.create_with(price: 1).find_or_create_by(name: :p1) |
5 |
| -material = Bouquet::Material.create_with(expiration_days: 1, order_lead_time: 2, order_quantity: 3).find_or_create_by(name: :m1) |
6 |
| -assembly = Bouquet::Assembly.create_with(quantity: 1).find_or_create_by(product_id: product.id, material_id: material.id) |
| 4 | +gerbera = Bouquet::Material.create_with(expiration_days: 1, order_lead_time: 2, order_quantity: 3).find_or_create_by(name: :Gerbera) |
| 5 | +tulip = Bouquet::Material.create_with(expiration_days: 1, order_lead_time: 2, order_quantity: 3).find_or_create_by(name: :Tulip) |
| 6 | +cosmos = Bouquet::Material.create_with(expiration_days: 1, order_lead_time: 2, order_quantity: 3).find_or_create_by(name: :Cosmos) |
| 7 | +sunflower = Bouquet::Material.create_with(expiration_days: 1, order_lead_time: 2, order_quantity: 3).find_or_create_by(name: :Sunflower) |
| 8 | + |
| 9 | +product = Bouquet::Product.create_with(price: 1).find_or_create_by(name: :Cute) |
| 10 | +Bouquet::Assembly.create_with(quantity: 1).find_or_create_by(product_id: product.id, material_id: gerbera.id) |
| 11 | +Bouquet::Assembly.create_with(quantity: 2).find_or_create_by(product_id: product.id, material_id: tulip.id) |
| 12 | + |
| 13 | +product = Bouquet::Product.create_with(price: 1).find_or_create_by(name: :Cool) |
| 14 | +Bouquet::Assembly.create_with(quantity: 1).find_or_create_by(product_id: product.id, material_id: gerbera.id) |
| 15 | +Bouquet::Assembly.create_with(quantity: 2).find_or_create_by(product_id: product.id, material_id: cosmos.id) |
| 16 | + |
| 17 | +product = Bouquet::Product.create_with(price: 1).find_or_create_by(name: :Passion) |
| 18 | +Bouquet::Assembly.create_with(quantity: 1).find_or_create_by(product_id: product.id, material_id: gerbera.id) |
| 19 | +Bouquet::Assembly.create_with(quantity: 2).find_or_create_by(product_id: product.id, material_id: sunflower.id) |
7 | 20 |
|
8 | 21 | # 場所
|
9 | 22 | location = Bouquet::Location.create_with(capacity: 100).find_or_create_by(name: :l1)
|
10 | 23 |
|
11 | 24 | # 仕入れ
|
12 | 25 | supplier = Bouquet:: Supplier.create_with(email: '[email protected]').find_or_create_by(name: :s1)
|
13 |
| -purchase_order = Bouquet::PurchaseOrder.create_with(quantity: 1).find_or_create_by(supplier_id: supplier.id, material_id: material.id) |
14 |
| -arrival = Bouquet::Arrival.create_with(quantity: 1).find_or_create_by(purchase_order_id: purchase_order.id) |
15 |
| -stock = Bouquet::Stock.create_with(quantity: 1).find_or_create_by(location_id: location.id, arrival_id: arrival.id) |
16 |
| -storage = Bouquet::Storage.create_with(quantity: 1).find_or_create_by(stock_id: stock.id) |
| 26 | +# purchase_order = Bouquet::PurchaseOrder.create_with(quantity: 1).find_or_create_by(supplier_id: supplier.id, material_id: material.id) |
| 27 | +# arrival = Bouquet::Arrival.create_with(quantity: 1).find_or_create_by(purchase_order_id: purchase_order.id) |
| 28 | +# stock = Bouquet::Stock.create_with(quantity: 1).find_or_create_by(location_id: location.id, arrival_id: arrival.id) |
| 29 | +# storage = Bouquet::Storage.create_with(initial_quantity: 1).find_or_create_by(stock_id: stock.id) |
17 | 30 |
|
18 | 31 | # 販売
|
19 | 32 | customer = Bouquet:: Customer.create_with(email: '[email protected]').find_or_create_by(name: :c1)
|
20 |
| -sales_order = Bouquet::SalesOrder.create_with(quantity: 1).find_or_create_by(customer_id: customer.id, product_id: product.id) |
21 |
| -shipment = Bouquet::Shipment.create_with(quantity: 1).find_or_create_by(sales_order_id: sales_order.id) |
22 |
| -delivery = Bouquet::Delivery.create_with(quantity: 1).find_or_create_by(location_id: location.id, shipment_id: shipment.id) |
23 |
| -retrieval = Bouquet::Retrieval.create_with(quantity: 1).find_or_create_by(storage_id: storage.id, delivery_id: delivery.id) |
| 33 | +# sales_order = Bouquet::SalesOrder.create_with(quantity: 1).find_or_create_by(customer_id: customer.id, product_id: product.id) |
| 34 | +# shipment = Bouquet::Shipment.create_with(quantity: 1).find_or_create_by(sales_order_id: sales_order.id) |
| 35 | +# delivery = Bouquet::Delivery.create_with(quantity: 1).find_or_create_by(location_id: location.id, shipment_id: shipment.id) |
| 36 | +# retrieval = Bouquet::Retrieval.create_with(quantity: 1).find_or_create_by(storage_id: storage.id, delivery_id: delivery.id) |
0 commit comments