/* eslint-disable-camelcase */
/* eslint-disable @typescript-eslint/camelcase */
/* eslint-disable @typescript-eslint/no-explicit-any */

import { makeTrustworthy } from './util';

import {
  AppReview,
  DeepLink,
  LoginProps,
  LoginStatus,
  Order,
  PageVisited,
  TodoItemType,
  UserConfirmsSubscription,
  UserProfile
} from './types';

export default class EventAction {
  appReviewed(sender: Function, review: AppReview): void {
    // TODO: Check payload
    sender('App Reviewed', makeTrustworthy(review));
  }

  charged(sender: Function, completed: Order): void {
    sender('Charged', makeTrustworthy(completed));
  }

  deepLinkClicked(sender: Function): void {
    // TODO: Check payload
    sender('Deep Link Clicked', null);
  }

  deepLinkOpened(sender: Function, deepLink: DeepLink): void {
    sender('Deep Link Opened', makeTrustworthy(deepLink));
  }

  login(sender: Function, status: LoginStatus): void {
    sender('Login', makeTrustworthy(status));
  }

  logout(sender: Function): void {
    sender('Logout', null);
  }

  onUserLogin(sender: Function, user: UserProfile): void {
    sender(makeTrustworthy(user));
  }

  orderSubmited(sender: Function, order: Order): void {
    const { Items, ...base } = order;
    sender(makeTrustworthy(base), makeTrustworthy(Items));
  }

  passwordResetSent(sender: Function): void {
    // TODO: Check payload
    sender('Password Reset Sent', null);
  }

  signUpStarted(sender: Function, status: LoginProps): void {
    sender('Sign Up Started', makeTrustworthy(status));
  }

  forgotPassword(sender: Function): void {
    sender('Password Reset Sent', null);
  }

  visitsHomePage(sender: Function, pageVisited: PageVisited): void {
    sender('Visits Home Page', makeTrustworthy(pageVisited));
  }

  visitsJoinPage(sender: Function, pageVisited: PageVisited): void {
    sender('Visits Join Page', makeTrustworthy(pageVisited));
  }

  visitsPremiumPage(sender: Function, pageVisited: PageVisited): void {
    sender('Visits Premium Page', makeTrustworthy(pageVisited));
  }

  visitsFreePage(sender: Function, pageVisited: PageVisited): void {
    sender('Visits Free Page', makeTrustworthy(pageVisited));
  }

  visitsOnboarding(sender: Function, pageVisited: PageVisited): void {
    sender('Visits OnBoarding', makeTrustworthy(pageVisited));
  }

  visitsDashboard(sender: Function, pageVisited: PageVisited): void {
    sender('Visits Dashboard Page', makeTrustworthy(pageVisited));
  }

  visitsBusinessProfile(sender: Function, pageVisited: PageVisited): void {
    sender('Visits Business Profile Page', makeTrustworthy(pageVisited));
  }

  visitsRemindersPage(sender: Function, pageVisited: PageVisited): void {
    sender('Visits Reminders Page', makeTrustworthy(pageVisited));
  }

  userClicksSignUp(sender: Function, pageVisited: PageVisited): void {
    sender('User Clicks Sign Up', makeTrustworthy(pageVisited));
  }

  userCompletesBusinessProfile(sender: Function, pageVisited: PageVisited): void {
    sender('User Completes Business Profile', makeTrustworthy(pageVisited));
  }

  userClickTodoItem(sender: Function, todoItemType: TodoItemType): void {
    sender('User Click ToDo Item', makeTrustworthy(todoItemType));
  }

  userConfirmsSubscription(sender: Function, subscription: any): void {
    sender('User Confirms Subscription', makeTrustworthy(subscription));
  }

  userScheduledOnboardingCall(sender: Function, pageVisited: PageVisited): void {
    sender('User Scheduled Onboarding Call', makeTrustworthy(pageVisited));
  }

  userFeaturedBusinessOnSkip(sender: Function, payload: any): void {
    sender('User Featured Business on Skip', makeTrustworthy(payload));
  }

  accountCreated(sender: Function, payload: any): void {
    sender('Account Created', makeTrustworthy(payload));
  }

  accountCreatedError(sender: Function, payload: any): void {
    sender('Account Created Error', makeTrustworthy(payload));
  }

  clickedAnnual(sender: Function, payload: any): void {
    sender('Clicked Annual', makeTrustworthy(payload));
  }

  clickedAutoSubCheckbox(sender: Function, payload: any): void {
    sender('Clicked Auto Sub Checkbox', makeTrustworthy(payload));
  }

  clickedCardNumberField(sender: Function, payload: any): void {
    sender('Clicked Card Number Field', makeTrustworthy(payload));
  }

