fix(WEB): FCM 모듈 오류 수정 및 중복 타입 제거

- fcm.ts: npm 패키지 import → window.Capacitor 전역 객체 사용
  - Capacitor 앱이 런타임에 주입하는 전역 객체 활용
  - 웹 빌드 시 '@capacitor/core' 모듈 오류 해결
- next.config.ts: Capacitor 패키지 webpack fallback 추가
- types.ts: VendorManagement 중복 선언 제거 (59줄 감소)
This commit is contained in:
2026-01-07 13:23:20 +09:00
parent df51cf6852
commit c367ba4ad9
3 changed files with 69 additions and 112 deletions

View File

@@ -274,63 +274,4 @@ export const VENDOR_CATEGORY_COLORS: Record<VendorCategory, string> = {
sales: 'bg-green-100 text-green-800',
purchase: 'bg-orange-100 text-orange-800',
both: 'bg-blue-100 text-blue-800',
};
// ===== API 데이터 타입 =====
export interface ClientApiData {
id: number;
tenant_id?: number;
client_code?: string;
name?: string;
client_type?: 'SALES' | 'PURCHASE' | 'BOTH';
contact_person?: string;
phone?: string;
mobile?: string;
fax?: string;
email?: string;
address?: string;
manager_name?: string;
manager_tel?: string;
system_manager?: string;
purchase_payment_day?: string;
sales_payment_day?: string;
business_no?: string;
business_type?: string;
business_item?: string;
account_id?: string;
memo?: string;
is_active?: boolean;
bad_debt?: boolean;
is_overdue?: boolean;
has_bad_debt?: boolean;
bad_debt_total?: number;
outstanding_amount?: number;
created_at: string;
updated_at: string;
}
export interface ApiResponse<T> {
success: boolean;
message?: string;
data?: T;
}
export interface PaginatedResponse<T> {
data: T[];
total: number;
page?: number;
size?: number;
}
// ===== API 타입 매핑 상수 =====
export const CLIENT_TYPE_TO_CATEGORY: Record<string, VendorCategory> = {
SALES: 'sales',
PURCHASE: 'purchase',
BOTH: 'both',
};
export const CATEGORY_TO_CLIENT_TYPE: Record<VendorCategory, string> = {
sales: 'SALES',
purchase: 'PURCHASE',
both: 'BOTH',
};