Skip to content

[Feature] Cost tracking with approval workflow for resources and organizational units #93

@PenguinzTech

Description

@PenguinzTech

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 Cost or Expense table with resource_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 entities and hierarchical organization_units for 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 for
  • organization_units — hierarchical OU for aggregation
  • identities — owners/approvers

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions