mirror of
http://124.126.16.154:8888/singularity/hdk-pay.git
synced 2026-01-15 07:15:06 +08:00
- 添加 ConsumeCmd 类用于消费操作 - 重构 RechargeCmd 类,使其返回自身以便链式调用 - 将 RechargeDto 重命名为 OrderDto,作为通用订单数据传输对象 - 更新 OrderRepoInterface 接口,使用新的命令和 DTO 类 - 修改 AccountBalanceRepo、OrderRepo 和 ProductRepo,移除不必要的选项参数 - 新增 CreateConsumptionOrderTest 测试用例 - 更新 CreateRechargeOrderTest 测试用例以使用新的命令和 DTO 类
35 lines
916 B
PHP
35 lines
916 B
PHP
<?php
|
|
|
|
/**
|
|
* CreateConsumptionOrderTest.php@Pay
|
|
*
|
|
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
|
* Powered by PhpStorm
|
|
* Created on 2025/8/18
|
|
*/
|
|
|
|
use Singularity\HDK\Pay\Application\Command\ConsumeCmd;
|
|
use Singularity\HDK\Pay\Application\Dto\Transaction\OrderDto;
|
|
use Singularity\HDK\Pay\Domain\Account\Enum\PointType;
|
|
use Singularity\HDK\Pay\Domain\Transaction\Enum\PayType;
|
|
use Singularity\HDK\Pay\Infrastructure\Repository\OrderRepo;
|
|
|
|
use function Hyperf\Support\make;
|
|
|
|
it('should can create consumption order', function () {
|
|
$uid = 'cn3321';
|
|
|
|
$cmd = (new ConsumeCmd(
|
|
uid: $uid,
|
|
type: PayType::Point,
|
|
method: PointType::FtaiAligner,
|
|
external: [],
|
|
externalID: null,
|
|
remark: '',
|
|
))->addItem('Design FTAI Aligner', 1, 5);
|
|
|
|
$repo = make(OrderRepo::class);
|
|
$result = $repo->consume($cmd);
|
|
expect($result)->toBeInstanceOf(OrderDto::class);
|
|
});
|