Skip to content
This repository has been archived by the owner on Sep 19, 2021. It is now read-only.

Commit

Permalink
Merge pull request #778 from 18F/develop
Browse files Browse the repository at this point in the history
Merge in sprint ending 2018-09-11
  • Loading branch information
ryanhofdotgov authored Sep 11, 2018
2 parents cb24e8e + 73b7880 commit 3fc0888
Show file tree
Hide file tree
Showing 109 changed files with 27,571 additions and 576 deletions.
8 changes: 7 additions & 1 deletion api/Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions api/Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@
branch = "master"
name = "github.com/antchfx/xmlquery"

[[constraint]]
branch = "master"
name = "github.com/benbjohnson/clock"

[prune]
go-tests = true
unused-packages = true
4 changes: 3 additions & 1 deletion api/cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/18F/e-QIP-prototype/api/saml"
"github.com/18F/e-QIP-prototype/api/usps"
"github.com/18F/e-QIP-prototype/api/xml"
"github.com/benbjohnson/clock"
"github.com/gorilla/mux"
)

Expand All @@ -26,12 +27,13 @@ var (
func main() {
cloudfoundry.Configure()
logger := &log.Service{Log: log.NewLogger()}
localClock := clock.New()
settings := env.Native{}
settings.Configure()
database := &postgresql.Service{Log: logger, Env: settings}
database.Configure()
token := jwt.Service{Env: settings}
xmlsvc := xml.Service{Log: logger}
xmlsvc := xml.Service{Log: logger, Clock: localClock}
pdfsvc := pdf.Service{Log: logger, Env: settings}
samlsvc := &saml.Service{Log: logger, Env: settings}
api.Geocode = usps.Geocoder{Log: logger, Env: settings}
Expand Down
6 changes: 6 additions & 0 deletions api/location.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ const (
LayoutStreetCity = "Street, City"
)

// Special layout flags for e-QIP integration for Country elements with CountriesNoUS type
const (
LayoutBirthPlaceWithoutCountyNoUS = "Birthplace without County CountriesNoUS"
LayoutBirthPlaceNoUS = "Birthplace CountriesNoUS"
)

// Location is a basic input.
type Location struct {
ID int `json:"-"`
Expand Down
7 changes: 5 additions & 2 deletions api/templates/application.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
<Version>2017-07</Version>
</Form>
<Applicant>
<Name>{{$name.first}} {{$name.middle}} {{$name.last}}</Name>
{{if $ssn.notApplicable}}
<SSN NotApplicable="True" />
{{else}}
<SSN>{{$ssn.first}}{{$ssn.middle}}{{$ssn.last}}</SSN>
{{end}}
</Applicant>
<Responses>
<AgencyInstructionsForApplicant></AgencyInstructionsForApplicant>
<AgencyInstructionsForApplicant/>
<FormInstanceSpecific>
<AgencyInstructionsForApplicant/>
<ESigCertificationResponses Version="1" Type="Pooled" LastSummaryID="201" LastDynamicListID="201">
<UserFinalizedCert>
<Answer>Yes</Answer>
Expand All @@ -30,6 +30,8 @@
<UserPreferences Version="1" Type="Pooled" LastSummaryID="201" LastDynamicListID="201">
<DisplayNavigation/>
</UserPreferences>
<!-- TODO https://github.com/18F/e-QIP-prototype/issues/759 -->
<ValidationResponses Version="1" Type="FormInstanceSpecific" />
</FormInstanceSpecific>
<Pooled>
{{tmpl "identification.xml" .}}
Expand All @@ -51,6 +53,7 @@
</Responses>
</Request>
</RequestInfo>
<DateSubmitted>{{now}}</DateSubmitted>
</SubmittedRequestInfo>
<AgencyUsageBlock>
<TypeOfInvestigation>
Expand Down
2 changes: 1 addition & 1 deletion api/templates/citizenship-multiple.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<DualCitizenships>
{{range $index, $item := .props.List.props.items}}
{{with $Item := $item.Item}}
<Citizenship ID="{{$index}}">
<Citizenship ID="{{inc $index}}">
{{country $Item.Country}}
<CountryOfCitizenshipDetailComment>{{countryComments $Item.Country}}</CountryOfCitizenshipDetailComment>
<CurrentlyHoldCitizenship>
Expand Down
2 changes: 1 addition & 1 deletion api/templates/citizenship-status.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</AlienRegistration>
<Citizenships>
{{range $cindex, $country := $citizenship.PriorCitizenship.props.value}}
<Citizenship ID="{{$cindex}}">
<Citizenship ID="{{inc $cindex}}">
<Country>{{$country}}</Country>
</Citizenship>
{{end}}
Expand Down
6 changes: 1 addition & 5 deletions api/templates/financial-bankruptcy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Activities>
{{range $index, $item := .props.List.props.items}}
{{with $Item := $item.Item}}
<Activity ID="{{$index}}">
<Activity ID="{{inc $index}}">
<AccountNumber>{{text $Item.CourtNumber}}</AccountNumber>
<Amount Estimated="{{checkboxTrueFalse $Item.TotalAmountEstimated}}">{{number $Item.TotalAmount}}</Amount>
<Authority>
Expand Down Expand Up @@ -37,10 +37,6 @@
</Activity>
{{end}}
{{end}}

{{- if branch .props.HasBankruptcy | eq "Yes"}}
<HaveAdditionalEntryAnswer>{{branch .props.List.props.branch}}</HaveAdditionalEntryAnswer>
{{end}}
</Activities>
<Answer>{{branch .props.HasBankruptcy}}</Answer>

Expand Down
2 changes: 1 addition & 1 deletion api/templates/financial-card.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Incidents>
{{range $index, $item := .props.List.props.items}}
{{with $Item := $item.Item}}
<Incident ID="{{$index}}">
<Incident ID="{{inc $index}}">
<Actions>{{textarea $Item.Description}}</Actions>
<Agency>
<Address>{{location $Item.Address}}</Address>
Expand Down
2 changes: 1 addition & 1 deletion api/templates/financial-credit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Incidents>
{{range $index, $item := .props.List.props.items}}
{{with $Item := $item.Item}}
<Incident ID="{{$index}}">
<Incident ID="{{inc $index}}">
<Actions>{{textarea $Item.Description}}</Actions>
<Comment></Comment>
<Explanation>{{textarea $Item.Explanation}}</Explanation>
Expand Down
9 changes: 5 additions & 4 deletions api/templates/financial-delinquent.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Incidents>
{{range $index, $item := .props.List.props.items}}
{{with $Item := $item.Item}}
<Incident ID="{{$index}}">
<Incident ID="{{inc $index}}">
<AccountNumber>{{text $Item.AccountNumber}}</AccountNumber>
<Agency>
<Name>{{text $Item.Name}}</Name>
Expand All @@ -28,12 +28,13 @@
<Description>{{textarea $Item.Description}}</Description>
<IssueType>
<Answer>{{if checkbox $Item.Infractions}}Yes{{else}}No{{end}}</Answer>
<!-- Note: Judgement with an 'e' and Judgment without an 'e' -->
<Options
{{ if (checkboxHas $Item.Infractions "Alimony") | eq "True" }}
Alimony="{{checkboxHas $Item.Infractions "Alimony"}}"
Alimony="True"
{{end}}
{{ if (checkboxHas $Item.Infractions "Judgment") | eq "True" }}
Judgment="{{checkboxHas $Item.Infractions "Judgment"}}"
{{ if (checkboxHas $Item.Infractions "Judgement") | eq "True" }}
Judgment="True"
{{end}}
{{ if (checkboxHas $Item.Infractions "Lien") | eq "True" }}
Lien="True"
Expand Down
2 changes: 1 addition & 1 deletion api/templates/financial-gambling.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Incidents>
{{range $index, $item := .props.List.props.items}}
{{with $Item := $item.Item}}
<Incident ID="{{$index}}">
<Incident ID="{{inc $index}}">
<Actions>{{textarea $Item.Actions}}</Actions>
<Amount>{{number $Item.Losses}}</Amount>
<Comment></Comment>
Expand Down
2 changes: 1 addition & 1 deletion api/templates/financial-nonpayment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Incidents>
{{range $index, $item := .props.List.props.items}}
{{with $Item := $item.Item}}
<Incident ID="{{$index}}">
<Incident ID="{{inc $index}}">
<AccountNumber>{{text $Item.AccountNumber}}</AccountNumber>
<Agency>
<Name>{{text $Item.Name}}</Name>
Expand Down
2 changes: 1 addition & 1 deletion api/templates/financial-taxes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Incidents>
{{range $index, $item := .props.List.props.items}}
{{with $Item := $item.Item}}
<Incident ID="{{$index}}">
<Incident ID="{{inc $index}}">
<Actions>{{textarea $Item.Description}}</Actions>
<Agency>{{text $Item.Agency}}</Agency>
<Amount Estimated="{{checkboxTrueFalse $Item.AmountEstimated}}">{{number $Item.Amount}}</Amount>
Expand Down
2 changes: 1 addition & 1 deletion api/templates/foreign-business-consultancies.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Comment></Comment>
{{range $index, $item := .props.List.props.items}}
{{with $Item := $item.Item}}
<Consultancy ID="{{$index}}">
<Consultancy ID="{{inc $index}}">
<Agency>
{{country $Item.Country}}
<Name>{{text $Item.Agency}}</Name>
Expand Down
10 changes: 5 additions & 5 deletions api/templates/foreign-business-government-contacts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<Comment></Comment>
{{range $index, $item := .props.List.props.items}}
{{with $Item := $item.Item}}
<GovernmentContact ID="{{$index}}">
<GovernmentContact ID="{{inc $index}}">
<Circumstances>{{text $Item.Purpose}}</Circumstances>
<CountriesInvolved>
{{range $cindex, $country := $Item.Governments.props.value}}
<CountryInvolved ID="{{$cindex}}">
<CountryInvolved ID="{{inc $cindex}}">
<Country>{{$country}}</Country>
</CountryInvolved>
{{end}}
Expand All @@ -28,12 +28,12 @@
</Place>
</Location>
<SubsequentForeignContacts>
<Answer>{{branchcollectionHas $Item.SubsequentContacts.props.List}}</Answer>
<Answer>{{branchcollectionHas $Item.SubsequentContacts}}</Answer>
<AnswerComment></AnswerComment>
{{range $sindex, $contact := $Item.SubsequentContacts.props.List.props.items}}
{{range $sindex, $contact := $Item.SubsequentContacts.props.items}}
{{with $Contact := $contact.Item}}
{{- if branch $Contact.Has | eq "Yes"}}
<Contact ID="{{$sindex}}">
<Contact ID="{{inc $sindex}}">
<Comment></Comment>
<Date Type="{{dateEstimated $Contact.Recent}}">
{{date $Contact.Recent}}
Expand Down
2 changes: 1 addition & 1 deletion api/templates/foreign-business-job-offers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<ForeignJobOffers>
{{range $index, $item := .props.List.props.items}}
{{with $Item := $item.Item}}
<ForeignJobOffer ID="{{$index}}">
<ForeignJobOffer ID="{{inc $index}}">
<AcceptOffer>
<Answer>{{text $Item.Accepted}}</Answer>
<Explanation>{{text $Item.Explanation}}</Explanation>
Expand Down
4 changes: 2 additions & 2 deletions api/templates/foreign-business-meetings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Comment></Comment>
{{range $index, $item := .props.List.props.items}}
{{with $Item := $item.Item}}
<Meeting ID="{{$index}}">
<Meeting ID="{{inc $index}}">
{{monthYearDaterange $Item.Dates}}
<EntryComment></EntryComment>
<Location>
Expand All @@ -22,7 +22,7 @@
{{range $cindex, $contact := $Item.Contacts.props.List.props.items}}
{{with $Contact := $contact.Item}}
{{if branch $Contact.Has | eq "Yes"}}
<Contact ID="{{$cindex}}">
<Contact ID="{{inc $cindex}}">
<Comment></Comment>
<Explanation>{{text $Contact.Explanation}}</Explanation>
</Contact>
Expand Down
4 changes: 2 additions & 2 deletions api/templates/foreign-business-other-employment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<OtherForeignEmployments>
{{range $index, $item := .props.List.props.items}}
{{with $Item := $item.Item}}
<OtherForeignEmployment ID="{{$index}}">
<OtherForeignEmployment ID="{{inc $index}}">
<Comment></Comment>
<CompensationDescription>{{text $Item.Compensation}}</CompensationDescription>
{{monthYearDaterange $Item.Dates}}
Expand All @@ -23,7 +23,7 @@
</Address>
<CountriesOfCitizenship>
{{range $cindex, $country := $Item.Citizenship.props.value}}
<Citizenship ID="{{$cindex}}">
<Citizenship ID="{{inc $cindex}}">
<Country>{{$country}}</Country>
</Citizenship>
{{end}}
Expand Down
2 changes: 1 addition & 1 deletion api/templates/foreign-business-political-office.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ForeignPoliticalOffices>
{{range $index, $item := .props.List.props.items}}
{{with $Item := $item.Item}}
<ForeignPoliticalOffice ID="{{$index}}">
<ForeignPoliticalOffice ID="{{inc $index}}">
<Comment></Comment>
{{country $Item.Country}}
<CurrentEligibility>{{text $Item.Eligibility}}</CurrentEligibility>
Expand Down
8 changes: 4 additions & 4 deletions api/templates/foreign-business-sponsored-visits.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<Comment></Comment>
{{range $index, $item := .props.List.props.items}}
{{with $Item := $item.Item}}
<SponsoredVisit ID="{{$index}}">
<SponsoredVisit ID="{{inc $index}}">
<AddressWhileInUS>
<Address>
{{location $Item.Address}}
{{location $Item.Residence}}
</Address>
</AddressWhileInUS>
<Birth>
Expand All @@ -27,14 +27,14 @@
</Birth>
<CountriesOfCitizenship>
{{range $cindex, $country := $Item.Citizenship.props.value}}
<Citizenship ID="{{$cindex}}">
<Citizenship ID="{{inc $cindex}}">
<Country>{{$country}}</Country>
</Citizenship>
{{end}}
</CountriesOfCitizenship>
<CurrentAddress>
<Address>
{{location $Item.Residence}}
{{location $Item.Address}}
</Address>
</CurrentAddress>
{{monthYearDaterange $Item.Dates}}
Expand Down
2 changes: 1 addition & 1 deletion api/templates/foreign-business-support-activities.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{{end}}
{{range $index, $item := .props.List.props.items}}
{{with $Item := $item.Item}}
<SupportActivity ID="{{$index}}">
<SupportActivity ID="{{inc $index}}">
{{country $Item.Country}}
{{monthYearDaterange $Item.Dates}}
<DescribeCompensation>{{text $Item.Compensation}}</DescribeCompensation>
Expand Down
2 changes: 1 addition & 1 deletion api/templates/foreign-business-voted.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<VotedInForeignElections>
{{range $index, $item := .props.List.props.items}}
{{with $Item := $item.Item}}
<ForeignElection ID="{{$index}}">
<ForeignElection ID="{{inc $index}}">
<Comment></Comment>
{{country $Item.Country}}
<CurrentVotingEligibility>{{text $Item.Eligibility}}</CurrentVotingEligibility>
Expand Down
Loading

0 comments on commit 3fc0888

Please sign in to comment.