> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usefactor.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Tax Calculation Example

> Invoice tax logic analysis

## The PR

**Title**: Add sales tax to invoice calculations

**Summary**:
Currently, invoices show line items and totals, but no sales tax. This PR adds tax calculation based on the customer's location and item categories.

**Changes**:

* New `calculateTax()` function that calls a tax rate API
* Tax amount added to invoice total
* Invoice template updated to show tax line item

***

## Factor Analysis

### Verdict

```
BLOCK_REVIEW
```

The PR has critical gaps in error handling and validation that must be addressed before merging.

***

... (rest of file unchanged)
