Skip to content

Search service logic and data flow #9

@bobetbat

Description

@bobetbat
flowchart
	subgraph state[App state]
		searchResults
	end

	subgraph useSearchForm
		validator
		queryBuilder
		querySender
	end

	subgraph form[Search form]
		address
		dates[check-in/out dates]
		guests
		num[Num rooms]
	end

	subgraph server
		search_api
	end

	querySender --> useDispatch
	useDispatch <--> state
	form <--> useSearchForm

	search[Search start] -.-> querySender

	querySender -.-> search_api
Loading
  • Address/city
  • Check-in/out dates selector
  • Guests (adult/children)
  • Num rooms

The Search form component should allow the following configuration*:

  • default address/city
  • default dates range

*This configuration must be provided via app config

useSearchForm hook accepts all the form properties as arguments.

  • When any of the arguments are changed in the state they must be validated and the search query is prepared to be sent to the server
  • When search is started by the user the querySender sends a request to the server

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions