first commit
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (8.3) (push) Has been cancelled
tests / ci (8.4) (push) Has been cancelled
tests / ci (8.5) (push) Has been cancelled

This commit is contained in:
brusnitsyn
2026-04-06 00:06:00 +09:00
commit fb2e6c58e3
409 changed files with 42953 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
<?php
test('that true is true', function () {
expect(true)->toBeTrue();
});

View File

@@ -0,0 +1,52 @@
<?php
use App\Services\Reports\MedicationExpenseService;
test('medication expense service calculates totals and totals without budget', function () {
$service = new MedicationExpenseService();
$totals = $service->calculateFromMatrix([
'oms' => [
'alcohol' => 100,
'narcotic' => 50,
'solutions' => 25,
'medicines' => 225,
'dressing' => 40,
],
'budget' => [
'alcohol' => 10,
'narcotic' => 5,
'solutions' => 0,
'medicines' => 35,
'dressing' => 15,
],
'paid' => [
'alcohol' => 20,
'narcotic' => 0,
'solutions' => 30,
'medicines' => 50,
'dressing' => 5,
],
'vmp_oms' => [
'alcohol' => 0,
'narcotic' => 10,
'solutions' => 10,
'medicines' => 30,
'dressing' => 20,
],
'vmp_budget' => [
'alcohol' => 5,
'narcotic' => 5,
'solutions' => 5,
'medicines' => 5,
'dressing' => 10,
],
]);
expect($totals['total_without_dressing'])->toBe(620.0)
->and($totals['total_dressing'])->toBe(90.0)
->and($totals['total_expense'])->toBe(710.0)
->and($totals['without_budget_no_dressing'])->toBe(570.0)
->and($totals['without_budget_dressing'])->toBe(75.0)
->and($totals['without_budget_total'])->toBe(645.0);
});

View File

@@ -0,0 +1,12 @@
<?php
use App\Models\ServiceEntry;
test('service entry calculates total amount from quantity and unit price', function () {
$entry = new ServiceEntry([
'quantity' => 2471,
'unit_price' => 15.50,
]);
expect($entry->totalAmount())->toBe(38300.5);
});