This repository has been archived by the owner on Sep 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.go
107 lines (88 loc) · 3.28 KB
/
types.go
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
package main
type County struct {
ZipCode string `json:"zipcode,omitempty"`
Name string `json:"name,omitempty"`
Fips string `json:"fips,omitempty"`
State string `json:"state,omitempty"`
}
type GetCountiesResponse struct {
Counties *[]County `json:"counties,omitempty"`
}
type Place struct {
CountyFips string `json:"countyfips,omitempty"`
State string `json:"state,omitempty"`
ZipCode string `json:"zipcode,omitempty"`
}
type IntRange struct {
Min int `json:"min,omitempty"`
Max int `json:"max,omitempty"`
}
type Campaign struct {
CampaignID string `json:"campaign_id,omitempty"`
Gender string `json:"gender,omitempty"`
IncomeRange *IntRange `json:"income_range,omitempty"`
AgeRange *IntRange `json:"age_range,omitempty"`
ZipCode string `json:"zipcode,omitempty"`
IsParent bool `json:"is_parent,omitempty"`
}
type CampaignRequest struct {
CampaignID string `json:"campaign_id,omitempty"`
Place *Place `json:"place,omitempty"`
Market string `json:"market,omitempty"`
Household *Household `json:"household,omitempty"`
}
// may need to rename this struct to specific endpoint name like county request
type GetCountiesRequest struct {
Campaign *Campaign `json:"campaign,omitempty"`
ZipCode string `json:"zipcode,omitempty"`
Income float64 `json:"income,omitempty"`
UsesTobacco bool `json:"uses_tobacco"`
}
func NewCampaign() *Campaign {
var IncomeRange IntRange
var AgeRange IntRange
var Campaign Campaign
Campaign.IncomeRange = &IncomeRange
Campaign.AgeRange = &AgeRange
return &Campaign
}
func NewRequest() *GetCountiesRequest {
var Request GetCountiesRequest
Request.Campaign = NewCampaign()
return &Request
}
type People struct {
AptcEligible bool `json:"aptc_elibigle"`
Age int32 `json:"age,omitempty"`
HasMec bool `json:"has_mec"`
IsPregnant bool `json:"is_pregnant"`
IsParent bool `json:"is_parent"`
UsesTobacco bool `json:"uses_tobacco"`
Gender string `json:"gender,omitempty"`
}
type Household struct {
Income float64 `json:"income,omitempty"`
People *[]People `json:"people,omitempty"`
HasMarriedCouple bool `json:"has_married_couple`
UnemploymentReceived string `json:"unemployment_received,omitempty"`
}
type HouseholdsEligibilityEstimatesRequest struct {
CampaignId string `json:"campaignId,omitempty"`
Place *Place `json:"place,omitempty"`
Market string `json:"market,omitempty"`
Household *Household `json:"household,omitempty"`
}
type Estimates struct {
Aptc int `json:"aptc,omitempty"`
Csr string `json:"csr,omitempty"`
Hardship_exemption bool `json:"hardship_exemption"`
Is_medicaid_chip bool `json:"is_medicaid_chip"`
In_coverage_gap bool `json:"in_coverage_gap"`
}
type HouseholdsEligibilityEstimatesRespond struct {
Estimates *[]Estimates `json:"estimates,omitempty"`
}
var Campaigns = []Campaign{
{CampaignID: "campaign_1", Gender: "Female", IncomeRange: &IntRange{Min: 30000, Max: 40000}, AgeRange: &IntRange{Min: 35, Max: 45}, ZipCode: "73301", IsParent: true},
{CampaignID: "campaign_2", Gender: "Female", IncomeRange: &IntRange{Min: 30000, Max: 40000}, AgeRange: &IntRange{Min: 40, Max: 50}, ZipCode: "73301", IsParent: true},
}