We have written a query on our pro_soda order, product, and line_item tables to find potential scheduling conflicts for booked line items. This first pass should be considered a proof of concept for the purposes of validating the result set. To keep this initial result set small, we have temporarily introduced the following limitations:
- conflicts were defined as two booked line items with identical product_ids on the same day
- only products 676, 677 and 1403 were used at the moment
- we only looked at media plans with 100% probability
- we only looked at line_items created after 8/1/2017
With those limitations in mind, we wrote the following query:
WITH line_item_run_dates AS (