Skip to content

Commit

Permalink
feat: add default value 'False' for is_last_day when update CostRepor…
Browse files Browse the repository at this point in the history
…tConfig
  • Loading branch information
ImMin5 committed Jan 29, 2024
1 parent 8144bc8 commit 97a5f4d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ def update(
params.cost_report_config_id, params.domain_id
)

if params.is_last_day is None:
params.is_last_day = False

cost_report_config_vo = self.cost_report_mgr.update_cost_report_config_by_vo(
params.dict(exclude_unset=True), cost_report_config_vo
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ def create_cost_report_data(self, cost_report_config_vo: CostReportConfig):
data_source_ids=data_source_ids,
report_month=current_month,
issue_day=issue_day,
is_confirmed=False,
)

def _aggregate_monthly_cost_report_data(
Expand Down Expand Up @@ -233,7 +234,7 @@ def _aggregate_monthly_cost_report_data(
aggregated_cost_report.pop("data_source_id")
)
aggregated_cost_report["cost"] = {
ag_cost_report_currency: aggregated_cost_report.pop("cost")
ag_cost_report_currency: aggregated_cost_report.pop("cost", 0.0)
}
aggregated_cost_report["currency"] = currency
aggregated_cost_report["issue_date"] = f"{report_month}-{issue_day}"
Expand Down

0 comments on commit 97a5f4d

Please sign in to comment.