forked from krysttian/ftw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
helpers.ts
26 lines (19 loc) · 903 Bytes
/
helpers.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { MiamiDadeDLReportCaseResponse } from "./dlReport"
export const formatDLReportMiamiDade = ((cases: Array<MiamiDadeDLReportCaseResponse>) => {
const dlNumbers = cases.map((element) => element.driverLicenseNum);
const DLReportBody = cases.map(trafficCase => {
return `Case number: ${trafficCase.caseNumber}
Issue Date: ${trafficCase.issueDate}
Amount Due: ${trafficCase.amountDue}
Violation Description: ${trafficCase.violationDescription}
Drivers License Number ${trafficCase.driverLicenseNum}
Action Description: ${trafficCase.actionDescription}
Violation Code: ${trafficCase.violationCode}
`
});
const string = `
You have an update for the following DL number(s) ${dlNumbers.length > 1 ? dlNumbers.join(', ') : dlNumbers}
${DLReportBody.join('').trim()}
`
return string;
});