From ef4c533ebacc2cdc97e518f30e9a9350004fcdfb Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Mon, 28 Apr 2025 02:13:30 +0000
Subject: ~20250428 작업사항
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 db/migrations/0026_slimy_maddog.sql | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 db/migrations/0026_slimy_maddog.sql

(limited to 'db/migrations/0026_slimy_maddog.sql')

diff --git a/db/migrations/0026_slimy_maddog.sql b/db/migrations/0026_slimy_maddog.sql
new file mode 100644
index 00000000..96b50a41
--- /dev/null
+++ b/db/migrations/0026_slimy_maddog.sql
@@ -0,0 +1,7 @@
+CREATE VIEW "public"."vendors_with_types" AS (select "vendors"."id", "vendors"."vendor_name", "vendors"."vendor_code", "vendors"."tax_id", "vendors"."address", "vendors"."country", "vendors"."phone", "vendors"."email", "vendors"."website", "vendors"."status", "vendors"."vendor_type_id", "vendors"."representative_name", "vendors"."representative_birth", "vendors"."representative_email", "vendors"."representative_phone", "vendors"."corporate_registration_number", "vendors"."items", "vendors"."credit_agency", "vendors"."credit_rating", "vendors"."cash_flow_rating", "vendors"."created_at", "vendors"."updated_at", "vendor_types"."name_ko", "vendor_types"."name_en", "vendor_types"."code", 
+        CASE
+          WHEN "vendors"."status" = 'ACTIVE' THEN '정규업체'
+          WHEN "vendors"."status" IN ('INACTIVE', 'BLACKLISTED', 'REJECTED') THEN ''
+          ELSE '잠재업체'
+        END
+       as "vendor_category" from "vendors" left join "vendor_types" on "vendors"."vendor_type_id" = "vendor_types"."id");
\ No newline at end of file
-- 
cgit v1.2.3

