Merge pull request #24 from serg1122/party-type-for-party-suggestion
Добавили параметр 'Type' в запрос подсказок юрлиц
This commit is contained in:
commit
4efbb0bd5a
@ -40,6 +40,7 @@ type (
|
|||||||
|
|
||||||
// RequestParams Request struct
|
// RequestParams Request struct
|
||||||
RequestParams struct {
|
RequestParams struct {
|
||||||
|
Type *PartyType `json:"type,omitempty"` // party type for the suggestion (user input)
|
||||||
Query string `json:"query"` // user input for suggestion
|
Query string `json:"query"` // user input for suggestion
|
||||||
Count int `json:"count"` // ligmit for results
|
Count int `json:"count"` // ligmit for results
|
||||||
Locations []*RequestParamsLocation `json:"locations"`
|
Locations []*RequestParamsLocation `json:"locations"`
|
||||||
|
@ -73,6 +73,34 @@ func (s *ApiSuggestIntegrationTest) TestParty() {
|
|||||||
s.NotEmpty(res)
|
s.NotEmpty(res)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *ApiSuggestIntegrationTest) TestPartyWithTypePositive() {
|
||||||
|
api := NewSuggestApi()
|
||||||
|
|
||||||
|
// positive: there are some legal entities "сбербанк"
|
||||||
|
legalParty := suggest.PartyTypeLegal
|
||||||
|
res, err := api.Party(context.Background(), &suggest.RequestParams{
|
||||||
|
Query: "сбербанк",
|
||||||
|
Type: &legalParty,
|
||||||
|
})
|
||||||
|
|
||||||
|
s.NoError(err)
|
||||||
|
s.NotEmpty(res)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *ApiSuggestIntegrationTest) TestPartyWithTypeNegative() {
|
||||||
|
api := NewSuggestApi()
|
||||||
|
|
||||||
|
// there are no one individual entrepreneur "сбербанк"
|
||||||
|
individualParty := suggest.PartyTypeIndividual
|
||||||
|
res, err := api.Party(context.Background(), &suggest.RequestParams{
|
||||||
|
Query: "сбербанк",
|
||||||
|
Type: &individualParty,
|
||||||
|
})
|
||||||
|
|
||||||
|
s.NoError(err)
|
||||||
|
s.Empty(res)
|
||||||
|
}
|
||||||
|
|
||||||
func (s *ApiSuggestIntegrationTest) TestPartyById() {
|
func (s *ApiSuggestIntegrationTest) TestPartyById() {
|
||||||
api := NewSuggestApi()
|
api := NewSuggestApi()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user