Integration - abeedal/Abeedal GitHub Wiki

Integration

Components that need their sources replaced or their requests amended due to the introduction of either the events or the offers service.

All pickswise data resets at 5am ET each morning - FE app will need to pass this datetime with all requests or filter accordingly

Care should be taken not to pass a changing timestamp as part of an endpoint request

Template

Example url

Component

Service

Endpoint Request

Inferred Logic (can be overwritten)

Action Required to move logic to FE - Not doing this :cross_mark:

Home

https://www.pickswise.com/

Navigation picks dropdown

Events

https://www.pickswise.com/wp-json/pw/v1/sports

sort=(in season, sports)

Request to ‘events service → selections’ specifying all ‘EventGroups’ and ‘property’ - response data grouped by sport and count attached.

hrefs generated for /{eventGroup}/picks/

Next up

Events

https://www.pickswise.com/wp-json/pw/v1/predictions/next

startsAfter=time() count=20 teamBased=true sort=(startTime, alpha)

:question_mark: Surely this sort should be startTime, sport, alpha

Request to 'events service → events' specifying all ‘EventGroups’ and ‘property’ - response data filtered to retain events that have not yet started for ‘teamBased’ sports only.

hrefs generated for /{eventGroup/predictions/{eventSlug}-predictions/{eventId}/

Featured carousel

Events, Offers & WordPress

:cross_mark: non MVP

:cross_mark: non MVP

ACF custom field group updated to point at 'offers service → offers' and 'events service → events' to populate ‘Post’ dropdown in wordpress backend. Featured items query updated to retrieve ‘promo_codes’ from the offers service and ‘previews’ from the events service. Mapping updated for each to match current wordpress response.

:question_mark: Candidate for non MVP - 'custom' option can be used to generate featured carousel items manually

Picks (best bets)

Events

https://www.pickswise.com/wp-json/pw/v1/picks?confidence=3&count=6

endsAfter=time() sort=(startTime, guestPick, sports, alpha, started are moved to end)

Request to ‘events service → selections’ specifying all ‘EventGroups’, ‘property’, and ‘betType’. Response data

filtered to retain only selections that have not yet reached their endTime

sorted to move selections that have passed their startTime to the end

hrefs generated for /{eventGroup}/best-bets/

Parlays

Events

https://www.pickswise.com/wp-json/pw/v1/parlays

endsAfter=time() sort=(startTime, sports, odds, started are moved to end)

Request to ‘events service → multiples’ specifying all ‘EventGroups’ and ‘property’. Response data:

filtered to retain only multiples that have not yet reached their endTime

sorted to move multiples that have passed their startTime to the end

hrefs generated for /{eventGroup}/parlays/

Predictions

Events

https://www.pickswise.com/wp-json/pw/v1/predictions?chunk=sport&count=6&removeStarted=true

startsAfter=(5am ET) sort=(startTime, alpha, started are moved to end)

Request to 'events service → events' specifying all ‘EventGroups’ and ‘property’ - can use same request as Next Up widget above.

Response data:

filtered to retain events that have not yet started

grouped by eventGroup

groups ordered according to property config

groups sliced to maximum of 6

count of all events used for ‘see all’ button

hrefs generated for:

/{eventGroup/predictions/

/{eventGroup/predictions/{eventSlug}-predictions/{eventId}/

Sidebar promo codes

Offers

:cross_mark: non MVP

:cross_mark: non MVP

Request to ‘offers service → offers’ specifying ‘property’, ‘country’ and ‘region’.

Title derived from location configuration:

If we care about the region we say ‘{region} Bonuses’ if we don’t care, we say '{country} Bonuses'

For some groups, we shouldn’t say the word ‘Bonuses’ at all

Location config task to follow

Sport home page

https://www.pickswise.com/mlb/

Next up

Events

https://www.pickswise.com/wp-json/pw/v1/predictions/next?sports=mlb

startsAfter=time() count=20 teamBased=true sort=(startTime, alpha)

Request to ‘events service → events' specifying current ‘EventGroup’, ‘property’ and 'startDatetime’ - response data filtered to retain events that have not yet started for ‘teamBased’ sports only.

hrefs generated for /{eventGroup/predictions/{eventSlug}-predictions/{eventId}/

No change in logic here, just request params

Picks (best bets)

Events

https://www.pickswise.com/wp-json/pw/v1/picks?sports=mlb&confidence=3&count=6

endsAfter=time() sort=(startTime, guestPick, alpha, started are moved to end)

Request to ‘events service → selections’ specifying current ‘EventGroup’, ‘property’, and ‘betType’. Response data

filtered to retain only selections that have not yet reached their endTime

sorted to move selections that have passed their startTime to the end

hrefs generated for /{eventGroup}/best-bets/

No change in logic here, just request params

Parlays

Events

https://www.pickswise.com/wp-json/pw/v1/parlays?sports=mlb

endsAfter=time() sort=(startTime, odds, started are moved to end)

Request to ‘events service → multiples’ specifying current ‘EventGroup’ and ‘property’. Response data filtered to retain only multiples that have not yet reached their endTime.

hrefs generated for /{eventGroup}/parlays/

Predictions

Events

https://www.pickswise.com/wp-json/pw/v1/predictions?sports=mlb&chunk=date&chunkCount=7&removeExpired=true

startsAfter=(start of current day) sort=(startTime, alpha)

Request to ‘events service → events' specifying current ‘EventGroup’, ‘property’, 'startDatetime’ - can use same request as Next Up widget for this page.

Response data:

filtered to retain events that have not yet ended

grouped by day

count of all events used for ‘see all’ button

hrefs generated for:

/{eventGroup/predictions/

/{eventGroup/predictions/{eventSlug}-predictions/{eventId}/

Logic change

Sport picks page

https://www.pickswise.com/mlb/picks/

Predictions (expanded)

Events

https://www.pickswise.com/wp-json/pw/v1/predictions?sports=mlb&dataSet=PredictionsExpanded

startsAfter=(5am ET) sort=(startTime, started are moved to end)

Request to ‘events service → selections’ specifying current ‘EventGroup’, ‘property’, 'startDatetime’

Response data:

grouped by event

sorted to move events that have passed their startTime to the end

abstract ‘marketTypes’, ‘tipster → types’, and ‘confidence’ to build filter object

hrefs generated for:

/{eventGroup/predictions/{eventSlug}-predictions/{eventId}/

Sport predictions page

https://www.pickswise.com/mlb/predictions/

Predictions

Events

https://www.pickswise.com/wp-json/pw/v1/predictions?sports=mlb&chunk=date&removeExpired=true

startsAfter=(start of current day) sort=(startTime, alpha)

Request to ‘events service → events' specifying current ‘EventGroup’, ‘property’, ‘startDatetime’

Response data:

grouped by day

hrefs generated for:

/{eventGroup/predictions/{eventSlug}-predictions/{eventId}/

Logic change

Sport best bets page

https://www.pickswise.com/mlb/best-bets/

Picks (expanded)

Events

https://www.pickswise.com/wp-json/pw/v1/picks?sports=mlb&confidence=3

endsAfter=time() sort=(startTime, guestPick, alpha, started are moved to end)

Request to ‘events service → selections’ specifying current ‘EventGroup’, ‘property’, and ‘betType’. Response data:

filtered to retain only selections that have not yet reached their endTime

sorted to move selections that have passed their startTime to the end

abstract ‘marketTypes’, ‘tipster → types’, and ‘confidence’ to build filter object

Note: There is a change here - previously all best bets were 3 star rated, ‘best bets’ will be a ‘betType' category going forward, so confidence may have more values than just '3’

Sport parlays page

https://www.pickswise.com/mlb/parlays/

Parlays (expanded)

Events

https://www.pickswise.com/wp-json/pw/v1/parlays?sports=mlb&dataSet=ParlaysFull

endsAfter=(5am ET) sort=(startTime, odds, started are moved to end)

Request to ‘events service → multiples’ specifying current ‘EventGroup’ and ‘property’. Response data filtered to retain only multiples that have not yet reached their endTime.

Sport props page

https://www.pickswise.com/mlb/prop-bets/

Picks (expanded)

Events

https://www.pickswise.com/wp-json/pw/v1/picks?sports=mlb&betTypes=prop-bets&dataSet=BasePicksFull&chunk=betTypes&chunkLevel=2

endsAfter=time() sort=(startTime, guestPick, alpha, started are moved to end)

Request to ‘events service → selections’ specifying current ‘EventGroup’, ‘property’, and ‘marketType’. Response data:

filtered to retain only selections that have not yet reached their endTime

sorted to move selections that have passed their startTime to the end

abstract ‘marketTypes’, ‘tipster → types’, and ‘confidence’ to build filter object

Sport futures page

https://www.pickswise.com/mlb/futures/

Picks (expanded)

Events

https://www.pickswise.com/wp-json/pw/v1/picks?sports=mlb&betTypes=futures&dataSet=BasePicksFull

endsAfter=time() sort=(startTime, guestPick, alpha, started are moved to end)

Request to ‘events service → selections’ specifying current ‘EventGroup’, ‘property’, and ‘marketType’. Response data:

filtered to retain only selections that have not yet reached their endTime

sorted to move selections that have passed their startTime to the end

abstract ‘marketTypes’, ‘tipster → types’, and ‘confidence’ to build filter object

Event home page

https://www.pickswise.com/nfl/super-bowl/

Picks (best bets)

Events

https://www.pickswise.com/wp-json/pw/v1/picks?sports=nfl&events=super-bowl&confidence=3&count=6

endsAfter=time() sort=(startTime, guestPick, alpha, started are moved to end)

Parlays

Events

https://www.pickswise.com/wp-json/pw/v1/parlays?sports=nfl&events=super-bowl&dataSet=ParlaysFull

endsAfter=(5am ET) sort=(startTime, odds, started are moved to end)

Event picks page

https://www.pickswise.com/nfl/super-bowl/picks/

Predictions (expanded)

Events

https://www.pickswise.com/wp-json/pw/v1/predictions?sports=nfl&events=super-bowl&dataSet=PredictionsExpanded

startsAfter=(5am ET) sort=(startTime, started are moved to end)

Event predictions page

https://www.pickswise.com/nfl/super-bowl/predictions/

Predictions

Events

https://www.pickswise.com/wp-json/pw/v1/predictions?sports=nfl&events=super-bowl&chunk=date&removeExpired=true

:question_mark: Lots of questions here regarding. Probably want PredictionsEnhanced as a dataSet. Who should handle the logic re multi vs single game events?

startsAfter=(start of current day) sort=(startTime, alpha)

Event best bet pages

https://www.pickswise.com/nfl/super-bowl/best-bets/

Picks (expanded)

Events

https://www.pickswise.com/wp-json/pw/v1/picks?sports=nfl&events=super-bowl&confidence=3

endsAfter=time() sort=(startTime, guestPick, alpha, started are moved to end)

Event props pages

https://www.pickswise.com/nfl/super-bowl/prop-bets/

Picks (expanded)

Events

https://www.pickswise.com/wp-json/pw/v1/picks?sports=nfl&events=super-bowl&betTypes=prop-bets&dataSet=BasePicksFull&chunk=betTypes&chunkLevel=2

endsAfter=time() sort=(startTime, guestPick, alpha, started are moved to end)

Event parlays page

https://www.pickswise.com/nfl/super-bowl/parlays/

Parlays (expanded)

Events

https://www.pickswise.com/wp-json/pw/v1/parlays?sports=bfl&sports=nfl&dataSet=ParlaysFull

endsAfter=(5am ET) sort=(startTime, odds, started are moved to end)

Parlays page

https://www.pickswise.com/parlays/

Parlays (expanded)

Events

https://www.pickswise.com/wp-json/pw/v1/parlays?dataSet=ParlaysFull

endsAfter=(5am ET) sort=(startTime, sports, odds, started are moved to end)

Request to ‘events service → multiples’ specifying current ‘EventGroup’ and ‘property.

Response data:

filtered to retain multiples that expire at a time later than the previous 5am ET

sorted to move multiples that have passed their startTime to the end

Individual Predictions

https://www.pickswise.com/mlb/predictions/al-all-star-team-vs-nl-all-star-team-predictions/

:question_mark: General discussion about posting eventId rather than pageSlug here, small amount of FE work to extract from url

Prediction dropdown

Events

https://www.pickswise.com/wp-json/pw/v1/predictions/next?sports=mlb

:question_mark: Need this looked into, believe there is discrepancy between app and web currently

startsAfter=time() count=20 teamBased=true sort=(startTime, alpha)

Request to ‘events service → events’ specifying current ‘eventId’, ‘EventGroup’ and ‘property’.

Response data:

filter the current event from the response

filter any events that have reached their eventTime

Prediction single

https://www.pickswise.com/wp-json/pw/v1/predictions/single/enhanced?id=123456

:question_mark: Feel like this is currently a cluster fuck, need confirmation on which endpoints are still in use and which can be deprecated in terms of enhanced vs normal

Content/SEO Meta

Events

https://www.pickswise.com/wp-json/pw/v1/content?id=123456

The application should contain SEO templates for this page, for example a meta description template may looks something like this:

{EVENT_TITLE} Tips and Predictions. Check out all of our expert {EVENT_GROUP} predictions and analysis.

Sometimes a meta title and/or a meta description may be provided by the main events request, in these cases, the provided title/description should replace the templated version

Parlays (related)

Events

https://www.pickswise.com/wp-json/pw/v1/parlays/related?id=123456

:question_mark: No idea what is currently going on here

:question_mark: Confirm logic - may require service level work

Prediction info

Events

:cross_mark: non MVP

:cross_mark: non MVP

Request to ‘events service → events’ specifying ‘eventId’ and ‘property.

Based on the response the page url must match the following format - else throw a 404: /{eventGroup/predictions/{eventSlug}-predictions/{eventId}/

This includes form, tv channel, and breaking news (if they exist)

Prediction stats

(Form, ATS & O/U)

GSP

:cross_mark: non MVP

:cross_mark: non MVP

Request to ‘GSP → insights → market stats’

Request to ‘GSP → insights → team stats’

:question_mark: Possibly worth trying to fold this into the 'event service → event participant' module?

Picks

Events

:cross_mark: non MVP

:cross_mark: non MVP

Request to ‘events service → selections’ specifying current ‘eventId’ and ‘property’.

Response data:

grouped according to market type (props) and tipster type (guest/resident)

Parlays (expanded)

Events

:cross_mark: non MVP

:cross_mark: non MVP

Request to ‘events service → multiples’ specifying ‘eventId’ and ‘property.

GSP Widgets

GSP

N/A

N/A

GSP event id will be returned as part of initial event request

Offers

Offers

:cross_mark: non MVP

:cross_mark: non MVP

:question_mark: This functionality has not been scoped out as part of MVP - might be worth a spike to investigate how we might achieve this, put some points against the task and then seek MVP sign off @Alex Peperell ?

News

WordPress

https://www.pickswise.com/wp-json/pw/v1/news/featured?sports=mlb

:warning: pageSlug must be removed

Request to ‘wp middleware → news/featured’ specifying current ‘EventGroup’ under the ‘sports’ parameter - NO pageSlug!

eg. https://www.pickswise.com/wp-json/pw/v1/news/featured?sports=mlb

Sportsbooks

https://www.pickswise.com/sportsbooks/best/

Offers

Offers

:cross_mark: non MVP

:cross_mark: non MVP

Request to ‘offers service → offers’ specifying ‘property’, ‘country’ and ‘region’.