mirror of
http://124.126.16.154:8888/singularity/hdk-pay.git
synced 2026-01-15 05:55:08 +08:00
feat(invoice): 添加创建发票功能
- 新增 CreateInvoiceCmd 类作为创建发票的命令对象 - 创建 Address 类表示发票地址信息 - 实现 Invoice 类作为发票的领域模型 - 添加 InvoiceRepoInterface 接口和 InvoiceRepo 实现类,用于处理发票创建逻辑 - 编写 CreateInvoiceTest测试用例验证发票创建功能
This commit is contained in:
37
tests/Feature/Invoice/CreateInvoiceTest.php
Normal file
37
tests/Feature/Invoice/CreateInvoiceTest.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* CreateInvoiceTest.php@Pay
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2025/8/29
|
||||
*/
|
||||
|
||||
use Singularity\HDK\Pay\Application\Command\CreateInvoiceCmd;
|
||||
use Singularity\HDK\Pay\Domain\Invoice\Aggregate\Invoice;
|
||||
use Singularity\HDK\Pay\Infrastructure\Repository\InvoiceRepo;
|
||||
|
||||
use function Hyperf\Support\make;
|
||||
|
||||
it('should can create invoice', function () {
|
||||
$repo = make(InvoiceRepo::class);
|
||||
|
||||
$invoice = $repo->create(
|
||||
new CreateInvoiceCmd(
|
||||
uid: '61dbe752d4caa',
|
||||
caseId: '68affb136c01d',
|
||||
setFreqInvAddr: true,
|
||||
receiver: "dongyun.li@luxcreo.ai",
|
||||
patientName: "Ms. Jennifer Durgan",
|
||||
address: "12345 Magnolia Boulevard Northeast,Apartment 5678, Suite 910",
|
||||
city: "Springfield",
|
||||
state: "Illinois",
|
||||
country: "United States",
|
||||
zipCode: "67890-1234",
|
||||
),
|
||||
);
|
||||
|
||||
expect($invoice)
|
||||
->toBeInstanceOf(Invoice::class);
|
||||
});
|
||||
Reference in New Issue
Block a user