slunchFactory

Tables (30)

allergens

  • id — BIGSERIAL — Primary key — NOT NULL
  • code — VARCHAR(100) — NOT NULL
  • translations — JSONB — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

categories

  • id — BIGSERIAL — Primary key — NOT NULL
  • type — VARCHAR(50) — NOT NULL
  • code — VARCHAR(100) — NOT NULL
  • filter_layer — VARCHAR(20) — NOT NULL
  • parent_id — BIGINT — Foreign key → categories.id
  • translations — JSONB — NOT NULL
  • sort_order — INT — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL
  • CHECK — (type IN ( 'dietary', 'label', 'food_type', 'cuisine', 'storage', 'ingredient_tag', 'health_goal', 'cooking_style', 'cooking_env' ))
  • CHECK — (filter_layer IN ('spirit', 'recipe', 'shared'))

daily_moods

  • id — BIGSERIAL — Primary key — NOT NULL
  • user_id — BIGINT — NOT NULL
  • mood_date — DATE — NOT NULL
  • cooking_energy — VARCHAR(20)
  • mood_tags — JSONB
  • created_at — TIMESTAMPTZ — NOT NULL

exchange_rates

  • id — BIGSERIAL — Primary key — NOT NULL
  • from_currency — VARCHAR(3) — NOT NULL
  • to_currency — VARCHAR(3) — NOT NULL
  • rate — NUMERIC(12,6) — NOT NULL
  • source — VARCHAR(50) — NOT NULL
  • fetched_at — TIMESTAMPTZ — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

fob_products

  • id — BIGSERIAL — Primary key — NOT NULL
  • product_variant_id — BIGINT — NOT NULL
  • storage_type — VARCHAR(20) — NOT NULL
  • hs_code — VARCHAR(20)
  • price_moq1 — NUMERIC(10,2)
  • price_moq4 — NUMERIC(10,2)
  • weight_g — INT
  • srp — VARCHAR(100)
  • units_per_carton — INT
  • carton_net_kg — NUMERIC(6,2)
  • carton_gross_kg — NUMERIC(6,2)
  • cbm — NUMERIC(8,4)
  • carton_size_mm — VARCHAR(100)
  • cartons_per_pallet — VARCHAR(50)
  • stacking — VARCHAR(100)
  • shelf_life — VARCHAR(100)
  • description — TEXT
  • main_ingredients — TEXT
  • origin — VARCHAR(100)
  • moq — VARCHAR(100)
  • tbd — BOOLEAN — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

fob_quotes

  • id — BIGSERIAL — Primary key — NOT NULL
  • quote_number — VARCHAR(100) — NOT NULL
  • buyer_name — VARCHAR(200) — NOT NULL
  • buyer_company — VARCHAR(200) — NOT NULL
  • buyer_email — VARCHAR(200) — NOT NULL
  • buyer_country — VARCHAR(100) — NOT NULL
  • quote_type — VARCHAR(30) — NOT NULL
  • total_amount_usd — NUMERIC(12,2) — NOT NULL
  • currency — VARCHAR(10) — NOT NULL
  • buyer_phone — VARCHAR(50)
  • memo — TEXT
  • lang — VARCHAR(10)
  • items — JSONB — NOT NULL
  • status — VARCHAR(20) — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

ingredient_allergens

  • ingredient_id — BIGINT — Foreign key → ingredients.id — NOT NULL
  • allergen_id — BIGINT — Foreign key → allergens.id — NOT NULL

ingredient_market_prices

  • id — BIGSERIAL — Primary key — NOT NULL
  • variable_id — BIGINT — Foreign key → ingredients_variable.id — NOT NULL
  • price — NUMERIC(12,2) — NOT NULL
  • currency — VARCHAR(10) — NOT NULL
  • fetched_at — TIMESTAMPTZ — NOT NULL

