All files / src/components/Disputes/GiveDisputePanel 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                                                                                                                                                                                   
import {
  DisputeCaseType,
  TCaseEvidence,
  TDisputeData,
} from "../utils/data.types";
 
export type DisputeDataset = {
  dispute: TDisputeData;
  history: DisputeCaseType[];
};
 
export type DisputeSecondPanel = "risk" | "customer" | "transaction" | null;
export type DisputeFirstPanel = "transaction" | "dispute";
 
export type DisputeStatusType = "Open" | "Under Review" | "Won" | "Lost";
 
export enum WorldpayDisputeStatusPayload {
  Pending = "pending",
  UnderReview = "under_review",
  ActionRequired = "action_required",
  Escalated = "escalated",
  Closed = "closed",
  Prevented = "prevented",
  Unknown = "unknown",
}
 
export enum DisputeOutcomePayload {
  Won = "won",
  Lost = "lost",
}
 
type HistoryItemBase = {
  id: string | number;
  createdAt: number;
  isLast?: boolean;
};
 
type MerchantActionItem = HistoryItemBase & {
  kind: "merchantAction";
  mspCaseType: string;
  notes: string;
  isFromRDR: boolean;
};
 
export type EvidenceItem = HistoryItemBase & {
  kind: "evidence";
  evidence: TCaseEvidence;
  mspCaseType: string;
  evidencesCount: number;
  isWorldpay: boolean;
  status: string;
  isFromRDR: boolean;
};
 
type IssuerItem = HistoryItemBase & {
  kind: "issuer";
  mspCaseType: string;
  notes: string;
  subNotes: string;
  isFromRDR: boolean;
  isDone: boolean;
};
 
export type HistoryItem = MerchantActionItem | EvidenceItem | IssuerItem;
 
export type BuildHistoryItemsParams = {
  data: DisputeCaseType;
  disputeCaseType: string;
  submittedEvidences: TCaseEvidence[];
  evidencesCount: number;
  isWorldpay: boolean;
  status?: string;
  notes: string;
  useDescription: string;
  mspNotes?: string;
  isFromRDR: boolean;
  isChargebackAccepted: boolean;
  isRDRSuccessfull: boolean;
  isCaseClosed: boolean;
  cardholder?: any;
};
 
export interface IDisputePreviewHeaderProps {
  isFirst: boolean;
  isLast: boolean;
  setSelectedRow: (value: string | number) => void;
  data: TDisputeData;
  isMarkAsFraudHidden?: boolean;
}