Skip to content

Instantly share code, notes, and snippets.

View BaggioGiacomo's full-sized avatar
👀
Happy

Jack BaggioGiacomo

👀
Happy
  • ITS Kennedy
  • Pordenone, PN
View GitHub Profile
@BaggioGiacomo
BaggioGiacomo / create_selling_plans_job.rb
Created August 26, 2026 07:53
Ruby job to create all the selling plans
class CreateSellingPlansJob < ApplicationJob
# These are the prices for the frozen variants, which have a pricing structure based on days between shipments and a multiplier for certain clusters of variants.
# [<SKU>, <multiplier>] => { <days-between-shipments> => <price-per-unit> }
VARIANT_FROZEN_DAILY_PRICES = {
# Turkey (FFTB) - Cluster 2-7 (x1)
['FFTB_170', 1, :cluster2] => { 14 => 2.9, 21 => 2.23, 28 => 1.9, 35 => 1.76 },
['FFTB_238', 1, :cluster3] => { 14 => 3.1, 21 => 2.4, 28 => 2.15, 35 => 2.0 },
['FFTB_306', 1, :cluster4] => { 14 => 3.5, 21 => 2.78, 28 => 2.46, 35 => 2.42 },
['FFTB_408', 1, :cluster5] => { 14 => 3.9, 21 => 3.29, 28 => 3.13, 35 => 3.05 },
['FFTB_544', 1, :cluster6] => { 14 => 4.4, 21 => 4.13, 28 => 3.95, 35 => 3.8 },