ingredient_prices

  • id — BIGSERIAL — Primary key — NOT NULL
  • ingredient_id — BIGINT — Foreign key → ingredients.id — NOT NULL
  • price — NUMERIC(12,2) — NOT NULL
  • currency — VARCHAR(10) — NOT NULL
  • unit — VARCHAR(20) — NOT NULL
  • fetched_at — TIMESTAMPTZ — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

ingredients

  • id — BIGSERIAL — Primary key — NOT NULL
  • code — VARCHAR(100) — NOT NULL
  • translations — JSONB — NOT NULL
  • unit — VARCHAR(20) — NOT NULL
  • origin_country — VARCHAR(100)
  • is_active — BOOLEAN — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

ingredients_variable

  • id — BIGSERIAL — Primary key — NOT NULL
  • ingredient_id — BIGINT — Foreign key → ingredients.id — NOT NULL
  • origin — VARCHAR(100)
  • weight_g — NUMERIC(10,2)
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

odm_quotes

  • id — BIGSERIAL — Primary key — NOT NULL
  • quote_number — VARCHAR(100) — NOT NULL
  • product_description — TEXT — NOT NULL
  • fixed_total — NUMERIC(12,2) — NOT NULL
  • company_name — VARCHAR(200) — NOT NULL
  • contact_name — VARCHAR(200) — NOT NULL
  • email — VARCHAR(200) — NOT NULL
  • country — VARCHAR(100) — NOT NULL
  • currency — VARCHAR(10) — NOT NULL
  • storage_type — VARCHAR(20)
  • packaging_type — VARCHAR(30)
  • phone — VARCHAR(50)
  • memo — TEXT
  • pdf_url — VARCHAR(500)
  • selections — JSONB — NOT NULL
  • status — VARCHAR(20) — NOT NULL
  • email_sent — BOOLEAN — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

oem_quotes

  • id — BIGSERIAL — Primary key — NOT NULL
  • quote_number — VARCHAR(100) — NOT NULL
  • product_id — BIGINT — NOT NULL
  • storage_type — VARCHAR(20) — NOT NULL
  • packaging_type — VARCHAR(30) — NOT NULL
  • quantity — INT — NOT NULL
  • fixed_total — NUMERIC(12,2) — NOT NULL
  • variable_total — NUMERIC(12,2) — NOT NULL
  • grand_total — NUMERIC(12,2) — NOT NULL
  • company_name — VARCHAR(200) — NOT NULL
  • contact_name — VARCHAR(200) — NOT NULL
  • email — VARCHAR(200) — NOT NULL
  • country — VARCHAR(100) — NOT NULL
  • currency — VARCHAR(10) — NOT NULL
  • unit_cost_before_discount — NUMERIC(12,2)
  • discount_rate — NUMERIC(5,2)
  • unit_cost — NUMERIC(12,2)
  • exchange_rate_used — NUMERIC(12,6)
  • phone — VARCHAR(50)
  • memo — TEXT
  • pdf_url — VARCHAR(500)
  • selections — JSONB — NOT NULL
  • status — VARCHAR(20) — NOT NULL
  • email_sent — BOOLEAN — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

pricing_rules

  • id — BIGSERIAL — Primary key — NOT NULL
  • rule_key — VARCHAR(100) — NOT NULL
  • rule_type — VARCHAR(50) — NOT NULL
  • currency — VARCHAR(10) — NOT NULL
  • sort_order — INT — NOT NULL
  • price — NUMERIC(12,2)
  • options — JSONB — NOT NULL
  • translations — JSONB — NOT NULL
  • is_active — BOOLEAN — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

product_allergens

  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • allergen_id — BIGINT — Foreign key → allergens.id — NOT NULL

product_categories

  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • category_id — BIGINT — Foreign key → categories.id — NOT NULL

product_channel_stats

  • id — BIGSERIAL — Primary key — NOT NULL
  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • channel — VARCHAR(20) — NOT NULL
  • stat_date — DATE — NOT NULL
  • order_count — INT — NOT NULL
  • quantity_sold — INT — NOT NULL
  • revenue — NUMERIC(12,2) — NOT NULL
  • view_count — INT — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL
  • CHECK — (channel IN ('self_mall', 'coupang', 'naver'))

