Class: Quote::LetterPdfGenerator
- Inherits:
-
BaseService
- Object
- BaseService
- Quote::LetterPdfGenerator
- Includes:
- Pdf::Base
- Defined in:
- app/services/quote/letter_pdf_generator.rb
Overview
Service object: letter pdf generator.
Defined Under Namespace
Classes: Result
Constant Summary collapse
- BRAND_COLOR =
Palette — "Modern Executive". Dark charcoal text + warm-maroon logo accent
- slate-blue secondary accent + light cool-grey for callouts and table rows.
'4A607A'- MARKETING_RED =
slate-blue accent (was orange) — Grand Total bar, buttons, numerals
'983333'- INK =
warm maroon — section eyebrows, links, brand accents
'2B2D2F'- MUTED =
dark charcoal — primary text
'6b7280'- HAIRLINE =
secondary text
'e5e7eb'- SURFACE =
ultra-subtle dividers
'F0F2F5'- LINK =
light cool grey — quiet card bg
'4A607A'- SAVINGS_BG =
slate blue (matches BRAND_COLOR for links)
'F0F2F5'- SAVINGS_BR =
light cool grey for the "You Saved" callout
'd6dae0'- AM_CARD_BG =
complementary border
'F0F2F5'- TESTIMONIAL_BG =
account manager card (unused in consolidated v2)
'd1fae5'- TESTIMONIAL_FG =
legacy
'065f46'- BRAND_TINT_BG =
Tinted card surfaces (now neutral light cool grey to match Option 1).
'F0F2F5'- BRAND_TINT_BR =
'd6dae0'- TRANSPARENT_LOGO_PATH =
Transparent-background WarmlyYours logo (Image #6520 from CRM, downloaded
to public/images/pdf/). Used in the page-level header so the logo sits
cleanly on the grey shaded band without a white box around it. Rails.public_path.join('images', 'pdf', 'wy-logo-transparent.png').to_s.freeze
- STOCK_BADGE_BG =
Success green for the in-stock badge.
'ecfdf5'- STOCK_BADGE_FG =
'047857'- STOCK_BADGE_BR =
'a7f3d0'- CALLOUT_BG =
Neutral callout (for design-alternatives note).
'F0F2F5'- CALLOUT_BR =
MARKETING_RED
Constants included from Pdf::Base
Pdf::Base::FONT, Pdf::Base::NIMBUS_SANS_PATH, Pdf::Base::NIMBUS_SANS_PATH_BOLD, Pdf::Base::WY_LOGO_PATH
Instance Attribute Summary
Attributes inherited from BaseService
Instance Method Summary collapse
-
#process(quote, options = {}) ⇒ Result
The rendered PDF and quote.
Methods inherited from BaseService
#initialize, #log_debug, #log_error, #log_info, #log_warning, #logger, #tagged_logger
Constructor Details
This class inherits a constructor from BaseService
Instance Method Details
#process(quote, options = {}) ⇒ Result
Returns the rendered PDF and quote.
57 58 59 60 61 62 63 64 65 |
# File 'app/services/quote/letter_pdf_generator.rb', line 57 def process(quote, = {}) opts = () composer = build_composer draw_body(composer, quote, opts) (composer, quote, opts) io = StringIO.new composer.write(io, optimize: true) Result.new(pdf: io.string, quote: quote) end |