Skip to content

Component Name: pacContribution

Last Updated: 2025-10-22 Source Code: .temp-staging-flows/force-app/main/default/lwc/pacContribution/

API Name: c-pac-contribution Type: Form / Page Component Target: lightningCommunity__Page, lightningCommunity__Default

Business Purpose

This component enables eligible AANP members to make political contributions to the AANP-PAC, supporting advocacy efforts for nurse practitioners. It handles both one-time and recurring contributions, ensures compliance with federal election law requirements including the $5,000 annual limit, and manages complex business rules around eligibility, contribution limits, and required reporting information for contributions over $200. This is a critical compliance component with legal and regulatory implications.

User Interface

Visual Description

  • Layout: Form-based interface with contribution type selection, amount input, recurring payment options
  • Key UI Elements: Contribution type dropdown (one-time, monthly, quarterly, annual), amount input with validation, occupation/employer fields (for >$200), recurring payment management table, submit button
  • Responsive: Mobile-optimized form layout

Screenshots

  • Desktop view: Wide form with side-by-side fields
  • Mobile view: Stacked form elements

Component Structure

Files

  • pacContribution.html - Template (52KB, ~1600 lines)
  • pacContribution.js - Controller (59KB, ~1700 lines)
  • pacContribution.css - Styling (6.1KB)
  • pacContribution.js-meta.xml - Metadata
  • __tests__/ - Test directory

HTML Template Structure

Form with contribution type selection, amount input, compliance fields, recurring payment display, and submission controls.

Key Template Features: - Contribution type dropdown with pricing calculations - Amount input with federal limit validation ($5,000/year) - Conditional occupation/employer fields for contributions >$200 - Recurring payment management table - Real-time contribution total display - Federal compliance messaging

JavaScript Controller

Properties (API)

No @api properties - standalone page component.

Tracked Properties

  • @track contributionType: Selected contribution frequency
  • @track contributionAmount: Dollar amount entered
  • @track occupation: Occupation (required for >$200)
  • @track employer: Employer (required for >$200)
  • @track currentYearTotal: Total contributions this calendar year
  • @track recurringOrders: Active recurring contributions
  • @track isLoading: Loading state
  • @track errorMessage: Validation errors

Wire Adapters

  • @wire(getTotalAmountPacContribution): Fetches current year total
  • @wire(getRecurringChargentOrders): Fetches active recurring payments
  • @wire(getPACContributionTypeValues): Contribution type picklist

Event Handlers

  • handleContributionTypeChange: Updates contribution frequency
  • handleAmountChange: Validates amount against limits
  • handleOccupationChange: Updates occupation field
  • handleEmployerChange: Updates employer field
  • handleSubmit: Validates and adds PAC product to cart
  • handleStopRecurring: Cancels recurring contribution

Private Methods

  • validateContributionAmount: Checks federal $5,000 annual limit
  • calculateAnnualizedAmount: Projects annual impact of recurring
  • checkComplianceFields: Validates occupation/employer for >$200

Events

  • ShowToastEvent: Success/error notifications
  • Navigation events: Redirect to checkout

Styling (CSS)

Custom styling for PAC-specific UI, compliance messaging, recurring payment table, error states.

Dependencies

Lightning Web Components

  • lightning/platformShowToastEvent
  • lightning/navigation

Apex Classes

  • ProductController.getPACContributionTypeValues()
  • ProductController.getTotalAmountPacContributionNew()
  • ProductController.getRecurringChargentOrders()
  • ProductController.updateChargentOrders()
  • ProductController.getPacContributionProducts()
  • CartController.addProductToCart()
  • AccountController.getUserInfo()

Salesforce Objects

  • Account: Member eligibility verification
  • Product2: PAC contribution products
  • ChargentOrders__ChargentOrder__c: Recurring payments
  • WebCart: Cart integration

Configuration

<LightningComponentBundle>
    <apiVersion>61.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightningCommunity__Page</target>
        <target>lightningCommunity__Default</target>
    </targets>
</LightningComponentBundle>

User Interactions

  1. Select contribution type (one-time, monthly, quarterly, annual)
  2. Enter contribution amount
  3. Provide occupation and employer (if >$200)
  4. Review current year total and federal limit
  5. View/manage active recurring contributions
  6. Submit and proceed to payment

Validation & Error Handling

  • Federal $5,000 annual limit enforcement
  • Occupation/employer required for contributions >$200
  • US-based member eligibility check
  • Active membership verification
  • Amount must be positive number
  • Recurring contribution management validation

Data Flow

User enters contribution → Validate amount against annual limit → Check compliance fields → Add PAC product to cart → Navigate to checkout → Process payment → Create recurring order (if applicable)

Performance Considerations

  • Real-time annual total calculation
  • Apex calls for recurring order management
  • Cart integration optimized

Accessibility (a11y)

  • Form labels properly associated
  • Error messages announced with aria-live
  • Compliance messaging clearly readable
  • Keyboard navigation supported

Testing

Test File: __tests__/pacContribution.test.js may exist Coverage: Unknown

Recommended Tests: - Component renders for eligible members - Federal limit validation ($5,000) - Occupation/employer fields show for >$200 - Recurring contribution display - Stop recurring functionality - Cart integration - Eligibility verification - Error handling

Usage Examples

Add to PAC contribution page in Experience Builder. Requires authenticated US-based active member.

Changes & History

  • Federal compliance updates for election law changes
  • Recurring contribution management
  • Annual limit tracking
  • Occupation/employer compliance fields

Pre-Go-Live Concerns

CRITICAL - Fix Before Go-Live

  • Federal compliance: $5,000 limit MUST be enforced server-side
  • Reporting requirements: Occupation/employer data for >$200 must be captured
  • Eligibility verification: Only US-based active members can contribute
  • Legal disclaimers: FEC-compliant messaging must be present
  • Audit trail: All contributions must be logged for FEC reporting

HIGH

  • Server-side validation must match all client-side rules
  • Recurring contribution cancellation must be immediate
  • Annual total calculation must be accurate
  • Error handling for payment failures
  • Mobile experience optimization

MEDIUM

  • Analytics tracking for contribution patterns
  • User experience improvements for recurring management
  • Better error messages for validation failures
  • Performance optimization for annual total calculation

LOW

  • Loading states during Apex calls
  • Browser compatibility testing
  • Accessibility audit

Maintenance Notes

Complexity: Very High (Legal/Compliance Risk) Review Schedule: Quarterly for compliance, annually for FEC rule changes

Key Notes: - CRITICAL: Federal election law compliance - consult legal before changes - $5,000 annual limit: Must be enforced server-side (client check is convenience only) - Reporting requirements: Occupation/employer fields required by FEC for >$200 - Eligibility rules: US-based, active membership required by law - Audit requirements: All contributions logged for FEC Form 3X reporting - Recurring contributions: Must allow immediate cancellation per FEC rules - Legal disclaimers: Must display FEC-compliant contribution messaging

Browser Compatibility: - Chrome 90+, Firefox 88+, Safari 14+, Edge 90+

Security Considerations: - PII in occupation/employer fields - Payment processing security - FEC reporting data integrity - Audit trail immutability

Federal Compliance Requirements: - $5,000 annual limit per calendar year - Occupation and employer required for contributions >$200 - Contributions only from US citizens/permanent residents - No corporate/foreign national contributions - Immediate cancellation option for recurring contributions - Proper FEC disclaimers on all solicitations

Recommended Next Steps: 1. Immediate: Legal review of all compliance messaging 2. Short-term: Comprehensive test suite for all compliance rules 3. Medium-term: FEC reporting integration automation 4. Long-term: Regular compliance audits with legal counsel