Skip to content

feat: add adjustment field to cost report#5940

Merged
yuda110 merged 4 commits intocloudforet-io:developfrom
yuda110:feature/cost-report-workspace-field
Jun 17, 2025
Merged

feat: add adjustment field to cost report#5940
yuda110 merged 4 commits intocloudforet-io:developfrom
yuda110:feature/cost-report-workspace-field

Conversation

@yuda110
Copy link
Member

@yuda110 yuda110 commented Jun 16, 2025

Skip Review (optional)

  • Minor changes that don't affect the functionality (e.g. style, chore, ci, test, docs)
  • Previously reviewed in feature branch, further review is not mandatory
  • Self-merge allowed for solo developers or urgent changes

Description (optional)

스크린샷 2025-06-16 오후 5 43 50

Things to Talk About (optional)

yuda110 added 3 commits June 16, 2025 15:57
Signed-off-by: yuda <yuda@megazone.com>
Signed-off-by: yuda <yuda@megazone.com>
Signed-off-by: yuda <yuda@megazone.com>
@vercel
Copy link

vercel bot commented Jun 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
console ⬜️ Ignored (Inspect) Visit Preview Jun 17, 2025 4:39am
web-storybook ⬜️ Ignored (Inspect) Visit Preview Jun 17, 2025 4:39am

@github-actions
Copy link
Contributor

🎉 @skdud4659 has been randomly selected as the reviewer! Please review. 🙏

@github-actions github-actions bot requested a review from skdud4659 June 16, 2025 08:44
@yuda110 yuda110 requested a review from Copilot June 17, 2025 01:30
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the cost report by adding an “Adjustment” field and grouping data by adjusted status, updates workspace grouping constants, and refactors sorting and filter logic.

  • Added is_adjusted to API queries and displayed an “Adjustment” column in trend and summary tables
  • Replaced WORKSPACE_NAME with WORKSPACE in constants and component props, and refactored monthly summary component to handle raw/refined data
  • Simplified date sorting in the store and moved status filter logic into the reports tab’s fetch function

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
cost-report-page-store.ts Simplified sorting logic for recentReportMonth
cost-explorer-constant.ts Changed COST_REPORT_GROUP_BY_ITEM_MAP key from WORKSPACE_NAME to WORKSPACE
CostReportReportsTab.vue Moved status filtering into getCostReportsList, removed inline filters
CostReportOverviewCostTrendChart.vue Updated label check to use GROUP_BY.WORKSPACE constant
CostReportOverviewCostTrendCard.vue Added is_adjusted grouping and updated selectedTarget constants
CostReportMonthlyTotalAmountSummaryCard.vue Refactored to separate raw/refined data, added adjusted_amount column, replaced old data structures
Comments suppressed due to low confidence (2)

apps/web/src/services/cost-explorer/components/CostReportReportsTab.vue:95

  • By removing filters entirely for admin mode, the behavior differs from the original (which applied both DONE and ADJUSTING). It’s clearer to explicitly set both statuses for admin, and to clear previous filters before setting new ones.
const costReportListApiQueryHelper = new ApiQueryHelper()
    .setSort('issue_date', true);

apps/web/src/services/cost-explorer/components/CostReportMonthlyTotalAmountSummaryCard.vue:20

  • The MenuItem type is for context menus, but this list feeds a select-button component. Please import the correct SelectButtonType to match the component’s expected prop type.
import type { MenuItem } from '@cloudforet/mirinae/types/controls/context-menu/type';

state.refinedData = getRefinedAnalyzeData(res);
} catch (e) {
state.data = {};
state.rawData = {};
Copy link

Copilot AI Jun 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assigning an empty object to rawData can break downstream code that expects an AnalyzeResponse shape. Consider resetting to undefined or a safe empty response (e.g., { results: [], more: false }).

Suggested change
state.rawData = {};
state.rawData = { results: [], more: false };

Copilot uses AI. Check for mistakes.
Copy link
Member

@skdud4659 skdud4659 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐱👍🏻

Signed-off-by: yuda <yuda@megazone.com>
@yuda110 yuda110 merged commit 9206fcc into cloudforet-io:develop Jun 17, 2025
5 checks passed
@yuda110 yuda110 deleted the feature/cost-report-workspace-field branch June 17, 2025 04:44
@github-actions github-actions bot mentioned this pull request Jul 9, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants