-
-
Notifications
You must be signed in to change notification settings - Fork 1
[Feature] Cost tracking with approval workflow for resources and organizational units #93
Copy link
Copy link
Open
Labels
component:backendBackend serviceBackend servicecomponent:databaseDatabaseDatabasepriority:highHigh priorityHigh prioritystatus:readyReady to work onReady to work ontype:featureNew feature or functionalityNew feature or functionality
Milestone
Description
User Story
As a cloud cost manager or resource owner, I want to track expenses and costs against resources, entities, and organizational units so that I can monitor spending and enforce cost governance with accountability. Costs should require approval from the owner of the associated resource or organizational unit to ensure spending is authorized and visible to stakeholders.
Acceptance Criteria
- Cost/expense records can be created and linked to entities (infrastructure resources)
- Cost/expense records can be linked to resources across providers (AWS, GCP, Azure, K8s)
- Cost/expense records can be linked to organizational units for hierarchical tracking
- Costs support multiple currencies and can be aggregated
- Optional URL field for linking to invoice, cost analysis, or related documentation
- Optional metadata field (JSON) for storing additional context: cost category, tags, business unit, project ID, etc.
- Approval workflow: pending costs require approval from owner of resource/entity/OU
- Owners receive notifications of pending cost approvals
- Approved costs are reflected in cost rollups and dashboards
- Cost history is maintained with audit trail (who approved, when, comments)
- API endpoints for cost CRUD operations: POST /api/v1/costs, GET, PATCH (approve/reject), DELETE
- Web UI pages for cost review, approval, and cost dashboard per resource/OU
- Cost aggregation by resource, entity, organizational unit, and date range
- Tests pass (unit + integration)
- Linting passes
- Security scan passes
Technical Notes
- Model: New
CostorExpensetable withresource_id,entity_id,organization_unit_id,amount,currency,status(pending/approved/rejected),owner_id,approved_at,approved_by,url(optional),metadata(optional JSON) - Approval workflow: Implement approval state machine; notify owners via user preferences
- Consider relationship to existing
entitiesand hierarchicalorganization_unitsfor rollups - Cost data should integrate with reporting/analytics dashboards
- Metadata schema: flexible JSON allowing cost_category, tags, business_unit, project_id, department, and custom fields
Related Tables
entities— resources to track costs fororganization_units— hierarchical OU for aggregationidentities— owners/approvers
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
component:backendBackend serviceBackend servicecomponent:databaseDatabaseDatabasepriority:highHigh priorityHigh prioritystatus:readyReady to work onReady to work ontype:featureNew feature or functionalityNew feature or functionality