elections-types 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -40,7 +40,7 @@ export class Committee {
|
|
|
40
40
|
typeof committee.name === "string" &&
|
|
41
41
|
typeof committee.url === "string" &&
|
|
42
42
|
is_committee_designation(committee.designation) &&
|
|
43
|
-
typeof committee.file_number === "number" &&
|
|
43
|
+
typeof committee.file_number === "number" && !isNaN(committee.file_number) &&
|
|
44
44
|
(committee.principal_committee_ids === undefined || Array.isArray(committee.principal_committee_ids) && committee.principal_committee_ids.every((committee_id) => typeof committee_id === "string")) &&
|
|
45
45
|
(committee.authorized_committee_ids === undefined || Array.isArray(committee.authorized_committee_ids) && committee.authorized_committee_ids.every((committee_id) => typeof committee_id === "string")) &&
|
|
46
46
|
(committee.sponsor_committee_ids === undefined || Array.isArray(committee.sponsor_committee_ids) && committee.sponsor_committee_ids.every((committee_id) => typeof committee_id === "string")) &&
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export class Donation {
|
|
2
2
|
committee_id;
|
|
3
3
|
donation_id;
|
|
4
|
+
file_number;
|
|
4
5
|
image_number;
|
|
5
6
|
receipt_date;
|
|
6
7
|
amount;
|
|
@@ -26,6 +27,7 @@ export class Donation {
|
|
|
26
27
|
}
|
|
27
28
|
this.committee_id = donation.committee_id;
|
|
28
29
|
this.donation_id = donation.donation_id;
|
|
30
|
+
this.file_number = donation.file_number;
|
|
29
31
|
this.image_number = donation.image_number;
|
|
30
32
|
this.receipt_date = donation.receipt_date;
|
|
31
33
|
this.amount = donation.amount;
|
|
@@ -50,9 +52,10 @@ export class Donation {
|
|
|
50
52
|
return (donation !== undefined &&
|
|
51
53
|
typeof donation.committee_id === "string" &&
|
|
52
54
|
typeof donation.donation_id === "string" &&
|
|
55
|
+
typeof donation.file_number === "number" && !isNaN(donation.file_number) &&
|
|
53
56
|
typeof donation.image_number === "string" &&
|
|
54
57
|
typeof donation.receipt_date === "string" &&
|
|
55
|
-
typeof donation.amount === "number" &&
|
|
58
|
+
typeof donation.amount === "number" && !isNaN(donation.amount) &&
|
|
56
59
|
(donation.donor_id === undefined || typeof donation.donor_id === "string") &&
|
|
57
60
|
typeof donation.donor_name === "string" &&
|
|
58
61
|
(donation.donor_prefix === undefined || typeof donation.donor_prefix === "string") &&
|
|
@@ -67,7 +70,7 @@ export class Donation {
|
|
|
67
70
|
typeof donation.donor_address_city === "string" &&
|
|
68
71
|
typeof donation.donor_address_state_id === "string" &&
|
|
69
72
|
typeof donation.donor_address_zip === "string" &&
|
|
70
|
-
typeof donation.donor_aggregate_ytd === "number" &&
|
|
73
|
+
typeof donation.donor_aggregate_ytd === "number" && !isNaN(donation.donor_aggregate_ytd) &&
|
|
71
74
|
typeof donation.memo_text === "string");
|
|
72
75
|
}
|
|
73
76
|
}
|
package/package.json
CHANGED
package/src/types/Committee.ts
CHANGED
|
@@ -48,7 +48,7 @@ export class Committee {
|
|
|
48
48
|
typeof committee.name === "string" &&
|
|
49
49
|
typeof committee.url === "string" &&
|
|
50
50
|
is_committee_designation(committee.designation) &&
|
|
51
|
-
typeof committee.file_number === "number" &&
|
|
51
|
+
typeof committee.file_number === "number" && !isNaN(committee.file_number) &&
|
|
52
52
|
(committee.principal_committee_ids === undefined || Array.isArray(committee.principal_committee_ids) && committee.principal_committee_ids.every((committee_id : any) => typeof committee_id === "string")) &&
|
|
53
53
|
(committee.authorized_committee_ids === undefined || Array.isArray(committee.authorized_committee_ids) && committee.authorized_committee_ids.every((committee_id : any) => typeof committee_id === "string")) &&
|
|
54
54
|
(committee.sponsor_committee_ids === undefined || Array.isArray(committee.sponsor_committee_ids) && committee.sponsor_committee_ids.every((committee_id : any) => typeof committee_id === "string")) &&
|
package/src/types/Donation.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { StateID } from "./State"
|
|
|
3
3
|
export class Donation {
|
|
4
4
|
readonly committee_id : string
|
|
5
5
|
readonly donation_id : string
|
|
6
|
+
readonly file_number : number
|
|
6
7
|
readonly image_number : string
|
|
7
8
|
readonly receipt_date : string
|
|
8
9
|
readonly amount : number
|
|
@@ -29,6 +30,7 @@ export class Donation {
|
|
|
29
30
|
}
|
|
30
31
|
this.committee_id = donation.committee_id
|
|
31
32
|
this.donation_id = donation.donation_id
|
|
33
|
+
this.file_number = donation.file_number
|
|
32
34
|
this.image_number = donation.image_number
|
|
33
35
|
this.receipt_date = donation.receipt_date
|
|
34
36
|
this.amount = donation.amount
|
|
@@ -55,9 +57,10 @@ export class Donation {
|
|
|
55
57
|
donation !== undefined &&
|
|
56
58
|
typeof donation.committee_id === "string" &&
|
|
57
59
|
typeof donation.donation_id === "string" &&
|
|
60
|
+
typeof donation.file_number === "number" && !isNaN(donation.file_number) &&
|
|
58
61
|
typeof donation.image_number === "string" &&
|
|
59
62
|
typeof donation.receipt_date === "string" &&
|
|
60
|
-
typeof donation.amount === "number" &&
|
|
63
|
+
typeof donation.amount === "number" && !isNaN(donation.amount) &&
|
|
61
64
|
(donation.donor_id === undefined || typeof donation.donor_id === "string") &&
|
|
62
65
|
typeof donation.donor_name === "string" &&
|
|
63
66
|
(donation.donor_prefix === undefined || typeof donation.donor_prefix === "string") &&
|
|
@@ -72,7 +75,7 @@ export class Donation {
|
|
|
72
75
|
typeof donation.donor_address_city === "string" &&
|
|
73
76
|
typeof donation.donor_address_state_id === "string" &&
|
|
74
77
|
typeof donation.donor_address_zip === "string" &&
|
|
75
|
-
typeof donation.donor_aggregate_ytd === "number" &&
|
|
78
|
+
typeof donation.donor_aggregate_ytd === "number" && !isNaN(donation.donor_aggregate_ytd) &&
|
|
76
79
|
typeof donation.memo_text === "string"
|
|
77
80
|
)
|
|
78
81
|
}
|