Skip to content

Latest commit

 

History

History
105 lines (80 loc) · 4.13 KB

File metadata and controls

105 lines (80 loc) · 4.13 KB

LinkedIn URL Complete Implementation for HubSpot Sync

✅ IMPLEMENTATION COMPLETE

LinkedIn URLs are now being synced to HubSpot for ALL THREE CATEGORIES:

1. 👥 NOMINEES (Already Working)

  • Form Collection: ✅ LinkedIn URLs collected in nomination form
  • Database Storage: ✅ Stored in linkedin_norm field
  • HubSpot Sync: ✅ Synced via syncNomination() function
  • HubSpot Fields:
    • Person Nominees: linkedin_url + wsa_linkedin_url + website
    • Company Nominees: linkedin_url + wsa_linkedin_url

2. 🗳️ VOTERS (Already Working)

  • Form Collection: ✅ LinkedIn URLs collected in vote dialog
  • Database Storage: ✅ Stored in votes/voters table
  • HubSpot Sync: ✅ Synced via syncVoter() function
  • HubSpot Fields: wsa_linkedin_url

3. 📝 NOMINATORS (Newly Implemented)

  • Form Collection: ✅ LinkedIn URL field added to Step 2 (nominator form)
  • Validation: ✅ Uses LinkedInSchema for validation
  • Database Storage: ✅ Will be stored in nominator_linkedin field
  • HubSpot Sync: ✅ Updated syncNominator() to include LinkedIn
  • HubSpot Fields: wsa_linkedin_url

🔧 CHANGES MADE

1. Database Schema Update Required

-- Run this in Supabase SQL Editor
ALTER TABLE nominations ADD COLUMN IF NOT EXISTS nominator_linkedin TEXT;
CREATE INDEX IF NOT EXISTS nominations_nominator_linkedin_idx ON nominations (nominator_linkedin);

2. Form Updates

  • File: src/components/form/Step2Nominator.tsx
  • Added: LinkedIn URL field (required)
  • Validation: Uses existing LinkedInSchema

3. Validation Schema

  • File: src/lib/validation.ts
  • Updated: NominatorSchema to include linkedin: LinkedInSchema

4. API Updates

  • File: src/app/api/nominations/route.ts
  • Updated: syncNominator() call to include LinkedIn URL

5. Storage Updates

  • File: src/lib/storage/supabase.ts
  • Updated: mapToDatabase() to save nominator_linkedin
  • Updated: mapFromDatabase() to load nominator_linkedin

6. HubSpot Mappers Fixed

  • File: src/integrations/hubspot/mappers-basic.ts
  • Fixed: Company mapper to include linkedin_url field (was missing)
  • Confirmed: All mappers include both linkedin_url and wsa_linkedin_url

📊 HUBSPOT FIELD MAPPING

Category HubSpot Object linkedin_url wsa_linkedin_url website
Person Nominees Contact ✅ (fallback)
Company Nominees Company
Nominators Contact
Voters Contact

🎯 NEXT STEPS

1. Apply Database Schema

Run the SQL commands above in your Supabase SQL Editor to add the nominator_linkedin column.

2. Test New Nomination Flow

  1. Go to /nominate
  2. Fill out Step 2 (Your Details) - now includes LinkedIn URL field
  3. Complete nomination
  4. Verify nominator LinkedIn URL is saved and synced to HubSpot

3. Verify in HubSpot

Check that LinkedIn URLs appear in HubSpot for:

Contacts (Nominators, Person Nominees, Voters):

  • Look for "WSA LinkedIn URL" custom field
  • Person nominees also have "LinkedIn URL" standard field
  • Person nominees also have "Website" field with LinkedIn URL

Companies (Company Nominees):

  • Look for "LinkedIn URL" standard field
  • Look for "WSA LinkedIn URL" custom field

✅ VERIFICATION CHECKLIST

  • Database schema updated (nominator_linkedin column added)
  • New nomination form includes LinkedIn field for nominator
  • Nominator LinkedIn URLs sync to HubSpot
  • Nominee LinkedIn URLs continue to sync (existing functionality)
  • Voter LinkedIn URLs continue to sync (existing functionality)
  • All LinkedIn URLs appear in appropriate HubSpot fields

🚀 IMPLEMENTATION STATUS

✅ COMPLETE: LinkedIn URLs are now being synced to HubSpot for all three categories (Nominators, Nominees, Voters) with proper field mapping and validation.

The only remaining step is to apply the database schema update in Supabase.