Skip to content

@alex.garcia/libfec / Itemization

Type Alias: Itemization ​

Itemization = object & ScheduleA | object & ScheduleB | object & ScheduleD | object & ScheduleF | object & ScheduleH1 | object & ScheduleH2 | object & ScheduleH3 | object & ScheduleH4 | object & ScheduleH5 | object & ScheduleH6 | object & Form5Contribution | object & Form5Expenditure | object & Form6Contribution | object & Form7Communication | object & Form9ControllingPerson | object & Form9Donation | object & Form9Disbursement | object & Form9Candidate | object & Form13Donation | object & Form13Refund | object & ScheduleL | object & TextRecord | object & ScheduleA3L | object & ScheduleE | object & ScheduleC | object & ScheduleC1 | object & ScheduleC2

Defined in: generated/Itemization.ts:47

One typed itemization record: a ScheduleA receipt, a ScheduleB disbursement, … . Narrow it with a switch on type, which is the struct's name:

ts
switch (row.itemization.type) {
  case "ScheduleA": row.itemization.contribution_amount; break;
  case "ScheduleB": row.itemization.expenditure_amount; break;
}

Rust and libfec's JSON output tag these with a family field ("SA") instead; the JS layer replaces it with type.