# ApprovePurchaseChangeOrder

## Permission Scope

purchaseOrder

## Overview

ApprovePurchaseChangeOrder moves a `SUBMITTED` change order to `APPROVED` status, signaling that the proposed changes have been reviewed and authorized for application to the purchase order.

## Business Rules

- Target change order must exist
- Only change orders in `SUBMITTED` status can be approved
- Approval does not modify the purchase order; changes take effect only when the change order is applied

## Process Flow

```mermaid
flowchart TD
    A[Receive approve request] --> B{Change order exists?}
    B -->|No| C[Return CO_NOT_FOUND]
    B -->|Yes| D{Status is SUBMITTED?}
    D -->|No| E[Return CO_NOT_SUBMITTED]
    D -->|Yes| F["Set status to APPROVED"]
    F --> G[Return approved change order]
```

## External Dependencies

- None

## Error Scenarios

- **CO_NOT_FOUND**: Target change order does not exist
- **CO_NOT_SUBMITTED**: Change order is not in `SUBMITTED` status

## Test Cases

- approves a valid submitted change order
- returns error when change order does not exist
- returns error when change order is not in SUBMITTED status
- returns error when change order is already APPROVED
