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");