Module: Testimonials::Seeds

Defined in:
lib/testimonials/seeds.rb

Constant Summary collapse

TESTIMONIALS =
[
  {
    seed_id: 'approved-founder',
    kind: 'text',
    body: 'We added the widget after onboarding and collected better customer quotes in the first week.',
    best_line: 'Collected better customer quotes in the first week.',
    rating: 5,
    status: 'approved',
    featured: true,
    consent_given: true,
    consent_text: 'You can use my testimonial publicly in your marketing and sales.',
    name: 'Maya Chen',
    email: 'maya@example.com',
    title_company: 'Founder, DemoCRM',
    source: 'widget',
    page_url: '/onboarding/complete',
    locale: 'en'
  },
  {
    seed_id: 'pending-operator',
    kind: 'text',
    body: 'The NPS prompt felt lightweight and did not interrupt the workflow.',
    rating: 4,
    status: 'pending',
    featured: false,
    consent_given: true,
    consent_text: 'You can use my testimonial publicly in your marketing and sales.',
    name: 'Jon Bell',
    email: 'jon@example.com',
    title_company: 'Operations Lead, ExampleCo',
    source: 'nps',
    page_url: '/reports',
    locale: 'en'
  },
  {
    seed_id: 'private-archive',
    kind: 'text',
    body: 'Useful for our internal rollout notes, but please do not publish my name.',
    rating: 3,
    status: 'archived',
    featured: false,
    consent_given: false,
    consent_text: 'You can only use my testimonial privately in your marketing and sales.',
    name: 'Priya Rao',
    email: 'priya@example.com',
    title_company: 'Customer Success, SampleOps',
    source: 'page',
    page_url: '/testimonials/new',
    locale: 'en'
  },
  {
    seed_id: 'approved-video',
    kind: 'video',
    body: 'Short demo video testimonial with a real MP4 attachment.',
    best_line: 'A real video testimonial is ready to review.',
    rating: 5,
    status: 'approved',
    featured: true,
    consent_given: true,
    consent_text: 'You can use my testimonial publicly in your marketing and sales.',
    name: 'Alex Rivera',
    email: 'alex@example.com',
    title_company: 'Head of Product, VideoDemo',
    source: 'page',
    page_url: '/testimonials/new',
    locale: 'en'
  }
].freeze
NPS_RESPONSES =
[
  { seed_id: 'promoter', score: 10,
    comment: 'Fast to install and easy to trust because the data stays in our app.' },
  { seed_id: 'passive', score: 8, comment: 'The flow is useful, but I would like more display examples.' },
  { seed_id: 'detractor', score: 4, comment: 'I was not sure when the prompt would appear again.' }
].freeze
PROMPT_EVENTS =
[
  { kind: 'testimonial', action: 'shown', visitor_token: 'testimonials-demo-visitor' },
  { kind: 'testimonial', action: 'dismissed', visitor_token: 'testimonials-demo-visitor' },
  { kind: 'nps', action: 'submitted', author_id: 'testimonials-demo:nps-promoter' }
].freeze

Class Method Summary collapse

Class Method Details

.load!(tenant: nil) ⇒ Object



90
91
92
93
94
95
96
# File 'lib/testimonials/seeds.rb', line 90

def self.load!(tenant: nil)
  {
    testimonials: load_testimonials!(tenant: tenant),
    nps_responses: load_nps_responses!(tenant: tenant),
    prompt_events: load_prompt_events!(tenant: tenant)
  }
end