## ADDED Requirements

### Requirement: New Shop Credit Initialization From Customer Role

The shop creation flow SHALL initialize a newly created agent shop's actual credit from the selected customer role's default credit configuration.

#### Scenario: Create agent shop with enabled role default credit

- **GIVEN** 选中的客户角色已启用默认信用
- **AND** 该客户角色配置了默认信用额度
- **WHEN** 用户创建新的代理店铺
- **THEN** 新店铺的实际信用 MUST 初始化为启用状态
- **AND** 新店铺的实际信用额度 MUST 使用该客户角色的默认信用额度

#### Scenario: Create agent shop with disabled role default credit

- **GIVEN** 选中的客户角色未启用默认信用
- **WHEN** 用户创建新的代理店铺
- **THEN** 新店铺的实际信用 MUST 初始化为关闭状态
- **AND** 新店铺的实际信用额度 MUST be `0`

#### Scenario: Existing shop keeps actual credit after role default change

- **GIVEN** 店铺已经完成创建
- **WHEN** 用户修改该店铺所属客户角色的默认信用配置
- **THEN** 该店铺的实际信用启用状态 MUST NOT change
- **AND** 该店铺的实际信用额度 MUST NOT change

### Requirement: Shop Actual Credit Limit Update API

The frontend SHALL update an existing shop's actual credit limit through `PUT /api/admin/shops/{id}/credit-limit` with optimistic concurrency versioning.

#### Scenario: Submit shop actual credit update

- **GIVEN** 用户正在调整已有店铺实际信用额度
- **WHEN** 用户提交调整
- **THEN** 前端 MUST call `PUT /api/admin/shops/{id}/credit-limit`
- **AND** 请求体 MUST include `credit_enabled: bool`
- **AND** 请求体 MUST include `credit_limit: int64`
- **AND** 请求体 MUST include `version: int64`

#### Scenario: Disable shop actual credit

- **GIVEN** 用户正在调整已有店铺实际信用额度
- **WHEN** 用户关闭信用开关
- **THEN** 页面 MUST 将额度输入归零
- **AND** 提交时请求体 MUST include `credit_enabled=false`
- **AND** 提交时请求体 MUST include `credit_limit=0`
