feat(invoice): 添加发票金额和货币支持

- 在 CreateInvoiceCmd 中新增 price 和 currencySymbol 字段
- 在 Invoice 聚合根中集成 Money 对象并添加相关方法
- 更新 InvoiceRepo 以处理价格数据的序列化与反序列化
- 在测试中增加对新字段的验证
This commit is contained in:
李东云
2025-11-27 11:51:46 +08:00
parent 8a9971bc59
commit 244dd1220a
4 changed files with 52 additions and 10 deletions

View File

@@ -8,6 +8,7 @@
* Created on 2025/8/29
*/
use Money\Money;
use Psr\Http\Message\ResponseInterface;
use Singularity\HDK\Pay\Application\Command\CreateInvoiceCmd;
use Singularity\HDK\Pay\Domain\Invoice\Aggregate\Invoice\Invoice;
@@ -29,6 +30,8 @@ it('should can create invoice', function () {
state: "Illinois",
country: "United States",
zipCode: "67890-1234",
price: Money::EUR('19900'),
currencySymbol: '€'
),
);