set/update/delete billing alert

This commit is contained in:
Čarodej
2021-12-17 10:44:50 +01:00
parent 04e46b7fcb
commit afb8323541
13 changed files with 307 additions and 96 deletions

View File

@@ -1,5 +1,4 @@
<?php
namespace App\Users\Actions;
use ByteUnits\Metric;
@@ -10,11 +9,10 @@ class FormatUsageEstimatesAction
public function __invoke(string $currency, Collection $usage)
{
return $usage->map(function ($estimate) use ($currency) {
// Format usage
$usage = match ($estimate['feature']) {
'bandwidth' => Metric::megabytes($estimate['usage'])->format(),
'storage' => Metric::megabytes($estimate['usage'])->format(),
'storage' => Metric::megabytes($estimate['usage'])->format(),
};
// Normalize units
@@ -28,4 +26,4 @@ class FormatUsageEstimatesAction
];
});
}
}
}