Files
hdk-pay/tests/Feature/Invoice/QueryCaseInvoiceProductTest.php
李东云 4c5dde9020 feat(invoice): 引入点数价格值对象并更新发票产品结构
- 新增 PointPrice 值对象用于表示金额与货币符号
- 修改 InvoiceProduct 结构以支持多个 PointPrice 实例
- 更新 InvoiceProductRepo 以映射数据库中的价格数据
- 在测试中验证 prices 字段的正确性和类型安全
2025-11-25 16:01:25 +08:00

30 lines
829 B
PHP

<?php
/**
* QueryCaseInvoiceProductTest.php@Pay
*
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
* Powered by PhpStorm
* Created on 2025/8/28
*/
use Singularity\HDK\Pay\Domain\Invoice\Aggregate\Invoice\InvoiceProduct;
use Singularity\HDK\Pay\Domain\Invoice\Aggregate\Invoice\ValueObject\PointPrice;
use Singularity\HDK\Pay\Infrastructure\Repository\InvoiceProductRepo;
use function Hyperf\Support\make;
it('should can query case invoice product', function () {
/** @var InvoiceProductRepo $invoiceProductRepo */
$invoiceProductRepo = make(InvoiceProductRepo::class);
$caseId = '68affb136c01d';
$result = $invoiceProductRepo->getCaseProduct(caseId: $caseId);
expect($result)->toBeInstanceOf(InvoiceProduct::class)
->prices->toBeArray()
->each->toBeInstanceOf(PointPrice::class);
});