All files / src/features/Merchants/MerchantSidePanel/AgreementAndSnapshot agreements.types.ts

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110                                                                                                                                                                                                                           
import { IParsedData } from "@components/Merchants/MerchantPreview/data.types";
import { Dispatch, SetStateAction } from "react";
import { DeepPartial } from "@customTypes/utils.types";
import type { TMerchantAgreementPayload } from "@components/Merchants/CreateMerchantPanel/hooks/TMerchantAgreementPayload";
import type {
  TMerchantInfo,
  TPrimaryAccountHolder,
} from "@components/Merchants/MerchantPreview/data.types";
 
export type AgreementState = "signed" | "not_signed" | "newVersion";
 
export interface StatusInfo {
  msaLastAcceptedVersion?: string | null;
  tcVersion?: string | null;
  signedOn?: string | null;
  status: AgreementState;
  signedBy?: string | null;
  signatureURL?: string | null;
  msaPreviousTerminationProcessorName?: string | null;
  msaPreviousTerminationAt?: number | Date | null;
  msaPreviousTerminationReason?: string | null;
  msaPreviousTermination?: boolean;
  msaPCICompliant?: boolean;
}
 
export type MainPages = "Agreement" | "Snapshot";
export type tabs = "merchantApplication" | "fees" | "refund";
 
export type StateType = {
  mainPage: MainPages;
  tab: tabs;
};
 
export interface JoinedProps {
  setPage: Dispatch<SetStateAction<StateType>>;
  page: StateType;
}
 
export type TabsDataTypes = {
  label: string;
  onClick: () => void;
  isActive: boolean;
};
 
export type GiveAgreementContentProps = {
  merchantAgreementVersion: {
    version: string;
    lastUpdated: string;
  };
  merchantName?: string;
  isEnterprise: boolean;
  /** Controls checkbox disabled state + click behavior */
  enabledAgreementCheckbox: boolean;
  inView: boolean;
  onToggleAgreement: () => void;
  agreementCheckboxText: string;
  /** Scroll-related wiring (recommended to keep existing logic working) */
  containerRef: React.Ref<HTMLDivElement>;
  onScroll?: (e: React.UIEvent<HTMLElement>) => void;
  viewRef: (node?: Element | null) => void;
  scrollButton: React.ReactNode;
  /** Styling controls for the scroll wrapper */
  tosMinHeight?: string;
  tosMaxHeight?: string;
  hasSignature?: boolean;
  /** Acquirer's published prose, rendered inside the scroll container so it
   * shares the same independent scroll area. When present it REPLACES the
   * hardcoded Terms of Service (see `hasPublished`), it does not stack above it. */
  publishedContent?: React.ReactNode;
  /** Whether the acquirer has published prose for this agreement type. When
   * true the published prose replaces the hardcoded legacy Terms of Service;
   * when false the hardcoded copy is the fallback. */
  hasPublished?: boolean;
  /** Render the signature block below the checkbox */
  signatureSection?: React.ReactNode;
  isOnboarding?: boolean;
  isSidepanel?: boolean;
};
 
export type GiveProviderAgreementContentProps = {
  data?: Partial<IParsedData>;
  addSignature?: (file: File) => void;
  onEnabledAgreementCheckboxChange?: (enabled: boolean) => void;
  tosMinHeight?: string;
  isOnboarding?: boolean;
  isSidepanel?: boolean;
};
 
export type TData = {
  merchantInfo: TMerchantInfo;
  primaryAccountHolder: TPrimaryAccountHolder;
  merchantAgreement: TMerchantAgreementPayload;
  status: { statusName: string };
};
 
export type GiveSignAgreementSectionProps = {
  data?: DeepPartial<TData>;
  status: "signed" | "not_signed" | "newVersion";
  canSign?: boolean;
  isOnboarding?: boolean;
  addSignature?: (file: File) => void;
  merchantId?: number;
  isSettings?: boolean;
  disabled?: boolean;
  file?: File | string | any;
  isEnterprise?: boolean;
  showErrorState?: boolean;
  isSidepanel?: boolean;
};