feat(WEB): FCM 푸시 알림, 입금 등록, 견적 저장 개선
- 수주 상세 페이지에서 수주확정 시 FCM 푸시 알림 발송 추가 - FCM 프리셋 함수 추가: 계약완료, 발주완료 알림 - 입금 등록 시 입금일, 입금계좌, 입금자명, 입금금액 입력 가능 - 견적 저장 시 토스트 메시지 정상 표시 수정 - ShipmentCreate SelectItem key prop 경고 수정 - DevToolbar 문법 오류 수정
This commit is contained in:
@@ -36,37 +36,35 @@ const WRITERS = ['드미트리', '김철수', '이영희', '박지민', '최서
|
||||
|
||||
/**
|
||||
* 견적 품목 1개 생성
|
||||
* @param index 품목 인덱스
|
||||
* @param products 제품 목록 (code, name, category 속성 필요)
|
||||
* @param category 제품 카테고리 (지정하지 않으면 랜덤 선택)
|
||||
*/
|
||||
export function generateQuoteItem(
|
||||
index: number,
|
||||
products?: FinishedGoods[]
|
||||
products?: Array<{ code: string; name: string; category?: string }>,
|
||||
category?: string
|
||||
): QuoteItem {
|
||||
const category = randomPick(PRODUCT_CATEGORIES);
|
||||
const selectedCategory = category || randomPick(PRODUCT_CATEGORIES);
|
||||
|
||||
// 카테고리에 맞는 제품 필터링
|
||||
let productName = '';
|
||||
let productCode = '';
|
||||
if (products && products.length > 0) {
|
||||
const categoryProducts = products.filter(p =>
|
||||
p.categoryCode?.toUpperCase() === category || !p.categoryCode
|
||||
p.category?.toUpperCase() === selectedCategory || !p.category
|
||||
);
|
||||
if (categoryProducts.length > 0) {
|
||||
productName = randomPick(categoryProducts).name;
|
||||
// item_code를 사용 (Select 컴포넌트의 value와 일치)
|
||||
productCode = randomPick(categoryProducts).code;
|
||||
}
|
||||
}
|
||||
|
||||
// 제품명이 없으면 기본값
|
||||
if (!productName) {
|
||||
productName = category === 'SCREEN'
|
||||
? randomPick(['방화스크린 FSC-1', '방화스크린 FSC-2', '방화스크린 FSC-3'])
|
||||
: randomPick(['방화철재셔터 FSD-1', '방화철재셔터 FSD-2']);
|
||||
}
|
||||
|
||||
return {
|
||||
id: tempId(),
|
||||
floor: randomFloor(),
|
||||
code: nextCode(),
|
||||
productCategory: category,
|
||||
productName,
|
||||
productCategory: selectedCategory,
|
||||
productName: productCode, // item_code 사용
|
||||
openWidth: String(randomInt100(2000, 5000)),
|
||||
openHeight: String(randomInt100(2000, 5000)),
|
||||
guideRailType: randomPick(GUIDE_RAIL_TYPES),
|
||||
@@ -82,13 +80,14 @@ export function generateQuoteItem(
|
||||
* 견적 폼 데이터 생성
|
||||
*/
|
||||
export interface GenerateQuoteDataOptions {
|
||||
clients?: Vendor[]; // 거래처 목록
|
||||
products?: FinishedGoods[]; // 제품 목록
|
||||
clients?: Array<{ id: string | number; name: string }>; // 거래처 목록
|
||||
products?: Array<{ code: string; name: string; category?: string }>; // 제품 목록 (code=item_code)
|
||||
itemCount?: number; // 품목 수 (기본: 1~5개 랜덤)
|
||||
category?: string; // 제품 카테고리 (지정하지 않으면 랜덤)
|
||||
}
|
||||
|
||||
export function generateQuoteData(options: GenerateQuoteDataOptions = {}): QuoteFormData {
|
||||
const { clients = [], products = [], itemCount } = options;
|
||||
const { clients = [], products = [], itemCount, category } = options;
|
||||
|
||||
// 부호 카운터 리셋
|
||||
resetCodeCounter();
|
||||
@@ -105,10 +104,11 @@ export function generateQuoteData(options: GenerateQuoteDataOptions = {}): Quote
|
||||
// 품목 수 결정
|
||||
const count = itemCount ?? randomInt(1, 5);
|
||||
|
||||
// 품목 생성
|
||||
// 품목 생성 (동일 카테고리 사용)
|
||||
const selectedCategory = category || randomPick(PRODUCT_CATEGORIES);
|
||||
const items: QuoteItem[] = [];
|
||||
for (let i = 0; i < count; i++) {
|
||||
items.push(generateQuoteItem(i, products));
|
||||
items.push(generateQuoteItem(i, products, selectedCategory));
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user