fix(user_type): 유형을 관리자(A)/사용자(U) 2가지로 통일
Deploy momo-erp / deploy (push) Successful in 1m42s

거래처/협력사 구분 제거 — 거래처 = 일반 사용자(U).
공급업체는 별도 supply_mng 테이블(공급업체 관리)에서 관리.

[UI]
- user-form 유형 셀렉트: 관리자/사용자 2개만 (거래처·협력사 제거)
- UserManagement 검색 구분 셀렉트: 관리자/사용자만
- profile 라벨: USER_TYPE='A' 면 '이름', 그 외 '업체명/이름'

[API/로직]
- signup: user_type='C' → 'U' / user_type_name '거래처' → '사용자'
- customers/list & customers/save: user_type='C' 강제 → user_type != 'A'

[운영 DB]
- 기존 user_type IN ('C','P') 134명 → 'U' 일괄 변경
  (분포: A 7명 / U 134명)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
chpark
2026-05-12 00:53:33 +09:00
parent a940c0735b
commit 4e85dd56fe
7 changed files with 7 additions and 9 deletions
+1 -1
View File
@@ -107,7 +107,7 @@ export default function ProfilePage() {
<input value={profile.USER_ID} disabled
className="w-full h-10 pl-9 pr-3 rounded-lg border border-slate-200 text-sm bg-slate-50 text-slate-500" />
</Field>
<Field icon={<Building2 size={14} />} label={profile.USER_TYPE === "C" ? "업체명" : "이름"}>
<Field icon={<Building2 size={14} />} label={profile.USER_TYPE === "A" ? "이름" : "업체명/이름"}>
<input value={profile.USER_NAME ?? ""}
onChange={(e) => setProfile({ ...profile, USER_NAME: e.target.value })}
className="w-full h-10 pl-9 pr-3 rounded-lg border border-slate-200 text-sm" />
-1
View File
@@ -333,7 +333,6 @@ function UserManagement() {
<option value=""></option>
<option value="A"></option>
<option value="U"></option>
<option value="P"></option>
</select>
</SearchField>
<SearchField label="부서명">
-2
View File
@@ -85,8 +85,6 @@ function UserForm() {
<option value=""></option>
<option value="A"></option>
<option value="U"></option>
<option value="C"></option>
<option value="P"></option>
</select></div>
<div><label className="block text-xs font-medium text-gray-500 mb-1"></label>
<Input value={form.ceo_name || ""} onChange={(e) => set("ceo_name", e.target.value)} /></div>
+2 -2
View File
@@ -41,8 +41,8 @@ export async function POST(request: NextRequest) {
email: result.user.email,
tel: "",
cellPhone: result.user.phone || "",
userType: "MOMO",
userTypeName: result.user.role === "ADMIN" ? "관리자" : "거래처",
userType: result.user.role === "ADMIN" ? "A" : "U",
userTypeName: result.user.role === "ADMIN" ? "관리자" : "사용자",
authName: result.user.role,
partnerCd: "",
isAdmin: result.user.isAdmin,
+2 -1
View File
@@ -10,7 +10,8 @@ export async function POST(req: NextRequest) {
const body = await req.json().catch(() => ({}));
const { keyword, status } = body as { keyword?: string; status?: string };
const conditions: string[] = ["user_type = 'C'"];
// 거래처 = 관리자 아닌 사용자 모두 (user_type='U' 또는 legacy 'C')
const conditions: string[] = ["COALESCE(user_type, '') NOT IN ('A')"];
const params: unknown[] = [];
let i = 1;
if (keyword) {
+1 -1
View File
@@ -40,7 +40,7 @@ export async function POST(req: NextRequest) {
status = COALESCE($8, status),
unlimited_qty = $9,
view_hidden = $10
WHERE user_id = $1 AND user_type = 'C'`,
WHERE user_id = $1 AND COALESCE(user_type, '') NOT IN ('A')`,
[userId, userName ?? null, email ?? null, cellPhone ?? null, bizNo ?? null,
ceoName ?? null, address ?? null, status ?? null, unlimited, view]
);
+1 -1
View File
@@ -112,7 +112,7 @@ export async function signupMomoUser(input: SignupInput): Promise<{ success: boo
`INSERT INTO user_info
(user_id, user_password, user_name, email, cell_phone,
user_type, user_type_name, biz_no, ceo_name, address, status, regdate)
VALUES ($1, $2, $3, $1, $4, 'C', '거래처', $5, $6, $7, 'active', NOW())`,
VALUES ($1, $2, $3, $1, $4, 'U', '사용자', $5, $6, $7, 'active', NOW())`,
[
email,
enc,