c1 = Colander::Crm::Aggregated::Customers::Customer.create(email: 'bumblebee@gega.com', first_name: 'Bumble', last_name: 'Bee', project: Project.first, timestamp: 2.days.ago)
cs1 = Colander::Crm::Session.create!(starts_at: 2.days.ago, expires_at: 2.days.ago + 1.hour, origin: 'test', project: c1.project, person: c1)
Colander::Crm::Aggregated::Customers::ViewProduct.create!(email: c1.email, customer_id: c1.id, project: c1.project, timestamp: cs1.starts_at, shop_item_ids: ['1708'])
Colander::Crm::Aggregated::Customers::AbandonedCart.create!(email: c1.email, customer_id: c1.id, project: c1.project, timestamp: cs1.starts_at + 1.minutes)
c1.update(orders_total:0, revenue_total: 0.0, ip_country: "USA", ip_city: 'Wildwood', ip_region: 'NJ', first_seen: cs2.starts_at, last_seen: cs1.starts_at + 1.minutes, tags: ['panda'], last_feedback_score: 1)
c2 = Colander::Crm::Aggregated::Customers::Customer.create(email: 'optimus@gega.com', project: Project.first, timestamp: 1.day.ago)
cs2 = Colander::Crm::Session.create!(starts_at: 1.day.ago, expires_at: 1.day.ago + 1.hour, origin: 'test', project: c2.project, person: c2)
Colander::Crm::Aggregated::Customers::Custom.create!(email: c2.email, customer_id: c2.id, project: c2.project, timestamp: cs2.starts_at, names: ['view_cart'])
Colander::Crm::Aggregated::Customers::ViewProduct.create!(email: c2.email, customer_id: c2.id, project: c2.project, timestamp: cs2.starts_at, shop_item_ids: ['13237', "1700", "10529"])
Colander::Crm::Aggregated::Customers::AddToCart.create!(email: c2.email, customer_id: c2.id, project: c2.project, timestamp: cs2.starts_at + 2.minutes, shop_item_ids: ['1700', "10529"])
Colander::Crm::Aggregated::Customers::CheckoutStart.create!(email: c2.email, customer_id: c2.id, project: c2.project, timestamp: cs2.starts_at + 3.minutes)
o2 = Colander::Crm::Aggregated::Customers::Order.create!(email: c2.email, customer_id: c2.id, project: c2.project, timestamp: cs2.starts_at + 5.minutes, shop_order_ids: ['2'], shop_item_ids: ['1700', "10529"], coupons: ['FRESH15', 'MYFREESHIPING'])
c2.update(orders_total:1, revenue_total: 100, ip_country: "USA", ip_city: 'Wildwood', ip_region: 'NJ', billing_country: 'USA', billing_city: 'Wildwood', billing_region: 'NJ', last_order: o2.timestamp,
first_seen: cs2.starts_at, last_seen: o2.timestamp, tags: ['panda', 'rhino'], last_feedback_score: 10, sessions_total: 1)
c3 = Colander::Crm::Aggregated::Customers::Customer.create(email: 'voltron@gega.com', project: Project.first, timestamp: Time.now)
cs3 = Colander::Crm::Session.create!(starts_at: Time.now, expires_at: 1.hour.from_now, origin: 'test', project: c3.project, person: c3)
Colander::Crm::Aggregated::Customers::Custom.create!(email: c3.email, customer_id: c3.id, project: c3.project, timestamp: cs3.starts_at, names: ['view_cart'])
Colander::Crm::Aggregated::Customers::ViewProduct.create!(email: c3.email, customer_id: c3.id, project: c3.project, timestamp: cs3.starts_at, shop_item_ids: ['18110', "1700", "1774"])
Colander::Crm::Aggregated::Customers::AddToCart.create!(email: c3.email, customer_id: c3.id, project: c3.project, timestamp: cs3.starts_at + 2.minutes, shop_item_ids: ['18110', "1700"])
Colander::Crm::Aggregated::Customers::CheckoutStart.create!(email: c3.email, customer_id: c3.id, project: c3.project, timestamp: cs3.starts_at + 3.minutes)
o3 = Colander::Crm::Aggregated::Customers::Order.create!(email: c3.email, customer_id: c3.id, project: c3.project, timestamp: cs3.starts_at + 5.minutes, shop_order_ids: ['10'], shop_item_ids: ['18110', "1700"], coupons: ['FRESH15'])
c3.update(orders_total:1, revenue_total: 500, ip_country: "USA", ip_city: 'Atlantic City', ip_region: 'NJ', billing_country: 'USA', billing_city: 'Wildwood', billing_region: 'NJ', last_order: o3.timestamp,
first_seen: cs3.starts_at, last_seen: o3.timestamp, tags: ['lion'], last_feedback_score: 5, sessions_total: 1)
Comments