  clickedCheckAvailability(sender: Function, payload: any): void {
    sender('Clicked Check Availability', makeTrustworthy(payload));
  }

  clickedConfirm(sender: Function, payload: any): void {
    sender('Clicked Confirm', makeTrustworthy(payload));
  }

  clickedContinuetoDashboard(sender: Function, payload: any): void {
    sender('Clicked Continue to Dashboard', makeTrustworthy(payload));
  }

  clickedDownloadApp(sender: Function, payload: any): void {
    sender('Clicked Download App', makeTrustworthy(payload));
  }

  clickedFunding(sender: Function, payload: any): void {
    sender('Clicked Funding', makeTrustworthy(payload));
  }

  clickedLogin(sender: Function, payload: any): void {
    sender('Clicked Login', makeTrustworthy(payload));
  }

  clickedMonthly(sender: Function, payload: any): void {
    sender('Clicked Monthly', makeTrustworthy(payload));
  }

  clickedPrivacyPolicy(sender: Function, payload: any): void {
    sender('Clicked Privacy Policy', makeTrustworthy(payload));
  }

  clickedReferralEmailField(sender: Function, payload: any): void {
    sender('Clicked Referral Email Field', makeTrustworthy(payload));
  }

  clickedReviewReadMore(sender: Function, payload: any): void {
    sender('Clicked Review Read More', makeTrustworthy(payload));
  }

  clickedSaveNewPassword(sender: Function, payload: any): void {
    sender('Clicked Save New Password', makeTrustworthy(payload));
  }

  clickedSendInvites(sender: Function, payload: any): void {
    sender('Clicked Send Invites', makeTrustworthy(payload));
  }

  clickedTermsandConditions(sender: Function, payload: any): void {
    sender('Clicked Terms and Conditions', makeTrustworthy(payload));
  }

  paymentVerifiedError(sender: Function, payload: any): void {
    sender('Payment Verified Error', makeTrustworthy(payload));
  }

  paymentVerifiedSuccess(sender: Function, payload: any): void {
    sender('Payment Verified Success', makeTrustworthy(payload));
  }

  saveNewPasswordError(sender: Function, payload: any): void {
    sender('Save New Password Error', makeTrustworthy(payload));
  }

  viewedCalendlyCalendar(sender: Function, payload: any): void {
    sender('Viewed Calendly Calendar', makeTrustworthy(payload));
  }

  viewedNewPasswordPage(sender: Function, payload: any): void {
    sender('Viewed New Password Page', makeTrustworthy(payload));
  }

  viewedPaymentInfo(sender: Function, payload: any): void {
    sender('Viewed Payment Info', makeTrustworthy(payload));
  }

  viewedPlusPage(sender: Function, payload: any): void {
    sender('Viewed Plus Page', makeTrustworthy(payload));
  }

  viewedPremiumConciergePage(sender: Function, payload: any): void {
    sender('Viewed Premium Concierge Page', makeTrustworthy(payload));
  }

  viewedPlatinumConciergePage(sender: Function, payload: any): void {
    sender('Viewed Platinum Concierge Page', makeTrustworthy(payload));
  }

  // plop

  addedLoanApplicationTracking(sender: Function, payload: any): void {
    sender('Added Loan Application Tracking', makeTrustworthy(payload));
  }

  clickedServiceFlow(sender: Function, payload: any): void {
    sender('Clicked Service Flow', makeTrustworthy(payload));
  }

  upgradedFromAccountDetails(sender: Function, payload: any): void {
    sender('Upgraded From Account Details', makeTrustworthy(payload));
  }

  upgradedFromLatestFundingOpportunity(sender: Function, payload: any): void {
    sender('Upgraded From Latest Funding Opportunity', makeTrustworthy(payload));
  }

  addedFundingGoal(sender: Function, payload: any): void {
    sender('Added Funding Goal', makeTrustworthy(payload));
  }

  clickOnBlog(sender: Function, payload: any): void {
    sender('Click on Blog', makeTrustworthy(payload));
  }

  notInterestedInFundingOpportunity(sender: Function, payload: any): void {
    sender('Not Interested in Funding Opportunity', makeTrustworthy(payload));
  }

  sharedReferralLink(sender: Function, payload: any): void {
    sender('Shared Referral Link', makeTrustworthy(payload));
  }

  exitedAddBusinessModal(sender: Function, payload: any): void {
    sender('Exited Add Business Modal', makeTrustworthy(payload));
  }

  addedBusiness(sender: Function, payload: any): void {
    sender('Added Business', makeTrustworthy(payload));
  }

  invitesAFriend(sender: Function, payload: any): void {
    sender('Invites a Friend', makeTrustworthy(payload));
  }
}
