ensignlee / ssbook

ssbook
5 stars 3 forks source link

Add Team Totals as Wager Type #165

Closed ensignlee closed 12 years ago

ensignlee commented 12 years ago

We've had several requests for this. Basically, a team total is a bet on the amount of points a team will score. Over/Under x number of points.

camerondavison commented 12 years ago

adding wager types are pretty involved. you may want to wait on this ticket until you are more experienced with the other tickets. But feel free to ask me if you have questions.

You have to add the ability to grade the wager type, add it to all the tables, also allow people to choose the wager type, and the UI on the enter bet screen, as well as the UI for the edit bet screen.

ensignlee commented 12 years ago

Hmm, I didn't realize that this was such a complicated ticket. Cameron, do you mind doing it then? I think I've had somewhere between 10-15 requests for this already.

chrisacheson commented 12 years ago

What exactly is the difference between this bet type and the existing "total" bet type?

ensignlee commented 12 years ago

So a total bet is the number of total points scored by BOTH teams.

A Team total is only for one team. For instance, Houston Astros Team total over 3.5, St. Louis Cardinals Team Total over 4.5. whereas the game total would be over 8.

Make sense?

chrisacheson commented 12 years ago

Gotcha. So in the bet history table, the "bet on" column would show something like "Astros Over", "Cardinals Under", etc?

ensignlee commented 12 years ago

That sounds good to me.

ensignlee commented 12 years ago

When users are entering in the bets, let's have it look like the following (you can see this yourself by going to "enter Bets", then selecting a game"):

First dropdown (bet type): They should select Team Total Second dropdown (bet choice): Astros Over, Astros Under, Cardinals Over, Cardinals Under Third text field: should say "Total" where the user can input a team total value. Ideally, this should autopopulate if you can get the information from the Pinnacle XML

Alternatively, we could have it display like this:

First dropdown (bet type): Choices are either "Astros TT" or "Cardinals TT" Second dropdown (bet choice): Over, Under Third text field: should say "Total" where the user can input a team total value. Ideally, this should autopopulate if you can get the information from the Pinnacle XML

I guess if I had a preference, I choose the 1st option in regards to UI for it. But if it's significantly harder, I'm fine with the 2nd. I'm not sure how Pinnacle's XML is structured nor how our DB is structured for that. Cameron - thoughts?

camerondavison commented 12 years ago

I think that we should stick with the first dropdown being the type, and the second one being the specific bet/side of the bet. So then it would be "Team Total" "Home Over, Home Under, Visitor Over, Visitor Under".

Is this for every sport type? I do not think that I have ever seen the team total in the pinnacle feed. Do they do them? Would it be in some special category? This is typically what I see from pinnacle

<period>
                        <period_number>0</period_number>
                        <period_description>Game</period_description>
                        <periodcutoff_datetimeGMT>2011-09-27 02:05</periodcutoff_datetimeGMT>
                        <period_status>I</period_status>
                        <period_update>open</period_update>
                        <spread_maximum>3000</spread_maximum>
                        <moneyline_maximum>5000</moneyline_maximum>
                        <total_maximum>2000</total_maximum>
                        <moneyline>
                                <moneyline_visiting>162</moneyline_visiting>
                                <moneyline_home>-173</moneyline_home>
                        </moneyline>
                        <spread>
                                <spread_visiting>1.5</spread_visiting>
                                <spread_adjust_visiting>-152</spread_adjust_visiting>
                                <spread_home>-1.5</spread_home>
                                <spread_adjust_home>140</spread_adjust_home>
                        </spread>
                        <total>
                                <total_points>6.5</total_points>
                                <over_adjust>100</over_adjust>
                                <under_adjust>-110</under_adjust>
                        </total>
                </period>
chrisacheson commented 12 years ago

Cameron, do you know if the data from the buildBet function in models/user_bet is actually used anywhere?

chrisacheson commented 12 years ago

Also, what files/directories can I safely ignore? I assume vendors/shells/migrate.php isn't going to be used anymore, for example.

ensignlee commented 12 years ago

Yes, this is for every sport type. Um...if you don't see team totals in the XML, then I guess we can just leave it blank and let users enter in their own values. This would make things significantly easier for Chris as well, I'd assume.

chrisacheson commented 12 years ago

This looks done to me, but there's likely something that I missed. Can you guys check it over and make sure that it works the way you expect it to?

ensignlee commented 12 years ago

I'll test it tonight and let you know if I find any bugs.

ensignlee commented 12 years ago

Looks good to me. Only change I have is to default odds to -110. Right now, the odds box is just getting the same value that it had previously from whatever bet choice was available.

Grading seems right, and the UI seems good. Great work Chris! btc sent your way.

chrisacheson commented 12 years ago

I'm not sure why the odds value isn't adjusting. There's code in place to do it, but it doesn't seem to be working. Should I get started on debugging it, or would you rather have Cameron take a look first?

ensignlee commented 12 years ago

Cameron - mind taking a crack at it first?

camerondavison commented 12 years ago

@Chris the place that your code is inside if (odd) {} that means that it will only get to that code path if the odds are set.

@Edmund we really should create another ticket if you would like this behavior changed. Currently if no odds are set for a bet type on a game then it will set it to -110 iff the box with the odds in it is empty. This is to minimize someone typing in some odds then realizing that it is the wrong bet type changing it and having the odds change in the box. This also has the unfortunate circumstance that if the odds are auto populated then they will stay as well. We can add some logic to say only change the odds to -110 if the odds were auto populated and not edited by the user or something like that, but we may want to discuss that further. You can see it on the main site by finding some game with moneyline odds and then changing it to second half bet type, they usually do not have odds on them if the game has not started yet. Also, it interacts kind of weird with parlays since all of those do not have odds, but yet we want to be using/setting odds that already were populated.

camerondavison commented 12 years ago

After reading through the code, chris fixed all my concerns and I tested some parts myself and I am happy with it.

Chris if you are happy with everything please go ahead and close the ticket.

Edmund if you are happy with everything then we can go ahead and make it live just tell me.

ensignlee commented 12 years ago

Make it so.