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
27b5028b
Commit
27b5028b
authored
May 14, 2026
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use settled win amounts in bet details
parent
6a7a0542
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
routes.py
mbetterclient/web_dashboard/routes.py
+1
-1
test_reports_daily_alignment.py
test_reports_daily_alignment.py
+10
-0
No files found.
mbetterclient/web_dashboard/routes.py
View file @
27b5028b
...
...
@@ -461,7 +461,7 @@ def bet_details(bet_id):
has_pending
=
True
elif
is_settled_bet_detail_winning
(
detail
,
match
,
session
):
results
[
'won'
]
+=
1
results
[
'winnings'
]
+=
float
(
detail
.
amount
)
*
float
(
odds
)
# Use actual odds
results
[
'winnings'
]
+=
float
(
detail
.
win_amount
or
0.0
)
elif
detail
.
result
==
'lost'
:
results
[
'lost'
]
+=
1
elif
detail
.
result
==
'cancelled'
:
...
...
test_reports_daily_alignment.py
View file @
27b5028b
...
...
@@ -275,6 +275,16 @@ def test_settled_winning_check_prefers_explicit_lost_for_completed_match():
assert
is_settled_bet_detail_winning
(
detail
,
match
,
session
)
is
False
def
test_settled_winning_check_uses_win_amount_for_completed_match_display
():
detail
=
DummyDetail
(
match_id
=
10
,
amount
=
100.0
,
win_amount
=
250.0
,
result
=
'win'
)
match
=
DummyMatch
(
match_id
=
10
)
match
.
status
=
'done'
session
=
Mock
()
assert
is_settled_bet_detail_winning
(
detail
,
match
,
session
)
is
True
assert
float
(
detail
.
win_amount
)
==
250.0
def
test_match_reports_route_counts_winning_payout_after_loading_match
(
monkeypatch
,
isolated_api_blueprint
):
install_route_test_doubles
(
monkeypatch
)
match
=
DummyMatch
(
match_id
=
10
)
...
...
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