From 8bbf436a3708c70c38eb93500bcae381edd0b420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Sat, 14 Mar 2026 16:32:42 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20[demo-tenant]=20=ED=94=84=EB=A1=9C?= =?UTF-8?q?=EB=AA=A8=EC=85=98=20=EC=84=A4=EC=A0=95=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 생성 모달에 프로모션 섹션 추가 (개발비 할인/면제, 구독료 할인, 무료기간) - Alpine.js 기반 슬라이더/토글 UI, 자동 비율 조절 - options JSON에 promotion 키로 프로모션 데이터 저장 - 상세 모달에 프로모션 조건 표시 --- .../Sales/DemoTenantController.php | 22 ++ .../partials/create-modal.blade.php | 199 +++++++++++++++++- .../partials/show-modal.blade.php | 50 +++++ 3 files changed, 269 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Sales/DemoTenantController.php b/app/Http/Controllers/Sales/DemoTenantController.php index 59f138c7..8d6f0c65 100644 --- a/app/Http/Controllers/Sales/DemoTenantController.php +++ b/app/Http/Controllers/Sales/DemoTenantController.php @@ -145,6 +145,13 @@ public function store(Request $request) 'email' => 'nullable|email|max:100', 'duration_days' => 'required|integer|min:7|max:60', 'preset' => 'nullable|string|in:manufacturing,none', + 'promo_dev_type' => 'nullable|string|in:percent,amount', + 'promo_dev_percent' => 'nullable|integer|min:0|max:50', + 'promo_dev_amount' => 'nullable|integer|min:0|max:5000000', + 'promo_dev_waive' => 'nullable|in:0,1', + 'promo_sub_percent' => 'nullable|integer|min:0|max:50', + 'promo_free_months' => 'nullable|integer|in:0,1,2,3,6', + 'promo_note' => 'nullable|string|max:200', ]); $partner = SalesPartner::where('user_id', auth()->id())->first(); @@ -158,6 +165,21 @@ public function store(Request $request) 'created_by_user_name' => auth()->user()->name ?? '', ]; + // 프로모션 설정 + if ($request->filled('promo_dev_type')) { + $options['promotion'] = [ + 'dev_discount_type' => $request->input('promo_dev_type'), + 'dev_discount_percent' => (int) $request->input('promo_dev_percent', 0), + 'dev_discount_amount' => (int) $request->input('promo_dev_amount', 0), + 'dev_waive' => $request->input('promo_dev_waive') === '1', + 'sub_discount_percent' => (int) $request->input('promo_sub_percent', 0), + 'free_months' => (int) $request->input('promo_free_months', 0), + 'note' => $request->input('promo_note', ''), + 'applied_at' => now()->toDateTimeString(), + 'applied_by_user_id' => auth()->id(), + ]; + } + $tenant = new Tenant; $tenant->forceFill([ 'company_name' => $request->input('company_name'), diff --git a/resources/views/sales/demo-tenants/partials/create-modal.blade.php b/resources/views/sales/demo-tenants/partials/create-modal.blade.php index 72e57e73..e7bab12d 100644 --- a/resources/views/sales/demo-tenants/partials/create-modal.blade.php +++ b/resources/views/sales/demo-tenants/partials/create-modal.blade.php @@ -1,5 +1,63 @@ {{-- 데모 체험 생성 모달 --}} -
+
@@ -18,7 +76,7 @@ hx-swap="none" @htmx:before-request="submitting = true" @htmx:after-request="submitting = false" - class="px-6 py-5 space-y-5"> + class="px-6 py-5 space-y-5 max-h-[75vh] overflow-y-auto"> @csrf @@ -68,6 +126,143 @@ class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 f

제조업 프리셋: 거래처, 품목, 수주, 생산 샘플 데이터가 자동 생성됩니다

+ +
+ +
+ + +
+ +
+
+

개발비(구축료) 할인

+ +
+ + + + +
+ + +
+

월 구독료 할인

+
+ + +
+
+ 0% + +
+
+ + +
+

무료 사용 기간

+
+ +
+
+ + +
+ + +
+ + + +
+ + + +

diff --git a/resources/views/sales/demo-tenants/partials/show-modal.blade.php b/resources/views/sales/demo-tenants/partials/show-modal.blade.php index dc6f5efd..f87a43c0 100644 --- a/resources/views/sales/demo-tenants/partials/show-modal.blade.php +++ b/resources/views/sales/demo-tenants/partials/show-modal.blade.php @@ -94,6 +94,56 @@

+ + @if(!empty($tenant->parsed_options['promotion'])) + @php $promo = $tenant->parsed_options['promotion']; @endphp +
+

프로모션 조건

+
+ {{-- 개발비 할인 --}} +
+ 개발비 할인 + + @if(!empty($promo['dev_waive'])) + 전액 면제 + @elseif(($promo['dev_discount_type'] ?? '') === 'percent' && ($promo['dev_discount_percent'] ?? 0) > 0) + {{ $promo['dev_discount_percent'] }}% + @elseif(($promo['dev_discount_type'] ?? '') === 'amount' && ($promo['dev_discount_amount'] ?? 0) > 0) + {{ number_format($promo['dev_discount_amount']) }}원 + @else + 없음 + @endif + +
+ {{-- 구독료 할인 --}} +
+ 구독료 할인 + + {{ ($promo['sub_discount_percent'] ?? 0) > 0 ? $promo['sub_discount_percent'] . '%' : '없음' }} + +
+ {{-- 무료 기간 --}} +
+ 무료 사용 기간 + + {{ ($promo['free_months'] ?? 0) > 0 ? $promo['free_months'] . '개월' : '없음' }} + +
+ {{-- 메모 --}} + @if(!empty($promo['note'])) +
+ 메모: + {{ $promo['note'] }} +
+ @endif + {{-- 적용일 --}} + @if(!empty($promo['applied_at'])) +

적용일: {{ $promo['applied_at'] }}

+ @endif +
+
+ @endif + @if(!empty($tenant->parsed_options['demo_extended']))