Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MBetterc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mbetter
MBetterc
Commits
f3f20822
Commit
f3f20822
authored
May 14, 2026
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose settled winnings in report details
parent
3fdad329
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
routes.py
mbetterclient/web_dashboard/routes.py
+5
-1
test_reports_daily_alignment.py
test_reports_daily_alignment.py
+18
-0
No files found.
mbetterclient/web_dashboard/routes.py
View file @
f3f20822
...
...
@@ -441,6 +441,7 @@ def bet_details(bet_id):
'amount'
:
float
(
detail
.
amount
),
'odds'
:
float
(
odds
),
'potential_winning'
:
float
(
detail
.
amount
)
*
float
(
odds
),
'settled_winning'
:
float
(
detail
.
win_amount
or
0.0
),
'result'
:
detail
.
result
,
'match'
:
{
'match_number'
:
match
.
match_number
if
match
else
'Unknown'
,
...
...
@@ -1105,6 +1106,7 @@ def cashier_bet_details(bet_id):
'amount'
:
float
(
detail
.
amount
),
'odds'
:
float
(
odds
),
'potential_winning'
:
float
(
detail
.
amount
)
*
float
(
odds
),
'settled_winning'
:
float
(
detail
.
win_amount
or
0.0
),
'result'
:
detail
.
result
,
'match'
:
{
'match_number'
:
match
.
match_number
if
match
else
'Unknown'
,
...
...
@@ -6559,6 +6561,7 @@ def get_cashier_bets():
'amount'
:
float
(
detail
.
amount
),
'odds'
:
float
(
odds
),
'potential_winning'
:
float
(
detail
.
amount
)
*
float
(
odds
),
'settled_winning'
:
float
(
detail
.
win_amount
or
0.0
),
'result'
:
detail
.
result
,
'match'
:
{
'match_number'
:
match
.
match_number
if
match
else
'Unknown'
,
...
...
@@ -8073,7 +8076,8 @@ def get_match_details():
'outcome'
:
detail
.
outcome
,
'amount'
:
float
(
detail
.
amount
),
'result'
:
actual_result
,
'potential_winning'
:
potential_winning
'potential_winning'
:
potential_winning
,
'settled_winning'
:
float
(
detail
.
win_amount
or
0.0
)
}
bets_data
.
append
(
bet_data
)
...
...
test_reports_daily_alignment.py
View file @
f3f20822
...
...
@@ -360,3 +360,21 @@ def test_match_details_route_uses_explicit_join_for_bet_lookup(monkeypatch, isol
assert
response
.
status_code
==
200
payload
=
response
.
get_json
()
assert
payload
[
'total'
]
==
0
def
test_match_details_includes_settled_winning_field
(
monkeypatch
,
isolated_api_blueprint
):
install_route_test_doubles
(
monkeypatch
)
detail
=
DummyDetail
(
match_id
=
10
,
amount
=
100.0
,
win_amount
=
250.0
,
result
=
'win'
)
bet
=
DummyBet
(
uuid
=
'bet1'
,
bet_datetime
=
datetime
(
2026
,
5
,
1
,
12
,
0
,
0
))
match
=
DummyMatch
(
match_id
=
10
)
match
.
status
=
'done'
client
=
make_test_client
(
DummySession
([
detail
],
[
bet
],
[
match
]),
isolated_api_blueprint
,
)
response
=
client
.
get
(
'/api/reports/match-details?date=2026-05-01&match_id=10'
)
assert
response
.
status_code
==
200
payload
=
response
.
get_json
()
assert
payload
[
'total'
]
==
0
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment