AmericaSCORESBayArea / salesforce-data-api

This project is based on Mulesoft Dataweave and Salesforce to provide secure, reliable, API access for all the Scores apps and projects. It is hosted on Anypoint and acts as the transactional hub, in concert with the authentication API
3 stars 1 forks source link

Feat/218 get teamseasons update filter #223

Closed AleksandrMolchagin closed 5 months ago

AleksandrMolchagin commented 5 months ago

Description: Update the endpoint to retrieve teamSeasons with a new filter system (endDate and isWithinDateRange)

isWithinDateRange Enabled: Returns teamSeasons between the specified date and endDate. If the endDate is not provided, it returns all teamSeasons after the start date.

isWithinDateRange Disabled: Returns teamSeasons with the start date equal to date.

RAML Link: Will be included in RAML 4.0.1 #222

RAML Specification:

/teamSeasons:
  post:
    description: Create a new TeamSeason
    body:
      application/json:
        type: types.TeamSeasonCreateModel
  get:
    description: Get TeamSeasons for given query params
    queryParameters:
      date:
        displayName: date
        description: TeamSeason Start Date
        type: date-only
        required: true
      endDate:
        displayName: endDate
        description: TeamSeason End Date (by default, today's date)
        type: date-only
        required: false
      isWithinDateRange:
        displayName: isWithinDateRange
        description: If **enabled**, returns `teamSeasons` between the start and end dates (If end date is not provided, returns all `teamSeasons` after the start date) If **disabled**, returns `teamSeasons` with start date equal to the give date.
        type: boolean
        required: false
    responses:
      200:
        body:
          application/json:
            type: types.TeamSeasonBaseModel[]

Test examples: {{base_url}}/teamSeasons?date=2019-01-01&endDate=2019-06-14&isWithinDateRange=true

{{base_url}}/teamSeasons?date=2019-01-01&isWithinDateRange=true

{{base_url}}/teamSeasons?date=2019-01-04

Screenshots of tests: image image image image image