Module: Edi::ResellerInventory::Templates
- Defined in:
- app/services/edi/reseller_inventory/templates.rb
Overview
The inventory-CSV ERB templates the legacy Feed rows carried in their
output_layout. 30 of the 32 active feeds share SKU_UNITS; the rest are
one-offs added per reseller as they're cut over. Rendered by Renderer,
which exposes @catalog_items and the ssc helper exactly as the legacy
Feed render binding did, so output is byte-for-byte compatible.
Constant Summary collapse
- SKU_UNITS =
Dominant format (30/32 feeds).
<<~ERB "SKU","UNITS ON HAND" <% @catalog_items.each do |ci| %>"<%= ci.sku %>","<%= ci.reported_stock %>" <% end %> ERB
- CODE_SKU_UNITS =
UnbeatableSale (legacy feed 15): prepends the reseller part number.
<<~ERB "CODE","SKU","UNITS ON HAND" <% @catalog_items.each do |ci| %>"<%= ci.third_party_part_number %>","<%= ci.sku %>","<%= ci.reported_stock %>" <% end %> ERB
- SKU_UNITS_UPC =
OnlyTowelWarmers (legacy feed 21): adds the UPC column.
<<~ERB "SKU","UNITS ON HAND","UPC" <% @catalog_items.each do |ci| %>"<%= ci.sku %>","<%= ci.reported_stock %>","<%= ci.upc %>" <% end %> ERB
- REGISTRY =
{ sku_units: SKU_UNITS, code_sku_units: CODE_SKU_UNITS, sku_units_upc: SKU_UNITS_UPC }.freeze
Class Method Summary collapse
-
.fetch(key) ⇒ String
The ERB template source.
Class Method Details
.fetch(key) ⇒ String
Returns the ERB template source.
39 40 41 |
# File 'app/services/edi/reseller_inventory/templates.rb', line 39 def self.fetch(key) REGISTRY.fetch(key.to_sym) end |