Skip to content

Commit

Permalink
Update docs for stats requests
Browse files Browse the repository at this point in the history
  • Loading branch information
samnang committed Jan 13, 2025
1 parent 1feb575 commit 155e6d9
Showing 1 changed file with 47 additions and 2 deletions.
49 changes: 47 additions & 2 deletions spec/requests/open_ews_api/v1/beneficiaries_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -275,14 +275,59 @@
get "/v1/beneficiaries/stats" do
with_options scope: :filter do
parameter(
:gender, "Must be either `M` or `F`",
:iso_country_code, "The [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the beneficiary.",
required: false
)
parameter(
:language_code, "The [ISO ISO 639-2](https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes) alpha-3 language code of the beneficiary.",
required: false
)
parameter(
:gender, "Must be one of `M` or `F`.",
required: false
)
# TODO: It seems to be a bug. It's always adding `status: nil` in the `filter` params.
# parameter(
# :status, "Must be one of `active` or `disabled`.",
# required: false
# )
parameter(
:date_of_birth, "Date of birth in `YYYY-MM-DD` format.",
required: false
)
parameter(
:"address.iso_region_code", "The [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) region code of the address",
required: false
)
parameter(
:"address.administrative_division_level_2_code", "The second-level administrative subdivision code of the address (e.g. district code)",
required: false
)
parameter(
:"address.administrative_division_level_2_name", "The second-level administrative subdivision name of the address (e.g. district name)",
required: false
)
parameter(
:"address.administrative_division_level_3_code", "The third-level administrative subdivision code of the address (e.g. commune code)",
required: false
)
parameter(
:"address.administrative_division_level_3_name", "The third-level administrative subdivision name of the address (e.g. commune name)",
required: false
)
parameter(
:"address.administrative_division_level_4_code", "The forth-level administrative subdivision code of the address (e.g. village code)",
required: false
)
parameter(
:"address.administrative_division_level_4_name", "The forth-level administrative subdivision name of the address (e.g. village name)",
required: false
)
end

parameter(
:group_by,
"An array of fields to group by.`",
"An array of fields to group by. Supported fields: #{V1::BeneficiaryStatsRequestSchema::GROUPS.map { |group| "`#{group}`" }.join(", ")}.",
required: true
)

Expand Down

0 comments on commit 155e6d9

Please sign in to comment.