Files
sam-react-prod/src/types/today-issue.ts
권혁성 14186d98c0 fix(WEB): 알림 폴링 시 인증 에러 처리 및 토큰 자동 갱신
- ApiResponse 타입에 authError 플래그 추가
- today-issue.ts에 인증 에러 감지 로직 추가
- AuthenticatedLayout에서 authError 시 토큰 갱신 후 재시도
- 토큰 갱신 실패 시 폴링 중지하여 반복 에러 방지
2026-01-22 19:51:24 +09:00

73 lines
1.6 KiB
TypeScript

/**
* TodayIssue 관련 타입 정의
* API: api/app/Swagger/v1/TodayIssueApi.php 참조
*/
/** 알림 뱃지 타입 (헤더 알림용) */
export type TodayIssueBadge =
| '수주등록'
| '추심이슈'
| '안전재고'
| '지출 승인대기'
| '세금 신고'
| '결재 요청'
| '신규거래처';
/** 알림 설정 타입 */
export type NotificationType =
| 'sales_order' // 수주등록
| 'new_vendor' // 신규거래처
| 'approval_request' // 결재 요청
| 'bad_debt' // 추심이슈
| 'safety_stock' // 안전재고
| 'expected_expense' // 지출 승인대기
| 'vat_report'; // 세금 신고
/**
* 읽지 않은 이슈 항목 (헤더 알림용)
* TodayIssueUnreadItem 스키마
*/
export interface TodayIssueUnreadItem {
id: number;
badge: TodayIssueBadge;
notification_type: NotificationType;
content: string;
path: string | null;
needs_approval: boolean;
time: string;
created_at: string; // ISO 8601
}
/**
* 읽지 않은 이슈 목록 응답
* TodayIssueUnreadResponse 스키마
*/
export interface TodayIssueUnreadResponse {
items: TodayIssueUnreadItem[];
total: number;
}
/**
* 읽지 않은 이슈 개수 응답
* TodayIssueUnreadCountResponse 스키마
*/
export interface TodayIssueUnreadCountResponse {
count: number;
}
/**
* 모든 이슈 읽음 처리 응답
* TodayIssueMarkAllReadResponse 스키마
*/
export interface TodayIssueMarkAllReadResponse {
count: number;
}
/** API 응답 공통 래퍼 */
export interface ApiResponse<T> {
success: boolean;
message: string;
data: T;
/** 인증 에러 여부 (토큰 만료 등) */
authError?: boolean;
}