All files / src/sections/PayBuilder/provider provider.type.ts

0% Statements 0/1
100% Branches 0/0
100% Functions 0/0
0% Lines 0/1

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 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
import { Customer } from "@customTypes/customer.types";
import type { SeatingRow } from "@sections/PayBuilder/types";
 
export type Assertion_position = "right" | "left" | "bottom";
export type Item_Layout = "card" | "list";
export type Location_position = "onsite" | "online";
export type Time_Type = "single" | "range";
 
export type LocationAddress = {
  line1?: string | null;
  line2?: string;
  city?: string;
  state?: string;
  zip?: string;
  country?: string;
} | null;
 
export type ResizeType = "fit" | "crop" | "fill" | "original";
export interface ImageCanvasTypes {
  x?: string | number;
  y?: string | number;
  width?: string | number;
  height?: string | number;
  rotate?: string | number;
  scaleX?: string | number;
  scaleY?: string | number;
  resizeType?: ResizeType;
  data?: any;
  CropBoxData?: any;
  CanvasData?: any;
  logoSize?: number;
}
export interface MediaItem extends ImageCanvasTypes {
  URL: string | null;
  accountID: number;
  createdAt: number;
  id: number;
  label: string;
  updatedAt: number;
  merchantMedia?: boolean;
}
 
interface VariantRecurringInterval {
  interval?: string;
}
 
export interface Variant {
  id?: number | string;
  productID?: number;
  productName?: string;
  productTypeID?: number;
  productTypeName?: string;
  displayOrder?: number;
  name?: string;
  description?: string | null;
  minPrice?: number | null;
  maxPrice?: number | null;
  imageURL?: string | null;
  isEnabled?: boolean;
  showAvailableVariants?: boolean | null;
  price: number;
  allowCustomPrice?: boolean | null;
  recurringIntervals?: string[] | any;
  defaultRecurringIntervalName?: string;
  bundle?: number;
  bundleFreeze?: boolean;
  numSold?: number;
  inventory?: number;
  hideInventory?: boolean;
  hideSoldOut?: boolean;
  createdAt?: number;
  updatedAt?: number;
  extraFees?: number;
  extendedDescription?: string;
  signupFeeCheckbox?: boolean;
  initialInventory?: number | null;
  seatingRowIDs?: number[]; // AC006 (PAY Builder 031) — rows this ticket sells
}
 
interface RecurringInterval {
  interval?: string;
}
 
export interface CheckoutItem {
  itemID?: number;
  paramID?: number;
  paramName: string;
  isRequiredByDefault?: boolean;
  isRequired: boolean;
  isVisible?: boolean;
  description: string;
  defaultDescription?: string;
}
 
/**
 * PAY-Builder016 — a merchant-authored custom field on the checkout form.
 * Read view carries `id`/`displayOrder`; create/update send `label`/`isRequired`
 * (order = array position) plus the persisted `id` on update so the BE keeps the
 * row id stable (upsert-by-id). Create ignores the id.
 */
export interface ICheckoutCustomField {
  id?: number;
  label: string;
  isRequired: boolean;
  displayOrder?: number;
}
 
export interface ICheckout {
  id: number;
  successMessage: string;
  receiptMessage: string;
  items: CheckoutItem[];
  recommendedAmount?: number | null;
  optionalAmounts?: number[] | null;
  optionalRecurringIntervals?: string[] | null;
  payButtonText?: string;
  feePayer?: string;
  // PAY-Builder016 Checkout-tab custom fields.
  customFieldsEnabled?: boolean;
  customFieldsSectionTitle?: string;
  customFields?: ICheckoutCustomField[];
}
``;
export interface ICheckoutData {
  productID: number;
  defaultCheckoutForm: ICheckout;
  customCheckoutForm: ICheckout;
  total: number;
}
 
export type TTypeName =
  // TODO: remove standard
  | "standard"
  | "sweepstake"
  | "invoice"
  | "membership"
  | "event"
  | "fundraiser"
  | "product";
 
export interface Product_payload_type {
  isVerified?: boolean;
  id?: number;
  typeID?: number;
  typeName?: TTypeName;
  name?: string;
  description?: string | null;
  accID?: number;
  merchantName?: string;
  merchantImageURL?: string;
  merchantDescription?: string;
  merchTypeName?: string;
  merchCanProcessMoney?: boolean;
  needsTax?: boolean;
  allowFeeChoice?: boolean;
  needsShipping?: boolean;
  imageURL?: string;
  usesBackgroundImage?: boolean;
  canBrowseCampaigns?: boolean;
  maxPurchaseQuantity?: number | null;
  startsAt?: string | null | number;
  endsAt?: null | number;
  showMap?: boolean | null;
  includeTime?: boolean | null;
  allowMultipleWinners?: boolean | null;
  locationURL?: string | null;
  locationShortAddress?: string | null;
  locationAddress?: LocationAddress | null;
  variants?: Variant[];
  recurringIntervals?: RecurringInterval[];
  defaultRecurringIntervalName?: string;
  publishedStatus?: string;
  totalTransactions?: number;
  totalValidPurchases?: number;
  sumTransactions?: number;
  averageTransactions?: number;
  visitors?: number;
  conversionRate?: number;
  position?: string;
  createdAt: number;
  updatedAt?: number;
  deletedAt?: number | null;
  checkout?: ICheckoutData;
  hasCheckoutForm?: boolean;
  hasPaymentForm?: boolean;
  hasVariants?: boolean;
  itemLayout?: Item_Layout;
  backgroundColor?: string;
  accentColor?: string;
  checkoutButtonText?: string;
  paymentLogoURL?: string;
  stopStep?: string;
  showHistory?: boolean;
  targetValue?: number;
  isNonProfit?: boolean;
  netGenerated?: number;
  imageStyles?: any;
  paymentLogoStyles?: any;
  videoURL?: string | null;
  notes?: string;
  customerId?: number | null;
  customer?: Customer;
  status?: string;
  sumApprovedPurchases?: number;
  feePayer?: string;
  // Assigned seating (PAY Builder 031)
  assignSeating?: boolean; // AC001 — event uses assigned seating
  seatingRows?: SeatingRow[]; // AC003 — configured rows (if the GET includes them)
  // Per-ticket Participant Details (Story 2). Stored on the product, not the
  // checkout form — see generatePayloadForProduct. The BE columns behind these
  // do not exist yet; the contract is story2-participant-details-FE-design.md §3.
  participantDetailsEnabled?: boolean; // AC010 — collect details per ticket
  participantPhoneEnabled?: boolean; // AC011 — nested Phone Number row rendered
  participantPhoneRequired?: boolean; // AC011 — that row is required
  // Physical tickets (PAY Builder 032-a) — event-only product flag,
  // migration 2106 / givesync-api PR #7133
  printedMaterialsEnabled?: boolean;
}
 
export type TransformedItems = Record<string, Omit<CheckoutItem, "paramName">>;
 
export type TDonor = {
  id: string | number;
  name: string;
  when: string;
  isTopDonor: boolean;
  amount: number;
  isSettled?: boolean;
};