Skip to content

feat(finance): add product cost-sheet export contracts and remove legacy CalculateRMCost RPC - #54

Merged
ilramdhan merged 2 commits into
mutugading:mainfrom
ilramdhan:fix/production-plan-and-chat-bot-ai
Aug 7, 2026
Merged

feat(finance): add product cost-sheet export contracts and remove legacy CalculateRMCost RPC#54
ilramdhan merged 2 commits into
mutugading:mainfrom
ilramdhan:fix/production-plan-and-chat-bot-ai

Conversation

@ilramdhan

Copy link
Copy Markdown
Member

Description

This PR introduces protobuf contracts backing the asynchronous product cost-sheet export feature in the finance domain. Additionally, it removes the deprecated and unused synchronous CalculateRMCost RPC and its associated request/response messages, which have been superseded by the V2 cost calculation engine (TriggerRMCostCalculation).

Change Type

  • ✨ New service/message
  • ➕ Add field/RPC/enum value
  • 🔄 Modify validation
  • 📝 Documentation update
  • ⚠️ Deprecation
  • 🔧 Config/script changes

Proto Files Changed

  • common/v1/common.proto
  • finance/v1/uom.proto
  • Other: finance/v1/ (RMCostService, cost result, and export proto contracts)

Changes Made

  • Product Cost-Sheet Export Contracts:
    • Added new RPCs and messages for export workflow: RequestProductCostSheetExport, GetProductCostSheetDownloadURL, GetProductCostSheetExportJobStatus, ListCostSheetExportBatchChildren, GetBatchChildDownloadUrl, DownloadExportBatchZip, ListExportJobs, and GetRouteCostSheet.
    • Extended ListCostResultsRequest with product_type_ids, sort_by, and sort_order.
    • Added ListCostResultPeriods RPC and corresponding messages.
    • Added route_level field on CostRMDetail, and product_type_id / product_type_code on CostResult.
  • Legacy RPC Cleanup:
    • Removed synchronous CalculateRMCost RPC (and HTTP REST annotation) from RMCostService.
    • Removed CalculateRMCostRequest and CalculateRMCostResponse messages.
    • Confirmed zero active callers across frontend/BFF (production uses TriggerRMCostCalculation).

Related Issues

Fixes #
Related to #

Breaking Change Check

Is this a breaking change?

  • No - buf breaking passes
  • Yes - Requires version bump

Breaking Change Evidence

# Output of buf breaking command
buf breaking --against '.git#branch=main'
# Note: Removal of CalculateRMCost RPC and request/response messages triggers RPC_NO_DELETE / MESSAGE_NO_DELETE. Zero live callers verified prior to removal.

Lint Check

# Output of buf lint
buf lint

Generated Code Preview (Optional)

// Generated Go code changes for RMCostService and Export Job contracts

Pre-merge Checklist

  • I have read and followed RULES.md
  • buf format -w applied
  • buf lint passes
  • buf breaking passes (Removal of legacy V1 RPC)
  • Comments document new messages/fields
  • REST mappings follow conventions
  • Validation rules are complete
  • Field numbers are logical

Impact Assessment

  • Backend code regeneration required
  • Frontend code regeneration required
  • OpenAPI spec regeneration required

Reviewer Notes

  • CalculateRMCost was an admin-only synchronous V1 RPC that is no longer in use. Production recalculations strictly use the async TriggerRMCostCalculation RPC under the V2 engine.
  • New export contracts support batching, ZIP archive downloads, and route-stage snapshot queries.

ilramdhan and others added 2 commits August 6, 2026 16:09
CalculateRMCost was an admin-only synchronous RPC that ran the V1
consumption-only RM cost calculation. V1 has been fully replaced by the V2
engine (cascade + marketing + simulation), and the async
TriggerRMCostCalculation RPC is the only path production/UI ever call for
recalculation. Verified zero live callers of CalculateRMCost anywhere in
the frontend/BFF.

Removes the CalculateRMCostRequest/CalculateRMCostResponse messages and the
CalculateRMCost RPC (with its HTTP annotation) from RMCostService.

Authored-By: Ilham R <ilhamram332@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Adds the RPCs and messages backing the async product-cost-sheet export
feature: RequestProductCostSheetExport, GetProductCostSheetDownloadURL,
GetProductCostSheetExportJobStatus, ListCostSheetExportBatchChildren,
GetBatchChildDownloadUrl, DownloadExportBatchZip, ListExportJobs, and
GetRouteCostSheet (route-stage snapshot query). Also extends
ListCostResultsRequest with product_type_ids/sort_by/sort_order and adds
ListCostResultPeriods, plus route_level on CostRMDetail and
product_type_id/product_type_code on CostResult.

Authored-By: Ilham R <ilhamram332@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ilramdhan ilramdhan added this to the Costing Release Milestone milestone Aug 7, 2026
@ilramdhan ilramdhan self-assigned this Aug 7, 2026
Copilot AI lite review requested due to automatic review settings August 7, 2026 09:17
@ilramdhan ilramdhan added bug Something isn't working documentation Improvements or additions to documentation labels Aug 7, 2026
@ilramdhan ilramdhan added enhancement New feature or request feat fix labels Aug 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ilramdhan
ilramdhan merged commit 9e48dbe into mutugading:main Aug 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request feat fix

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants