Skip to content

Instantly share code, notes, and snippets.

@tolbard
Last active January 14, 2016 22:32
Show Gist options
  • Save tolbard/2d101bb100789412a58e to your computer and use it in GitHub Desktop.
Save tolbard/2d101bb100789412a58e to your computer and use it in GitHub Desktop.
Footy Tab Bet Specific or Generic json structure.
[{
"type": "FOOTY",
"competition": "NRL",
"betType": "PICK_THE_WINNERS",
"stake": "$2.00",
"flexi": true,
"date": "2016-03-23",
"matches": [
{"legs": [
{"selections": ["H"]}
]},
{"legs": [
{"selections": ["H","A"]}
]},
{"legs": [
{"selections": ["A"]}
]},
]
},
{
"type": "FOOTY",
"competition": "NRL",
"betType": "PICK_THE_SCORES",
"stake": "$1.00",
"flexi": false,
"date": "2016-03-23",
"matchNumber": 3,
"matches": [
{"legs": [
{"selections": [48]},
{"selections": [0,1,2]}
]},
]
},
{
"type": "FOOTY",
"competition": "NRL",
"betType": "PICK_THE_MARGINS",
"stake": "$3.00",
"flexi": false,
"date": "2016-03-23",
"matches": [
{"legs": [
{"selections": ["ALL"]}
]},
{"legs": [
{"selections": [0,1]}
]},
{"legs": [
{"selections": [4,5]}
]},
]
},
{
"type": "FOOTY",
"competition": "AFL",
"betType": "PICK_THE_WINNERS",
"stake": "$2.00",
"flexi": true,
"date": "2016-03-23",
"matches": [
{"legs": [
{"selections": ["H","A"]}
]},
{"legs": [
{"selections": ["H","A"]}
]},
{"legs": [
{"selections": ["A"]}
]},
]
},
{
"type": "FOOTY",
"competition": "AFL",
"betType": "PICK_THE_MARGINS",
"stake": "$3.00",
"flexi": false,
"date": "2016-03-23",
"matches": [
{"legs": [
{"selections": ["ALL"]}
]},
{"legs": [
{"selections": [0,"MYSTERY"]}
]},
{"legs": [
{"selections": [4,5]}
]},
]
},
{
"type": "FOOTY",
"competition": "AFL",
"betType": "WIN",
"stake": "$3.00",
"flexi": false,
"date": "2016-03-23",
"matchNumber": 3,
"matches": [
{"legs": [
{"selections": [1,2]}
]}
]
},
{
"type": "FOOTY",
"competition": "AFL",
"betType": "QUAD",
"stake": "$0.50",
"flexi": false,
"date": "2016-03-23",
"matches": [
{"legs": [
{"selections": [1,2]}
]},
{"legs": [
{"selections": [7,8,9]}
]},
{"legs": [
{"selections": [16]}
]},
{"legs": [
{"selections": [3,4]}
]},
]
},
{
"type": "FOOTY",
"competition": "AFL",
"betType": "QUARTER_QUAD",
"stake": "$3.50",
"flexi": false,
"date": "2016-03-23",
"matches": [
{"legs": [
{"selections": [2,3]}
{"selections": [3]},
{"selections": [1]},
{"selections": [8]}
]},
]
},
{
"type": "FOOTY",
"competition": "AFL",
"betType": "DOUBLE",
"stake": "$3.50",
"date": "2016-03-21",
"matches": [
{"legs": [
{"selections": [2,3]}
]},
{"legs": [
{"selections": [3,4]}
]}
]
},
{
"type": "FOOTY",
"competition": "AFL",
"betType": "HALF_DOUBLE",
"stake": "$1.50",
"flexi": false,
"date": "2016-03-20",
"matches": [
{"legs": [
{"selections": [10]},
{"selections": [12]}
]},
]
},
{
"type": "FOOTY",
"competition": "AFL",
"betType": "XTRA_DOUBLE",
"stake": "$3.50",
"flexi": false,
"date": "2016-03-23",
"matches": [
{"legs": [
{"selections": [2,3]}
]},
{"legs": [
{"selections": [3,4]}
]}
]
},
{
"type": "FOOTY",
"competition": "AFL",
"betType": "HALF_XTRA_DOUBLE",
"stake": "$1.50",
"flexi": false,
"date": "2016-03-13",
"matches": [
{"legs": [
{"selections": [10]},
{"selections": [12]}
]},
]
}
]
@nguyenchr
Copy link

@tolbard

I would have expected NRL winners to be more like

{
  "type": "FOOTY",
  "sportType": "NRL",
  "betType": "PICK_THE_WINNERS",
  "stake": "$2.00",
  "flexi": true,
  "matchResults": [
    ['H'],
    ['H','A'],
    ['A']
  ]
}

@nguyenchr
Copy link

looks like most things are an array of arrays apart from the FootyTabWin? and pick the scores

@tolbard
Copy link
Author

tolbard commented Jan 11, 2016

@nguyenchr

I can change it to H and A.

@tolbard
Copy link
Author

tolbard commented Jan 11, 2016

@nguyenchr @vickvu then the real question should I keep the structure of the selection all different or use a Generic structure like

{
  "matchLegs": [
     "period": [
       "selections": [1,4,"ALL", "MYSTERY","H","A"]
     ]
  ]
}

@nguyenchr
Copy link

@tolbard lets explore a few different options in this gist

see what it looks like to be generic? and add to this gist, but dont remove the other examples, and then we can compare

@tolbard
Copy link
Author

tolbard commented Jan 11, 2016

A not generic method make it more difficult to do things like "bet.hasMystery"

@tolbard
Copy link
Author

tolbard commented Jan 11, 2016

@nguyenchr @vickvu I add the generic examples in the end of the gist

@raymaung
Copy link

Generic version, but no periods ie

{
  "type": "FOOTY",
  "venueCode": "C",
  "betType": "PICK_THE_MARGINS",
  "stake": "$3.00",
  "flexi": false,
  "matchLegs": [
    ["ALL"],
    [0,1],
    [4,5]
  ]
},

@alexdeem
Copy link

Without periods would actually look like:

{
  "type": "FOOTY",
  "venueCode": "C",
  "betType": "PICK_THE_MARGINS",
  "stake": "$3.00",
  "flexi": false,
  "matchLegs": [
    [["ALL"]],
    [[0,1]],
    [[4,5]]
  ]
},

@alexdeem
Copy link

My understanding is that 'matchLegs' actually corresponds to a 'race' in the parimutuel racing analogy.
How about we just call this 'match'?
Then each 'period' is actually the 'leg' of that 'match' (corresponding to leg of a racing bet)?

{
  "type": "FOOTY",
  "venueCode": "F",
  "betType": "FOOTY_QUAD",
  "stake": "$0.50",
  "flexi": false,
  "matches": [
    {"legs": [
          {"selections": [1,2]}
        ]},
    {"legs": [
          {"selections": [7,8,9]}
        ]},

    {"legs": [
          {"selections": [16]}
        ]},
    {"legs": [
          {"selections": [3,4]}
        ]},
  ]
},

@vickvu
Copy link

vickvu commented Jan 11, 2016

do we have to keep the name venueCode, may be we should rename venueCode to something more meaningful?

@nguyenchr
Copy link

@vickvu I agree, have a look at my first comment, I called it sportType not sure whether that is better or not?

@tolbard
Copy link
Author

tolbard commented Jan 12, 2016

@nguyenchr @vickvu what do you think about betTypeGroup

@tolbard
Copy link
Author

tolbard commented Jan 12, 2016

@nguyenchr After I read again you first comment I got It. I can use sportType : "NRL" or "AFL"

@tolbard
Copy link
Author

tolbard commented Jan 12, 2016

instead of sportType why not use competiton as "NRL" and "AFL" are sport competition

@tolbard
Copy link
Author

tolbard commented Jan 12, 2016

{
  "type": "FOOTY",
  "competition": "NRL",
  "betType": "PICK_THE_MARGINS",
  "stake": "$3.00",
  "flexi": false,
  "matches": [
    ["ALL"],
    [0,1],
    [4,5]
  ]
},

@alexdeem
Copy link

s/matchs/matches/ :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment