feat: landing settings, instant withdraw deduct, and OTP site URL
Add has_landing plus landing_* deploy keys, deduct balance on withdraw request, keep app_url for SMS login links, and clarify Zarin rial wallet document titles. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit;
|
||||
|
||||
use App\Models\Withdraw;
|
||||
use App\Services\ZarinSyncService;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ZarinRialWalletDirectionTest extends TestCase
|
||||
{
|
||||
public function test_customer_rial_withdraw_is_direction_one_even_if_cash_positive(): void
|
||||
{
|
||||
$withdraw = new Withdraw([
|
||||
'type' => 2,
|
||||
'cash' => 200000000,
|
||||
'note' => 'برداشت ریالی',
|
||||
]);
|
||||
|
||||
$this->assertSame(1, app(ZarinSyncService::class)->rialWalletDirectionFromWithdraw($withdraw));
|
||||
}
|
||||
|
||||
public function test_admin_deposit_with_positive_cash_is_direction_zero(): void
|
||||
{
|
||||
$withdraw = new Withdraw([
|
||||
'type' => null,
|
||||
'cash' => 200000000,
|
||||
'note' => 'افزایش موجودی',
|
||||
]);
|
||||
|
||||
$this->assertSame(0, app(ZarinSyncService::class)->rialWalletDirectionFromWithdraw($withdraw));
|
||||
}
|
||||
|
||||
public function test_admin_deduction_with_negative_cash_is_direction_one(): void
|
||||
{
|
||||
$withdraw = new Withdraw([
|
||||
'cash' => -50000000,
|
||||
'note' => 'کسر',
|
||||
]);
|
||||
|
||||
$this->assertSame(1, app(ZarinSyncService::class)->rialWalletDirectionFromWithdraw($withdraw));
|
||||
}
|
||||
|
||||
public function test_desc_bardasht_is_withdraw_and_variz_is_deposit(): void
|
||||
{
|
||||
$svc = app(ZarinSyncService::class);
|
||||
$this->assertSame(1, $svc->rialWalletDirectionFromDesc('برداشت وجه'));
|
||||
$this->assertSame(0, $svc->rialWalletDirectionFromDesc('واریز وجه'));
|
||||
$this->assertSame(0, $svc->rialWalletDirectionFromDesc('واریز — افزایش موجودی'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user