# task-05-cost-centers.md

## Goal
Create hierarchical Cost Centers module.

## Database
Table: cost_centers

Fields:
- id
- code
- name (json translatable)
- parent_id
- branch_id
- is_active
- created_by
- updated_by
- timestamps

## Relations
CostCenter
- parent() belongsTo
- children() hasMany
- branch() belongsTo

## Files
app/Models/Finance/CostCenter.php
app/Services/Finance/CostCenterService.php
app/Http/Controllers/Admin/Finance/CostCenterController.php
app/Http/Requests/Admin/Finance/StoreCostCenterRequest.php
app/Http/Requests/Admin/Finance/UpdateCostCenterRequest.php

resources/views/dashboard/finance/cost_centers/

lang/ar/finance.php
lang/en/finance.php

## Permissions
finance.cost_centers.view
finance.cost_centers.create
finance.cost_centers.update
finance.cost_centers.delete

## Steps

### Step 1
Create migration for cost_centers

### Step 2
Create model with HasTranslations

### Step 3
Create service

### Step 4
Create requests

### Step 5
Create controller

### Step 6
Create views

### Step 7
Create lang files

