Files
sam-docs/features/crm/customers.md
김보곤 157e8a95d5 docs:고객/거래처/채권관리 개발문서 추가 (5개 메뉴)
- 거래처관리: vendor/freelancer 타입, OCR 명함인식
- 고객사관리: VIP/Gold/Silver/Bronze 등급, 업종별 관리
- 미수금관리: 부분/전액 수금, 연체 추적, API 서비스
- 미지급금관리: 부분/전액 지급, 세금계산서 추적
- 환불/해지관리: 승인 워크플로우, refund/cancel 타입

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 16:54:06 +09:00

3.9 KiB

고객사관리

개요

고객사관리는 회사의 고객사 정보를 등급별로 관리하는 기능입니다. 고객사 CRUD, 등급 분류(VIP/Gold/Silver/Bronze), 업종별 관리, 담당자 정보를 지원합니다.

  • 라우트: GET /finance/customers
  • 라우트 이름: finance.customers
  • UI 기술: React 18 + Babel (브라우저 트랜스파일링)

파일 구조

mng/
├── app/Http/Controllers/Finance/
│   └── CustomerController.php             # 메인 컨트롤러 (4개 메서드)
├── app/Models/Finance/
│   └── Customer.php                       # 고객사 모델
└── resources/views/finance/
    └── customers.blade.php                # React 기반 단일 페이지

api/
└── database/migrations/
    └── 2026_02_04_230001_create_customers_table.php

라우트

// routes/web.php (finance prefix 그룹 내)
GET    /customers             페이지 렌더링 (HX-Redirect)

// API 라우트 (customers prefix)
GET    /customers/list        index()     고객사 목록 (JSON)
POST   /customers/store       store()     고객사 등록
PUT    /customers/{id}        update()    고객사 수정
DELETE /customers/{id}        destroy()   고객사 삭제

컨트롤러

CustomerController

메서드 HTTP 설명
index() GET 고객사 목록 (검색, 등급/상태 필터)
store() POST 고객사 등록 (name 필수)
update() PUT 고객사 수정
destroy() DELETE 고객사 삭제 (Soft Delete)

index() 응답 구조

{
  "success": true,
  "data": [...],
  "stats": {
    "total": 100,
    "active": 85,
    "vip": 10,
    "inactive": 15
  }
}

모델

Customer

테이블: customers

필드 타입 설명
tenant_id bigint 테넌트 ID
name string(100) 고객사명
biz_no string(20) 사업자번호
ceo string(50) 대표자명
industry string(50) 업종
grade string(20) 등급 (기본: Silver)
contact string(50) 연락처
email string(100) 이메일
address string(200) 주소
manager string(50) 담당자명
manager_phone string(20) 담당자 연락처
status string(20) active / inactive
memo text 메모
  • SoftDeletes 적용
  • Scope: forTenant($tenantId)

등급 (grade)

등급 설명
VIP 최우수 고객
Gold 우수 고객
Silver 일반 고객 (기본값)
Bronze 신규/소규모 고객

업종 목록

IT/소프트웨어, 제조업, 서비스업, 유통업, 금융업, 기타

뷰 구성 (React)

customers.blade.php

┌─ 페이지 헤더 ──────────────────────
│  제목: "고객사관리"
│  [CSV 내보내기] [등록] 버튼
│
├─ 통계 카드 (4열) ──────────────────
│  전체 | 활성 | VIP | 비활성
│
├─ 필터 영역 ────────────────────────
│  검색 (고객사명, 대표자, 담당자) | 등급 필터 | 상태 필터
│
├─ 고객사 목록 테이블 ───────────────
│  고객사명 | 사업자번호 | 대표자 | 업종 | 등급 | 연락처 | 이메일 | 담당자 | 상태
│  └─ 등급: VIP(보라), Gold(노랑), Silver(회색), Bronze(갈색) 배지
│
├─ 등록/수정 모달 ───────────────────
│  고객사명, 사업자번호, 대표자명
│  업종, 등급, 연락처, 이메일, 주소
│  담당자, 담당자 연락처, 상태, 메모
│
└─ 비어있을 때: 안내 메시지

HTMX 호환성

  • React 기반 페이지이므로 HX-Redirect 필요
  • @push('scripts') 블록에 React/Babel 스크립트 포함