product_images

  • id — BIGSERIAL — Primary key — NOT NULL
  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • url — VARCHAR(500) — NOT NULL
  • alt_text — VARCHAR(300)
  • image_type — VARCHAR(10) — NOT NULL
  • sort_order — INT — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

product_ingredients

  • id — BIGSERIAL — Primary key — NOT NULL
  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • ingredient_id — BIGINT — Foreign key → ingredients.id — NOT NULL
  • name — VARCHAR(200) — NOT NULL
  • percentage — NUMERIC(5,2) — NOT NULL
  • sort_order — INT — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

product_variant_prices

  • id — BIGSERIAL — Primary key — NOT NULL
  • variant_id — BIGINT — Foreign key → product_variants.id — NOT NULL
  • channel — VARCHAR(20) — NOT NULL
  • price — NUMERIC(12,2) — NOT NULL
  • currency — VARCHAR(10) — NOT NULL
  • is_active — BOOLEAN — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL
  • CHECK — (channel IN ('self_mall', 'coupang', 'naver'))

product_variants

  • id — BIGSERIAL — Primary key — NOT NULL
  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • sku — VARCHAR(100) — NOT NULL
  • weight_g — NUMERIC(10,2)
  • packaging_type — VARCHAR(30)
  • translations — JSONB — NOT NULL
  • certifications — JSONB
  • is_active — BOOLEAN — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

products

  • id — BIGSERIAL — Primary key — NOT NULL
  • code — VARCHAR(100) — NOT NULL
  • slug — VARCHAR(200) — NOT NULL
  • storage_type — VARCHAR(20) — NOT NULL
  • translations — JSONB — NOT NULL
  • content_blocks — JSONB
  • b2b_spec — JSONB
  • is_published — BOOLEAN — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

recipe_categories

  • recipe_id — BIGINT — Foreign key → recipes.id — NOT NULL
  • category_id — BIGINT — Foreign key → categories.id — NOT NULL

recipe_ingredients

  • id — BIGSERIAL — Primary key — NOT NULL
  • recipe_id — BIGINT — Foreign key → recipes.id — NOT NULL
  • ingredient_id — BIGINT — Foreign key → ingredients.id — NOT NULL
  • amount_g — NUMERIC(10,2) — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

recipes

  • id — BIGSERIAL — Primary key — NOT NULL
  • code — VARCHAR(100) — NOT NULL
  • parent_recipe_id — BIGINT — Foreign key → recipes.id
  • translations — JSONB — NOT NULL
  • is_active — BOOLEAN — NOT NULL
  • difficulty — INT
  • cooking_time — INT
  • spice_level — INT
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

spirit_allergens

  • allergen_id — BIGINT — Primary key — NOT NULL
  • spirit_profile_id — BIGINT — Foreign key → spirit_profiles.id — NOT NULL

spirit_health_goals

  • category_id — BIGINT — Primary key — NOT NULL
  • spirit_profile_id — BIGINT — Foreign key → spirit_profiles.id — NOT NULL

spirit_profiles

  • id — BIGSERIAL — Primary key — NOT NULL
  • user_id — BIGINT — NOT NULL
  • dietary_type — VARCHAR(30)
  • spice_tolerance — INT
  • preference_weights — JSONB
  • raw_answers — JSONB
  • completed_at — TIMESTAMPTZ
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

user_ingredient_prefs

  • id — BIGSERIAL — Primary key — NOT NULL
  • user_id — BIGINT — NOT NULL
  • ingredient_id — BIGINT — NOT NULL
  • pref_type — VARCHAR(10) — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL

veggiverse_products

  • id — BIGSERIAL — Primary key — NOT NULL
  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • serving_size — VARCHAR(50)
  • cooking_guide — JSONB
  • recipe_id — BIGINT
  • translations — JSONB — NOT NULL
  • is_published — BOOLEAN — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL