mirror of
http://124.126.16.154:8888/singularity/hdk-pay.git
synced 2026-01-15 05:35:08 +08:00
- 创建 Email 值对象用于封装邮箱信息 - 扩展 AccountRepoInterface 添加邮箱管理方法 - 重命名 AccountBalanceRepo 为 AccountRepo 并实现邮箱功能 - 更新相关测试用例和配置以适配新功能
54 lines
1.3 KiB
PHP
54 lines
1.3 KiB
PHP
<?php
|
|
|
|
/**
|
|
* InitialAccountBalanceTest.php@Pay
|
|
*
|
|
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
|
* Powered by PhpStorm
|
|
* Created on 2025/9/17
|
|
*/
|
|
|
|
use Carbon\Carbon;
|
|
use Singularity\HDK\Pay\Application\Command\InitialAccountCmd;
|
|
use Singularity\HDK\Pay\Domain\Account\Enum\PointType;
|
|
|
|
use Singularity\HDK\Pay\Infrastructure\Repository\AccountRepo;
|
|
|
|
use function Hyperf\Support\make;
|
|
|
|
it('should initial account balance', function () {
|
|
$uid = uniqid('TDD');
|
|
$data = [
|
|
[
|
|
'type' => 'aligner',
|
|
'basic' => 0,
|
|
'bonus' => 40,
|
|
'expired_at' => Carbon::now()->addYear(),
|
|
'version' => 'trial',
|
|
],
|
|
[
|
|
'type' => 'ema',
|
|
'basic' => 0,
|
|
'bonus' => 1,
|
|
'expired_at' => Carbon::now()->addYear(),
|
|
'version' => 'Trial',
|
|
],
|
|
];
|
|
|
|
$cmd = new InitialAccountCmd($uid);
|
|
foreach ($data as $point_balance) {
|
|
$cmd->addPointsBalance(
|
|
type: PointType::from($point_balance['type']),
|
|
basic: $point_balance['basic'],
|
|
bonus: $point_balance['bonus'],
|
|
expiredAt: $point_balance['expired_at'],
|
|
version: $point_balance['version'],
|
|
);
|
|
}
|
|
|
|
$repo = make(AccountRepo::class);
|
|
$repo->initial($cmd);
|
|
|
|
expect(true)->toBeTrue();
|
|
});
|