update email template

This commit is contained in:
baodev0
2026-09-09 16:56:22 +07:00
parent d3d9f76ba0
commit 2365ef72e9
210 changed files with 6335 additions and 4688 deletions
+2 -14
View File
@@ -83,7 +83,7 @@ class OrderService
$this->orderRepo->createItem($order->id, [
'product_id' => $product->id,
'billing_cycle' => $data['billing_cycle'],
'months' => $this->cycleToMonths($data['billing_cycle']),
'months' => OrderHelper::cycleToMonths($data['billing_cycle']),
'server_name' => $data['server_name'] ?? null,
'os_id' => $data['os_id'] ?? null,
'quantity' => 1,
@@ -151,7 +151,7 @@ class OrderService
private function provisionService(Order $order, OrderItem $item, $customer): void
{
$invoice = $order->invoice;
$months = $item->months ?: $this->cycleToMonths($item->billing_cycle);
$months = $item->months ?: OrderHelper::cycleToMonths($item->billing_cycle);
$expiresAt = now()->addMonths($months);
$service = Service::create([
@@ -253,18 +253,6 @@ class OrderService
// Helpers
// =========================================================================
private function cycleToMonths(?string $cycle): int
{
return match ($cycle) {
'monthly' => 1,
'quarterly' => 3,
'semi_annually' => 6,
'annually' => 12,
'biennially' => 24,
'triennially' => 36,
default => 1,
};
}
private function dispatchAdminNotification(Order $order, $customer): void
{