[feat] negodata/front: 협상대화 카드내용 렌더 + 견적상세 헤더·테이블 UI 정리

- 협상대화: 사용 카드 번호/멘트(Slate 서식본)/와일드 조건·메모 표시, SlateRenderer
  밑줄·헥스색·{변수} 치환 보정, 말풍선 우측정렬·발신자 아바타 제거
- 견적상세 헤더: DB 컬럼명 라벨 제거, 견적정보/(진행상태+세팅)/상품(이미지) 2열 재배치,
  협상카드 탭에 사용 카드 수 표시
- DataTable 행 패딩 축소, 협력사명 아바타 제거, 카드관리 본인 카드 안내문
- orval 재생성(QuotationCardData 신규 필드)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Mina Choi 2026-06-18 16:21:58 +09:00
parent df68609c49
commit 7186446068
114 changed files with 4731 additions and 5537 deletions

View File

@ -14,7 +14,6 @@
"@hookform/resolvers": "^5.4.0", "@hookform/resolvers": "^5.4.0",
"@tailwindcss/vite": "^4.1.14", "@tailwindcss/vite": "^4.1.14",
"@tanstack/react-query": "^5.62.0", "@tanstack/react-query": "^5.62.0",
"@tanstack/react-router": "^1.170.15",
"@vitejs/plugin-react": "^5.0.4", "@vitejs/plugin-react": "^5.0.4",
"class-variance-authority": "^0.7.1", "class-variance-authority": "^0.7.1",
"clsx": "^2.1.1", "clsx": "^2.1.1",
@ -27,6 +26,10 @@
"react-hook-form": "^7.79.0", "react-hook-form": "^7.79.0",
"react-router": "^7.17.0", "react-router": "^7.17.0",
"shadcn": "^4.11.0", "shadcn": "^4.11.0",
"slate": "^0.118.1",
"slate-dom": "^0.119.0",
"slate-history": "^0.113.1",
"slate-react": "^0.119.0",
"sonner": "^2.0.7", "sonner": "^2.0.7",
"tailwind-merge": "^3.6.0", "tailwind-merge": "^3.6.0",
"tw-animate-css": "^1.4.0", "tw-animate-css": "^1.4.0",
@ -36,8 +39,6 @@
"zustand": "^5.0.14" "zustand": "^5.0.14"
}, },
"devDependencies": { "devDependencies": {
"@tanstack/router-cli": "^1.167.17",
"@tanstack/router-plugin": "^1.168.18",
"@types/express": "^4.17.21", "@types/express": "^4.17.21",
"@types/node": "^22.14.0", "@types/node": "^22.14.0",
"@types/react": "^19.2.17", "@types/react": "^19.2.17",
@ -1456,6 +1457,12 @@
"jsep": "^0.4.0||^1.0.0" "jsep": "^0.4.0||^1.0.0"
} }
}, },
"node_modules/@juggle/resize-observer": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/@juggle/resize-observer/-/resize-observer-3.4.0.tgz",
"integrity": "sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==",
"license": "Apache-2.0"
},
"node_modules/@modelcontextprotocol/sdk": { "node_modules/@modelcontextprotocol/sdk": {
"version": "1.29.0", "version": "1.29.0",
"resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.29.0.tgz", "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.29.0.tgz",
@ -3533,19 +3540,6 @@
"vite": "^5.2.0 || ^6 || ^7 || ^8" "vite": "^5.2.0 || ^6 || ^7 || ^8"
} }
}, },
"node_modules/@tanstack/history": {
"version": "1.162.0",
"resolved": "https://registry.npmjs.org/@tanstack/history/-/history-1.162.0.tgz",
"integrity": "sha512-79pf/RkhteYZTRgcR4F9kbk84P2N8rugQJswxfIqovlbRiT3yI7eBE+5QorIrZaOKktsgzRlXh1l/du/xpl4iA==",
"license": "MIT",
"engines": {
"node": ">=20.19"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
}
},
"node_modules/@tanstack/query-core": { "node_modules/@tanstack/query-core": {
"version": "5.101.0", "version": "5.101.0",
"resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.101.0.tgz", "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.101.0.tgz",
@ -3572,269 +3566,6 @@
"react": "^18 || ^19" "react": "^18 || ^19"
} }
}, },
"node_modules/@tanstack/react-router": {
"version": "1.170.15",
"resolved": "https://registry.npmjs.org/@tanstack/react-router/-/react-router-1.170.15.tgz",
"integrity": "sha512-GawYz7HEjj8rTUUDoT/SemDEVm63pZUO+2mOcXHY9Jl3EwMS5gFBnPu/2UvcrwRm1jN1k79fokc0d4aFmrLatg==",
"license": "MIT",
"dependencies": {
"@tanstack/history": "1.162.0",
"@tanstack/react-store": "^0.9.3",
"@tanstack/router-core": "1.171.13",
"isbot": "^5.1.22"
},
"engines": {
"node": ">=20.19"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"peerDependencies": {
"react": ">=18.0.0 || >=19.0.0",
"react-dom": ">=18.0.0 || >=19.0.0"
}
},
"node_modules/@tanstack/react-store": {
"version": "0.9.3",
"resolved": "https://registry.npmjs.org/@tanstack/react-store/-/react-store-0.9.3.tgz",
"integrity": "sha512-y2iHd/N9OkoQbFJLUX1T9vbc2O9tjH0pQRgTcx1/Nz4IlwLvkgpuglXUx+mXt0g5ZDFrEeDnONPqkbfxXJKwRg==",
"license": "MIT",
"dependencies": {
"@tanstack/store": "0.9.3",
"use-sync-external-store": "^1.6.0"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
}
},
"node_modules/@tanstack/router-cli": {
"version": "1.167.17",
"resolved": "https://registry.npmjs.org/@tanstack/router-cli/-/router-cli-1.167.17.tgz",
"integrity": "sha512-kws9PNdspkHbeZG6aLDjjpgH/hg7Q565BdSW9hHrjKmXPq/at7OKxQnA76aw9dJiJqy9OmST2RdOKlMEog43+g==",
"dev": true,
"license": "MIT",
"dependencies": {
"@tanstack/router-generator": "1.167.17",
"chokidar": "^5.0.0",
"yargs": "^17.7.2"
},
"bin": {
"tsr": "bin/tsr.cjs"
},
"engines": {
"node": ">=20.19"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
}
},
"node_modules/@tanstack/router-cli/node_modules/chokidar": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-5.0.0.tgz",
"integrity": "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==",
"dev": true,
"license": "MIT",
"dependencies": {
"readdirp": "^5.0.0"
},
"engines": {
"node": ">= 20.19.0"
},
"funding": {
"url": "https://paulmillr.com/funding/"
}
},
"node_modules/@tanstack/router-cli/node_modules/readdirp": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-5.0.0.tgz",
"integrity": "sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 20.19.0"
},
"funding": {
"type": "individual",
"url": "https://paulmillr.com/funding/"
}
},
"node_modules/@tanstack/router-core": {
"version": "1.171.13",
"resolved": "https://registry.npmjs.org/@tanstack/router-core/-/router-core-1.171.13.tgz",
"integrity": "sha512-+NOwEj1kO/6IGmpHRIZHasYxYWpyBQGNIZAST9aNrk9Q3YlU9SgqVnl1pbLa9qAKfeNdXQIRve0RQb/0kyDeDA==",
"license": "MIT",
"dependencies": {
"@tanstack/history": "1.162.0",
"cookie-es": "^3.0.0",
"seroval": "^1.5.4",
"seroval-plugins": "^1.5.4"
},
"engines": {
"node": ">=20.19"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
}
},
"node_modules/@tanstack/router-generator": {
"version": "1.167.17",
"resolved": "https://registry.npmjs.org/@tanstack/router-generator/-/router-generator-1.167.17.tgz",
"integrity": "sha512-xtB9tB2Ws0tWR6Pi7nc3Qk9IYgoh1mQCKWjHqIl9tf6BNUpKoqniJoPAQ4+LGrK8FeZYU0o0p/qlZEyj9FAulA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/types": "^7.28.5",
"@tanstack/router-core": "1.171.13",
"@tanstack/router-utils": "1.162.2",
"@tanstack/virtual-file-routes": "1.162.0",
"jiti": "^2.7.0",
"magic-string": "^0.30.21",
"prettier": "^3.5.0",
"zod": "^4.4.3"
},
"engines": {
"node": ">=20.19"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
}
},
"node_modules/@tanstack/router-plugin": {
"version": "1.168.18",
"resolved": "https://registry.npmjs.org/@tanstack/router-plugin/-/router-plugin-1.168.18.tgz",
"integrity": "sha512-MofS28/axfnfnhOD2RSgJEaU882aX5RsAzhGz5Vc4XhAmvCjy919u9JrNs4QsTWFbTD1P7IJ8WFlFVsrg0pStg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/core": "^7.28.5",
"@babel/template": "^7.27.2",
"@babel/types": "^7.28.5",
"@tanstack/router-core": "1.171.13",
"@tanstack/router-generator": "1.167.17",
"@tanstack/router-utils": "1.162.2",
"chokidar": "^5.0.0",
"unplugin": "^3.0.0",
"zod": "^4.4.3"
},
"engines": {
"node": ">=20.19"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"peerDependencies": {
"@rsbuild/core": ">=1.0.2 || ^2.0.0",
"@tanstack/react-router": "^1.170.15",
"vite": ">=5.0.0 || >=6.0.0 || >=7.0.0 || >=8.0.0",
"vite-plugin-solid": "^2.11.10 || ^3.0.0-0",
"webpack": ">=5.92.0"
},
"peerDependenciesMeta": {
"@rsbuild/core": {
"optional": true
},
"@tanstack/react-router": {
"optional": true
},
"vite": {
"optional": true
},
"vite-plugin-solid": {
"optional": true
},
"webpack": {
"optional": true
}
}
},
"node_modules/@tanstack/router-plugin/node_modules/chokidar": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-5.0.0.tgz",
"integrity": "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==",
"dev": true,
"license": "MIT",
"dependencies": {
"readdirp": "^5.0.0"
},
"engines": {
"node": ">= 20.19.0"
},
"funding": {
"url": "https://paulmillr.com/funding/"
}
},
"node_modules/@tanstack/router-plugin/node_modules/readdirp": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-5.0.0.tgz",
"integrity": "sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 20.19.0"
},
"funding": {
"type": "individual",
"url": "https://paulmillr.com/funding/"
}
},
"node_modules/@tanstack/router-utils": {
"version": "1.162.2",
"resolved": "https://registry.npmjs.org/@tanstack/router-utils/-/router-utils-1.162.2.tgz",
"integrity": "sha512-hTWqJtqIFFdvuCl8WXNyrodp2L9zo2G37xKRrcVmVRWpAB2h+U1LuRAfS4tsFTiWOIoE/B+WDVFB8JpoEdw6jQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/generator": "^7.28.5",
"@babel/parser": "^7.28.5",
"@babel/types": "^7.28.5",
"ansis": "^4.1.0",
"babel-dead-code-elimination": "^1.0.12",
"diff": "^8.0.2",
"pathe": "^2.0.3",
"tinyglobby": "^0.2.15"
},
"engines": {
"node": ">=20.19"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
}
},
"node_modules/@tanstack/store": {
"version": "0.9.3",
"resolved": "https://registry.npmjs.org/@tanstack/store/-/store-0.9.3.tgz",
"integrity": "sha512-8reSzl/qGWGGVKhBoxXPMWzATSbZLZFWhwBAFO9NAyp0TxzfBP0mIrGb8CP8KrQTmvzXlR/vFPPUrHTLBGyFyw==",
"license": "MIT",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
}
},
"node_modules/@tanstack/virtual-file-routes": {
"version": "1.162.0",
"resolved": "https://registry.npmjs.org/@tanstack/virtual-file-routes/-/virtual-file-routes-1.162.0.tgz",
"integrity": "sha512-uhOeFyxLcU41HzvrxsGpiWdcMbScY1EDgbZ5K7DVRMYInbLYWAC0EA/kx9wXAoSM8q82bUG2hRl8+EAjE6XAbA==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=20.19"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
}
},
"node_modules/@ts-morph/common": { "node_modules/@ts-morph/common": {
"version": "0.27.0", "version": "0.27.0",
"resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.27.0.tgz", "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.27.0.tgz",
@ -4243,16 +3974,6 @@
"url": "https://github.com/chalk/ansi-styles?sponsor=1" "url": "https://github.com/chalk/ansi-styles?sponsor=1"
} }
}, },
"node_modules/ansis": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/ansis/-/ansis-4.3.1.tgz",
"integrity": "sha512-BJ8/l4R5LRE7hW9WdSuGYrLSHi2ynxeFpDFbH0K/CgNeY/tyhk+vO6TYxXC5r5CpUhNVX310xzPsN/H9lCdfOA==",
"dev": true,
"license": "ISC",
"engines": {
"node": ">=14"
}
},
"node_modules/argparse": { "node_modules/argparse": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
@ -4411,19 +4132,6 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/babel-dead-code-elimination": {
"version": "1.0.12",
"resolved": "https://registry.npmjs.org/babel-dead-code-elimination/-/babel-dead-code-elimination-1.0.12.tgz",
"integrity": "sha512-GERT7L2TiYcYDtYk1IpD+ASAYXjKbLTDPhBtYj7X1NuRMDTMtAx9kyBenub1Ev41lo91OHCKdmP+egTDmfQ7Ig==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/core": "^7.23.7",
"@babel/parser": "^7.23.6",
"@babel/traverse": "^7.23.7",
"@babel/types": "^7.23.6"
}
},
"node_modules/balanced-match": { "node_modules/balanced-match": {
"version": "4.0.4", "version": "4.0.4",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",
@ -4839,6 +4547,12 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/compute-scroll-into-view": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/compute-scroll-into-view/-/compute-scroll-into-view-3.1.1.tgz",
"integrity": "sha512-VRhuHOLoKYOy4UbilLbUzbYg93XLjv2PncJC50EuTWPA3gaja1UjBsUP/D/9/juV3vQFr6XBEzn9KCAHdUvOHw==",
"license": "MIT"
},
"node_modules/concat-map": { "node_modules/concat-map": {
"version": "0.0.1", "version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
@ -4882,12 +4596,6 @@
"node": ">= 0.6" "node": ">= 0.6"
} }
}, },
"node_modules/cookie-es": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/cookie-es/-/cookie-es-3.1.1.tgz",
"integrity": "sha512-UaXxwISYJPTr9hwQxMFYZ7kNhSXboMXP+Z3TRX6f1/NyaGPfuNUZOWP1pUEb75B2HjfklIYLVRfWiFZJyC6Npg==",
"license": "MIT"
},
"node_modules/cookie-signature": { "node_modules/cookie-signature": {
"version": "1.0.7", "version": "1.0.7",
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz",
@ -5236,6 +4944,19 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/direction": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/direction/-/direction-1.0.4.tgz",
"integrity": "sha512-GYqKi1aH7PJXxdhTeZBFrg8vUBeKXi+cNprXsC1kpJcbcVnV9wBsrOu1cQEdG0WeQwlfHiy3XvnKfIrJ2R0NzQ==",
"license": "MIT",
"bin": {
"direction": "cli.js"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/wooorm"
}
},
"node_modules/dotenv": { "node_modules/dotenv": {
"version": "17.4.2", "version": "17.4.2",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.4.2.tgz", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.4.2.tgz",
@ -6839,6 +6560,12 @@
"node": ">=0.10.0" "node": ">=0.10.0"
} }
}, },
"node_modules/is-hotkey": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/is-hotkey/-/is-hotkey-0.2.0.tgz",
"integrity": "sha512-UknnZK4RakDmTgz4PI1wIph5yxSs/mvChWs9ifnlXsKuXgWmOkY/hAE0H/k2MIqH0RlRye0i1oC07MCRSD28Mw==",
"license": "MIT"
},
"node_modules/is-in-ssh": { "node_modules/is-in-ssh": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-in-ssh/-/is-in-ssh-1.0.0.tgz", "resolved": "https://registry.npmjs.org/is-in-ssh/-/is-in-ssh-1.0.0.tgz",
@ -6957,6 +6684,15 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/is-plain-object": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
"integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==",
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/is-promise": { "node_modules/is-promise": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz",
@ -7166,15 +6902,6 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/isbot": {
"version": "5.1.42",
"resolved": "https://registry.npmjs.org/isbot/-/isbot-5.1.42.tgz",
"integrity": "sha512-/SXsVh7KpPRISrD4ffrGSxnTLlUBzEQUfWIusaJPrpJ93FW1P0YEZri5vAUkFsA0m2HRUhQRQadk2wJ+EeKowQ==",
"license": "Unlicense",
"engines": {
"node": ">=18"
}
},
"node_modules/isexe": { "node_modules/isexe": {
"version": "3.1.5", "version": "3.1.5",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.5.tgz", "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.5.tgz",
@ -7684,7 +7411,6 @@
"version": "4.18.1", "version": "4.18.1",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz",
"integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==", "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==",
"dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/lodash.isempty": { "node_modules/lodash.isempty": {
@ -8823,13 +8549,6 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/pathe": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz",
"integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==",
"dev": true,
"license": "MIT"
},
"node_modules/picocolors": { "node_modules/picocolors": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
@ -8937,22 +8656,6 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/prettier": {
"version": "3.8.4",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.4.tgz",
"integrity": "sha512-N2MylSdi48+5N/6S5j+maeHbUSIzzZ5uOcX5Hm4QpV8Dkb1HFjfAKTKX6yNPJQD9AhcT3ifHNB66tWTTJDi11Q==",
"dev": true,
"license": "MIT",
"bin": {
"prettier": "bin/prettier.cjs"
},
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
}
},
"node_modules/pretty-ms": { "node_modules/pretty-ms": {
"version": "9.3.0", "version": "9.3.0",
"resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.3.0.tgz", "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.3.0.tgz",
@ -9598,6 +9301,15 @@
"integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/scroll-into-view-if-needed": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/scroll-into-view-if-needed/-/scroll-into-view-if-needed-3.1.0.tgz",
"integrity": "sha512-49oNpRjWRvnU8NyGVmUaYG4jtTkNonFZI86MmGRDqBphEK2EXT9gdEUoQPZhuBM8yWHxCWbobltqYO5M4XrUvQ==",
"license": "MIT",
"dependencies": {
"compute-scroll-into-view": "^3.0.2"
}
},
"node_modules/semver": { "node_modules/semver": {
"version": "6.3.1", "version": "6.3.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
@ -9646,27 +9358,6 @@
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/seroval": {
"version": "1.5.4",
"resolved": "https://registry.npmjs.org/seroval/-/seroval-1.5.4.tgz",
"integrity": "sha512-46uFvgrXTVxZcUorgSSRZ4y+ieqLLQRMlG4bnCZKW3qI6BZm7Rg4ntMW4p1mILEEBZWrFlcpp0AyIIlM6jD9iw==",
"license": "MIT",
"engines": {
"node": ">=10"
}
},
"node_modules/seroval-plugins": {
"version": "1.5.4",
"resolved": "https://registry.npmjs.org/seroval-plugins/-/seroval-plugins-1.5.4.tgz",
"integrity": "sha512-S0xQPhUTefAhNvNWFg0c1J8qJArHt5KdtJ/cFAofo06KD1MVSeFWyl4iiu+ApDIuw0WhjpOfCdgConOfAnLgkw==",
"license": "MIT",
"engines": {
"node": ">=10"
},
"peerDependencies": {
"seroval": "^1.0"
}
},
"node_modules/serve-static": { "node_modules/serve-static": {
"version": "1.16.3", "version": "1.16.3",
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.3.tgz", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.3.tgz",
@ -9977,6 +9668,88 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/slate": {
"version": "0.118.1",
"resolved": "https://registry.npmjs.org/slate/-/slate-0.118.1.tgz",
"integrity": "sha512-6H1DNgnSwAFhq/pIgf+tLvjNzH912M5XrKKhP9Frmbds2zFXdSJ6L/uFNyVKxQIkPzGWPD0m+wdDfmEuGFH5Tg==",
"license": "MIT",
"dependencies": {
"immer": "^10.0.3",
"tiny-warning": "^1.0.3"
}
},
"node_modules/slate-dom": {
"version": "0.119.0",
"resolved": "https://registry.npmjs.org/slate-dom/-/slate-dom-0.119.0.tgz",
"integrity": "sha512-foc8a2NkE+1SldDIYaoqjhVKupt8RSuvHI868rfYOcypD4we5TT7qunjRKJ852EIRh/Ql8sSTepXgXKOUJnt1w==",
"license": "MIT",
"dependencies": {
"@juggle/resize-observer": "^3.4.0",
"direction": "^1.0.4",
"is-hotkey": "^0.2.0",
"is-plain-object": "^5.0.0",
"lodash": "^4.17.21",
"scroll-into-view-if-needed": "^3.1.0",
"tiny-invariant": "1.3.1"
},
"peerDependencies": {
"slate": ">=0.99.0"
}
},
"node_modules/slate-dom/node_modules/tiny-invariant": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.1.tgz",
"integrity": "sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==",
"license": "MIT"
},
"node_modules/slate-history": {
"version": "0.113.1",
"resolved": "https://registry.npmjs.org/slate-history/-/slate-history-0.113.1.tgz",
"integrity": "sha512-J9NSJ+UG2GxoW0lw5mloaKcN0JI0x2IA5M5FxyGiInpn+QEutxT1WK7S/JneZCMFJBoHs1uu7S7e6pxQjubHmQ==",
"license": "MIT",
"dependencies": {
"is-plain-object": "^5.0.0"
},
"peerDependencies": {
"slate": ">=0.65.3"
}
},
"node_modules/slate-react": {
"version": "0.119.0",
"resolved": "https://registry.npmjs.org/slate-react/-/slate-react-0.119.0.tgz",
"integrity": "sha512-snHqhQ1NkZXyuqG4JTxywRg1accho/hnioM2JIYqziaQQcgfqLi2Pe1AHL82WIC1pLWdzPjy2O7drnSbO0DBsQ==",
"license": "MIT",
"dependencies": {
"@juggle/resize-observer": "^3.4.0",
"direction": "^1.0.4",
"is-hotkey": "^0.2.0",
"lodash": "^4.17.21",
"scroll-into-view-if-needed": "^3.1.0",
"tiny-invariant": "1.3.1"
},
"peerDependencies": {
"react": ">=18.2.0",
"react-dom": ">=18.2.0",
"slate": ">=0.114.0",
"slate-dom": ">=0.116.0"
}
},
"node_modules/slate-react/node_modules/tiny-invariant": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.1.tgz",
"integrity": "sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==",
"license": "MIT"
},
"node_modules/slate/node_modules/immer": {
"version": "10.2.0",
"resolved": "https://registry.npmjs.org/immer/-/immer-10.2.0.tgz",
"integrity": "sha512-d/+XTN3zfODyjr89gM3mPq1WNX2B8pYsu7eORitdwyA2sBubnTl3laYlBk4sXY5FUa5qTZGBDPJICVbvqzjlbw==",
"license": "MIT",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/immer"
}
},
"node_modules/sonner": { "node_modules/sonner": {
"version": "2.0.7", "version": "2.0.7",
"resolved": "https://registry.npmjs.org/sonner/-/sonner-2.0.7.tgz", "resolved": "https://registry.npmjs.org/sonner/-/sonner-2.0.7.tgz",
@ -10311,6 +10084,12 @@
"integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==", "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/tiny-warning": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz",
"integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==",
"license": "MIT"
},
"node_modules/tinyglobby": { "node_modules/tinyglobby": {
"version": "0.2.17", "version": "0.2.17",
"resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz",
@ -11109,21 +10888,6 @@
"node": ">= 0.8" "node": ">= 0.8"
} }
}, },
"node_modules/unplugin": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/unplugin/-/unplugin-3.0.0.tgz",
"integrity": "sha512-0Mqk3AT2TZCXWKdcoaufeXNukv2mTrEZExeXlHIOZXdqYoHHr4n51pymnwV8x2BOVxwXbK2HLlI7usrqMpycdg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@jridgewell/remapping": "^2.3.5",
"picomatch": "^4.0.3",
"webpack-virtual-modules": "^0.6.2"
},
"engines": {
"node": "^20.19.0 || >=22.12.0"
}
},
"node_modules/update-browserslist-db": { "node_modules/update-browserslist-db": {
"version": "1.2.3", "version": "1.2.3",
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz",
@ -11369,13 +11133,6 @@
"dev": true, "dev": true,
"license": "BSD-2-Clause" "license": "BSD-2-Clause"
}, },
"node_modules/webpack-virtual-modules": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.6.2.tgz",
"integrity": "sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==",
"dev": true,
"license": "MIT"
},
"node_modules/whatwg-url": { "node_modules/whatwg-url": {
"version": "5.0.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",

View File

@ -30,6 +30,10 @@
"react-hook-form": "^7.79.0", "react-hook-form": "^7.79.0",
"react-router": "^7.17.0", "react-router": "^7.17.0",
"shadcn": "^4.11.0", "shadcn": "^4.11.0",
"slate": "^0.118.1",
"slate-dom": "^0.119.0",
"slate-history": "^0.113.1",
"slate-react": "^0.119.0",
"sonner": "^2.0.7", "sonner": "^2.0.7",
"tailwind-merge": "^3.6.0", "tailwind-merge": "^3.6.0",
"tw-animate-css": "^1.4.0", "tw-animate-css": "^1.4.0",

View File

@ -4,7 +4,10 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import { useMutation, useQuery } from "@tanstack/react-query"; import {
useMutation,
useQuery
} from '@tanstack/react-query';
import type { import type {
DataTag, DataTag,
DefinedInitialDataOptions, DefinedInitialDataOptions,
@ -17,8 +20,8 @@ import type {
UseMutationOptions, UseMutationOptions,
UseMutationResult, UseMutationResult,
UseQueryOptions, UseQueryOptions,
UseQueryResult, UseQueryResult
} from "@tanstack/react-query"; } from '@tanstack/react-query';
import type { import type {
HTTPValidationError, HTTPValidationError,
@ -27,361 +30,299 @@ import type {
ResCreateAccount, ResCreateAccount,
ResLogin, ResLogin,
ResMe, ResMe,
ResRefreshToken, ResRefreshToken
} from ".././model"; } from '.././model';
import { customFetch } from '../../mutator/custom-fetch';
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
import { customFetch } from "../../mutator/custom-fetch";
/** /**
* id/pw 로 로그인하고 JWT 토큰을 발급한다. * id/pw 로 로그인하고 JWT 토큰을 발급한다.
* @summary 로그인 * @summary 로그인
*/ */
export const login = (reqLogin: ReqLogin, signal?: AbortSignal) => { export const login = (
return customFetch<ResLogin>({ reqLogin: ReqLogin,
url: `/v1/auth/login`, options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
method: "POST", ) => {
headers: { "Content-Type": "application/json" },
data: reqLogin,
signal, return customFetch<ResLogin>(
}); {url: `/v1/auth/login`, method: 'POST',
}; headers: {'Content-Type': 'application/json', },
data: reqLogin, signal
},
options);
}
export const getLoginMutationOptions = <
TError = void | HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof login>>,
TError,
{ data: ReqLogin },
TContext
>;
}): UseMutationOptions<
Awaited<ReturnType<typeof login>>,
TError,
{ data: ReqLogin },
TContext
> => {
const mutationKey = ["login"];
const { mutation: mutationOptions } = options
? options.mutation &&
"mutationKey" in options.mutation &&
options.mutation.mutationKey
? options
: { ...options, mutation: { ...options.mutation, mutationKey } }
: { mutation: { mutationKey } };
const mutationFn: MutationFunction< export const getLoginMutationOptions = <TError = void | HTTPValidationError,
Awaited<ReturnType<typeof login>>, TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof login>>, TError,{data: ReqLogin}, TContext>, request?: SecondParameter<typeof customFetch>}
{ data: ReqLogin } ): UseMutationOptions<Awaited<ReturnType<typeof login>>, TError,{data: ReqLogin}, TContext> => {
> = (props) => {
const { data } = props ?? {};
return login(data); const mutationKey = ['login'];
}; const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
: {...options, mutation: {...options.mutation, mutationKey}}
: {mutation: { mutationKey, }, request: undefined};
return { mutationFn, ...mutationOptions };
};
export type LoginMutationResult = NonNullable<
Awaited<ReturnType<typeof login>>
>;
export type LoginMutationBody = ReqLogin;
export type LoginMutationError = void | HTTPValidationError;
/** const mutationFn: MutationFunction<Awaited<ReturnType<typeof login>>, {data: ReqLogin}> = (props) => {
const {data} = props ?? {};
return login(data,requestOptions)
}
return { mutationFn, ...mutationOptions }}
export type LoginMutationResult = NonNullable<Awaited<ReturnType<typeof login>>>
export type LoginMutationBody = ReqLogin
export type LoginMutationError = void | HTTPValidationError
/**
* @summary 로그인 * @summary 로그인
*/ */
export const useLogin = < export const useLogin = <TError = void | HTTPValidationError,
TError = void | HTTPValidationError, TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof login>>, TError,{data: ReqLogin}, TContext>, request?: SecondParameter<typeof customFetch>}
TContext = unknown, , queryClient?: QueryClient): UseMutationResult<
>( Awaited<ReturnType<typeof login>>,
options?: { TError,
mutation?: UseMutationOptions< {data: ReqLogin},
Awaited<ReturnType<typeof login>>, TContext
TError, > => {
{ data: ReqLogin },
TContext
>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof login>>,
TError,
{ data: ReqLogin },
TContext
> => {
const mutationOptions = getLoginMutationOptions(options);
return useMutation(mutationOptions, queryClient); const mutationOptions = getLoginMutationOptions(options);
};
/** return useMutation(mutationOptions, queryClient);
}
/**
* 새 계정을 생성한다. * 새 계정을 생성한다.
* @summary 계정 생성 * @summary 계정 생성
*/ */
export const createAccount = ( export const createAccount = (
reqCreateAccount: ReqCreateAccount, reqCreateAccount: ReqCreateAccount,
signal?: AbortSignal, options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
) => { ) => {
return customFetch<ResCreateAccount>({
url: `/v1/auth/create`,
method: "POST", return customFetch<ResCreateAccount>(
headers: { "Content-Type": "application/json" }, {url: `/v1/auth/create`, method: 'POST',
data: reqCreateAccount, headers: {'Content-Type': 'application/json', },
signal, data: reqCreateAccount, signal
}); },
}; options);
}
export const getCreateAccountMutationOptions = <
TError = void | HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof createAccount>>,
TError,
{ data: ReqCreateAccount },
TContext
>;
}): UseMutationOptions<
Awaited<ReturnType<typeof createAccount>>,
TError,
{ data: ReqCreateAccount },
TContext
> => {
const mutationKey = ["createAccount"];
const { mutation: mutationOptions } = options
? options.mutation &&
"mutationKey" in options.mutation &&
options.mutation.mutationKey
? options
: { ...options, mutation: { ...options.mutation, mutationKey } }
: { mutation: { mutationKey } };
const mutationFn: MutationFunction< export const getCreateAccountMutationOptions = <TError = void | HTTPValidationError,
Awaited<ReturnType<typeof createAccount>>, TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createAccount>>, TError,{data: ReqCreateAccount}, TContext>, request?: SecondParameter<typeof customFetch>}
{ data: ReqCreateAccount } ): UseMutationOptions<Awaited<ReturnType<typeof createAccount>>, TError,{data: ReqCreateAccount}, TContext> => {
> = (props) => {
const { data } = props ?? {};
return createAccount(data); const mutationKey = ['createAccount'];
}; const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
: {...options, mutation: {...options.mutation, mutationKey}}
: {mutation: { mutationKey, }, request: undefined};
return { mutationFn, ...mutationOptions };
};
export type CreateAccountMutationResult = NonNullable<
Awaited<ReturnType<typeof createAccount>>
>;
export type CreateAccountMutationBody = ReqCreateAccount;
export type CreateAccountMutationError = void | HTTPValidationError;
/** const mutationFn: MutationFunction<Awaited<ReturnType<typeof createAccount>>, {data: ReqCreateAccount}> = (props) => {
const {data} = props ?? {};
return createAccount(data,requestOptions)
}
return { mutationFn, ...mutationOptions }}
export type CreateAccountMutationResult = NonNullable<Awaited<ReturnType<typeof createAccount>>>
export type CreateAccountMutationBody = ReqCreateAccount
export type CreateAccountMutationError = void | HTTPValidationError
/**
* @summary 계정 생성 * @summary 계정 생성
*/ */
export const useCreateAccount = < export const useCreateAccount = <TError = void | HTTPValidationError,
TError = void | HTTPValidationError, TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createAccount>>, TError,{data: ReqCreateAccount}, TContext>, request?: SecondParameter<typeof customFetch>}
TContext = unknown, , queryClient?: QueryClient): UseMutationResult<
>( Awaited<ReturnType<typeof createAccount>>,
options?: { TError,
mutation?: UseMutationOptions< {data: ReqCreateAccount},
Awaited<ReturnType<typeof createAccount>>, TContext
TError, > => {
{ data: ReqCreateAccount },
TContext
>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof createAccount>>,
TError,
{ data: ReqCreateAccount },
TContext
> => {
const mutationOptions = getCreateAccountMutationOptions(options);
return useMutation(mutationOptions, queryClient); const mutationOptions = getCreateAccountMutationOptions(options);
};
/** return useMutation(mutationOptions, queryClient);
}
/**
* refresh 토큰으로 access 토큰을 재발급한다. * refresh 토큰으로 access 토큰을 재발급한다.
* @summary 액세스 토큰 갱신 * @summary 액세스 토큰 갱신
*/ */
export const refreshToken = (signal?: AbortSignal) => { export const refreshToken = (
return customFetch<ResRefreshToken>({
url: `/v1/auth/refresh_token`, options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
method: "POST", ) => {
signal,
});
}; return customFetch<ResRefreshToken>(
{url: `/v1/auth/refresh_token`, method: 'POST', signal
},
options);
}
export const getRefreshTokenMutationOptions = <
TError = void,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof refreshToken>>,
TError,
void,
TContext
>;
}): UseMutationOptions<
Awaited<ReturnType<typeof refreshToken>>,
TError,
void,
TContext
> => {
const mutationKey = ["refreshToken"];
const { mutation: mutationOptions } = options
? options.mutation &&
"mutationKey" in options.mutation &&
options.mutation.mutationKey
? options
: { ...options, mutation: { ...options.mutation, mutationKey } }
: { mutation: { mutationKey } };
const mutationFn: MutationFunction< export const getRefreshTokenMutationOptions = <TError = void,
Awaited<ReturnType<typeof refreshToken>>, TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof refreshToken>>, TError,void, TContext>, request?: SecondParameter<typeof customFetch>}
void ): UseMutationOptions<Awaited<ReturnType<typeof refreshToken>>, TError,void, TContext> => {
> = () => {
return refreshToken();
};
return { mutationFn, ...mutationOptions }; const mutationKey = ['refreshToken'];
}; const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
: {...options, mutation: {...options.mutation, mutationKey}}
: {mutation: { mutationKey, }, request: undefined};
export type RefreshTokenMutationResult = NonNullable<
Awaited<ReturnType<typeof refreshToken>>
>;
export type RefreshTokenMutationError = void;
/** const mutationFn: MutationFunction<Awaited<ReturnType<typeof refreshToken>>, void> = () => {
return refreshToken(requestOptions)
}
return { mutationFn, ...mutationOptions }}
export type RefreshTokenMutationResult = NonNullable<Awaited<ReturnType<typeof refreshToken>>>
export type RefreshTokenMutationError = void
/**
* @summary 액세스 토큰 갱신 * @summary 액세스 토큰 갱신
*/ */
export const useRefreshToken = <TError = void, TContext = unknown>( export const useRefreshToken = <TError = void,
options?: { TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof refreshToken>>, TError,void, TContext>, request?: SecondParameter<typeof customFetch>}
mutation?: UseMutationOptions< , queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof refreshToken>>, Awaited<ReturnType<typeof refreshToken>>,
TError, TError,
void, void,
TContext TContext
>; > => {
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof refreshToken>>,
TError,
void,
TContext
> => {
const mutationOptions = getRefreshTokenMutationOptions(options);
return useMutation(mutationOptions, queryClient); const mutationOptions = getRefreshTokenMutationOptions(options);
};
/** return useMutation(mutationOptions, queryClient);
}
/**
* 유효한 access 토큰이 있어야 호출 가능. 토큰의 유저+회사 정보를 반환한다. * 유효한 access 토큰이 있어야 호출 가능. 토큰의 유저+회사 정보를 반환한다.
* @summary 내 정보 * @summary 내 정보
*/ */
export const me = (signal?: AbortSignal) => { export const me = (
return customFetch<ResMe>({ url: `/v1/auth/me`, method: "GET", signal });
}; options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
) => {
return customFetch<ResMe>(
{url: `/v1/auth/me`, method: 'GET', signal
},
options);
}
export const getMeQueryKey = () => { export const getMeQueryKey = () => {
return [`/v1/auth/me`] as const; return [
}; `/v1/auth/me`
] as const;
}
export const getMeQueryOptions = <
TData = Awaited<ReturnType<typeof me>>, export const getMeQueryOptions = <TData = Awaited<ReturnType<typeof me>>, TError = void>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof me>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
TError = void, ) => {
>(options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof me>>, TError, TData>
>;
}) => {
const { query: queryOptions } = options ?? {};
const queryKey = queryOptions?.queryKey ?? getMeQueryKey(); const {query: queryOptions, request: requestOptions} = options ?? {};
const queryFn: QueryFunction<Awaited<ReturnType<typeof me>>> = ({ signal }) => const queryKey = queryOptions?.queryKey ?? getMeQueryKey();
me(signal);
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
Awaited<ReturnType<typeof me>>,
TError, const queryFn: QueryFunction<Awaited<ReturnType<typeof me>>> = ({ signal }) => me(requestOptions, signal);
TData
> & { queryKey: DataTag<QueryKey, TData, TError> };
};
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof me>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type MeQueryResult = NonNullable<Awaited<ReturnType<typeof me>>>
export type MeQueryError = void
export type MeQueryResult = NonNullable<Awaited<ReturnType<typeof me>>>;
export type MeQueryError = void;
export function useMe<TData = Awaited<ReturnType<typeof me>>, TError = void>( export function useMe<TData = Awaited<ReturnType<typeof me>>, TError = void>(
options: { options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof me>>, TError, TData>> & Pick<
query: Partial<
UseQueryOptions<Awaited<ReturnType<typeof me>>, TError, TData>
> &
Pick<
DefinedInitialDataOptions< DefinedInitialDataOptions<
Awaited<ReturnType<typeof me>>, Awaited<ReturnType<typeof me>>,
TError, TError,
Awaited<ReturnType<typeof me>> Awaited<ReturnType<typeof me>>
>, > , 'initialData'
"initialData" >, request?: SecondParameter<typeof customFetch>}
>; , queryClient?: QueryClient
}, ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useMe<TData = Awaited<ReturnType<typeof me>>, TError = void>( export function useMe<TData = Awaited<ReturnType<typeof me>>, TError = void>(
options?: { options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof me>>, TError, TData>> & Pick<
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof me>>, TError, TData>
> &
Pick<
UndefinedInitialDataOptions< UndefinedInitialDataOptions<
Awaited<ReturnType<typeof me>>, Awaited<ReturnType<typeof me>>,
TError, TError,
Awaited<ReturnType<typeof me>> Awaited<ReturnType<typeof me>>
>, > , 'initialData'
"initialData" >, request?: SecondParameter<typeof customFetch>}
>; , queryClient?: QueryClient
}, ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useMe<TData = Awaited<ReturnType<typeof me>>, TError = void>( export function useMe<TData = Awaited<ReturnType<typeof me>>, TError = void>(
options?: { options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof me>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
query?: Partial< , queryClient?: QueryClient
UseQueryOptions<Awaited<ReturnType<typeof me>>, TError, TData> ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
/** /**
* @summary 내 정보 * @summary 내 정보
*/ */
export function useMe<TData = Awaited<ReturnType<typeof me>>, TError = void>( export function useMe<TData = Awaited<ReturnType<typeof me>>, TError = void>(
options?: { options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof me>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
query?: Partial< , queryClient?: QueryClient
UseQueryOptions<Awaited<ReturnType<typeof me>>, TError, TData> ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
} {
const queryOptions = getMeQueryOptions(options);
const query = useQuery(queryOptions, queryClient) as UseQueryResult< const queryOptions = getMeQueryOptions(options)
TData,
TError
> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey; const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey ;
return query; return query;
} }

View File

@ -4,7 +4,10 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import { useMutation, useQuery } from "@tanstack/react-query"; import {
useMutation,
useQuery
} from '@tanstack/react-query';
import type { import type {
DataTag, DataTag,
DefinedInitialDataOptions, DefinedInitialDataOptions,
@ -17,8 +20,8 @@ import type {
UseMutationOptions, UseMutationOptions,
UseMutationResult, UseMutationResult,
UseQueryOptions, UseQueryOptions,
UseQueryResult, UseQueryResult
} from "@tanstack/react-query"; } from '@tanstack/react-query';
import type { import type {
HTTPValidationError, HTTPValidationError,
@ -27,525 +30,388 @@ import type {
ReqUpdateCard, ReqUpdateCard,
ResCard, ResCard,
ResCardList, ResCardList,
ResDeleteCard, ResDeleteCard
} from ".././model"; } from '.././model';
import { customFetch } from '../../mutator/custom-fetch';
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
import { customFetch } from "../../mutator/custom-fetch";
/** /**
* @summary 협상카드 목록 * @summary 협상카드 목록
*/ */
export const listCards = (params?: ListCardsParams, signal?: AbortSignal) => { export const listCards = (
return customFetch<ResCardList>({ params?: ListCardsParams,
url: `/v1/card/list`, options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
method: "GET",
params,
signal,
});
};
export const getListCardsQueryKey = (params?: ListCardsParams) => {
return [`/v1/card/list`, ...(params ? [params] : [])] as const;
};
export const getListCardsQueryOptions = <
TData = Awaited<ReturnType<typeof listCards>>,
TError = void | HTTPValidationError,
>(
params?: ListCardsParams,
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof listCards>>, TError, TData>
>;
},
) => { ) => {
const { query: queryOptions } = options ?? {};
return customFetch<ResCardList>(
{url: `/v1/card/list`, method: 'GET',
params, signal
},
options);
}
const queryKey = queryOptions?.queryKey ?? getListCardsQueryKey(params);
const queryFn: QueryFunction<Awaited<ReturnType<typeof listCards>>> = ({
signal,
}) => listCards(params, signal);
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< export const getListCardsQueryKey = (params?: ListCardsParams,) => {
Awaited<ReturnType<typeof listCards>>, return [
TError, `/v1/card/list`, ...(params ? [params]: [])
TData ] as const;
> & { queryKey: DataTag<QueryKey, TData, TError> }; }
};
export type ListCardsQueryResult = NonNullable<
Awaited<ReturnType<typeof listCards>> export const getListCardsQueryOptions = <TData = Awaited<ReturnType<typeof listCards>>, TError = void | HTTPValidationError>(params?: ListCardsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listCards>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
>; ) => {
export type ListCardsQueryError = void | HTTPValidationError;
export function useListCards< const {query: queryOptions, request: requestOptions} = options ?? {};
TData = Awaited<ReturnType<typeof listCards>>,
TError = void | HTTPValidationError, const queryKey = queryOptions?.queryKey ?? getListCardsQueryKey(params);
>(
params: undefined | ListCardsParams,
options: {
query: Partial< const queryFn: QueryFunction<Awaited<ReturnType<typeof listCards>>> = ({ signal }) => listCards(params, requestOptions, signal);
UseQueryOptions<Awaited<ReturnType<typeof listCards>>, TError, TData>
> &
Pick<
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listCards>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type ListCardsQueryResult = NonNullable<Awaited<ReturnType<typeof listCards>>>
export type ListCardsQueryError = void | HTTPValidationError
export function useListCards<TData = Awaited<ReturnType<typeof listCards>>, TError = void | HTTPValidationError>(
params: undefined | ListCardsParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listCards>>, TError, TData>> & Pick<
DefinedInitialDataOptions< DefinedInitialDataOptions<
Awaited<ReturnType<typeof listCards>>, Awaited<ReturnType<typeof listCards>>,
TError, TError,
Awaited<ReturnType<typeof listCards>> Awaited<ReturnType<typeof listCards>>
>, > , 'initialData'
"initialData" >, request?: SecondParameter<typeof customFetch>}
>; , queryClient?: QueryClient
}, ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
queryClient?: QueryClient, export function useListCards<TData = Awaited<ReturnType<typeof listCards>>, TError = void | HTTPValidationError>(
): DefinedUseQueryResult<TData, TError> & { params?: ListCardsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listCards>>, TError, TData>> & Pick<
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useListCards<
TData = Awaited<ReturnType<typeof listCards>>,
TError = void | HTTPValidationError,
>(
params?: ListCardsParams,
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof listCards>>, TError, TData>
> &
Pick<
UndefinedInitialDataOptions< UndefinedInitialDataOptions<
Awaited<ReturnType<typeof listCards>>, Awaited<ReturnType<typeof listCards>>,
TError, TError,
Awaited<ReturnType<typeof listCards>> Awaited<ReturnType<typeof listCards>>
>, > , 'initialData'
"initialData" >, request?: SecondParameter<typeof customFetch>}
>; , queryClient?: QueryClient
}, ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
queryClient?: QueryClient, export function useListCards<TData = Awaited<ReturnType<typeof listCards>>, TError = void | HTTPValidationError>(
): UseQueryResult<TData, TError> & { params?: ListCardsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listCards>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
queryKey: DataTag<QueryKey, TData, TError>; , queryClient?: QueryClient
}; ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useListCards<
TData = Awaited<ReturnType<typeof listCards>>,
TError = void | HTTPValidationError,
>(
params?: ListCardsParams,
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof listCards>>, TError, TData>
>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
/** /**
* @summary 협상카드 목록 * @summary 협상카드 목록
*/ */
export function useListCards< export function useListCards<TData = Awaited<ReturnType<typeof listCards>>, TError = void | HTTPValidationError>(
TData = Awaited<ReturnType<typeof listCards>>, params?: ListCardsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listCards>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
TError = void | HTTPValidationError, , queryClient?: QueryClient
>( ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
params?: ListCardsParams,
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof listCards>>, TError, TData>
>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
} {
const queryOptions = getListCardsQueryOptions(params, options);
const query = useQuery(queryOptions, queryClient) as UseQueryResult< const queryOptions = getListCardsQueryOptions(params,options)
TData,
TError
> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey; const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey ;
return query; return query;
} }
/** /**
* @summary 협상카드 등록 * @summary 협상카드 등록
*/ */
export const createCard = ( export const createCard = (
reqCreateCard: ReqCreateCard, reqCreateCard: ReqCreateCard,
signal?: AbortSignal, options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
) => { ) => {
return customFetch<ResCard>({
url: `/v1/card/create`,
method: "POST", return customFetch<ResCard>(
headers: { "Content-Type": "application/json" }, {url: `/v1/card/create`, method: 'POST',
data: reqCreateCard, headers: {'Content-Type': 'application/json', },
signal, data: reqCreateCard, signal
}); },
}; options);
}
export const getCreateCardMutationOptions = <
TError = void | HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof createCard>>,
TError,
{ data: ReqCreateCard },
TContext
>;
}): UseMutationOptions<
Awaited<ReturnType<typeof createCard>>,
TError,
{ data: ReqCreateCard },
TContext
> => {
const mutationKey = ["createCard"];
const { mutation: mutationOptions } = options
? options.mutation &&
"mutationKey" in options.mutation &&
options.mutation.mutationKey
? options
: { ...options, mutation: { ...options.mutation, mutationKey } }
: { mutation: { mutationKey } };
const mutationFn: MutationFunction< export const getCreateCardMutationOptions = <TError = void | HTTPValidationError,
Awaited<ReturnType<typeof createCard>>, TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createCard>>, TError,{data: ReqCreateCard}, TContext>, request?: SecondParameter<typeof customFetch>}
{ data: ReqCreateCard } ): UseMutationOptions<Awaited<ReturnType<typeof createCard>>, TError,{data: ReqCreateCard}, TContext> => {
> = (props) => {
const { data } = props ?? {};
return createCard(data); const mutationKey = ['createCard'];
}; const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
: {...options, mutation: {...options.mutation, mutationKey}}
: {mutation: { mutationKey, }, request: undefined};
return { mutationFn, ...mutationOptions };
};
export type CreateCardMutationResult = NonNullable<
Awaited<ReturnType<typeof createCard>>
>;
export type CreateCardMutationBody = ReqCreateCard;
export type CreateCardMutationError = void | HTTPValidationError;
/** const mutationFn: MutationFunction<Awaited<ReturnType<typeof createCard>>, {data: ReqCreateCard}> = (props) => {
const {data} = props ?? {};
return createCard(data,requestOptions)
}
return { mutationFn, ...mutationOptions }}
export type CreateCardMutationResult = NonNullable<Awaited<ReturnType<typeof createCard>>>
export type CreateCardMutationBody = ReqCreateCard
export type CreateCardMutationError = void | HTTPValidationError
/**
* @summary 협상카드 등록 * @summary 협상카드 등록
*/ */
export const useCreateCard = < export const useCreateCard = <TError = void | HTTPValidationError,
TError = void | HTTPValidationError, TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createCard>>, TError,{data: ReqCreateCard}, TContext>, request?: SecondParameter<typeof customFetch>}
TContext = unknown, , queryClient?: QueryClient): UseMutationResult<
>( Awaited<ReturnType<typeof createCard>>,
options?: { TError,
mutation?: UseMutationOptions< {data: ReqCreateCard},
Awaited<ReturnType<typeof createCard>>, TContext
TError, > => {
{ data: ReqCreateCard },
TContext
>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof createCard>>,
TError,
{ data: ReqCreateCard },
TContext
> => {
const mutationOptions = getCreateCardMutationOptions(options);
return useMutation(mutationOptions, queryClient); const mutationOptions = getCreateCardMutationOptions(options);
};
/** return useMutation(mutationOptions, queryClient);
}
/**
* @summary 협상카드 조회 * @summary 협상카드 조회
*/ */
export const getCard = (cardId: string, signal?: AbortSignal) => { export const getCard = (
return customFetch<ResCard>({ cardId: string,
url: `/v1/card/${cardId}`, options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
method: "GET",
signal,
});
};
export const getGetCardQueryKey = (cardId?: string) => {
return [`/v1/card/${cardId}`] as const;
};
export const getGetCardQueryOptions = <
TData = Awaited<ReturnType<typeof getCard>>,
TError = void | HTTPValidationError,
>(
cardId: string,
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof getCard>>, TError, TData>
>;
},
) => { ) => {
const { query: queryOptions } = options ?? {};
return customFetch<ResCard>(
{url: `/v1/card/${cardId}`, method: 'GET', signal
},
options);
}
const queryKey = queryOptions?.queryKey ?? getGetCardQueryKey(cardId);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getCard>>> = ({
signal,
}) => getCard(cardId, signal);
return { export const getGetCardQueryKey = (cardId?: string,) => {
queryKey, return [
queryFn, `/v1/card/${cardId}`
enabled: !!cardId, ] as const;
...queryOptions, }
} as UseQueryOptions<Awaited<ReturnType<typeof getCard>>, TError, TData> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
};
export type GetCardQueryResult = NonNullable<
Awaited<ReturnType<typeof getCard>> export const getGetCardQueryOptions = <TData = Awaited<ReturnType<typeof getCard>>, TError = void | HTTPValidationError>(cardId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getCard>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
>; ) => {
export type GetCardQueryError = void | HTTPValidationError;
export function useGetCard< const {query: queryOptions, request: requestOptions} = options ?? {};
TData = Awaited<ReturnType<typeof getCard>>,
TError = void | HTTPValidationError, const queryKey = queryOptions?.queryKey ?? getGetCardQueryKey(cardId);
>(
cardId: string,
options: {
query: Partial< const queryFn: QueryFunction<Awaited<ReturnType<typeof getCard>>> = ({ signal }) => getCard(cardId, requestOptions, signal);
UseQueryOptions<Awaited<ReturnType<typeof getCard>>, TError, TData>
> &
Pick<
return { queryKey, queryFn, enabled: !!(cardId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getCard>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetCardQueryResult = NonNullable<Awaited<ReturnType<typeof getCard>>>
export type GetCardQueryError = void | HTTPValidationError
export function useGetCard<TData = Awaited<ReturnType<typeof getCard>>, TError = void | HTTPValidationError>(
cardId: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getCard>>, TError, TData>> & Pick<
DefinedInitialDataOptions< DefinedInitialDataOptions<
Awaited<ReturnType<typeof getCard>>, Awaited<ReturnType<typeof getCard>>,
TError, TError,
Awaited<ReturnType<typeof getCard>> Awaited<ReturnType<typeof getCard>>
>, > , 'initialData'
"initialData" >, request?: SecondParameter<typeof customFetch>}
>; , queryClient?: QueryClient
}, ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
queryClient?: QueryClient, export function useGetCard<TData = Awaited<ReturnType<typeof getCard>>, TError = void | HTTPValidationError>(
): DefinedUseQueryResult<TData, TError> & { cardId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getCard>>, TError, TData>> & Pick<
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetCard<
TData = Awaited<ReturnType<typeof getCard>>,
TError = void | HTTPValidationError,
>(
cardId: string,
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof getCard>>, TError, TData>
> &
Pick<
UndefinedInitialDataOptions< UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getCard>>, Awaited<ReturnType<typeof getCard>>,
TError, TError,
Awaited<ReturnType<typeof getCard>> Awaited<ReturnType<typeof getCard>>
>, > , 'initialData'
"initialData" >, request?: SecondParameter<typeof customFetch>}
>; , queryClient?: QueryClient
}, ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
queryClient?: QueryClient, export function useGetCard<TData = Awaited<ReturnType<typeof getCard>>, TError = void | HTTPValidationError>(
): UseQueryResult<TData, TError> & { cardId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getCard>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
queryKey: DataTag<QueryKey, TData, TError>; , queryClient?: QueryClient
}; ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetCard<
TData = Awaited<ReturnType<typeof getCard>>,
TError = void | HTTPValidationError,
>(
cardId: string,
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof getCard>>, TError, TData>
>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
/** /**
* @summary 협상카드 조회 * @summary 협상카드 조회
*/ */
export function useGetCard< export function useGetCard<TData = Awaited<ReturnType<typeof getCard>>, TError = void | HTTPValidationError>(
TData = Awaited<ReturnType<typeof getCard>>, cardId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getCard>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
TError = void | HTTPValidationError, , queryClient?: QueryClient
>( ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
cardId: string,
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof getCard>>, TError, TData>
>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
} {
const queryOptions = getGetCardQueryOptions(cardId, options);
const query = useQuery(queryOptions, queryClient) as UseQueryResult< const queryOptions = getGetCardQueryOptions(cardId,options)
TData,
TError
> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey; const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey ;
return query; return query;
} }
/**
* @summary 협상카드 수정
*/
export const updateCard = (cardId: string, reqUpdateCard: ReqUpdateCard) => {
return customFetch<ResCard>({
url: `/v1/card/update/${cardId}`,
method: "PATCH",
headers: { "Content-Type": "application/json" },
data: reqUpdateCard,
});
};
export const getUpdateCardMutationOptions = <
TError = void | HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof updateCard>>,
TError,
{ cardId: string; data: ReqUpdateCard },
TContext
>;
}): UseMutationOptions<
Awaited<ReturnType<typeof updateCard>>,
TError,
{ cardId: string; data: ReqUpdateCard },
TContext
> => {
const mutationKey = ["updateCard"];
const { mutation: mutationOptions } = options
? options.mutation &&
"mutationKey" in options.mutation &&
options.mutation.mutationKey
? options
: { ...options, mutation: { ...options.mutation, mutationKey } }
: { mutation: { mutationKey } };
const mutationFn: MutationFunction<
Awaited<ReturnType<typeof updateCard>>,
{ cardId: string; data: ReqUpdateCard }
> = (props) => {
const { cardId, data } = props ?? {};
return updateCard(cardId, data);
};
return { mutationFn, ...mutationOptions };
};
export type UpdateCardMutationResult = NonNullable<
Awaited<ReturnType<typeof updateCard>>
>;
export type UpdateCardMutationBody = ReqUpdateCard;
export type UpdateCardMutationError = void | HTTPValidationError;
/** /**
* @summary 협상카드 수정 * @summary 협상카드 수정
*/ */
export const useUpdateCard = < export const updateCard = (
TError = void | HTTPValidationError, cardId: string,
TContext = unknown, reqUpdateCard: ReqUpdateCard,
>( options?: SecondParameter<typeof customFetch>,) => {
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof updateCard>>, return customFetch<ResCard>(
TError, {url: `/v1/card/update/${cardId}`, method: 'PATCH',
{ cardId: string; data: ReqUpdateCard }, headers: {'Content-Type': 'application/json', },
TContext data: reqUpdateCard
>; },
}, options);
queryClient?: QueryClient, }
): UseMutationResult<
Awaited<ReturnType<typeof updateCard>>,
TError,
{ cardId: string; data: ReqUpdateCard },
TContext
> => {
const mutationOptions = getUpdateCardMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}; export const getUpdateCardMutationOptions = <TError = void | HTTPValidationError,
/** TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof updateCard>>, TError,{cardId: string;data: ReqUpdateCard}, TContext>, request?: SecondParameter<typeof customFetch>}
): UseMutationOptions<Awaited<ReturnType<typeof updateCard>>, TError,{cardId: string;data: ReqUpdateCard}, TContext> => {
const mutationKey = ['updateCard'];
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
: {...options, mutation: {...options.mutation, mutationKey}}
: {mutation: { mutationKey, }, request: undefined};
const mutationFn: MutationFunction<Awaited<ReturnType<typeof updateCard>>, {cardId: string;data: ReqUpdateCard}> = (props) => {
const {cardId,data} = props ?? {};
return updateCard(cardId,data,requestOptions)
}
return { mutationFn, ...mutationOptions }}
export type UpdateCardMutationResult = NonNullable<Awaited<ReturnType<typeof updateCard>>>
export type UpdateCardMutationBody = ReqUpdateCard
export type UpdateCardMutationError = void | HTTPValidationError
/**
* @summary 협상카드 수정
*/
export const useUpdateCard = <TError = void | HTTPValidationError,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof updateCard>>, TError,{cardId: string;data: ReqUpdateCard}, TContext>, request?: SecondParameter<typeof customFetch>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof updateCard>>,
TError,
{cardId: string;data: ReqUpdateCard},
TContext
> => {
const mutationOptions = getUpdateCardMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
/**
* @summary 협상카드 삭제 * @summary 협상카드 삭제
*/ */
export const deleteCard = (cardId: string) => { export const deleteCard = (
return customFetch<ResDeleteCard>({ cardId: string,
url: `/v1/card/delete/${cardId}`, options?: SecondParameter<typeof customFetch>,) => {
method: "DELETE",
});
}; return customFetch<ResDeleteCard>(
{url: `/v1/card/delete/${cardId}`, method: 'DELETE'
},
options);
}
export const getDeleteCardMutationOptions = <
TError = void | HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof deleteCard>>,
TError,
{ cardId: string },
TContext
>;
}): UseMutationOptions<
Awaited<ReturnType<typeof deleteCard>>,
TError,
{ cardId: string },
TContext
> => {
const mutationKey = ["deleteCard"];
const { mutation: mutationOptions } = options
? options.mutation &&
"mutationKey" in options.mutation &&
options.mutation.mutationKey
? options
: { ...options, mutation: { ...options.mutation, mutationKey } }
: { mutation: { mutationKey } };
const mutationFn: MutationFunction< export const getDeleteCardMutationOptions = <TError = void | HTTPValidationError,
Awaited<ReturnType<typeof deleteCard>>, TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteCard>>, TError,{cardId: string}, TContext>, request?: SecondParameter<typeof customFetch>}
{ cardId: string } ): UseMutationOptions<Awaited<ReturnType<typeof deleteCard>>, TError,{cardId: string}, TContext> => {
> = (props) => {
const { cardId } = props ?? {};
return deleteCard(cardId); const mutationKey = ['deleteCard'];
}; const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
: {...options, mutation: {...options.mutation, mutationKey}}
: {mutation: { mutationKey, }, request: undefined};
return { mutationFn, ...mutationOptions };
};
export type DeleteCardMutationResult = NonNullable<
Awaited<ReturnType<typeof deleteCard>>
>;
export type DeleteCardMutationError = void | HTTPValidationError; const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteCard>>, {cardId: string}> = (props) => {
const {cardId} = props ?? {};
/** return deleteCard(cardId,requestOptions)
}
return { mutationFn, ...mutationOptions }}
export type DeleteCardMutationResult = NonNullable<Awaited<ReturnType<typeof deleteCard>>>
export type DeleteCardMutationError = void | HTTPValidationError
/**
* @summary 협상카드 삭제 * @summary 협상카드 삭제
*/ */
export const useDeleteCard = < export const useDeleteCard = <TError = void | HTTPValidationError,
TError = void | HTTPValidationError, TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteCard>>, TError,{cardId: string}, TContext>, request?: SecondParameter<typeof customFetch>}
TContext = unknown, , queryClient?: QueryClient): UseMutationResult<
>( Awaited<ReturnType<typeof deleteCard>>,
options?: { TError,
mutation?: UseMutationOptions< {cardId: string},
Awaited<ReturnType<typeof deleteCard>>, TContext
TError, > => {
{ cardId: string },
TContext
>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof deleteCard>>,
TError,
{ cardId: string },
TContext
> => {
const mutationOptions = getDeleteCardMutationOptions(options);
return useMutation(mutationOptions, queryClient); const mutationOptions = getDeleteCardMutationOptions(options);
};
return useMutation(mutationOptions, queryClient);
}

View File

@ -4,7 +4,9 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import { useQuery } from "@tanstack/react-query"; import {
useQuery
} from '@tanstack/react-query';
import type { import type {
DataTag, DataTag,
DefinedInitialDataOptions, DefinedInitialDataOptions,
@ -14,150 +16,105 @@ import type {
QueryKey, QueryKey,
UndefinedInitialDataOptions, UndefinedInitialDataOptions,
UseQueryOptions, UseQueryOptions,
UseQueryResult, UseQueryResult
} from "@tanstack/react-query"; } from '@tanstack/react-query';
import { customFetch } from '../../mutator/custom-fetch';
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
import { customFetch } from "../../mutator/custom-fetch";
/** /**
* @summary Healthz * @summary Healthz
*/ */
export const healthzHealthzGet = (signal?: AbortSignal) => { export const healthzHealthzGet = (
return customFetch<unknown>({ url: `/healthz`, method: "GET", signal });
}; options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
) => {
return customFetch<unknown>(
{url: `/healthz`, method: 'GET', signal
},
options);
}
export const getHealthzHealthzGetQueryKey = () => { export const getHealthzHealthzGetQueryKey = () => {
return [`/healthz`] as const; return [
}; `/healthz`
] as const;
}
export const getHealthzHealthzGetQueryOptions = <
TData = Awaited<ReturnType<typeof healthzHealthzGet>>, export const getHealthzHealthzGetQueryOptions = <TData = Awaited<ReturnType<typeof healthzHealthzGet>>, TError = void>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof healthzHealthzGet>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
TError = void, ) => {
>(options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof healthzHealthzGet>>,
TError,
TData
>
>;
}) => {
const { query: queryOptions } = options ?? {};
const queryKey = queryOptions?.queryKey ?? getHealthzHealthzGetQueryKey(); const {query: queryOptions, request: requestOptions} = options ?? {};
const queryFn: QueryFunction< const queryKey = queryOptions?.queryKey ?? getHealthzHealthzGetQueryKey();
Awaited<ReturnType<typeof healthzHealthzGet>>
> = ({ signal }) => healthzHealthzGet(signal);
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
Awaited<ReturnType<typeof healthzHealthzGet>>,
TError,
TData
> & { queryKey: DataTag<QueryKey, TData, TError> };
};
export type HealthzHealthzGetQueryResult = NonNullable< const queryFn: QueryFunction<Awaited<ReturnType<typeof healthzHealthzGet>>> = ({ signal }) => healthzHealthzGet(requestOptions, signal);
Awaited<ReturnType<typeof healthzHealthzGet>>
>;
export type HealthzHealthzGetQueryError = void;
export function useHealthzHealthzGet<
TData = Awaited<ReturnType<typeof healthzHealthzGet>>,
TError = void,
>(
options: { return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof healthzHealthzGet>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
query: Partial< }
UseQueryOptions<
Awaited<ReturnType<typeof healthzHealthzGet>>, export type HealthzHealthzGetQueryResult = NonNullable<Awaited<ReturnType<typeof healthzHealthzGet>>>
TError, export type HealthzHealthzGetQueryError = void
TData
>
> & export function useHealthzHealthzGet<TData = Awaited<ReturnType<typeof healthzHealthzGet>>, TError = void>(
Pick< options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof healthzHealthzGet>>, TError, TData>> & Pick<
DefinedInitialDataOptions< DefinedInitialDataOptions<
Awaited<ReturnType<typeof healthzHealthzGet>>, Awaited<ReturnType<typeof healthzHealthzGet>>,
TError, TError,
Awaited<ReturnType<typeof healthzHealthzGet>> Awaited<ReturnType<typeof healthzHealthzGet>>
>, > , 'initialData'
"initialData" >, request?: SecondParameter<typeof customFetch>}
>; , queryClient?: QueryClient
}, ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
queryClient?: QueryClient, export function useHealthzHealthzGet<TData = Awaited<ReturnType<typeof healthzHealthzGet>>, TError = void>(
): DefinedUseQueryResult<TData, TError> & { options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof healthzHealthzGet>>, TError, TData>> & Pick<
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useHealthzHealthzGet<
TData = Awaited<ReturnType<typeof healthzHealthzGet>>,
TError = void,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof healthzHealthzGet>>,
TError,
TData
>
> &
Pick<
UndefinedInitialDataOptions< UndefinedInitialDataOptions<
Awaited<ReturnType<typeof healthzHealthzGet>>, Awaited<ReturnType<typeof healthzHealthzGet>>,
TError, TError,
Awaited<ReturnType<typeof healthzHealthzGet>> Awaited<ReturnType<typeof healthzHealthzGet>>
>, > , 'initialData'
"initialData" >, request?: SecondParameter<typeof customFetch>}
>; , queryClient?: QueryClient
}, ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
queryClient?: QueryClient, export function useHealthzHealthzGet<TData = Awaited<ReturnType<typeof healthzHealthzGet>>, TError = void>(
): UseQueryResult<TData, TError> & { options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof healthzHealthzGet>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
queryKey: DataTag<QueryKey, TData, TError>; , queryClient?: QueryClient
}; ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useHealthzHealthzGet<
TData = Awaited<ReturnType<typeof healthzHealthzGet>>,
TError = void,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof healthzHealthzGet>>,
TError,
TData
>
>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
/** /**
* @summary Healthz * @summary Healthz
*/ */
export function useHealthzHealthzGet< export function useHealthzHealthzGet<TData = Awaited<ReturnType<typeof healthzHealthzGet>>, TError = void>(
TData = Awaited<ReturnType<typeof healthzHealthzGet>>, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof healthzHealthzGet>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
TError = void, , queryClient?: QueryClient
>( ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof healthzHealthzGet>>,
TError,
TData
>
>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
} {
const queryOptions = getHealthzHealthzGetQueryOptions(options);
const query = useQuery(queryOptions, queryClient) as UseQueryResult< const queryOptions = getHealthzHealthzGetQueryOptions(options)
TData,
TError
> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey; const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey ;
return query; return query;
} }

View File

@ -4,7 +4,9 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import { useQuery } from "@tanstack/react-query"; import {
useQuery
} from '@tanstack/react-query';
import type { import type {
DataTag, DataTag,
DefinedInitialDataOptions, DefinedInitialDataOptions,
@ -14,132 +16,109 @@ import type {
QueryKey, QueryKey,
UndefinedInitialDataOptions, UndefinedInitialDataOptions,
UseQueryOptions, UseQueryOptions,
UseQueryResult, UseQueryResult
} from "@tanstack/react-query"; } from '@tanstack/react-query';
import type {
ResEnums
} from '.././model';
import { customFetch } from '../../mutator/custom-fetch';
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
import type { ResEnums } from ".././model";
import { customFetch } from "../../mutator/custom-fetch";
/** /**
* @summary 도메인 코드 enum 전체 * @summary 도메인 코드 enum 전체
*/ */
export const listEnums = (signal?: AbortSignal) => { export const listEnums = (
return customFetch<ResEnums>({ url: `/v1/enums`, method: "GET", signal });
}; options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
) => {
return customFetch<ResEnums>(
{url: `/v1/enums`, method: 'GET', signal
},
options);
}
export const getListEnumsQueryKey = () => { export const getListEnumsQueryKey = () => {
return [`/v1/enums`] as const; return [
}; `/v1/enums`
] as const;
}
export const getListEnumsQueryOptions = <
TData = Awaited<ReturnType<typeof listEnums>>, export const getListEnumsQueryOptions = <TData = Awaited<ReturnType<typeof listEnums>>, TError = void>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listEnums>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
TError = void, ) => {
>(options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof listEnums>>, TError, TData>
>;
}) => {
const { query: queryOptions } = options ?? {};
const queryKey = queryOptions?.queryKey ?? getListEnumsQueryKey(); const {query: queryOptions, request: requestOptions} = options ?? {};
const queryFn: QueryFunction<Awaited<ReturnType<typeof listEnums>>> = ({ const queryKey = queryOptions?.queryKey ?? getListEnumsQueryKey();
signal,
}) => listEnums(signal);
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
Awaited<ReturnType<typeof listEnums>>,
TError,
TData
> & { queryKey: DataTag<QueryKey, TData, TError> };
};
export type ListEnumsQueryResult = NonNullable< const queryFn: QueryFunction<Awaited<ReturnType<typeof listEnums>>> = ({ signal }) => listEnums(requestOptions, signal);
Awaited<ReturnType<typeof listEnums>>
>;
export type ListEnumsQueryError = void;
export function useListEnums<
TData = Awaited<ReturnType<typeof listEnums>>,
TError = void,
>(
options: { return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listEnums>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
query: Partial< }
UseQueryOptions<Awaited<ReturnType<typeof listEnums>>, TError, TData>
> & export type ListEnumsQueryResult = NonNullable<Awaited<ReturnType<typeof listEnums>>>
Pick< export type ListEnumsQueryError = void
export function useListEnums<TData = Awaited<ReturnType<typeof listEnums>>, TError = void>(
options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listEnums>>, TError, TData>> & Pick<
DefinedInitialDataOptions< DefinedInitialDataOptions<
Awaited<ReturnType<typeof listEnums>>, Awaited<ReturnType<typeof listEnums>>,
TError, TError,
Awaited<ReturnType<typeof listEnums>> Awaited<ReturnType<typeof listEnums>>
>, > , 'initialData'
"initialData" >, request?: SecondParameter<typeof customFetch>}
>; , queryClient?: QueryClient
}, ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
queryClient?: QueryClient, export function useListEnums<TData = Awaited<ReturnType<typeof listEnums>>, TError = void>(
): DefinedUseQueryResult<TData, TError> & { options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listEnums>>, TError, TData>> & Pick<
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useListEnums<
TData = Awaited<ReturnType<typeof listEnums>>,
TError = void,
>(
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof listEnums>>, TError, TData>
> &
Pick<
UndefinedInitialDataOptions< UndefinedInitialDataOptions<
Awaited<ReturnType<typeof listEnums>>, Awaited<ReturnType<typeof listEnums>>,
TError, TError,
Awaited<ReturnType<typeof listEnums>> Awaited<ReturnType<typeof listEnums>>
>, > , 'initialData'
"initialData" >, request?: SecondParameter<typeof customFetch>}
>; , queryClient?: QueryClient
}, ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
queryClient?: QueryClient, export function useListEnums<TData = Awaited<ReturnType<typeof listEnums>>, TError = void>(
): UseQueryResult<TData, TError> & { options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listEnums>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
queryKey: DataTag<QueryKey, TData, TError>; , queryClient?: QueryClient
}; ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useListEnums<
TData = Awaited<ReturnType<typeof listEnums>>,
TError = void,
>(
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof listEnums>>, TError, TData>
>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
/** /**
* @summary 도메인 코드 enum 전체 * @summary 도메인 코드 enum 전체
*/ */
export function useListEnums< export function useListEnums<TData = Awaited<ReturnType<typeof listEnums>>, TError = void>(
TData = Awaited<ReturnType<typeof listEnums>>, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listEnums>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
TError = void, , queryClient?: QueryClient
>( ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof listEnums>>, TError, TData>
>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
} {
const queryOptions = getListEnumsQueryOptions(options);
const query = useQuery(queryOptions, queryClient) as UseQueryResult< const queryOptions = getListEnumsQueryOptions(options)
TData,
TError
> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey; const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey ;
return query; return query;
} }

File diff suppressed because it is too large Load Diff

View File

@ -5,6 +5,6 @@
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
export interface BodyUploadItemsExcelV1ItemUploadExcelPost { export interface BodyUploadItemImageV1ItemImagePost {
file: string; file: string;
} }

View File

@ -4,15 +4,15 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { CardDataUserId } from "./cardDataUserId"; import type { CardDataUserId } from './cardDataUserId';
import type { CardDataName } from "./cardDataName"; import type { CardDataName } from './cardDataName';
import type { CardDataNumber } from "./cardDataNumber"; import type { CardDataNumber } from './cardDataNumber';
import type { CardDataScript } from "./cardDataScript"; import type { CardDataScript } from './cardDataScript';
import type { CardDataEditScript } from "./cardDataEditScript"; import type { CardDataEditScript } from './cardDataEditScript';
import type { CardDataCondition } from "./cardDataCondition"; import type { CardDataCondition } from './cardDataCondition';
import type { CardDataMemo } from "./cardDataMemo"; import type { CardDataMemo } from './cardDataMemo';
import type { CardDataCreatedAt } from "./cardDataCreatedAt"; import type { CardDataCreatedAt } from './cardDataCreatedAt';
import type { CardDataUpdatedAt } from "./cardDataUpdatedAt"; import type { CardDataUpdatedAt } from './cardDataUpdatedAt';
export interface CardData { export interface CardData {
nego_card_id: string; nego_card_id: string;

View File

@ -4,10 +4,10 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ChatMessageDataCardId } from "./chatMessageDataCardId"; import type { ChatMessageDataCardId } from './chatMessageDataCardId';
import type { ChatMessageDataCardUsedYn } from "./chatMessageDataCardUsedYn"; import type { ChatMessageDataCardUsedYn } from './chatMessageDataCardUsedYn';
import type { ChatMessageDataIndicatorValue } from "./chatMessageDataIndicatorValue"; import type { ChatMessageDataIndicatorValue } from './chatMessageDataIndicatorValue';
import type { ChatMessageDataCardType } from "./chatMessageDataCardType"; import type { ChatMessageDataCardType } from './chatMessageDataCardType';
export interface ChatMessageData { export interface ChatMessageData {
chat_id: string; chat_id: string;

View File

@ -4,9 +4,9 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfoSuccess } from "./errorInfoSuccess"; import type { ErrorInfoSuccess } from './errorInfoSuccess';
import type { ErrorInfoCode } from "./errorInfoCode"; import type { ErrorInfoCode } from './errorInfoCode';
import type { ErrorInfoDesc } from "./errorInfoDesc"; import type { ErrorInfoDesc } from './errorInfoDesc';
/** /**
* 모든 응답에 공통으로 실리는 결과 정보. result.success / code / desc 로 내려간다. * 모든 응답에 공통으로 실리는 결과 정보. result.success / code / desc 로 내려간다.

View File

@ -4,7 +4,7 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ValidationError } from "./validationError"; import type { ValidationError } from './validationError';
export interface HTTPValidationError { export interface HTTPValidationError {
detail?: ValidationError[]; detail?: ValidationError[];

View File

@ -5,248 +5,253 @@
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
export * from "./asyncJob"; export * from './asyncJob';
export * from "./bodyUploadItemsExcelV1ItemUploadExcelPost"; export * from './bodyUploadItemImageV1ItemImagePost';
export * from "./bodyUploadSuppliersExcelV1SupplierUploadExcelPost"; export * from './cardData';
export * from "./cardData"; export * from './cardDataCondition';
export * from "./cardDataCondition"; export * from './cardDataCreatedAt';
export * from "./cardDataCreatedAt"; export * from './cardDataEditScript';
export * from "./cardDataEditScript"; export * from './cardDataMemo';
export * from "./cardDataMemo"; export * from './cardDataName';
export * from "./cardDataName"; export * from './cardDataNumber';
export * from "./cardDataNumber"; export * from './cardDataScript';
export * from "./cardDataScript"; export * from './cardDataUpdatedAt';
export * from "./cardDataUpdatedAt"; export * from './cardDataUserId';
export * from "./cardDataUserId"; export * from './chatMessageData';
export * from "./chatMessageData"; export * from './chatMessageDataCardId';
export * from "./chatMessageDataCardId"; export * from './chatMessageDataCardType';
export * from "./chatMessageDataCardType"; export * from './chatMessageDataCardUsedYn';
export * from "./chatMessageDataCardUsedYn"; export * from './chatMessageDataIndicatorValue';
export * from "./chatMessageDataIndicatorValue"; export * from './companyData';
export * from "./companyData"; export * from './enumOption';
export * from "./enumOption"; export * from './errorInfo';
export * from "./errorInfo"; export * from './errorInfoCode';
export * from "./errorInfoCode"; export * from './errorInfoDesc';
export * from "./errorInfoDesc"; export * from './errorInfoSuccess';
export * from "./errorInfoSuccess"; export * from './hTTPValidationError';
export * from "./hTTPValidationError"; export * from './itemCategory';
export * from "./itemCategory"; export * from './itemData';
export * from "./itemData"; export * from './itemDataCategory';
export * from "./itemDataCategory"; export * from './itemDataCode';
export * from "./itemDataCode"; export * from './itemDataCreatedAt';
export * from "./itemDataCreatedAt"; export * from './itemDataDeliveryFeeYn';
export * from "./itemDataDeliveryFeeYn"; export * from './itemDataDeliveryType';
export * from "./itemDataDeliveryType"; export * from './itemDataImageUrl';
export * from "./itemDataImageUrl"; export * from './itemDataLeadTime';
export * from "./itemDataLeadTime"; export * from './itemDataMadeIn';
export * from "./itemDataMadeIn"; export * from './itemDataManufacturer';
export * from "./itemDataManufacturer"; export * from './itemDataModelName';
export * from "./itemDataModelName"; export * from './itemDataMoq';
export * from "./itemDataMoq"; export * from './itemDataPrice';
export * from "./itemDataPrice"; export * from './itemDataQuantityUnit';
export * from "./itemDataQuantityUnit"; export * from './itemDataSpec';
export * from "./itemDataSpec"; export * from './itemDataUpdatedAt';
export * from "./itemDataUpdatedAt"; export * from './itemDataVatYn';
export * from "./itemDataVatYn"; export * from './listCardsParams';
export * from "./listCardsParams"; export * from './listItemsParams';
export * from "./listItemsParams"; export * from './listQuotationsParams';
export * from "./listQuotationsParams"; export * from './listSuppliersParams';
export * from "./listSuppliersParams"; export * from './quotationCardData';
export * from "./quotationCardData"; export * from './quotationCardDataCondition';
export * from "./quotationCardDataName"; export * from './quotationCardDataEditScript';
export * from "./quotationCardDataNegoCardId"; export * from './quotationCardDataMemo';
export * from "./quotationCardDataQtId"; export * from './quotationCardDataName';
export * from "./quotationCardDataScript"; export * from './quotationCardDataNegoCardId';
export * from "./quotationCardDataType"; export * from './quotationCardDataNumber';
export * from "./quotationCardDataWildCardId"; export * from './quotationCardDataQtId';
export * from "./quotationData"; export * from './quotationCardDataScript';
export * from "./quotationDataCreatedAt"; export * from './quotationCardDataType';
export * from "./quotationDataEqualBidData"; export * from './quotationCardDataWildCardId';
export * from "./quotationDataEqualBidYn"; export * from './quotationData';
export * from "./quotationDataManagerContactNumber"; export * from './quotationDataCreatedAt';
export * from "./quotationDataManagerEmail"; export * from './quotationDataEqualBidData';
export * from "./quotationDataManagerName"; export * from './quotationDataEqualBidYn';
export * from "./quotationDataMemo"; export * from './quotationDataManagerContactNumber';
export * from "./quotationDataPreferredSpId"; export * from './quotationDataManagerEmail';
export * from "./quotationDataPreferredSpName"; export * from './quotationDataManagerName';
export * from "./quotationDataPreferredSpYn"; export * from './quotationDataMemo';
export * from "./quotationDataUpdatedAt"; export * from './quotationDataPreferredSpId';
export * from "./quotationSettingData"; export * from './quotationDataPreferredSpName';
export * from "./quotationSettingDataCreatedAt"; export * from './quotationDataPreferredSpYn';
export * from "./quotationSettingDataUpdatedAt"; export * from './quotationDataUpdatedAt';
export * from "./quotationSettingDataUserId"; export * from './quotationSettingData';
export * from "./reqCheckCodes"; export * from './quotationSettingDataCreatedAt';
export * from "./reqCreateAccount"; export * from './quotationSettingDataUpdatedAt';
export * from "./reqCreateCard"; export * from './quotationSettingDataUserId';
export * from "./reqCreateCardCondition"; export * from './reqCheckCodes';
export * from "./reqCreateCardEditScript"; export * from './reqCreateAccount';
export * from "./reqCreateCardMemo"; export * from './reqCreateCard';
export * from "./reqCreateCardName"; export * from './reqCreateCardCondition';
export * from "./reqCreateCardNumber"; export * from './reqCreateCardEditScript';
export * from "./reqCreateCardScript"; export * from './reqCreateCardMemo';
export * from "./reqCreateItem"; export * from './reqCreateCardName';
export * from "./reqCreateItemCategory"; export * from './reqCreateCardNumber';
export * from "./reqCreateItemCode"; export * from './reqCreateCardScript';
export * from "./reqCreateItemDeliveryFeeYn"; export * from './reqCreateItem';
export * from "./reqCreateItemDeliveryType"; export * from './reqCreateItemCategory';
export * from "./reqCreateItemImageUrl"; export * from './reqCreateItemCode';
export * from "./reqCreateItemLeadTime"; export * from './reqCreateItemDeliveryFeeYn';
export * from "./reqCreateItemMadeIn"; export * from './reqCreateItemDeliveryType';
export * from "./reqCreateItemManufacturer"; export * from './reqCreateItemImageUrl';
export * from "./reqCreateItemModelName"; export * from './reqCreateItemLeadTime';
export * from "./reqCreateItemMoq"; export * from './reqCreateItemMadeIn';
export * from "./reqCreateItemPrice"; export * from './reqCreateItemManufacturer';
export * from "./reqCreateItemQuantityUnit"; export * from './reqCreateItemModelName';
export * from "./reqCreateItemSpec"; export * from './reqCreateItemMoq';
export * from "./reqCreateItemVatYn"; export * from './reqCreateItemPrice';
export * from "./reqCreateQuotation"; export * from './reqCreateItemQuantityUnit';
export * from "./reqCreateQuotationManagerContactNumber"; export * from './reqCreateItemSpec';
export * from "./reqCreateQuotationManagerEmail"; export * from './reqCreateItemVatYn';
export * from "./reqCreateQuotationManagerName"; export * from './reqCreateQuotation';
export * from "./reqCreateQuotationMemo"; export * from './reqCreateQuotationManagerContactNumber';
export * from "./reqCreateQuotationSetting"; export * from './reqCreateQuotationManagerEmail';
export * from "./reqCreateSupplier"; export * from './reqCreateQuotationManagerName';
export * from "./reqCreateSupplierCode"; export * from './reqCreateQuotationMemo';
export * from "./reqCreateSupplierManagerContactNumber"; export * from './reqCreateQuotationSetting';
export * from "./reqCreateSupplierManagerEmail"; export * from './reqCreateSupplier';
export * from "./reqCreateSupplierManagerName"; export * from './reqCreateSupplierCode';
export * from "./reqCreateSupplierPriority"; export * from './reqCreateSupplierManagerContactNumber';
export * from "./reqLogin"; export * from './reqCreateSupplierManagerEmail';
export * from "./reqUpdateCard"; export * from './reqCreateSupplierManagerName';
export * from "./reqUpdateCardCondition"; export * from './reqCreateSupplierPriority';
export * from "./reqUpdateCardEditScript"; export * from './reqLogin';
export * from "./reqUpdateCardMemo"; export * from './reqUpdateCard';
export * from "./reqUpdateCardName"; export * from './reqUpdateCardCondition';
export * from "./reqUpdateCardNumber"; export * from './reqUpdateCardEditScript';
export * from "./reqUpdateCardScript"; export * from './reqUpdateCardMemo';
export * from "./reqUpdateCardStatus"; export * from './reqUpdateCardName';
export * from "./reqUpdateItem"; export * from './reqUpdateCardNumber';
export * from "./reqUpdateItemCategory"; export * from './reqUpdateCardScript';
export * from "./reqUpdateItemCategoryType"; export * from './reqUpdateCardStatus';
export * from "./reqUpdateItemCode"; export * from './reqUpdateItem';
export * from "./reqUpdateItemDeliveryFeeYn"; export * from './reqUpdateItemCategory';
export * from "./reqUpdateItemDeliveryType"; export * from './reqUpdateItemCategoryType';
export * from "./reqUpdateItemImageUrl"; export * from './reqUpdateItemCode';
export * from "./reqUpdateItemInternetLowestPriceYn"; export * from './reqUpdateItemDeliveryFeeYn';
export * from "./reqUpdateItemLeadTime"; export * from './reqUpdateItemDeliveryType';
export * from "./reqUpdateItemMadeIn"; export * from './reqUpdateItemImageUrl';
export * from "./reqUpdateItemManufacturer"; export * from './reqUpdateItemInternetLowestPriceYn';
export * from "./reqUpdateItemModelName"; export * from './reqUpdateItemLeadTime';
export * from "./reqUpdateItemMoq"; export * from './reqUpdateItemMadeIn';
export * from "./reqUpdateItemName"; export * from './reqUpdateItemManufacturer';
export * from "./reqUpdateItemPrice"; export * from './reqUpdateItemModelName';
export * from "./reqUpdateItemQuantityUnit"; export * from './reqUpdateItemMoq';
export * from "./reqUpdateItemSpec"; export * from './reqUpdateItemName';
export * from "./reqUpdateItemVatYn"; export * from './reqUpdateItemPrice';
export * from "./reqUpdateQuotationSetting"; export * from './reqUpdateItemQuantityUnit';
export * from "./reqUpdateQuotationSettingAnchoringValue"; export * from './reqUpdateItemSpec';
export * from "./reqUpdateQuotationSettingCardCount"; export * from './reqUpdateItemVatYn';
export * from "./reqUpdateQuotationSettingTargetMarginRate"; export * from './reqUpdateQuotationSetting';
export * from "./reqUpdateSupplier"; export * from './reqUpdateQuotationSettingAnchoringValue';
export * from "./reqUpdateSupplierCode"; export * from './reqUpdateQuotationSettingCardCount';
export * from "./reqUpdateSupplierManagerContactNumber"; export * from './reqUpdateQuotationSettingTargetMarginRate';
export * from "./reqUpdateSupplierManagerEmail"; export * from './reqUpdateSupplier';
export * from "./reqUpdateSupplierManagerName"; export * from './reqUpdateSupplierCode';
export * from "./reqUpdateSupplierName"; export * from './reqUpdateSupplierManagerContactNumber';
export * from "./reqUpdateSupplierPriority"; export * from './reqUpdateSupplierManagerEmail';
export * from "./resCard"; export * from './reqUpdateSupplierManagerName';
export * from "./resCardCard"; export * from './reqUpdateSupplierName';
export * from "./resCardList"; export * from './reqUpdateSupplierPriority';
export * from "./resCardListMsg"; export * from './resCard';
export * from "./resCardMsg"; export * from './resCardCard';
export * from "./resCheckCodes"; export * from './resCardList';
export * from "./resCheckCodesMsg"; export * from './resCardListMsg';
export * from "./resCreateAccount"; export * from './resCardMsg';
export * from "./resCreateAccountMsg"; export * from './resCheckCodes';
export * from "./resCreateQuotation"; export * from './resCheckCodesMsg';
export * from "./resCreateQuotationAsyncJob"; export * from './resCreateAccount';
export * from "./resCreateQuotationMsg"; export * from './resCreateAccountMsg';
export * from "./resCreateQuotationQuotation"; export * from './resCreateQuotation';
export * from "./resDeleteCard"; export * from './resCreateQuotationAsyncJob';
export * from "./resDeleteCardMsg"; export * from './resCreateQuotationMsg';
export * from "./resDeleteItem"; export * from './resCreateQuotationQuotation';
export * from "./resDeleteItemMsg"; export * from './resDeleteCard';
export * from "./resDeleteQuotation"; export * from './resDeleteCardMsg';
export * from "./resDeleteQuotationMsg"; export * from './resDeleteItem';
export * from "./resDeleteQuotationSetting"; export * from './resDeleteItemMsg';
export * from "./resDeleteQuotationSettingMsg"; export * from './resDeleteQuotation';
export * from "./resDeleteSupplier"; export * from './resDeleteQuotationMsg';
export * from "./resDeleteSupplierMsg"; export * from './resDeleteQuotationSetting';
export * from "./resEnums"; export * from './resDeleteQuotationSettingMsg';
export * from "./resEnumsEnums"; export * from './resDeleteSupplier';
export * from "./resEnumsMsg"; export * from './resDeleteSupplierMsg';
export * from "./resExcelUpload"; export * from './resEnums';
export * from "./resExcelUploadMsg"; export * from './resEnumsEnums';
export * from "./resExcelUploadReceivedFilename"; export * from './resEnumsMsg';
export * from "./resItem"; export * from './resItem';
export * from "./resItemCategories"; export * from './resItemCategories';
export * from "./resItemCategoriesMsg"; export * from './resItemCategoriesMsg';
export * from "./resItemItem"; export * from './resItemImage';
export * from "./resItemList"; export * from './resItemImageFilename';
export * from "./resItemListMsg"; export * from './resItemImageImageUrl';
export * from "./resItemMsg"; export * from './resItemImageMsg';
export * from "./resLogin"; export * from './resItemImageSize';
export * from "./resLoginMsg"; export * from './resItemItem';
export * from "./resLowestPriceResult"; export * from './resItemList';
export * from "./resLowestPriceResultMsg"; export * from './resItemListMsg';
export * from "./resLowestPriceTrigger"; export * from './resItemMsg';
export * from "./resLowestPriceTriggerMsg"; export * from './resLogin';
export * from "./resMe"; export * from './resLoginMsg';
export * from "./resMeCompany"; export * from './resLowestPriceResult';
export * from "./resMeContactNumber"; export * from './resLowestPriceResultMsg';
export * from "./resMeEmail"; export * from './resLowestPriceTrigger';
export * from "./resMeMsg"; export * from './resLowestPriceTriggerMsg';
export * from "./resMeName"; export * from './resMe';
export * from "./resQuotation"; export * from './resMeCompany';
export * from "./resQuotationCards"; export * from './resMeContactNumber';
export * from "./resQuotationCardsMsg"; export * from './resMeEmail';
export * from "./resQuotationCardsQtId"; export * from './resMeMsg';
export * from "./resQuotationList"; export * from './resMeName';
export * from "./resQuotationListMsg"; export * from './resQuotation';
export * from "./resQuotationMsg"; export * from './resQuotationCards';
export * from "./resQuotationQuotation"; export * from './resQuotationCardsMsg';
export * from "./resQuotationResult"; export * from './resQuotationCardsQtId';
export * from "./resQuotationResultEqualBidData"; export * from './resQuotationList';
export * from "./resQuotationResultIsEqualBid"; export * from './resQuotationListMsg';
export * from "./resQuotationResultMsg"; export * from './resQuotationMsg';
export * from "./resQuotationResultQtId"; export * from './resQuotationQuotation';
export * from "./resQuotationResultWinnerSupplierId"; export * from './resQuotationResult';
export * from "./resQuotationResultWinnerSupplierName"; export * from './resQuotationResultEqualBidData';
export * from "./resQuotationSessions"; export * from './resQuotationResultIsEqualBid';
export * from "./resQuotationSessionsMsg"; export * from './resQuotationResultMsg';
export * from "./resQuotationSessionsQtId"; export * from './resQuotationResultQtId';
export * from "./resQuotationSetting"; export * from './resQuotationResultWinnerSupplierId';
export * from "./resQuotationSettingList"; export * from './resQuotationResultWinnerSupplierName';
export * from "./resQuotationSettingListMsg"; export * from './resQuotationSessions';
export * from "./resQuotationSettingMsg"; export * from './resQuotationSessionsMsg';
export * from "./resQuotationSettingSetting"; export * from './resQuotationSessionsQtId';
export * from "./resQuotationStatus"; export * from './resQuotationSetting';
export * from "./resQuotationStatusMsg"; export * from './resQuotationSettingList';
export * from "./resQuotationStatusQtId"; export * from './resQuotationSettingListMsg';
export * from "./resRefreshToken"; export * from './resQuotationSettingMsg';
export * from "./resRefreshTokenMsg"; export * from './resQuotationSettingSetting';
export * from "./resSessionChat"; export * from './resQuotationStatus';
export * from "./resSessionChatMsg"; export * from './resQuotationStatusMsg';
export * from "./resSessionChatSessionId"; export * from './resQuotationStatusQtId';
export * from "./resSupplier"; export * from './resRefreshToken';
export * from "./resSupplierList"; export * from './resRefreshTokenMsg';
export * from "./resSupplierListMsg"; export * from './resSessionChat';
export * from "./resSupplierMsg"; export * from './resSessionChatMsg';
export * from "./resSupplierSupplier"; export * from './resSessionChatSessionId';
export * from "./sessionData"; export * from './resSupplier';
export * from "./sessionDataBidAt"; export * from './resSupplierList';
export * from "./sessionDataBidPrice"; export * from './resSupplierListMsg';
export * from "./sessionDataRejectDeliveryType"; export * from './resSupplierMsg';
export * from "./sessionDataRejectPrice"; export * from './resSupplierSupplier';
export * from "./sessionDataRejectReason"; export * from './sessionData';
export * from "./supplierData"; export * from './sessionDataBidAt';
export * from "./supplierDataCode"; export * from './sessionDataBidPrice';
export * from "./supplierDataCreatedAt"; export * from './sessionDataRejectDeliveryType';
export * from "./supplierDataManagerContactNumber"; export * from './sessionDataRejectPrice';
export * from "./supplierDataManagerEmail"; export * from './sessionDataRejectReason';
export * from "./supplierDataManagerName"; export * from './supplierData';
export * from "./supplierDataPriority"; export * from './supplierDataCode';
export * from "./supplierDataUpdatedAt"; export * from './supplierDataCreatedAt';
export * from "./validationError"; export * from './supplierDataManagerContactNumber';
export * from "./validationErrorCtx"; export * from './supplierDataManagerEmail';
export * from "./validationErrorLocItem"; export * from './supplierDataManagerName';
export * from './supplierDataPriority';
export * from './supplierDataUpdatedAt';
export * from './validationError';
export * from './validationErrorCtx';
export * from './validationErrorLocItem';

View File

@ -4,22 +4,22 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ItemDataCode } from "./itemDataCode"; import type { ItemDataCode } from './itemDataCode';
import type { ItemDataCategory } from "./itemDataCategory"; import type { ItemDataCategory } from './itemDataCategory';
import type { ItemDataImageUrl } from "./itemDataImageUrl"; import type { ItemDataImageUrl } from './itemDataImageUrl';
import type { ItemDataModelName } from "./itemDataModelName"; import type { ItemDataModelName } from './itemDataModelName';
import type { ItemDataSpec } from "./itemDataSpec"; import type { ItemDataSpec } from './itemDataSpec';
import type { ItemDataManufacturer } from "./itemDataManufacturer"; import type { ItemDataManufacturer } from './itemDataManufacturer';
import type { ItemDataMadeIn } from "./itemDataMadeIn"; import type { ItemDataMadeIn } from './itemDataMadeIn';
import type { ItemDataPrice } from "./itemDataPrice"; import type { ItemDataPrice } from './itemDataPrice';
import type { ItemDataMoq } from "./itemDataMoq"; import type { ItemDataMoq } from './itemDataMoq';
import type { ItemDataLeadTime } from "./itemDataLeadTime"; import type { ItemDataLeadTime } from './itemDataLeadTime';
import type { ItemDataQuantityUnit } from "./itemDataQuantityUnit"; import type { ItemDataQuantityUnit } from './itemDataQuantityUnit';
import type { ItemDataDeliveryType } from "./itemDataDeliveryType"; import type { ItemDataDeliveryType } from './itemDataDeliveryType';
import type { ItemDataVatYn } from "./itemDataVatYn"; import type { ItemDataVatYn } from './itemDataVatYn';
import type { ItemDataDeliveryFeeYn } from "./itemDataDeliveryFeeYn"; import type { ItemDataDeliveryFeeYn } from './itemDataDeliveryFeeYn';
import type { ItemDataCreatedAt } from "./itemDataCreatedAt"; import type { ItemDataCreatedAt } from './itemDataCreatedAt';
import type { ItemDataUpdatedAt } from "./itemDataUpdatedAt"; import type { ItemDataUpdatedAt } from './itemDataUpdatedAt';
export interface ItemData { export interface ItemData {
item_id: string; item_id: string;

View File

@ -6,17 +6,17 @@
*/ */
export type ListCardsParams = { export type ListCardsParams = {
/** /**
* 카드명/카드번호/스크립트 검색 * 카드명/카드번호/스크립트 검색
*/ */
search?: string | null; search?: string | null;
/** /**
* @minimum 1 * @minimum 1
*/ */
page?: number; page?: number;
/** /**
* @minimum 1 * @minimum 1
* @maximum 100 * @maximum 100
*/ */
size?: number; size?: number;
}; };

View File

@ -6,21 +6,21 @@
*/ */
export type ListItemsParams = { export type ListItemsParams = {
/** /**
* 상품명/상품코드 검색 * 상품명/상품코드 검색
*/ */
search?: string | null; search?: string | null;
/** /**
* 카테고리 필터 * 카테고리 필터
*/ */
category?: string | null; category?: string | null;
/** /**
* @minimum 1 * @minimum 1
*/ */
page?: number; page?: number;
/** /**
* @minimum 1 * @minimum 1
* @maximum 100 * @maximum 100
*/ */
size?: number; size?: number;
}; };

View File

@ -6,29 +6,29 @@
*/ */
export type ListQuotationsParams = { export type ListQuotationsParams = {
/** /**
* 상태 필터(정확히 일치) * 상태 필터(정확히 일치)
*/ */
status?: string | null; status?: string | null;
/** /**
* 유형 필터(정확히 일치) * 유형 필터(정확히 일치)
*/ */
type?: string | null; type?: string | null;
/** /**
* 시작일시 이후(ISO) * 시작일시 이후(ISO)
*/ */
start_from?: string | null; start_from?: string | null;
/** /**
* 시작일시 이전(ISO) * 시작일시 이전(ISO)
*/ */
start_to?: string | null; start_to?: string | null;
/** /**
* @minimum 1 * @minimum 1
*/ */
page?: number; page?: number;
/** /**
* @minimum 1 * @minimum 1
* @maximum 100 * @maximum 100
*/ */
size?: number; size?: number;
}; };

View File

@ -6,21 +6,21 @@
*/ */
export type ListSuppliersParams = { export type ListSuppliersParams = {
/** /**
* 협력사명/코드/담당자명 검색 * 협력사명/코드/담당자명 검색
*/ */
search?: string | null; search?: string | null;
/** /**
* 우선순위 필터(HIGH/MEDIUM/LOW) * 우선순위 필터(HIGH/MEDIUM/LOW)
*/ */
priority?: string | null; priority?: string | null;
/** /**
* @minimum 1 * @minimum 1
*/ */
page?: number; page?: number;
/** /**
* @minimum 1 * @minimum 1
* @maximum 100 * @maximum 100
*/ */
size?: number; size?: number;
}; };

View File

@ -4,12 +4,16 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { QuotationCardDataQtId } from "./quotationCardDataQtId"; import type { QuotationCardDataQtId } from './quotationCardDataQtId';
import type { QuotationCardDataNegoCardId } from "./quotationCardDataNegoCardId"; import type { QuotationCardDataNegoCardId } from './quotationCardDataNegoCardId';
import type { QuotationCardDataWildCardId } from "./quotationCardDataWildCardId"; import type { QuotationCardDataWildCardId } from './quotationCardDataWildCardId';
import type { QuotationCardDataType } from "./quotationCardDataType"; import type { QuotationCardDataType } from './quotationCardDataType';
import type { QuotationCardDataName } from "./quotationCardDataName"; import type { QuotationCardDataNumber } from './quotationCardDataNumber';
import type { QuotationCardDataScript } from "./quotationCardDataScript"; import type { QuotationCardDataName } from './quotationCardDataName';
import type { QuotationCardDataScript } from './quotationCardDataScript';
import type { QuotationCardDataEditScript } from './quotationCardDataEditScript';
import type { QuotationCardDataCondition } from './quotationCardDataCondition';
import type { QuotationCardDataMemo } from './quotationCardDataMemo';
export interface QuotationCardData { export interface QuotationCardData {
session_card_id: string; session_card_id: string;
@ -17,6 +21,10 @@ export interface QuotationCardData {
nego_card_id?: QuotationCardDataNegoCardId; nego_card_id?: QuotationCardDataNegoCardId;
wild_card_id?: QuotationCardDataWildCardId; wild_card_id?: QuotationCardDataWildCardId;
type?: QuotationCardDataType; type?: QuotationCardDataType;
number?: QuotationCardDataNumber;
name?: QuotationCardDataName; name?: QuotationCardDataName;
script?: QuotationCardDataScript; script?: QuotationCardDataScript;
edit_script?: QuotationCardDataEditScript;
condition?: QuotationCardDataCondition;
memo?: QuotationCardDataMemo;
} }

View File

@ -5,4 +5,4 @@
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
export type ResExcelUploadReceivedFilename = string | null; export type QuotationCardDataCondition = string | null;

View File

@ -5,6 +5,4 @@
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
export interface BodyUploadSuppliersExcelV1SupplierUploadExcelPost { export type QuotationCardDataEditScript = unknown | null;
file: string;
}

View File

@ -0,0 +1,8 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* Negodata Api Server
* OpenAPI spec version: 0.1.0
*/
export type QuotationCardDataMemo = string | null;

View File

@ -0,0 +1,8 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* Negodata Api Server
* OpenAPI spec version: 0.1.0
*/
export type QuotationCardDataNumber = string | null;

View File

@ -4,17 +4,17 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { QuotationDataManagerName } from "./quotationDataManagerName"; import type { QuotationDataManagerName } from './quotationDataManagerName';
import type { QuotationDataManagerEmail } from "./quotationDataManagerEmail"; import type { QuotationDataManagerEmail } from './quotationDataManagerEmail';
import type { QuotationDataManagerContactNumber } from "./quotationDataManagerContactNumber"; import type { QuotationDataManagerContactNumber } from './quotationDataManagerContactNumber';
import type { QuotationDataMemo } from "./quotationDataMemo"; import type { QuotationDataMemo } from './quotationDataMemo';
import type { QuotationDataPreferredSpYn } from "./quotationDataPreferredSpYn"; import type { QuotationDataPreferredSpYn } from './quotationDataPreferredSpYn';
import type { QuotationDataPreferredSpId } from "./quotationDataPreferredSpId"; import type { QuotationDataPreferredSpId } from './quotationDataPreferredSpId';
import type { QuotationDataPreferredSpName } from "./quotationDataPreferredSpName"; import type { QuotationDataPreferredSpName } from './quotationDataPreferredSpName';
import type { QuotationDataEqualBidYn } from "./quotationDataEqualBidYn"; import type { QuotationDataEqualBidYn } from './quotationDataEqualBidYn';
import type { QuotationDataEqualBidData } from "./quotationDataEqualBidData"; import type { QuotationDataEqualBidData } from './quotationDataEqualBidData';
import type { QuotationDataCreatedAt } from "./quotationDataCreatedAt"; import type { QuotationDataCreatedAt } from './quotationDataCreatedAt';
import type { QuotationDataUpdatedAt } from "./quotationDataUpdatedAt"; import type { QuotationDataUpdatedAt } from './quotationDataUpdatedAt';
export interface QuotationData { export interface QuotationData {
qt_id: string; qt_id: string;
@ -38,6 +38,7 @@ export interface QuotationData {
preferred_sp_name?: QuotationDataPreferredSpName; preferred_sp_name?: QuotationDataPreferredSpName;
equal_bid_yn?: QuotationDataEqualBidYn; equal_bid_yn?: QuotationDataEqualBidYn;
equal_bid_data?: QuotationDataEqualBidData; equal_bid_data?: QuotationDataEqualBidData;
participation_count?: number;
created_at?: QuotationDataCreatedAt; created_at?: QuotationDataCreatedAt;
updated_at?: QuotationDataUpdatedAt; updated_at?: QuotationDataUpdatedAt;
} }

View File

@ -4,9 +4,9 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { QuotationSettingDataUserId } from "./quotationSettingDataUserId"; import type { QuotationSettingDataUserId } from './quotationSettingDataUserId';
import type { QuotationSettingDataCreatedAt } from "./quotationSettingDataCreatedAt"; import type { QuotationSettingDataCreatedAt } from './quotationSettingDataCreatedAt';
import type { QuotationSettingDataUpdatedAt } from "./quotationSettingDataUpdatedAt"; import type { QuotationSettingDataUpdatedAt } from './quotationSettingDataUpdatedAt';
export interface QuotationSettingData { export interface QuotationSettingData {
qt_setting_id: string; qt_setting_id: string;

View File

@ -4,12 +4,12 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ReqCreateCardName } from "./reqCreateCardName"; import type { ReqCreateCardName } from './reqCreateCardName';
import type { ReqCreateCardNumber } from "./reqCreateCardNumber"; import type { ReqCreateCardNumber } from './reqCreateCardNumber';
import type { ReqCreateCardScript } from "./reqCreateCardScript"; import type { ReqCreateCardScript } from './reqCreateCardScript';
import type { ReqCreateCardEditScript } from "./reqCreateCardEditScript"; import type { ReqCreateCardEditScript } from './reqCreateCardEditScript';
import type { ReqCreateCardCondition } from "./reqCreateCardCondition"; import type { ReqCreateCardCondition } from './reqCreateCardCondition';
import type { ReqCreateCardMemo } from "./reqCreateCardMemo"; import type { ReqCreateCardMemo } from './reqCreateCardMemo';
export interface ReqCreateCard { export interface ReqCreateCard {
is_wildcard?: boolean; is_wildcard?: boolean;

View File

@ -4,20 +4,20 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ReqCreateItemCode } from "./reqCreateItemCode"; import type { ReqCreateItemCode } from './reqCreateItemCode';
import type { ReqCreateItemCategory } from "./reqCreateItemCategory"; import type { ReqCreateItemCategory } from './reqCreateItemCategory';
import type { ReqCreateItemImageUrl } from "./reqCreateItemImageUrl"; import type { ReqCreateItemImageUrl } from './reqCreateItemImageUrl';
import type { ReqCreateItemModelName } from "./reqCreateItemModelName"; import type { ReqCreateItemModelName } from './reqCreateItemModelName';
import type { ReqCreateItemSpec } from "./reqCreateItemSpec"; import type { ReqCreateItemSpec } from './reqCreateItemSpec';
import type { ReqCreateItemManufacturer } from "./reqCreateItemManufacturer"; import type { ReqCreateItemManufacturer } from './reqCreateItemManufacturer';
import type { ReqCreateItemMadeIn } from "./reqCreateItemMadeIn"; import type { ReqCreateItemMadeIn } from './reqCreateItemMadeIn';
import type { ReqCreateItemPrice } from "./reqCreateItemPrice"; import type { ReqCreateItemPrice } from './reqCreateItemPrice';
import type { ReqCreateItemMoq } from "./reqCreateItemMoq"; import type { ReqCreateItemMoq } from './reqCreateItemMoq';
import type { ReqCreateItemLeadTime } from "./reqCreateItemLeadTime"; import type { ReqCreateItemLeadTime } from './reqCreateItemLeadTime';
import type { ReqCreateItemQuantityUnit } from "./reqCreateItemQuantityUnit"; import type { ReqCreateItemQuantityUnit } from './reqCreateItemQuantityUnit';
import type { ReqCreateItemDeliveryType } from "./reqCreateItemDeliveryType"; import type { ReqCreateItemDeliveryType } from './reqCreateItemDeliveryType';
import type { ReqCreateItemVatYn } from "./reqCreateItemVatYn"; import type { ReqCreateItemVatYn } from './reqCreateItemVatYn';
import type { ReqCreateItemDeliveryFeeYn } from "./reqCreateItemDeliveryFeeYn"; import type { ReqCreateItemDeliveryFeeYn } from './reqCreateItemDeliveryFeeYn';
export interface ReqCreateItem { export interface ReqCreateItem {
name?: string; name?: string;

View File

@ -4,10 +4,10 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ReqCreateQuotationManagerName } from "./reqCreateQuotationManagerName"; import type { ReqCreateQuotationManagerName } from './reqCreateQuotationManagerName';
import type { ReqCreateQuotationManagerEmail } from "./reqCreateQuotationManagerEmail"; import type { ReqCreateQuotationManagerEmail } from './reqCreateQuotationManagerEmail';
import type { ReqCreateQuotationManagerContactNumber } from "./reqCreateQuotationManagerContactNumber"; import type { ReqCreateQuotationManagerContactNumber } from './reqCreateQuotationManagerContactNumber';
import type { ReqCreateQuotationMemo } from "./reqCreateQuotationMemo"; import type { ReqCreateQuotationMemo } from './reqCreateQuotationMemo';
export interface ReqCreateQuotation { export interface ReqCreateQuotation {
qt_setting_id: string; qt_setting_id: string;

View File

@ -4,11 +4,11 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ReqCreateSupplierCode } from "./reqCreateSupplierCode"; import type { ReqCreateSupplierCode } from './reqCreateSupplierCode';
import type { ReqCreateSupplierManagerName } from "./reqCreateSupplierManagerName"; import type { ReqCreateSupplierManagerName } from './reqCreateSupplierManagerName';
import type { ReqCreateSupplierManagerEmail } from "./reqCreateSupplierManagerEmail"; import type { ReqCreateSupplierManagerEmail } from './reqCreateSupplierManagerEmail';
import type { ReqCreateSupplierManagerContactNumber } from "./reqCreateSupplierManagerContactNumber"; import type { ReqCreateSupplierManagerContactNumber } from './reqCreateSupplierManagerContactNumber';
import type { ReqCreateSupplierPriority } from "./reqCreateSupplierPriority"; import type { ReqCreateSupplierPriority } from './reqCreateSupplierPriority';
export interface ReqCreateSupplier { export interface ReqCreateSupplier {
name?: string; name?: string;

View File

@ -4,13 +4,13 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ReqUpdateCardName } from "./reqUpdateCardName"; import type { ReqUpdateCardName } from './reqUpdateCardName';
import type { ReqUpdateCardNumber } from "./reqUpdateCardNumber"; import type { ReqUpdateCardNumber } from './reqUpdateCardNumber';
import type { ReqUpdateCardScript } from "./reqUpdateCardScript"; import type { ReqUpdateCardScript } from './reqUpdateCardScript';
import type { ReqUpdateCardEditScript } from "./reqUpdateCardEditScript"; import type { ReqUpdateCardEditScript } from './reqUpdateCardEditScript';
import type { ReqUpdateCardStatus } from "./reqUpdateCardStatus"; import type { ReqUpdateCardStatus } from './reqUpdateCardStatus';
import type { ReqUpdateCardCondition } from "./reqUpdateCardCondition"; import type { ReqUpdateCardCondition } from './reqUpdateCardCondition';
import type { ReqUpdateCardMemo } from "./reqUpdateCardMemo"; import type { ReqUpdateCardMemo } from './reqUpdateCardMemo';
export interface ReqUpdateCard { export interface ReqUpdateCard {
name?: ReqUpdateCardName; name?: ReqUpdateCardName;

View File

@ -4,23 +4,23 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ReqUpdateItemName } from "./reqUpdateItemName"; import type { ReqUpdateItemName } from './reqUpdateItemName';
import type { ReqUpdateItemCode } from "./reqUpdateItemCode"; import type { ReqUpdateItemCode } from './reqUpdateItemCode';
import type { ReqUpdateItemCategory } from "./reqUpdateItemCategory"; import type { ReqUpdateItemCategory } from './reqUpdateItemCategory';
import type { ReqUpdateItemCategoryType } from "./reqUpdateItemCategoryType"; import type { ReqUpdateItemCategoryType } from './reqUpdateItemCategoryType';
import type { ReqUpdateItemImageUrl } from "./reqUpdateItemImageUrl"; import type { ReqUpdateItemImageUrl } from './reqUpdateItemImageUrl';
import type { ReqUpdateItemModelName } from "./reqUpdateItemModelName"; import type { ReqUpdateItemModelName } from './reqUpdateItemModelName';
import type { ReqUpdateItemSpec } from "./reqUpdateItemSpec"; import type { ReqUpdateItemSpec } from './reqUpdateItemSpec';
import type { ReqUpdateItemManufacturer } from "./reqUpdateItemManufacturer"; import type { ReqUpdateItemManufacturer } from './reqUpdateItemManufacturer';
import type { ReqUpdateItemMadeIn } from "./reqUpdateItemMadeIn"; import type { ReqUpdateItemMadeIn } from './reqUpdateItemMadeIn';
import type { ReqUpdateItemPrice } from "./reqUpdateItemPrice"; import type { ReqUpdateItemPrice } from './reqUpdateItemPrice';
import type { ReqUpdateItemInternetLowestPriceYn } from "./reqUpdateItemInternetLowestPriceYn"; import type { ReqUpdateItemInternetLowestPriceYn } from './reqUpdateItemInternetLowestPriceYn';
import type { ReqUpdateItemMoq } from "./reqUpdateItemMoq"; import type { ReqUpdateItemMoq } from './reqUpdateItemMoq';
import type { ReqUpdateItemLeadTime } from "./reqUpdateItemLeadTime"; import type { ReqUpdateItemLeadTime } from './reqUpdateItemLeadTime';
import type { ReqUpdateItemQuantityUnit } from "./reqUpdateItemQuantityUnit"; import type { ReqUpdateItemQuantityUnit } from './reqUpdateItemQuantityUnit';
import type { ReqUpdateItemDeliveryType } from "./reqUpdateItemDeliveryType"; import type { ReqUpdateItemDeliveryType } from './reqUpdateItemDeliveryType';
import type { ReqUpdateItemVatYn } from "./reqUpdateItemVatYn"; import type { ReqUpdateItemVatYn } from './reqUpdateItemVatYn';
import type { ReqUpdateItemDeliveryFeeYn } from "./reqUpdateItemDeliveryFeeYn"; import type { ReqUpdateItemDeliveryFeeYn } from './reqUpdateItemDeliveryFeeYn';
export interface ReqUpdateItem { export interface ReqUpdateItem {
name?: ReqUpdateItemName; name?: ReqUpdateItemName;

View File

@ -4,9 +4,9 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ReqUpdateQuotationSettingTargetMarginRate } from "./reqUpdateQuotationSettingTargetMarginRate"; import type { ReqUpdateQuotationSettingTargetMarginRate } from './reqUpdateQuotationSettingTargetMarginRate';
import type { ReqUpdateQuotationSettingAnchoringValue } from "./reqUpdateQuotationSettingAnchoringValue"; import type { ReqUpdateQuotationSettingAnchoringValue } from './reqUpdateQuotationSettingAnchoringValue';
import type { ReqUpdateQuotationSettingCardCount } from "./reqUpdateQuotationSettingCardCount"; import type { ReqUpdateQuotationSettingCardCount } from './reqUpdateQuotationSettingCardCount';
export interface ReqUpdateQuotationSetting { export interface ReqUpdateQuotationSetting {
target_margin_rate?: ReqUpdateQuotationSettingTargetMarginRate; target_margin_rate?: ReqUpdateQuotationSettingTargetMarginRate;

View File

@ -4,12 +4,12 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ReqUpdateSupplierName } from "./reqUpdateSupplierName"; import type { ReqUpdateSupplierName } from './reqUpdateSupplierName';
import type { ReqUpdateSupplierCode } from "./reqUpdateSupplierCode"; import type { ReqUpdateSupplierCode } from './reqUpdateSupplierCode';
import type { ReqUpdateSupplierManagerName } from "./reqUpdateSupplierManagerName"; import type { ReqUpdateSupplierManagerName } from './reqUpdateSupplierManagerName';
import type { ReqUpdateSupplierManagerEmail } from "./reqUpdateSupplierManagerEmail"; import type { ReqUpdateSupplierManagerEmail } from './reqUpdateSupplierManagerEmail';
import type { ReqUpdateSupplierManagerContactNumber } from "./reqUpdateSupplierManagerContactNumber"; import type { ReqUpdateSupplierManagerContactNumber } from './reqUpdateSupplierManagerContactNumber';
import type { ReqUpdateSupplierPriority } from "./reqUpdateSupplierPriority"; import type { ReqUpdateSupplierPriority } from './reqUpdateSupplierPriority';
export interface ReqUpdateSupplier { export interface ReqUpdateSupplier {
name?: ReqUpdateSupplierName; name?: ReqUpdateSupplierName;

View File

@ -4,9 +4,9 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResCardMsg } from "./resCardMsg"; import type { ResCardMsg } from './resCardMsg';
import type { ResCardCard } from "./resCardCard"; import type { ResCardCard } from './resCardCard';
export interface ResCard { export interface ResCard {
result?: ErrorInfo; result?: ErrorInfo;

View File

@ -4,6 +4,6 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { CardData } from "./cardData"; import type { CardData } from './cardData';
export type ResCardCard = CardData | null; export type ResCardCard = CardData | null;

View File

@ -4,15 +4,15 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResCardListMsg } from "./resCardListMsg"; import type { ResCardListMsg } from './resCardListMsg';
import type { CardData } from "./cardData"; import type { CardData } from './cardData';
export interface ResCardList { export interface ResCardList {
result?: ErrorInfo; result?: ErrorInfo;
msg?: ResCardListMsg; msg?: ResCardListMsg;
cards?: CardData[];
total?: number; total?: number;
page?: number; page?: number;
size?: number; size?: number;
cards?: CardData[];
} }

View File

@ -4,8 +4,8 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResCheckCodesMsg } from "./resCheckCodesMsg"; import type { ResCheckCodesMsg } from './resCheckCodesMsg';
export interface ResCheckCodes { export interface ResCheckCodes {
result?: ErrorInfo; result?: ErrorInfo;

View File

@ -4,8 +4,8 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResCreateAccountMsg } from "./resCreateAccountMsg"; import type { ResCreateAccountMsg } from './resCreateAccountMsg';
export interface ResCreateAccount { export interface ResCreateAccount {
result?: ErrorInfo; result?: ErrorInfo;

View File

@ -4,10 +4,10 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResCreateQuotationMsg } from "./resCreateQuotationMsg"; import type { ResCreateQuotationMsg } from './resCreateQuotationMsg';
import type { ResCreateQuotationQuotation } from "./resCreateQuotationQuotation"; import type { ResCreateQuotationQuotation } from './resCreateQuotationQuotation';
import type { ResCreateQuotationAsyncJob } from "./resCreateQuotationAsyncJob"; import type { ResCreateQuotationAsyncJob } from './resCreateQuotationAsyncJob';
export interface ResCreateQuotation { export interface ResCreateQuotation {
result?: ErrorInfo; result?: ErrorInfo;

View File

@ -4,6 +4,6 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { AsyncJob } from "./asyncJob"; import type { AsyncJob } from './asyncJob';
export type ResCreateQuotationAsyncJob = AsyncJob | null; export type ResCreateQuotationAsyncJob = AsyncJob | null;

View File

@ -4,6 +4,6 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { QuotationData } from "./quotationData"; import type { QuotationData } from './quotationData';
export type ResCreateQuotationQuotation = QuotationData | null; export type ResCreateQuotationQuotation = QuotationData | null;

View File

@ -4,8 +4,8 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResDeleteCardMsg } from "./resDeleteCardMsg"; import type { ResDeleteCardMsg } from './resDeleteCardMsg';
export interface ResDeleteCard { export interface ResDeleteCard {
result?: ErrorInfo; result?: ErrorInfo;

View File

@ -4,8 +4,8 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResDeleteItemMsg } from "./resDeleteItemMsg"; import type { ResDeleteItemMsg } from './resDeleteItemMsg';
export interface ResDeleteItem { export interface ResDeleteItem {
result?: ErrorInfo; result?: ErrorInfo;

View File

@ -4,8 +4,8 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResDeleteQuotationMsg } from "./resDeleteQuotationMsg"; import type { ResDeleteQuotationMsg } from './resDeleteQuotationMsg';
export interface ResDeleteQuotation { export interface ResDeleteQuotation {
result?: ErrorInfo; result?: ErrorInfo;

View File

@ -4,8 +4,8 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResDeleteQuotationSettingMsg } from "./resDeleteQuotationSettingMsg"; import type { ResDeleteQuotationSettingMsg } from './resDeleteQuotationSettingMsg';
export interface ResDeleteQuotationSetting { export interface ResDeleteQuotationSetting {
result?: ErrorInfo; result?: ErrorInfo;

View File

@ -4,8 +4,8 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResDeleteSupplierMsg } from "./resDeleteSupplierMsg"; import type { ResDeleteSupplierMsg } from './resDeleteSupplierMsg';
export interface ResDeleteSupplier { export interface ResDeleteSupplier {
result?: ErrorInfo; result?: ErrorInfo;

View File

@ -4,9 +4,9 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResEnumsMsg } from "./resEnumsMsg"; import type { ResEnumsMsg } from './resEnumsMsg';
import type { ResEnumsEnums } from "./resEnumsEnums"; import type { ResEnumsEnums } from './resEnumsEnums';
export interface ResEnums { export interface ResEnums {
result?: ErrorInfo; result?: ErrorInfo;

View File

@ -4,6 +4,6 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { EnumOption } from "./enumOption"; import type { EnumOption } from './enumOption';
export type ResEnumsEnums = { [key: string]: EnumOption[] }; export type ResEnumsEnums = {[key: string]: EnumOption[]};

View File

@ -1,17 +0,0 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* Negodata Api Server
* OpenAPI spec version: 0.1.0
*/
import type { ErrorInfo } from "./errorInfo";
import type { ResExcelUploadMsg } from "./resExcelUploadMsg";
import type { ResExcelUploadReceivedFilename } from "./resExcelUploadReceivedFilename";
export interface ResExcelUpload {
result?: ErrorInfo;
msg?: ResExcelUploadMsg;
received_filename?: ResExcelUploadReceivedFilename;
status?: string;
message?: string;
}

View File

@ -4,9 +4,9 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResItemMsg } from "./resItemMsg"; import type { ResItemMsg } from './resItemMsg';
import type { ResItemItem } from "./resItemItem"; import type { ResItemItem } from './resItemItem';
export interface ResItem { export interface ResItem {
result?: ErrorInfo; result?: ErrorInfo;

View File

@ -4,9 +4,9 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResItemCategoriesMsg } from "./resItemCategoriesMsg"; import type { ResItemCategoriesMsg } from './resItemCategoriesMsg';
import type { ItemCategory } from "./itemCategory"; import type { ItemCategory } from './itemCategory';
export interface ResItemCategories { export interface ResItemCategories {
result?: ErrorInfo; result?: ErrorInfo;

View File

@ -0,0 +1,19 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* Negodata Api Server
* OpenAPI spec version: 0.1.0
*/
import type { ErrorInfo } from './errorInfo';
import type { ResItemImageMsg } from './resItemImageMsg';
import type { ResItemImageImageUrl } from './resItemImageImageUrl';
import type { ResItemImageFilename } from './resItemImageFilename';
import type { ResItemImageSize } from './resItemImageSize';
export interface ResItemImage {
result?: ErrorInfo;
msg?: ResItemImageMsg;
image_url?: ResItemImageImageUrl;
filename?: ResItemImageFilename;
size?: ResItemImageSize;
}

View File

@ -0,0 +1,8 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* Negodata Api Server
* OpenAPI spec version: 0.1.0
*/
export type ResItemImageFilename = string | null;

View File

@ -0,0 +1,8 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* Negodata Api Server
* OpenAPI spec version: 0.1.0
*/
export type ResItemImageImageUrl = string | null;

View File

@ -5,4 +5,4 @@
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
export type ResExcelUploadMsg = string | null; export type ResItemImageMsg = string | null;

View File

@ -0,0 +1,8 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* Negodata Api Server
* OpenAPI spec version: 0.1.0
*/
export type ResItemImageSize = number | null;

View File

@ -4,6 +4,6 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ItemData } from "./itemData"; import type { ItemData } from './itemData';
export type ResItemItem = ItemData | null; export type ResItemItem = ItemData | null;

View File

@ -4,15 +4,15 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResItemListMsg } from "./resItemListMsg"; import type { ResItemListMsg } from './resItemListMsg';
import type { ItemData } from "./itemData"; import type { ItemData } from './itemData';
export interface ResItemList { export interface ResItemList {
result?: ErrorInfo; result?: ErrorInfo;
msg?: ResItemListMsg; msg?: ResItemListMsg;
items?: ItemData[];
total?: number; total?: number;
page?: number; page?: number;
size?: number; size?: number;
items?: ItemData[];
} }

View File

@ -4,8 +4,8 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResLoginMsg } from "./resLoginMsg"; import type { ResLoginMsg } from './resLoginMsg';
export interface ResLogin { export interface ResLogin {
result?: ErrorInfo; result?: ErrorInfo;

View File

@ -4,8 +4,8 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResLowestPriceResultMsg } from "./resLowestPriceResultMsg"; import type { ResLowestPriceResultMsg } from './resLowestPriceResultMsg';
export interface ResLowestPriceResult { export interface ResLowestPriceResult {
result?: ErrorInfo; result?: ErrorInfo;

View File

@ -4,8 +4,8 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResLowestPriceTriggerMsg } from "./resLowestPriceTriggerMsg"; import type { ResLowestPriceTriggerMsg } from './resLowestPriceTriggerMsg';
export interface ResLowestPriceTrigger { export interface ResLowestPriceTrigger {
result?: ErrorInfo; result?: ErrorInfo;

View File

@ -4,12 +4,12 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResMeMsg } from "./resMeMsg"; import type { ResMeMsg } from './resMeMsg';
import type { ResMeName } from "./resMeName"; import type { ResMeName } from './resMeName';
import type { ResMeEmail } from "./resMeEmail"; import type { ResMeEmail } from './resMeEmail';
import type { ResMeContactNumber } from "./resMeContactNumber"; import type { ResMeContactNumber } from './resMeContactNumber';
import type { ResMeCompany } from "./resMeCompany"; import type { ResMeCompany } from './resMeCompany';
export interface ResMe { export interface ResMe {
result?: ErrorInfo; result?: ErrorInfo;

View File

@ -4,6 +4,6 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { CompanyData } from "./companyData"; import type { CompanyData } from './companyData';
export type ResMeCompany = CompanyData | null; export type ResMeCompany = CompanyData | null;

View File

@ -4,9 +4,9 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResQuotationMsg } from "./resQuotationMsg"; import type { ResQuotationMsg } from './resQuotationMsg';
import type { ResQuotationQuotation } from "./resQuotationQuotation"; import type { ResQuotationQuotation } from './resQuotationQuotation';
export interface ResQuotation { export interface ResQuotation {
result?: ErrorInfo; result?: ErrorInfo;

View File

@ -4,10 +4,10 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResQuotationCardsMsg } from "./resQuotationCardsMsg"; import type { ResQuotationCardsMsg } from './resQuotationCardsMsg';
import type { ResQuotationCardsQtId } from "./resQuotationCardsQtId"; import type { ResQuotationCardsQtId } from './resQuotationCardsQtId';
import type { QuotationCardData } from "./quotationCardData"; import type { QuotationCardData } from './quotationCardData';
export interface ResQuotationCards { export interface ResQuotationCards {
result?: ErrorInfo; result?: ErrorInfo;

View File

@ -4,15 +4,15 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResQuotationListMsg } from "./resQuotationListMsg"; import type { ResQuotationListMsg } from './resQuotationListMsg';
import type { QuotationData } from "./quotationData"; import type { QuotationData } from './quotationData';
export interface ResQuotationList { export interface ResQuotationList {
result?: ErrorInfo; result?: ErrorInfo;
msg?: ResQuotationListMsg; msg?: ResQuotationListMsg;
quotations?: QuotationData[];
total?: number; total?: number;
page?: number; page?: number;
size?: number; size?: number;
quotations?: QuotationData[];
} }

View File

@ -4,6 +4,6 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { QuotationData } from "./quotationData"; import type { QuotationData } from './quotationData';
export type ResQuotationQuotation = QuotationData | null; export type ResQuotationQuotation = QuotationData | null;

View File

@ -4,13 +4,13 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResQuotationResultMsg } from "./resQuotationResultMsg"; import type { ResQuotationResultMsg } from './resQuotationResultMsg';
import type { ResQuotationResultQtId } from "./resQuotationResultQtId"; import type { ResQuotationResultQtId } from './resQuotationResultQtId';
import type { ResQuotationResultWinnerSupplierId } from "./resQuotationResultWinnerSupplierId"; import type { ResQuotationResultWinnerSupplierId } from './resQuotationResultWinnerSupplierId';
import type { ResQuotationResultWinnerSupplierName } from "./resQuotationResultWinnerSupplierName"; import type { ResQuotationResultWinnerSupplierName } from './resQuotationResultWinnerSupplierName';
import type { ResQuotationResultIsEqualBid } from "./resQuotationResultIsEqualBid"; import type { ResQuotationResultIsEqualBid } from './resQuotationResultIsEqualBid';
import type { ResQuotationResultEqualBidData } from "./resQuotationResultEqualBidData"; import type { ResQuotationResultEqualBidData } from './resQuotationResultEqualBidData';
export interface ResQuotationResult { export interface ResQuotationResult {
result?: ErrorInfo; result?: ErrorInfo;

View File

@ -4,10 +4,10 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResQuotationSessionsMsg } from "./resQuotationSessionsMsg"; import type { ResQuotationSessionsMsg } from './resQuotationSessionsMsg';
import type { ResQuotationSessionsQtId } from "./resQuotationSessionsQtId"; import type { ResQuotationSessionsQtId } from './resQuotationSessionsQtId';
import type { SessionData } from "./sessionData"; import type { SessionData } from './sessionData';
export interface ResQuotationSessions { export interface ResQuotationSessions {
result?: ErrorInfo; result?: ErrorInfo;

View File

@ -4,9 +4,9 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResQuotationSettingMsg } from "./resQuotationSettingMsg"; import type { ResQuotationSettingMsg } from './resQuotationSettingMsg';
import type { ResQuotationSettingSetting } from "./resQuotationSettingSetting"; import type { ResQuotationSettingSetting } from './resQuotationSettingSetting';
export interface ResQuotationSetting { export interface ResQuotationSetting {
result?: ErrorInfo; result?: ErrorInfo;

View File

@ -4,9 +4,9 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResQuotationSettingListMsg } from "./resQuotationSettingListMsg"; import type { ResQuotationSettingListMsg } from './resQuotationSettingListMsg';
import type { QuotationSettingData } from "./quotationSettingData"; import type { QuotationSettingData } from './quotationSettingData';
export interface ResQuotationSettingList { export interface ResQuotationSettingList {
result?: ErrorInfo; result?: ErrorInfo;

View File

@ -4,6 +4,6 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { QuotationSettingData } from "./quotationSettingData"; import type { QuotationSettingData } from './quotationSettingData';
export type ResQuotationSettingSetting = QuotationSettingData | null; export type ResQuotationSettingSetting = QuotationSettingData | null;

View File

@ -4,9 +4,9 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResQuotationStatusMsg } from "./resQuotationStatusMsg"; import type { ResQuotationStatusMsg } from './resQuotationStatusMsg';
import type { ResQuotationStatusQtId } from "./resQuotationStatusQtId"; import type { ResQuotationStatusQtId } from './resQuotationStatusQtId';
export interface ResQuotationStatus { export interface ResQuotationStatus {
result?: ErrorInfo; result?: ErrorInfo;

View File

@ -4,8 +4,8 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResRefreshTokenMsg } from "./resRefreshTokenMsg"; import type { ResRefreshTokenMsg } from './resRefreshTokenMsg';
export interface ResRefreshToken { export interface ResRefreshToken {
result?: ErrorInfo; result?: ErrorInfo;

View File

@ -4,10 +4,10 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResSessionChatMsg } from "./resSessionChatMsg"; import type { ResSessionChatMsg } from './resSessionChatMsg';
import type { ResSessionChatSessionId } from "./resSessionChatSessionId"; import type { ResSessionChatSessionId } from './resSessionChatSessionId';
import type { ChatMessageData } from "./chatMessageData"; import type { ChatMessageData } from './chatMessageData';
export interface ResSessionChat { export interface ResSessionChat {
result?: ErrorInfo; result?: ErrorInfo;

View File

@ -4,9 +4,9 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResSupplierMsg } from "./resSupplierMsg"; import type { ResSupplierMsg } from './resSupplierMsg';
import type { ResSupplierSupplier } from "./resSupplierSupplier"; import type { ResSupplierSupplier } from './resSupplierSupplier';
export interface ResSupplier { export interface ResSupplier {
result?: ErrorInfo; result?: ErrorInfo;

View File

@ -4,15 +4,15 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ErrorInfo } from "./errorInfo"; import type { ErrorInfo } from './errorInfo';
import type { ResSupplierListMsg } from "./resSupplierListMsg"; import type { ResSupplierListMsg } from './resSupplierListMsg';
import type { SupplierData } from "./supplierData"; import type { SupplierData } from './supplierData';
export interface ResSupplierList { export interface ResSupplierList {
result?: ErrorInfo; result?: ErrorInfo;
msg?: ResSupplierListMsg; msg?: ResSupplierListMsg;
suppliers?: SupplierData[];
total?: number; total?: number;
page?: number; page?: number;
size?: number; size?: number;
suppliers?: SupplierData[];
} }

View File

@ -4,6 +4,6 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { SupplierData } from "./supplierData"; import type { SupplierData } from './supplierData';
export type ResSupplierSupplier = SupplierData | null; export type ResSupplierSupplier = SupplierData | null;

View File

@ -4,11 +4,11 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { SessionDataBidPrice } from "./sessionDataBidPrice"; import type { SessionDataBidPrice } from './sessionDataBidPrice';
import type { SessionDataBidAt } from "./sessionDataBidAt"; import type { SessionDataBidAt } from './sessionDataBidAt';
import type { SessionDataRejectReason } from "./sessionDataRejectReason"; import type { SessionDataRejectReason } from './sessionDataRejectReason';
import type { SessionDataRejectPrice } from "./sessionDataRejectPrice"; import type { SessionDataRejectPrice } from './sessionDataRejectPrice';
import type { SessionDataRejectDeliveryType } from "./sessionDataRejectDeliveryType"; import type { SessionDataRejectDeliveryType } from './sessionDataRejectDeliveryType';
export interface SessionData { export interface SessionData {
session_id: string; session_id: string;

View File

@ -4,13 +4,13 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { SupplierDataCode } from "./supplierDataCode"; import type { SupplierDataCode } from './supplierDataCode';
import type { SupplierDataManagerName } from "./supplierDataManagerName"; import type { SupplierDataManagerName } from './supplierDataManagerName';
import type { SupplierDataManagerEmail } from "./supplierDataManagerEmail"; import type { SupplierDataManagerEmail } from './supplierDataManagerEmail';
import type { SupplierDataManagerContactNumber } from "./supplierDataManagerContactNumber"; import type { SupplierDataManagerContactNumber } from './supplierDataManagerContactNumber';
import type { SupplierDataPriority } from "./supplierDataPriority"; import type { SupplierDataPriority } from './supplierDataPriority';
import type { SupplierDataCreatedAt } from "./supplierDataCreatedAt"; import type { SupplierDataCreatedAt } from './supplierDataCreatedAt';
import type { SupplierDataUpdatedAt } from "./supplierDataUpdatedAt"; import type { SupplierDataUpdatedAt } from './supplierDataUpdatedAt';
export interface SupplierData { export interface SupplierData {
supplier_id: string; supplier_id: string;

View File

@ -4,8 +4,8 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import type { ValidationErrorLocItem } from "./validationErrorLocItem"; import type { ValidationErrorLocItem } from './validationErrorLocItem';
import type { ValidationErrorCtx } from "./validationErrorCtx"; import type { ValidationErrorCtx } from './validationErrorCtx';
export interface ValidationError { export interface ValidationError {
loc: ValidationErrorLocItem[]; loc: ValidationErrorLocItem[];

View File

@ -4,7 +4,10 @@
* Negodata Api Server * Negodata Api Server
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import { useMutation, useQuery } from "@tanstack/react-query"; import {
useMutation,
useQuery
} from '@tanstack/react-query';
import type { import type {
DataTag, DataTag,
DefinedInitialDataOptions, DefinedInitialDataOptions,
@ -17,8 +20,8 @@ import type {
UseMutationOptions, UseMutationOptions,
UseMutationResult, UseMutationResult,
UseQueryOptions, UseQueryOptions,
UseQueryResult, UseQueryResult
} from "@tanstack/react-query"; } from '@tanstack/react-query';
import type { import type {
HTTPValidationError, HTTPValidationError,
@ -26,383 +29,295 @@ import type {
ReqUpdateQuotationSetting, ReqUpdateQuotationSetting,
ResDeleteQuotationSetting, ResDeleteQuotationSetting,
ResQuotationSetting, ResQuotationSetting,
ResQuotationSettingList, ResQuotationSettingList
} from ".././model"; } from '.././model';
import { customFetch } from '../../mutator/custom-fetch';
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
import { customFetch } from "../../mutator/custom-fetch";
/** /**
* @summary 견적 설정 목록 * @summary 견적 설정 목록
*/ */
export const listSettings = (signal?: AbortSignal) => { export const listSettings = (
return customFetch<ResQuotationSettingList>({
url: `/v1/quotation-setting/list`, options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
method: "GET", ) => {
signal,
});
}; return customFetch<ResQuotationSettingList>(
{url: `/v1/quotation-setting/list`, method: 'GET', signal
},
options);
}
export const getListSettingsQueryKey = () => { export const getListSettingsQueryKey = () => {
return [`/v1/quotation-setting/list`] as const; return [
}; `/v1/quotation-setting/list`
] as const;
}
export const getListSettingsQueryOptions = <
TData = Awaited<ReturnType<typeof listSettings>>, export const getListSettingsQueryOptions = <TData = Awaited<ReturnType<typeof listSettings>>, TError = void>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listSettings>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
TError = void, ) => {
>(options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof listSettings>>, TError, TData>
>;
}) => {
const { query: queryOptions } = options ?? {};
const queryKey = queryOptions?.queryKey ?? getListSettingsQueryKey(); const {query: queryOptions, request: requestOptions} = options ?? {};
const queryFn: QueryFunction<Awaited<ReturnType<typeof listSettings>>> = ({ const queryKey = queryOptions?.queryKey ?? getListSettingsQueryKey();
signal,
}) => listSettings(signal);
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
Awaited<ReturnType<typeof listSettings>>,
TError,
TData
> & { queryKey: DataTag<QueryKey, TData, TError> };
};
export type ListSettingsQueryResult = NonNullable< const queryFn: QueryFunction<Awaited<ReturnType<typeof listSettings>>> = ({ signal }) => listSettings(requestOptions, signal);
Awaited<ReturnType<typeof listSettings>>
>;
export type ListSettingsQueryError = void;
export function useListSettings<
TData = Awaited<ReturnType<typeof listSettings>>,
TError = void,
>(
options: { return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listSettings>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
query: Partial< }
UseQueryOptions<Awaited<ReturnType<typeof listSettings>>, TError, TData>
> & export type ListSettingsQueryResult = NonNullable<Awaited<ReturnType<typeof listSettings>>>
Pick< export type ListSettingsQueryError = void
export function useListSettings<TData = Awaited<ReturnType<typeof listSettings>>, TError = void>(
options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listSettings>>, TError, TData>> & Pick<
DefinedInitialDataOptions< DefinedInitialDataOptions<
Awaited<ReturnType<typeof listSettings>>, Awaited<ReturnType<typeof listSettings>>,
TError, TError,
Awaited<ReturnType<typeof listSettings>> Awaited<ReturnType<typeof listSettings>>
>, > , 'initialData'
"initialData" >, request?: SecondParameter<typeof customFetch>}
>; , queryClient?: QueryClient
}, ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
queryClient?: QueryClient, export function useListSettings<TData = Awaited<ReturnType<typeof listSettings>>, TError = void>(
): DefinedUseQueryResult<TData, TError> & { options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listSettings>>, TError, TData>> & Pick<
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useListSettings<
TData = Awaited<ReturnType<typeof listSettings>>,
TError = void,
>(
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof listSettings>>, TError, TData>
> &
Pick<
UndefinedInitialDataOptions< UndefinedInitialDataOptions<
Awaited<ReturnType<typeof listSettings>>, Awaited<ReturnType<typeof listSettings>>,
TError, TError,
Awaited<ReturnType<typeof listSettings>> Awaited<ReturnType<typeof listSettings>>
>, > , 'initialData'
"initialData" >, request?: SecondParameter<typeof customFetch>}
>; , queryClient?: QueryClient
}, ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
queryClient?: QueryClient, export function useListSettings<TData = Awaited<ReturnType<typeof listSettings>>, TError = void>(
): UseQueryResult<TData, TError> & { options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listSettings>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
queryKey: DataTag<QueryKey, TData, TError>; , queryClient?: QueryClient
}; ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useListSettings<
TData = Awaited<ReturnType<typeof listSettings>>,
TError = void,
>(
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof listSettings>>, TError, TData>
>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
/** /**
* @summary 견적 설정 목록 * @summary 견적 설정 목록
*/ */
export function useListSettings< export function useListSettings<TData = Awaited<ReturnType<typeof listSettings>>, TError = void>(
TData = Awaited<ReturnType<typeof listSettings>>, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listSettings>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
TError = void, , queryClient?: QueryClient
>( ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof listSettings>>, TError, TData>
>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
} {
const queryOptions = getListSettingsQueryOptions(options);
const query = useQuery(queryOptions, queryClient) as UseQueryResult< const queryOptions = getListSettingsQueryOptions(options)
TData,
TError
> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey; const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey ;
return query; return query;
} }
/** /**
* @summary 견적 설정 등록 * @summary 견적 설정 등록
*/ */
export const createSetting = ( export const createSetting = (
reqCreateQuotationSetting: ReqCreateQuotationSetting, reqCreateQuotationSetting: ReqCreateQuotationSetting,
signal?: AbortSignal, options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
) => { ) => {
return customFetch<ResQuotationSetting>({
url: `/v1/quotation-setting/create`,
method: "POST", return customFetch<ResQuotationSetting>(
headers: { "Content-Type": "application/json" }, {url: `/v1/quotation-setting/create`, method: 'POST',
data: reqCreateQuotationSetting, headers: {'Content-Type': 'application/json', },
signal, data: reqCreateQuotationSetting, signal
}); },
}; options);
}
export const getCreateSettingMutationOptions = <
TError = void | HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof createSetting>>,
TError,
{ data: ReqCreateQuotationSetting },
TContext
>;
}): UseMutationOptions<
Awaited<ReturnType<typeof createSetting>>,
TError,
{ data: ReqCreateQuotationSetting },
TContext
> => {
const mutationKey = ["createSetting"];
const { mutation: mutationOptions } = options
? options.mutation &&
"mutationKey" in options.mutation &&
options.mutation.mutationKey
? options
: { ...options, mutation: { ...options.mutation, mutationKey } }
: { mutation: { mutationKey } };
const mutationFn: MutationFunction< export const getCreateSettingMutationOptions = <TError = void | HTTPValidationError,
Awaited<ReturnType<typeof createSetting>>, TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createSetting>>, TError,{data: ReqCreateQuotationSetting}, TContext>, request?: SecondParameter<typeof customFetch>}
{ data: ReqCreateQuotationSetting } ): UseMutationOptions<Awaited<ReturnType<typeof createSetting>>, TError,{data: ReqCreateQuotationSetting}, TContext> => {
> = (props) => {
const { data } = props ?? {};
return createSetting(data); const mutationKey = ['createSetting'];
}; const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
: {...options, mutation: {...options.mutation, mutationKey}}
: {mutation: { mutationKey, }, request: undefined};
return { mutationFn, ...mutationOptions };
};
export type CreateSettingMutationResult = NonNullable<
Awaited<ReturnType<typeof createSetting>>
>;
export type CreateSettingMutationBody = ReqCreateQuotationSetting;
export type CreateSettingMutationError = void | HTTPValidationError;
/** const mutationFn: MutationFunction<Awaited<ReturnType<typeof createSetting>>, {data: ReqCreateQuotationSetting}> = (props) => {
const {data} = props ?? {};
return createSetting(data,requestOptions)
}
return { mutationFn, ...mutationOptions }}
export type CreateSettingMutationResult = NonNullable<Awaited<ReturnType<typeof createSetting>>>
export type CreateSettingMutationBody = ReqCreateQuotationSetting
export type CreateSettingMutationError = void | HTTPValidationError
/**
* @summary 견적 설정 등록 * @summary 견적 설정 등록
*/ */
export const useCreateSetting = < export const useCreateSetting = <TError = void | HTTPValidationError,
TError = void | HTTPValidationError, TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createSetting>>, TError,{data: ReqCreateQuotationSetting}, TContext>, request?: SecondParameter<typeof customFetch>}
TContext = unknown, , queryClient?: QueryClient): UseMutationResult<
>( Awaited<ReturnType<typeof createSetting>>,
options?: { TError,
mutation?: UseMutationOptions< {data: ReqCreateQuotationSetting},
Awaited<ReturnType<typeof createSetting>>, TContext
TError, > => {
{ data: ReqCreateQuotationSetting },
TContext
>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof createSetting>>,
TError,
{ data: ReqCreateQuotationSetting },
TContext
> => {
const mutationOptions = getCreateSettingMutationOptions(options);
return useMutation(mutationOptions, queryClient); const mutationOptions = getCreateSettingMutationOptions(options);
};
/** return useMutation(mutationOptions, queryClient);
}
/**
* @summary 견적 설정 수정 * @summary 견적 설정 수정
*/ */
export const updateSetting = ( export const updateSetting = (
qtSettingId: string, qtSettingId: string,
reqUpdateQuotationSetting: ReqUpdateQuotationSetting, reqUpdateQuotationSetting: ReqUpdateQuotationSetting,
) => { options?: SecondParameter<typeof customFetch>,) => {
return customFetch<ResQuotationSetting>({
url: `/v1/quotation-setting/update/${qtSettingId}`,
method: "PATCH", return customFetch<ResQuotationSetting>(
headers: { "Content-Type": "application/json" }, {url: `/v1/quotation-setting/update/${qtSettingId}`, method: 'PATCH',
data: reqUpdateQuotationSetting, headers: {'Content-Type': 'application/json', },
}); data: reqUpdateQuotationSetting
}; },
options);
}
export const getUpdateSettingMutationOptions = <
TError = void | HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof updateSetting>>,
TError,
{ qtSettingId: string; data: ReqUpdateQuotationSetting },
TContext
>;
}): UseMutationOptions<
Awaited<ReturnType<typeof updateSetting>>,
TError,
{ qtSettingId: string; data: ReqUpdateQuotationSetting },
TContext
> => {
const mutationKey = ["updateSetting"];
const { mutation: mutationOptions } = options
? options.mutation &&
"mutationKey" in options.mutation &&
options.mutation.mutationKey
? options
: { ...options, mutation: { ...options.mutation, mutationKey } }
: { mutation: { mutationKey } };
const mutationFn: MutationFunction< export const getUpdateSettingMutationOptions = <TError = void | HTTPValidationError,
Awaited<ReturnType<typeof updateSetting>>, TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof updateSetting>>, TError,{qtSettingId: string;data: ReqUpdateQuotationSetting}, TContext>, request?: SecondParameter<typeof customFetch>}
{ qtSettingId: string; data: ReqUpdateQuotationSetting } ): UseMutationOptions<Awaited<ReturnType<typeof updateSetting>>, TError,{qtSettingId: string;data: ReqUpdateQuotationSetting}, TContext> => {
> = (props) => {
const { qtSettingId, data } = props ?? {};
return updateSetting(qtSettingId, data); const mutationKey = ['updateSetting'];
}; const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
: {...options, mutation: {...options.mutation, mutationKey}}
: {mutation: { mutationKey, }, request: undefined};
return { mutationFn, ...mutationOptions };
};
export type UpdateSettingMutationResult = NonNullable<
Awaited<ReturnType<typeof updateSetting>>
>;
export type UpdateSettingMutationBody = ReqUpdateQuotationSetting;
export type UpdateSettingMutationError = void | HTTPValidationError;
/** const mutationFn: MutationFunction<Awaited<ReturnType<typeof updateSetting>>, {qtSettingId: string;data: ReqUpdateQuotationSetting}> = (props) => {
const {qtSettingId,data} = props ?? {};
return updateSetting(qtSettingId,data,requestOptions)
}
return { mutationFn, ...mutationOptions }}
export type UpdateSettingMutationResult = NonNullable<Awaited<ReturnType<typeof updateSetting>>>
export type UpdateSettingMutationBody = ReqUpdateQuotationSetting
export type UpdateSettingMutationError = void | HTTPValidationError
/**
* @summary 견적 설정 수정 * @summary 견적 설정 수정
*/ */
export const useUpdateSetting = < export const useUpdateSetting = <TError = void | HTTPValidationError,
TError = void | HTTPValidationError, TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof updateSetting>>, TError,{qtSettingId: string;data: ReqUpdateQuotationSetting}, TContext>, request?: SecondParameter<typeof customFetch>}
TContext = unknown, , queryClient?: QueryClient): UseMutationResult<
>( Awaited<ReturnType<typeof updateSetting>>,
options?: { TError,
mutation?: UseMutationOptions< {qtSettingId: string;data: ReqUpdateQuotationSetting},
Awaited<ReturnType<typeof updateSetting>>, TContext
TError, > => {
{ qtSettingId: string; data: ReqUpdateQuotationSetting },
TContext
>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof updateSetting>>,
TError,
{ qtSettingId: string; data: ReqUpdateQuotationSetting },
TContext
> => {
const mutationOptions = getUpdateSettingMutationOptions(options);
return useMutation(mutationOptions, queryClient); const mutationOptions = getUpdateSettingMutationOptions(options);
};
/** return useMutation(mutationOptions, queryClient);
}
/**
* @summary 견적 설정 삭제 * @summary 견적 설정 삭제
*/ */
export const deleteSetting = (qtSettingId: string) => { export const deleteSetting = (
return customFetch<ResDeleteQuotationSetting>({ qtSettingId: string,
url: `/v1/quotation-setting/delete/${qtSettingId}`, options?: SecondParameter<typeof customFetch>,) => {
method: "DELETE",
});
}; return customFetch<ResDeleteQuotationSetting>(
{url: `/v1/quotation-setting/delete/${qtSettingId}`, method: 'DELETE'
},
options);
}
export const getDeleteSettingMutationOptions = <
TError = void | HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof deleteSetting>>,
TError,
{ qtSettingId: string },
TContext
>;
}): UseMutationOptions<
Awaited<ReturnType<typeof deleteSetting>>,
TError,
{ qtSettingId: string },
TContext
> => {
const mutationKey = ["deleteSetting"];
const { mutation: mutationOptions } = options
? options.mutation &&
"mutationKey" in options.mutation &&
options.mutation.mutationKey
? options
: { ...options, mutation: { ...options.mutation, mutationKey } }
: { mutation: { mutationKey } };
const mutationFn: MutationFunction< export const getDeleteSettingMutationOptions = <TError = void | HTTPValidationError,
Awaited<ReturnType<typeof deleteSetting>>, TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteSetting>>, TError,{qtSettingId: string}, TContext>, request?: SecondParameter<typeof customFetch>}
{ qtSettingId: string } ): UseMutationOptions<Awaited<ReturnType<typeof deleteSetting>>, TError,{qtSettingId: string}, TContext> => {
> = (props) => {
const { qtSettingId } = props ?? {};
return deleteSetting(qtSettingId); const mutationKey = ['deleteSetting'];
}; const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
: {...options, mutation: {...options.mutation, mutationKey}}
: {mutation: { mutationKey, }, request: undefined};
return { mutationFn, ...mutationOptions };
};
export type DeleteSettingMutationResult = NonNullable<
Awaited<ReturnType<typeof deleteSetting>>
>;
export type DeleteSettingMutationError = void | HTTPValidationError; const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteSetting>>, {qtSettingId: string}> = (props) => {
const {qtSettingId} = props ?? {};
/** return deleteSetting(qtSettingId,requestOptions)
}
return { mutationFn, ...mutationOptions }}
export type DeleteSettingMutationResult = NonNullable<Awaited<ReturnType<typeof deleteSetting>>>
export type DeleteSettingMutationError = void | HTTPValidationError
/**
* @summary 견적 설정 삭제 * @summary 견적 설정 삭제
*/ */
export const useDeleteSetting = < export const useDeleteSetting = <TError = void | HTTPValidationError,
TError = void | HTTPValidationError, TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteSetting>>, TError,{qtSettingId: string}, TContext>, request?: SecondParameter<typeof customFetch>}
TContext = unknown, , queryClient?: QueryClient): UseMutationResult<
>( Awaited<ReturnType<typeof deleteSetting>>,
options?: { TError,
mutation?: UseMutationOptions< {qtSettingId: string},
Awaited<ReturnType<typeof deleteSetting>>, TContext
TError, > => {
{ qtSettingId: string },
TContext
>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof deleteSetting>>,
TError,
{ qtSettingId: string },
TContext
> => {
const mutationOptions = getDeleteSettingMutationOptions(options);
return useMutation(mutationOptions, queryClient); const mutationOptions = getDeleteSettingMutationOptions(options);
};
return useMutation(mutationOptions, queryClient);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -94,13 +94,19 @@ export const customFetch = async <T>(
(url.startsWith('http') ? url : `${BASE_URL}${url}`) + (url.startsWith('http') ? url : `${BASE_URL}${url}`) +
(queryString ? `?${queryString}` : ''); (queryString ? `?${queryString}` : '');
// 파일 업로드(FormData)는 ① 브라우저가 boundary 포함 Content-Type 을 직접 설정해야 하고
// ② 본문을 JSON.stringify 하면 "{}" 가 되어 파일이 통째로 누락된다. 분기 처리.
const isFormData = typeof FormData !== 'undefined' && data instanceof FormData;
// [요청 인터셉터] 토큰을 받아 헤더를 구성하고 한 번 호출(만료 재시도 시 새 토큰으로 재구성). // [요청 인터셉터] 토큰을 받아 헤더를 구성하고 한 번 호출(만료 재시도 시 새 토큰으로 재구성).
const doFetch = (token: string | null) => { const doFetch = (token: string | null) => {
const headers = new Headers(config.headers); const headers = new Headers(config.headers);
if (options?.headers) { if (options?.headers) {
new Headers(options.headers).forEach((v, k) => headers.set(k, v)); new Headers(options.headers).forEach((v, k) => headers.set(k, v));
} }
if (data != null && !headers.has('Content-Type')) { if (isFormData) {
headers.delete('Content-Type'); // 생성 클라이언트가 박은 boundary 없는 multipart 헤더 제거 → 브라우저가 재설정
} else if (data != null && !headers.has('Content-Type')) {
headers.set('Content-Type', 'application/json'); headers.set('Content-Type', 'application/json');
} }
if (token) headers.set('Authorization', `Bearer ${token}`); if (token) headers.set('Authorization', `Bearer ${token}`);
@ -108,7 +114,7 @@ export const customFetch = async <T>(
...options, ...options,
method, method,
headers, headers,
body: data != null ? JSON.stringify(data) : options?.body, body: data != null ? (isFormData ? data : JSON.stringify(data)) : options?.body,
signal, signal,
}); });
}; };

View File

@ -1,6 +1,7 @@
import {QueryClient, QueryClientProvider} from '@tanstack/react-query'; import {QueryClient, QueryClientProvider} from '@tanstack/react-query';
import {useState, type ReactNode} from 'react'; import {useState, type ReactNode} from 'react';
import {Toaster} from 'sonner'; import {Toaster} from 'sonner';
import {ConfirmHost} from '@/lib/confirm';
export function Providers({children}: {children: ReactNode}) { export function Providers({children}: {children: ReactNode}) {
const [queryClient] = useState( const [queryClient] = useState(
@ -19,6 +20,7 @@ export function Providers({children}: {children: ReactNode}) {
<QueryClientProvider client={queryClient}> <QueryClientProvider client={queryClient}>
{children} {children}
<Toaster richColors position="top-center" /> <Toaster richColors position="top-center" />
<ConfirmHost />
</QueryClientProvider> </QueryClientProvider>
); );
} }

View File

@ -1,41 +1,63 @@
import React, { useState, useRef, DragEvent, ChangeEvent } from 'react'; import React, { useState, useRef, DragEvent, ChangeEvent } from 'react';
import { Upload, Image as ImageIcon, X, AlertCircle } from 'lucide-react'; import { Upload, Image as ImageIcon, X, AlertCircle, Link2, Loader2 } from 'lucide-react';
interface ImageDropzoneProps { interface ImageDropzoneProps {
value: string; value: string;
onChange: (base64Url: string) => void; onChange: (url: string) => void;
onClear: () => void; onClear: () => void;
/**
* 파일을 받아 업로드하고 저장 URL 을 돌려준다(예: Azure Blob).
* 주어지면 드롭/선택한 파일을 업로드해 그 URL 을 value 로 쓴다.
* 없으면 과거처럼 base64 data URL 로 폴백한다(재사용 컴포넌트 호환).
*/
onUpload?: (file: File) => Promise<string>;
label?: string; label?: string;
className?: string; className?: string;
} }
const MAX_SIZE = 4 * 1024 * 1024; // 백엔드 max_image_mb=4 와 일치
export default function ImageDropzone({ export default function ImageDropzone({
value, value,
onChange, onChange,
onClear, onClear,
onUpload,
label = '상품 대표 이미지 업로드', label = '상품 대표 이미지 업로드',
className = '' className = ''
}: ImageDropzoneProps) { }: ImageDropzoneProps) {
const [isDragActive, setIsDragActive] = useState(false); const [isDragActive, setIsDragActive] = useState(false);
const [error, setError] = useState<string | null>(null); const [error, setError] = useState<string | null>(null);
const [uploading, setUploading] = useState(false);
const [urlDraft, setUrlDraft] = useState('');
const fileInputRef = useRef<HTMLInputElement>(null); const fileInputRef = useRef<HTMLInputElement>(null);
const processFile = (file: File) => { const processFile = async (file: File) => {
setError(null); setError(null);
// Validate file type
if (!file.type.startsWith('image/')) { if (!file.type.startsWith('image/')) {
setError('이미지 파일(*.png, *.jpg, *.jpeg, *.gif)만 업로드할 수 있습니다.'); setError('이미지 파일(*.png, *.jpg, *.jpeg, *.gif, *.webp)만 업로드할 수 있습니다.');
return; return;
} }
if (file.size > MAX_SIZE) {
// Validate size (e.g., max 4MB for high-fidelity base64 storage)
const maxSize = 4 * 1024 * 1024;
if (file.size > maxSize) {
setError('이미지 최댓값은 4MB입니다. 더 작고 최적화된 이미지를 권장합니다.'); setError('이미지 최댓값은 4MB입니다. 더 작고 최적화된 이미지를 권장합니다.');
return; return;
} }
// 업로드 핸들러가 있으면 서버(blob)로 올리고 URL 을 받는다.
if (onUpload) {
setUploading(true);
try {
const url = await onUpload(file);
onChange(url);
} catch (err) {
setError(err instanceof Error ? err.message : '이미지 업로드에 실패했습니다.');
} finally {
setUploading(false);
}
return;
}
// 폴백: base64 data URL.
const reader = new FileReader(); const reader = new FileReader();
reader.onload = (e) => { reader.onload = (e) => {
if (e.target?.result && typeof e.target.result === 'string') { if (e.target?.result && typeof e.target.result === 'string') {
@ -44,16 +66,14 @@ export default function ImageDropzone({
setError('이미지 해독 과정에 이상이 발생했습니다.'); setError('이미지 해독 과정에 이상이 발생했습니다.');
} }
}; };
reader.onerror = () => { reader.onerror = () => setError('파일을 수집하지 못했습니다.');
setError('파일을 수집하지 못했습니다.');
};
reader.readAsDataURL(file); reader.readAsDataURL(file);
}; };
const handleDragOver = (e: DragEvent<HTMLDivElement>) => { const handleDragOver = (e: DragEvent<HTMLDivElement>) => {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
setIsDragActive(true); if (!uploading) setIsDragActive(true);
}; };
const handleDragLeave = (e: DragEvent<HTMLDivElement>) => { const handleDragLeave = (e: DragEvent<HTMLDivElement>) => {
@ -66,20 +86,29 @@ export default function ImageDropzone({
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
setIsDragActive(false); setIsDragActive(false);
if (uploading) return;
if (e.dataTransfer.files && e.dataTransfer.files[0]) { if (e.dataTransfer.files && e.dataTransfer.files[0]) {
processFile(e.dataTransfer.files[0]); void processFile(e.dataTransfer.files[0]);
} }
}; };
const handleFileChange = (e: ChangeEvent<HTMLInputElement>) => { const handleFileChange = (e: ChangeEvent<HTMLInputElement>) => {
if (e.target.files && e.target.files[0]) { if (e.target.files && e.target.files[0]) {
processFile(e.target.files[0]); void processFile(e.target.files[0]);
} }
e.target.value = ''; // 같은 파일 재선택 허용
}; };
const handleButtonClick = () => { const handleButtonClick = () => {
fileInputRef.current?.click(); if (!uploading) fileInputRef.current?.click();
};
const applyUrl = () => {
const url = urlDraft.trim();
if (!url) return;
setError(null);
onChange(url);
setUrlDraft('');
}; };
return ( return (
@ -90,7 +119,7 @@ export default function ImageDropzone({
</label> </label>
{value ? ( {value ? (
// Preview Mode with image loaded // 미리보기 (blob URL / 외부 URL / base64 모두 동일하게 표시)
<div className="relative group border border-border rounded-lg overflow-hidden bg-background h-44 flex items-center justify-center"> <div className="relative group border border-border rounded-lg overflow-hidden bg-background h-44 flex items-center justify-center">
<img <img
src={value} src={value}
@ -98,7 +127,6 @@ export default function ImageDropzone({
referrerPolicy="no-referrer" referrerPolicy="no-referrer"
className="h-full w-full object-contain" className="h-full w-full object-contain"
/> />
{/* Hover overlay control */}
<div className="absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex flex-col items-center justify-center gap-2"> <div className="absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex flex-col items-center justify-center gap-2">
<button <button
type="button" type="button"
@ -118,15 +146,17 @@ export default function ImageDropzone({
</div> </div>
</div> </div>
) : ( ) : (
// Active Dropzone Area // 드롭존
<div <div
onDragOver={handleDragOver} onDragOver={handleDragOver}
onDragLeave={handleDragLeave} onDragLeave={handleDragLeave}
onDrop={handleDrop} onDrop={handleDrop}
onClick={handleButtonClick} onClick={handleButtonClick}
className={`border-2 border-dashed rounded-lg p-6 flex flex-col items-center justify-center text-center cursor-pointer min-h-44 transition-all ${ className={`relative border-2 border-dashed rounded-lg p-6 flex flex-col items-center justify-center text-center min-h-44 transition-all ${
isDragActive uploading ? 'cursor-wait' : 'cursor-pointer'
? 'border-primary bg-primary/5' } ${
isDragActive
? 'border-primary bg-primary/5'
: 'border-border hover:border-foreground/30 bg-muted/20' : 'border-border hover:border-foreground/30 bg-muted/20'
}`} }`}
> >
@ -136,27 +166,64 @@ export default function ImageDropzone({
onChange={handleFileChange} onChange={handleFileChange}
accept="image/*" accept="image/*"
className="hidden" className="hidden"
disabled={uploading}
/> />
<div className="p-2.5 bg-background border border-border rounded-full shadow-xs mb-3 text-muted-foreground">
{isDragActive ? (
<Upload size={22} className="animate-bounce text-primary" />
) : (
<ImageIcon size={22} />
)}
</div>
<div className="space-y-1"> {uploading ? (
<p className="font-semibold text-foreground text-xs"> <div className="flex flex-col items-center gap-2 text-muted-foreground">
{isDragActive ? '여기에 드롭하여 업로드' : '이지지 드래그 앤 드롭 또는 파일 탐색'} <Loader2 size={22} className="animate-spin text-primary" />
</p> <p className="font-semibold text-foreground text-xs">업로드 중…</p>
<p className="text-[10px] text-muted-foreground max-w-[280px] leading-relaxed"> </div>
PNG, JPG, JPEG, GIF 파일 지원 (최대 4MB) ) : (
</p> <>
</div> <div className="p-2.5 bg-background border border-border rounded-full shadow-xs mb-3 text-muted-foreground">
{isDragActive ? (
<Upload size={22} className="animate-bounce text-primary" />
) : (
<ImageIcon size={22} />
)}
</div>
<div className="space-y-1">
<p className="font-semibold text-foreground text-xs">
{isDragActive ? '여기에 드롭하여 업로드' : '이미지 드래그 앤 드롭 또는 파일 탐색'}
</p>
<p className="text-[10px] text-muted-foreground max-w-[280px] leading-relaxed">
PNG, JPG, JPEG, GIF, WEBP 파일 지원 (최대 4MB)
</p>
</div>
</>
)}
</div> </div>
)} )}
{/* 이미지 URL 직접 입력 */}
<div className="flex items-center gap-1.5 pt-1">
<div className="relative flex-1">
<Link2 size={12} className="absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground" />
<input
type="url"
value={urlDraft}
onChange={(e) => setUrlDraft(e.target.value)}
onKeyDown={(e) => {
if (e.key === 'Enter') {
e.preventDefault();
applyUrl();
}
}}
placeholder="또는 이미지 URL 붙여넣기 (https://…)"
className="w-full pl-6 pr-2 py-1.5 text-[11px] rounded border border-border bg-background text-foreground placeholder:text-muted-foreground/70 focus:outline-none focus:border-primary"
/>
</div>
<button
type="button"
onClick={applyUrl}
disabled={!urlDraft.trim()}
className="px-2.5 py-1.5 text-[11px] font-bold rounded bg-primary text-primary-foreground hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer shrink-0"
>
적용
</button>
</div>
{error && ( {error && (
<div className="flex items-center gap-1.5 text-[10px] text-destructive mt-1"> <div className="flex items-center gap-1.5 text-[10px] text-destructive mt-1">
<AlertCircle size={12} /> <AlertCircle size={12} />

View File

@ -1,12 +1,23 @@
import React from 'react'; import React from 'react';
import { variableLabel } from '@/features/cards/editor/variables';
interface SlateLeaf { interface SlateLeaf {
text: string; text: string;
bold?: boolean; bold?: boolean;
italic?: boolean; italic?: boolean;
color?: 'primary' | 'success' | 'warning' | 'destructive'; underline?: boolean;
// 'primary'|'success'|'warning'|'destructive' 프리셋 토큰 또는 임의 CSS 색(예: '#ED2024')
color?: string;
} }
// 프리셋 색 토큰 → 클래스. 카드 에디터는 헥스(#ED2024)를 쓰므로 토큰에 없으면 인라인 style 로 처리.
const NAMED_COLOR: Record<string, string> = {
primary: 'text-primary font-bold underline decoration-2 decoration-gray-400 dark:decoration-gray-600',
success: 'text-success font-semibold px-1 py-0.5 rounded bg-emerald-50 dark:bg-emerald-950/40 border border-emerald-200/50 dark:border-emerald-900/40',
warning: 'text-warning font-semibold px-1 py-0.5 rounded bg-amber-50 dark:bg-amber-950/40 border border-amber-200/50',
destructive: 'text-destructive font-semibold',
};
interface SlateNode { interface SlateNode {
type?: 'paragraph' | 'block-quote' | 'heading-one' | 'heading-two' | 'list-item'; type?: 'paragraph' | 'block-quote' | 'heading-one' | 'heading-two' | 'list-item';
children: (SlateLeaf | SlateNode)[]; children: (SlateLeaf | SlateNode)[];
@ -41,45 +52,17 @@ export default function SlateRenderer({ nodes, variables = {} }: SlateRendererPr
const renderLeaf = (leaf: SlateLeaf, key: string) => { const renderLeaf = (leaf: SlateLeaf, key: string) => {
const text = replaceVariables(leaf.text); const text = replaceVariables(leaf.text);
let classes = ''; let classes = '';
if (leaf.bold) classes += ' font-bold';
if (leaf.bold) { if (leaf.italic) classes += ' italic';
classes += ' font-bold '; if (leaf.underline) classes += ' underline';
}
if (leaf.italic) {
classes += ' italic ';
}
if (leaf.color === 'primary') { // color 가 프리셋 토큰이면 클래스, 임의 CSS 색(헥스 등)이면 인라인 style 로 적용.
return ( const named = leaf.color ? NAMED_COLOR[leaf.color] : undefined;
<span key={key} className={`${classes} text-primary font-bold underline decoration-2 decoration-gray-400 dark:decoration-gray-600`}> const style = leaf.color && !named ? { color: leaf.color } : undefined;
{text} const cls = `${classes}${named ? ` ${named}` : ''}`.trim();
</span>
);
}
if (leaf.color === 'success') {
return (
<span key={key} className={`${classes} text-success font-semibold px-1 py-0.5 rounded bg-emerald-50 dark:bg-emerald-950/40 border border-emerald-200/50 dark:border-emerald-900/40`}>
{text}
</span>
);
}
if (leaf.color === 'warning') {
return (
<span key={key} className={`${classes} text-warning font-semibold px-1 py-0.5 rounded bg-amber-50 dark:bg-amber-950/40 border border-amber-200/50`}>
{text}
</span>
);
}
if (leaf.color === 'destructive') {
return (
<span key={key} className={`${classes} text-destructive font-semibold`}>
{text}
</span>
);
}
return ( return (
<span key={key} className={classes || undefined}> <span key={key} className={cls || undefined} style={style}>
{text} {text}
</span> </span>
); );
@ -93,6 +76,22 @@ export default function SlateRenderer({ nodes, variables = {} }: SlateRendererPr
return renderLeaf(node as SlateLeaf, key); return renderLeaf(node as SlateLeaf, key);
} }
// 변수 노드(void inline): {type:'variable', name}. variables 에 값 있으면 치환, 없으면 라벨 칩.
if (node.type === 'variable') {
const raw = variables[node.name];
const hasValue = raw !== undefined && raw !== null && raw !== '';
if (hasValue) {
const text = typeof raw === 'number' ? raw.toLocaleString('ko-KR') : String(raw);
return <span key={key} className="font-semibold text-primary">{text}</span>;
}
// 값 없으면 치환하지 않고 {라벨} 형태로 그대로 노출.
return (
<span key={key} className="text-muted-foreground">
{`{${variableLabel(node.name)}}`}
</span>
);
}
const childrenElements = (node.children || []).map((child: any, childIdx: number) => { const childrenElements = (node.children || []).map((child: any, childIdx: number) => {
if (child.text !== undefined) { if (child.text !== undefined) {
return renderLeaf(child as SlateLeaf, `${key}-${childIdx}`); return renderLeaf(child as SlateLeaf, `${key}-${childIdx}`);

View File

@ -15,6 +15,8 @@ import {
Moon, Moon,
Building, Building,
ChevronRight, ChevronRight,
Menu,
X,
} from 'lucide-react'; } from 'lucide-react';
interface LayoutProps { interface LayoutProps {
@ -46,7 +48,11 @@ export default function Layout({ children, currentPage, setPage, onLogout }: Lay
const today = new Date().toLocaleDateString('sv-SE'); const today = new Date().toLocaleDateString('sv-SE');
const [isDark, setIsDark] = useState(false); const [isDark, setIsDark] = useState(false);
const [isSidebarOpen, setIsSidebarOpen] = useState(true); const [isSidebarOpen, setIsSidebarOpen] = useState(true); // 데스크톱 접기 토글
const [isMobileOpen, setIsMobileOpen] = useState(false); // 모바일 드로어 열림
// 사이드바 펼침 여부(라벨/프로필 노출 기준). 모바일 드로어는 항상 펼친 상태로 본다.
const expanded = isMobileOpen || isSidebarOpen;
const toggleDarkMode = () => { const toggleDarkMode = () => {
setIsDark(!isDark); setIsDark(!isDark);
@ -61,44 +67,62 @@ export default function Layout({ children, currentPage, setPage, onLogout }: Lay
<div className="min-h-screen bg-background text-foreground flex"> <div className="min-h-screen bg-background text-foreground flex">
{/* 토스트는 sonner <Toaster/>(main.tsx)가 전역으로 처리한다 */} {/* 토스트는 sonner <Toaster/>(main.tsx)가 전역으로 처리한다 */}
{/* 모바일 드로어 백드롭 */}
{isMobileOpen && (
<div
className="fixed inset-0 z-30 bg-black/40 backdrop-blur-xs md:hidden"
onClick={() => setIsMobileOpen(false)}
aria-hidden
/>
)}
{/* Main Sidebar */} {/* Main Sidebar */}
<aside <aside
className={cn( className={cn(
'bg-card border-r border-border flex flex-col justify-between transition-all duration-300 z-30 fixed h-full', 'bg-card border-r border-border flex flex-col justify-between transition-all duration-300 z-40 fixed inset-y-0 left-0',
isSidebarOpen ? 'w-60' : 'w-16' // 폭: 모바일은 항상 펼친 드로어(w-60), 데스크톱만 접기 토글
'w-60',
isSidebarOpen ? 'md:w-60' : 'md:w-16',
// 모바일 슬라이드 인/아웃 — 데스크톱은 항상 보임
isMobileOpen ? 'translate-x-0' : '-translate-x-full',
'md:translate-x-0'
)} )}
> >
<div> <div>
{/* Sidebar Brand Header */} {/* Sidebar Brand Header */}
<div className="h-14 flex items-center justify-between px-4 border-b border-border"> <div className="h-14 flex items-center justify-between px-4 border-b border-border">
{isSidebarOpen ? ( {expanded && (
<> <Typography as="div" variant="body" className="text-primary font-extrabold tracking-tighter">
<Typography as="div" variant="body" className="text-primary font-extrabold tracking-tighter"> NegoData
NegoData </Typography>
</Typography>
<Button
variant="ghost"
onClick={() => setIsSidebarOpen(false)}
className="p-1 h-auto rounded text-muted-foreground"
title="메뉴 접기"
>
<ChevronRight size={14} className="rotate-180 size-3.5" />
</Button>
</>
) : (
<Button
variant="ghost"
onClick={() => setIsSidebarOpen(true)}
className="mx-auto p-1.5 h-auto rounded bg-muted/65 text-muted-foreground"
title="메뉴 열기"
>
<ChevronRight size={14} className="size-3.5" />
</Button>
)} )}
{/* 데스크톱: 사이드바 접기/펼치기 */}
<Button
variant="ghost"
onClick={() => setIsSidebarOpen((v) => !v)}
className={cn(
'hidden md:inline-flex p-1 h-auto rounded text-muted-foreground',
!isSidebarOpen && 'mx-auto bg-muted/65'
)}
title={isSidebarOpen ? '메뉴 접기' : '메뉴 열기'}
>
<ChevronRight size={14} className={cn('size-3.5', isSidebarOpen && 'rotate-180')} />
</Button>
{/* 모바일: 드로어 닫기 */}
<Button
variant="ghost"
onClick={() => setIsMobileOpen(false)}
className="md:hidden p-1 h-auto rounded text-muted-foreground"
title="메뉴 닫기"
>
<X size={16} className="size-4" />
</Button>
</div> </div>
{/* Nav User Profile Card */} {/* Nav User Profile Card */}
{isSidebarOpen && <SidebarProfileCard user={user} />} {expanded && <SidebarProfileCard user={user} />}
{/* Nav Items */} {/* Nav Items */}
<nav className="mt-2 px-3 space-y-1"> <nav className="mt-2 px-3 space-y-1">
@ -107,8 +131,11 @@ export default function Layout({ children, currentPage, setPage, onLogout }: Lay
key={item.type} key={item.type}
item={item} item={item}
isActive={currentPage === item.type} isActive={currentPage === item.type}
isOpen={isSidebarOpen} isOpen={expanded}
onClick={() => setPage(item.type)} onClick={() => {
setPage(item.type);
setIsMobileOpen(false);
}}
/> />
))} ))}
</nav> </nav>
@ -123,7 +150,7 @@ export default function Layout({ children, currentPage, setPage, onLogout }: Lay
className="w-full justify-start gap-3 py-1.5 px-3 h-auto rounded text-[11px] font-semibold text-muted-foreground" className="w-full justify-start gap-3 py-1.5 px-3 h-auto rounded text-[11px] font-semibold text-muted-foreground"
> >
{isDark ? <Sun size={14} className="text-warning size-3.5" /> : <Moon size={14} className="size-3.5" />} {isDark ? <Sun size={14} className="text-warning size-3.5" /> : <Moon size={14} className="size-3.5" />}
{isSidebarOpen && <span>{isDark ? '라이트 모드' : '다크 모드'}</span>} {expanded && <span>{isDark ? '라이트 모드' : '다크 모드'}</span>}
</Button> </Button>
{/* Logout btn */} {/* Logout btn */}
@ -134,20 +161,33 @@ export default function Layout({ children, currentPage, setPage, onLogout }: Lay
className="w-full justify-start gap-3 py-1.5 px-3 h-auto rounded text-[11px] font-semibold text-destructive hover:bg-destructive/10 hover:text-destructive" className="w-full justify-start gap-3 py-1.5 px-3 h-auto rounded text-[11px] font-semibold text-destructive hover:bg-destructive/10 hover:text-destructive"
> >
<LogOut size={14} className="size-3.5" /> <LogOut size={14} className="size-3.5" />
{isSidebarOpen && <span>시스템 로그아웃</span>} {expanded && <span>시스템 로그아웃</span>}
</Button> </Button>
</div> </div>
</aside> </aside>
{/* Main Container Wrapper */} {/* Main Container Wrapper */}
<div <div
className="flex-1 flex flex-col transition-all duration-300" className={cn(
style={{ paddingLeft: isSidebarOpen ? '15rem' : '4rem' }} 'flex-1 flex flex-col transition-all duration-300',
// 모바일: 사이드바가 오버레이라 패딩 없음 / 데스크톱: 사이드바 폭만큼 확보
isSidebarOpen ? 'md:pl-60' : 'md:pl-16'
)}
> >
{/* Global Header */} {/* Global Header */}
<header className="h-14 bg-card border-b border-border flex items-center justify-between px-8 sticky top-0 z-20 shadow-xs backdrop-blur-md bg-opacity-95"> <header className="h-14 bg-card border-b border-border flex items-center justify-between px-4 md:px-8 sticky top-0 z-20 shadow-xs backdrop-blur-md bg-opacity-95">
<div className="flex items-center gap-4"> <div className="flex items-center gap-2 md:gap-4 min-w-0">
<Typography as="div" variant="small" className="font-bold"> {/* 모바일 햄버거 */}
<Button
variant="ghost"
onClick={() => setIsMobileOpen(true)}
className="md:hidden p-1.5 h-auto rounded text-muted-foreground"
title="메뉴 열기"
>
<Menu size={18} className="size-[18px]" />
</Button>
{/* 현재 페이지 — 모바일·데스크톱 모두 표시(로고는 사이드바/드로어 몫) */}
<Typography as="div" variant="small" className="font-bold truncate">
{pageLabelMap[currentPage]} {pageLabelMap[currentPage]}
</Typography> </Typography>
</div> </div>
@ -156,12 +196,12 @@ export default function Layout({ children, currentPage, setPage, onLogout }: Lay
</header> </header>
{/* Content Body Area */} {/* Content Body Area */}
<main className="flex-1 p-8 overflow-y-auto bg-background"> <main className="flex-1 p-4 md:p-8 overflow-y-auto bg-background">
<div className="max-w-7xl mx-auto space-y-6">{children}</div> <div className="max-w-7xl mx-auto space-y-6">{children}</div>
</main> </main>
{/* Compact Admin footer info */} {/* Compact Admin footer info */}
<footer className="h-10 border-t border-border/60 bg-card flex items-center justify-between px-8"> <footer className="h-10 border-t border-border/60 bg-card flex items-center justify-between px-4 md:px-8">
<Typography variant="mono">Copyright &copy; O2O Inc. All rights reserved</Typography> <Typography variant="mono">Copyright &copy; O2O Inc. All rights reserved</Typography>
</footer> </footer>
</div> </div>
@ -254,27 +294,27 @@ function NavItem({
/** 글로벌 헤더 우측 메타 정보 */ /** 글로벌 헤더 우측 메타 정보 */
function HeaderMeta({ user, today }: { user: SidebarUser; today: string }) { function HeaderMeta({ user, today }: { user: SidebarUser; today: string }) {
return ( return (
<div className="flex items-center gap-4"> <div className="flex items-center gap-3 md:gap-4">
<Typography as="div" variant="caption" className="hidden md:block"> <Typography as="div" variant="caption" className="hidden lg:block">
기준일시: <span className="font-semibold text-foreground">{today}</span> 기준일시: <span className="font-semibold text-foreground">{today}</span>
</Typography> </Typography>
<div className="h-4 w-px bg-border hidden md:block" /> <div className="h-4 w-px bg-border hidden lg:block" />
<div className="flex items-center gap-2"> <div className="flex items-center gap-2 min-w-0">
<span className="inline-block h-2 w-2 rounded-full bg-success animate-pulse" /> <span className="inline-block h-2 w-2 rounded-full bg-success animate-pulse shrink-0" />
<Typography as="span" variant="caption">회사:</Typography> <Typography as="span" variant="caption" className="shrink-0">회사:</Typography>
<Typography <Typography
as="span" as="span"
variant="caption" variant="caption"
id="header-company-name" id="header-company-name"
className="font-bold text-foreground underline decoration-1" className="font-bold text-foreground underline decoration-1 truncate max-w-[140px] md:max-w-none"
> >
{user?.company} {user?.company}
</Typography> </Typography>
</div> </div>
<div className="h-4 w-px bg-border" /> <div className="h-4 w-px bg-border hidden lg:block" />
<div className="flex items-center gap-2"> <div className="hidden lg:flex items-center gap-2">
<Typography as="span" variant="caption">관리자:</Typography> <Typography as="span" variant="caption">관리자:</Typography>
<Typography as="span" variant="caption" className="font-semibold text-foreground"> <Typography as="span" variant="caption" className="font-semibold text-foreground">
{user?.name} ({user?.loginId}) {user?.name} ({user?.loginId})

View File

@ -21,7 +21,7 @@ export function PageToolbar({
)} )}
> >
<div className="flex flex-1 flex-col sm:flex-row gap-3">{children}</div> <div className="flex flex-1 flex-col sm:flex-row gap-3">{children}</div>
{actions && <div className="flex items-center gap-2">{actions}</div>} {actions && <div className="flex flex-wrap items-center gap-2">{actions}</div>}
</div> </div>
); );
} }

View File

@ -12,6 +12,7 @@ import {
// 컬럼 설정형 데이터 테이블. 래퍼/헤더/행/빈상태/정렬·패딩, 그리고 행 선택(체크박스)까지 // 컬럼 설정형 데이터 테이블. 래퍼/헤더/행/빈상태/정렬·패딩, 그리고 행 선택(체크박스)까지
// 여기서 책임지고, 페이지는 컬럼 정의(header/cell)와 선택 상태만 넘긴다. 표 룩의 단일 출처. // 여기서 책임지고, 페이지는 컬럼 정의(header/cell)와 선택 상태만 넘긴다. 표 룩의 단일 출처.
// md 미만(모바일)에서는 같은 컬럼 정의로 카드(라벨:값) 리스트를 렌더해 가로 스크롤을 없앤다.
export type Column<T> = { export type Column<T> = {
id?: string id?: string
header: ReactNode header: ReactNode
@ -21,6 +22,12 @@ export type Column<T> = {
cellClassName?: string cellClassName?: string
// 셀 단위 클릭 핸들러 (예: 행 클릭 전파 차단) // 셀 단위 클릭 핸들러 (예: 행 클릭 전파 차단)
onCellClick?: (row: T, e: MouseEvent) => void onCellClick?: (row: T, e: MouseEvent) => void
// 모바일 카드뷰에서 라벨 없이 카드 헤더로 단독 표기(보통 첫 컬럼=식별값). 미지정 시 첫 컬럼이 자동 헤더.
mobileHeader?: boolean
// 모바일 카드뷰에서 이 컬럼 숨김
mobileHidden?: boolean
// 모바일 카드뷰에서 라벨:값 한 줄이 아니라 라벨 아래 값 풀폭 스택으로(여러 줄/긴 블록 셀용)
mobileBlock?: boolean
} }
// 행 선택 기능. 넘기면 맨 앞에 체크박스 컬럼(전체선택 헤더 포함)이 자동으로 붙는다. // 행 선택 기능. 넘기면 맨 앞에 체크박스 컬럼(전체선택 헤더 포함)이 자동으로 붙는다.
@ -83,88 +90,172 @@ export function DataTable<T>({
const colCount = columns.length + (selection ? 1 : 0) const colCount = columns.length + (selection ? 1 : 0)
// 모바일 카드뷰 컬럼 분류: 헤더(식별값) 1개 + 나머지(라벨:값).
const mobileCols = columns.filter((c) => !c.mobileHidden)
const headerIdx = mobileCols.findIndex((c) => c.mobileHeader)
const primaryCol = headerIdx >= 0 ? mobileCols[headerIdx] : mobileCols[0]
const detailCols = mobileCols.filter((c) => c !== primaryCol)
return ( return (
<div className={cn("border border-border rounded-lg bg-card overflow-hidden", className)}> // 전환 기준은 뷰포트가 아니라 '표가 들어갈 실제 폭'(컨테이너). 사이드바가 폭을 먹어도
<Table className="w-full text-xs"> // 어긋나지 않는다. 컨테이너 ≥ 48rem(@3xl)이면 표, 그 미만은 카드 리스트. (Tailwind v4 내장 @container)
<TableHeader> <div className={cn("@container border border-border rounded-lg bg-card overflow-hidden", className)}>
<TableRow className="bg-muted/50 border-b border-border hover:bg-transparent"> {/* 넓을 때: 표 — 그래도 넘치면 Table 내부에서 가로 스크롤 */}
{selection && ( <div className="hidden @3xl:block">
<TableHead className="p-4 w-12 text-center"> <Table className="w-full text-xs">
<input <TableHeader>
type="checkbox" <TableRow className="bg-muted/50 border-b border-border hover:bg-transparent">
checked={isAllSelected} {selection && (
onChange={(e) => toggleAll(e.target.checked)} <TableHead className="p-4 w-12 text-center">
className={checkboxClass} <input
/> type="checkbox"
</TableHead> checked={isAllSelected}
)} onChange={(e) => toggleAll(e.target.checked)}
{columns.map((c, i) => ( className={checkboxClass}
<TableHead />
key={c.id ?? i} </TableHead>
className={cn( )}
"p-4 font-semibold text-foreground", {columns.map((c, i) => (
c.align && alignClass[c.align], <TableHead
c.headClassName key={c.id ?? i}
)}
>
{c.header}
</TableHead>
))}
</TableRow>
</TableHeader>
<TableBody>
{data.length > 0 ? (
data.map((row) => {
const key = rowKey(row)
const selected = !!selection && selection.selectedKeys.includes(key)
return (
<TableRow
key={key}
className={cn( className={cn(
"border-b border-border/50 transition-colors", "px-4 py-2.5 font-semibold text-foreground",
onRowClick && "cursor-pointer hover:bg-muted/35", c.align && alignClass[c.align],
selected && "bg-primary/5 hover:bg-primary/10", c.headClassName
rowClassName?.(row)
)} )}
onClick={onRowClick ? () => onRowClick(row) : undefined}
> >
{selection && ( {c.header}
<TableCell </TableHead>
className="p-4 text-center w-12" ))}
onClick={(e) => e.stopPropagation()} </TableRow>
> </TableHeader>
<TableBody>
{data.length > 0 ? (
data.map((row) => {
const key = rowKey(row)
const selected = !!selection && selection.selectedKeys.includes(key)
return (
<TableRow
key={key}
className={cn(
"border-b border-border/50 transition-colors",
onRowClick && "cursor-pointer hover:bg-muted/35",
selected && "bg-primary/5 hover:bg-primary/10",
rowClassName?.(row)
)}
onClick={onRowClick ? () => onRowClick(row) : undefined}
>
{selection && (
<TableCell
className="p-4 text-center w-12"
onClick={(e) => e.stopPropagation()}
>
<input
type="checkbox"
checked={selected}
onChange={(e) => toggleOne(key, e.target.checked)}
className={checkboxClass}
/>
</TableCell>
)}
{columns.map((c, i) => (
<TableCell
key={c.id ?? i}
className={cn("px-4 py-2", c.align && alignClass[c.align], c.cellClassName)}
onClick={c.onCellClick ? (e) => c.onCellClick!(row, e) : undefined}
>
{c.cell(row)}
</TableCell>
))}
</TableRow>
)
})
) : (
<TableRow>
<TableCell
colSpan={colCount}
className="p-12 text-center text-muted-foreground font-mono"
>
{empty}
</TableCell>
</TableRow>
)}
</TableBody>
</Table>
</div>
{/* 좁을 때(컨테이너 < 48rem): 카드 리스트 — 행=카드, 컬럼=라벨:값 */}
<div className="@3xl:hidden divide-y divide-border">
{data.length > 0 ? (
data.map((row) => {
const key = rowKey(row)
const selected = !!selection && selection.selectedKeys.includes(key)
return (
<div
key={key}
className={cn(
"p-3 transition-colors",
onRowClick && "cursor-pointer active:bg-muted/40",
selected && "bg-primary/5"
)}
onClick={onRowClick ? () => onRowClick(row) : undefined}
>
{/* 헤더: 선택 체크박스 + 식별 컬럼 */}
{(selection || primaryCol) && (
<div className="flex items-center gap-2.5">
{selection && (
<input <input
type="checkbox" type="checkbox"
checked={selected} checked={selected}
onChange={(e) => toggleOne(key, e.target.checked)} onChange={(e) => toggleOne(key, e.target.checked)}
className={checkboxClass} onClick={(e) => e.stopPropagation()}
className={cn(checkboxClass, "shrink-0")}
/> />
</TableCell> )}
)} {primaryCol && (
{columns.map((c, i) => ( <div className="min-w-0 flex-1">{primaryCol.cell(row)}</div>
<TableCell )}
key={c.id ?? i} </div>
className={cn("p-4", c.align && alignClass[c.align], c.cellClassName)} )}
onClick={c.onCellClick ? (e) => c.onCellClick!(row, e) : undefined}
> {/* 상세: 기본=라벨:값 한 줄(컴팩트) / mobileBlock=라벨 아래 풀폭 */}
{c.cell(row)} {detailCols.length > 0 && (
</TableCell> <dl className="mt-2.5 space-y-1.5 border-t border-border/40 pt-2.5 text-[11px] leading-tight">
))} {detailCols.map((c, i) =>
</TableRow> c.mobileBlock ? (
) <div key={c.id ?? i} className="space-y-1">
}) <dt className="text-muted-foreground">{c.header}</dt>
) : ( <dd
<TableRow> className={cn("text-foreground", c.cellClassName)}
<TableCell onClick={c.onCellClick ? (e) => c.onCellClick!(row, e) : undefined}
colSpan={colCount} >
className="p-12 text-center text-muted-foreground font-mono" {c.cell(row)}
> </dd>
{empty} </div>
</TableCell> ) : (
</TableRow> <div key={c.id ?? i} className="flex items-start justify-between gap-3">
)} <dt className="shrink-0 text-muted-foreground">{c.header}</dt>
</TableBody> <dd
</Table> className={cn("min-w-0 text-right text-foreground", c.cellClassName)}
onClick={c.onCellClick ? (e) => c.onCellClick!(row, e) : undefined}
>
{c.cell(row)}
</dd>
</div>
)
)}
</dl>
)}
</div>
)
})
) : (
<div className="p-12 text-center text-muted-foreground font-mono text-xs">
{empty}
</div>
)}
</div>
{footer} {footer}
</div> </div>
) )

View File

@ -1,317 +0,0 @@
import { useForm, Controller } from 'react-hook-form';
import { zodResolver } from '@hookform/resolvers/zod';
import { z } from 'zod';
import { X, Layers } from 'lucide-react';
import { showToast } from '@/lib/notify';
import { Typography } from '@/components/ui/typography';
import { Input } from '@/components/ui/input';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
import { type NegotiationCard, type CardTab, generateCardCode } from '../types';
import type { CardInput } from '../hooks/useCards';
const schema = z.object({
isWildcard: z.boolean(),
code: z.string().trim().min(1, '카드번호는 필수 기입 사항입니다.'),
title: z.string().trim().min(1, '카드이름은 필수 기입 사항입니다.'),
scriptPreview: z.string().trim().min(1, '스크립트를 작성해 주십시오.'),
status: z.enum(['ACTIVE', 'INACTIVE']),
triggerCondition: z.string(),
memo: z.string(),
});
type FormValues = z.infer<typeof schema>;
type CardFormModalProps = {
open: boolean;
mode: 'create' | 'edit';
card: NegotiationCard | null; // edit 모드 초기값 출처
activeTab: CardTab; // create 시 기본 카드 종류 결정
onCreate: (input: CardInput) => Promise<void>;
onUpdate: (id: string, input: CardInput) => Promise<void>;
onClose: () => void;
};
function buildDefaults(
mode: 'create' | 'edit',
card: NegotiationCard | null,
activeTab: CardTab,
): FormValues {
if (mode === 'edit' && card) {
return {
isWildcard: card.isWildcard,
code: card.code,
title: card.title,
scriptPreview: card.scriptPreview,
status: card.status,
triggerCondition: card.triggerCondition || '',
memo: card.memo || '',
};
}
const wild = activeTab === 'WILD';
return {
isWildcard: wild,
code: generateCardCode(wild),
title: '',
scriptPreview: '',
status: 'ACTIVE',
triggerCondition: '',
memo: '',
};
}
// 협상카드/와일드카드 등록·수정 모달. react-hook-form + zod로 검증.
// 페이지는 key={mode + card?.id}로 리마운트시켜 초기값을 주입한다.
export function CardFormModal({
open,
mode,
card,
activeTab,
onCreate,
onUpdate,
onClose,
}: CardFormModalProps) {
const {
register,
control,
handleSubmit,
watch,
setValue,
formState: { errors },
} = useForm<FormValues>({
resolver: zodResolver(schema),
defaultValues: buildDefaults(mode, card, activeTab),
});
const isWildcard = watch('isWildcard');
if (!open) return null;
const onValid = async (v: FormValues) => {
const input: CardInput = {
title: v.title,
code: v.code,
scriptPreview: v.scriptPreview,
status: v.status,
isWildcard: v.isWildcard,
triggerCondition: v.triggerCondition,
memo: v.memo,
};
const kind = v.isWildcard ? '와일드카드' : '협상카드';
try {
if (mode === 'create') {
await onCreate(input);
showToast(`${kind}가 추가되었습니다.`, 'success');
} else if (card) {
await onUpdate(card.id, input);
showToast('정보가 수정되었습니다.', 'success');
}
onClose();
} catch (err) {
showToast(err instanceof Error ? err.message : `${kind} 저장 실패`, 'error');
}
};
return (
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-xs p-4">
<div className="w-full max-w-lg bg-card border border-border rounded-lg shadow-2xl p-6 overflow-y-auto max-h-[90vh] animate-scale-up font-mono text-xs">
<div className="flex items-center justify-between pb-4 border-b border-border mb-4">
<div className="flex items-center gap-2">
<Layers className="text-foreground" size={16} />
<Typography variant="h3" className="text-sm">
{mode === 'create'
? isWildcard
? '신규 와일드카드 등록'
: '신규 협상카드 등록'
: isWildcard
? '와일드카드 정보 수정'
: '협상카드 정보 수정'}
</Typography>
</div>
<button
onClick={onClose}
className="p-1 rounded text-muted-foreground hover:bg-muted cursor-pointer"
>
<X size={18} />
</button>
</div>
<form onSubmit={handleSubmit(onValid)} className="space-y-4">
<div className="grid grid-cols-1 md:grid-cols-3 gap-3">
{/* Card Type Selection */}
<div className="space-y-1">
<Typography as="label" variant="small" className="font-semibold">카드 종류</Typography>
<Controller
control={control}
name="isWildcard"
render={({ field }) => (
<Select
value={field.value ? 'WILD' : 'CARD'}
onValueChange={(v) => {
// 카드 종류는 등록 시에만 정한다(수정 시 테이블 이동 불가 → 고정).
if (mode !== 'create') return;
const wild = v === 'WILD';
field.onChange(wild);
setValue('code', generateCardCode(wild));
}}
>
<SelectTrigger id="form-card-is-wildcard" className="w-full" disabled={mode === 'edit'}>
<SelectValue>
{(value) => (value === 'WILD' ? '와일드카드' : '일반 협상카드')}
</SelectValue>
</SelectTrigger>
<SelectContent>
<SelectItem value="CARD">일반 협상카드</SelectItem>
<SelectItem value="WILD">와일드카드</SelectItem>
</SelectContent>
</Select>
)}
/>
</div>
{/* Code */}
<div className="space-y-1">
<Typography as="label" variant="small" className="font-semibold">카드번호</Typography>
<Input
id="form-card-code"
type="text"
{...register('code')}
placeholder="CARD-XXX 또는 WILD-XXX"
/>
{errors.code && <p className="text-[10px] text-rose-500">{errors.code.message}</p>}
</div>
{/* Status */}
<div className="space-y-1">
<Typography as="label" variant="small" className="font-semibold block mb-1">협상 적용 여부</Typography>
{isWildcard ? (
<Controller
control={control}
name="status"
render={({ field }) => (
<div className="flex items-center gap-3 p-2 bg-muted/30 border border-border rounded-md h-[34px]">
<button
id="form-card-status-switch"
type="button"
role="switch"
aria-checked={field.value === 'ACTIVE'}
onClick={() => field.onChange(field.value === 'ACTIVE' ? 'INACTIVE' : 'ACTIVE')}
className={`relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-all duration-200 focus:outline-none ${
field.value === 'ACTIVE' ? 'bg-emerald-600 dark:bg-emerald-500' : 'bg-zinc-300 dark:bg-zinc-700'
}`}
>
<span
className={`pointer-events-none block h-4 w-4 rounded-full bg-white shadow transition-all duration-200 ${
field.value === 'ACTIVE' ? 'translate-x-4' : 'translate-x-0'
}`}
/>
</button>
<span className="text-[11px] font-bold text-foreground">
{field.value === 'ACTIVE' ? '적용 승인' : '적용 대기'}
</span>
</div>
)}
/>
) : (
<div className="flex items-center gap-3 p-2 bg-muted/60 border border-border/60 rounded-md h-[34px] cursor-not-allowed select-none">
<button
type="button"
disabled
className="relative inline-flex h-5 w-9 shrink-0 items-center rounded-full border-2 border-transparent transition-all duration-200 bg-blue-400/40 dark:bg-blue-600/30 cursor-not-allowed"
>
<span className="pointer-events-none block h-4 w-4 rounded-full bg-white/70 dark:bg-zinc-400 translate-x-4" />
</button>
<span className="text-[11px] text-muted-foreground font-semibold">상시 항상 적용</span>
</div>
)}
</div>
</div>
{/* Title */}
<div className="space-y-1">
<Typography as="label" variant="small" className="font-semibold">카드이름</Typography>
<Input
id="form-card-title"
type="text"
{...register('title')}
placeholder="예: 최우수 등급 부여 카드"
/>
{errors.title && <p className="text-[10px] text-rose-500">{errors.title.message}</p>}
</div>
{/* Script */}
<div className="space-y-1.5">
<div className="flex items-center justify-between">
<Typography as="label" variant="small" className="font-bold flex items-center gap-1.5">
<span className="h-1.5 w-1.5 rounded-full bg-primary" />
스크립트
</Typography>
<div className="text-[10px] text-muted-foreground bg-muted px-2 py-0.5 rounded border border-border">
치환 변수 사용: {'{target_price}'}, {'{partner_name}'}
</div>
</div>
<div className="border border-border rounded-md overflow-hidden bg-background focus-within:border-foreground/30 transition-all">
<div className="bg-muted/45 px-3 py-1.5 border-b border-border flex items-center justify-between text-[10px] text-muted-foreground select-none">
<span>에디터</span>
</div>
<textarea
id="form-card-script"
{...register('scriptPreview')}
rows={3}
className="w-full p-3 bg-transparent text-xs leading-relaxed resize-none focus:outline-none font-sans border-none"
placeholder="협상 중에 상대에게 발송할 멘트 스크립트를 기술하십시오."
/>
</div>
{errors.scriptPreview && <p className="text-[10px] text-rose-500">{errors.scriptPreview.message}</p>}
</div>
{/* Wildcard-only fields */}
{isWildcard && (
<div className="space-y-4 p-3 bg-muted/40 rounded border border-border">
<Typography variant="label" className="font-bold text-[10px] block">와일드카드 세부조항</Typography>
<div className="space-y-3 font-mono">
<div className="space-y-1">
<Typography as="label" variant="small" className="font-semibold">사용 조건</Typography>
<Input
id="form-card-trigger"
type="text"
{...register('triggerCondition')}
placeholder="예: 원부자재 시세가 계약일 대조 3.5% 상회 시"
/>
</div>
<div className="space-y-1">
<Typography as="label" variant="small" className="font-semibold">메모</Typography>
<Input
id="form-card-memo"
type="text"
{...register('memo')}
placeholder="예: 특정 원재료 포함 입찰에만 적용"
/>
</div>
</div>
</div>
)}
{/* Footer */}
<div className="pt-4 flex items-center gap-2 border-t border-border mt-8">
<button
type="button"
onClick={onClose}
className="flex-1 py-1.5 border border-border rounded text-foreground cursor-pointer text-center"
>
취소
</button>
<button
type="submit"
id="form-card-submit"
className="flex-1 py-1.5 bg-primary text-primary-foreground font-bold rounded hover:opacity-95 cursor-pointer text-center"
>
{mode === 'create' ? '저장' : '수정'}
</button>
</div>
</form>
</div>
</div>
);
}

View File

@ -0,0 +1,311 @@
import { useForm, Controller } from 'react-hook-form';
import { zodResolver } from '@hookform/resolvers/zod';
import { z } from 'zod';
import type { Descendant } from 'slate';
import { showToast } from '@/lib/notify';
import { Typography } from '@/components/ui/typography';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Sheet } from '@/components/ui/sheet';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
import { type NegotiationCard, type CardTab, generateCardCode } from '../types';
import type { CardInput } from '../hooks/useCards';
import { CardScriptEditor, deserialize, serializeToText } from '../editor';
const schema = z.object({
isWildcard: z.boolean(),
code: z.string().trim().min(1, '카드번호는 필수 기입 사항입니다.'),
title: z.string().trim().min(1, '카드이름은 필수 기입 사항입니다.'),
editorScript: z
.custom<Descendant[]>((v) => Array.isArray(v))
.refine((v) => serializeToText(v).trim().length > 0, '스크립트를 작성해 주십시오.'),
status: z.enum(['ACTIVE', 'INACTIVE']),
triggerCondition: z.string(),
memo: z.string(),
});
type FormValues = z.infer<typeof schema>;
type CardFormSheetProps = {
open: boolean;
mode: 'create' | 'edit';
card: NegotiationCard | null; // edit 모드 초기값 출처
activeTab: CardTab; // create 시 기본 카드 종류 결정
onCreate: (input: CardInput) => Promise<void>;
onUpdate: (id: string, input: CardInput) => Promise<void>;
onDelete: (id: string, title: string) => void;
onClose: () => void;
};
function buildDefaults(
mode: 'create' | 'edit',
card: NegotiationCard | null,
activeTab: CardTab,
): FormValues {
if (mode === 'edit' && card) {
return {
isWildcard: card.isWildcard,
code: card.code,
title: card.title,
// 저장된 Slate JSON 우선, 없으면 레거시 평문 script 를 변수 노드로 복원.
editorScript: deserialize(card.editorScript, card.scriptPreview),
status: card.status,
triggerCondition: card.triggerCondition || '',
memo: card.memo || '',
};
}
const wild = activeTab === 'WILD';
return {
isWildcard: wild,
code: generateCardCode(wild),
title: '',
editorScript: deserialize(), // 새 빈 값(공용 상수 mutate 방지)
status: 'ACTIVE',
triggerCondition: '',
memo: '',
};
}
// 협상카드/와일드카드 등록·수정 우측 드로어 폼. react-hook-form + zod로 검증.
// 상품·협력사 폼과 동일하게 공통 Sheet 셸을 쓴다(우측 슬라이드).
// 페이지는 key={mode + card?.id}로 리마운트시켜 초기값을 주입한다.
export function CardFormSheet({
open,
mode,
card,
activeTab,
onCreate,
onUpdate,
onDelete,
onClose,
}: CardFormSheetProps) {
const {
register,
control,
handleSubmit,
watch,
setValue,
formState: { errors, isSubmitting },
} = useForm<FormValues>({
resolver: zodResolver(schema),
defaultValues: buildDefaults(mode, card, activeTab),
});
const isWildcard = watch('isWildcard');
const onValid = async (v: FormValues) => {
const input: CardInput = {
title: v.title,
code: v.code,
editorScript: v.editorScript,
status: v.status,
isWildcard: v.isWildcard,
triggerCondition: v.triggerCondition,
memo: v.memo,
};
const kind = v.isWildcard ? '와일드카드' : '협상카드';
try {
if (mode === 'create') {
await onCreate(input);
showToast(`${kind}가 추가되었습니다.`, 'success');
} else if (card) {
await onUpdate(card.id, input);
showToast('정보가 수정되었습니다.', 'success');
}
onClose();
} catch (err) {
showToast(err instanceof Error ? err.message : `${kind} 저장 실패`, 'error');
}
};
const title =
mode === 'create'
? isWildcard
? '신규 와일드카드 등록'
: '신규 협상카드 등록'
: isWildcard
? '와일드카드 정보 수정'
: '협상카드 정보 수정';
return (
<Sheet open={open} title={title} onClose={onClose}>
<form onSubmit={handleSubmit(onValid)} className="mt-6 space-y-4 text-xs font-mono">
<div className="grid grid-cols-1 sm:grid-cols-3 gap-3">
{/* Card Type Selection */}
<div className="space-y-1">
<Typography as="label" variant="small" className="font-semibold">카드 종류</Typography>
<Controller
control={control}
name="isWildcard"
render={({ field }) => (
<Select
value={field.value ? 'WILD' : 'CARD'}
onValueChange={(v) => {
// 카드 종류는 등록 시에만 정한다(수정 시 테이블 이동 불가 → 고정).
if (mode !== 'create') return;
const wild = v === 'WILD';
field.onChange(wild);
setValue('code', generateCardCode(wild));
}}
>
<SelectTrigger id="form-card-is-wildcard" className="w-full" disabled={mode === 'edit'}>
<SelectValue>
{(value) => (value === 'WILD' ? '와일드카드' : '일반 협상카드')}
</SelectValue>
</SelectTrigger>
<SelectContent>
<SelectItem value="CARD">일반 협상카드</SelectItem>
<SelectItem value="WILD">와일드카드</SelectItem>
</SelectContent>
</Select>
)}
/>
</div>
{/* Code */}
<div className="space-y-1">
<Typography as="label" variant="small" className="font-semibold">카드번호</Typography>
<Input
id="form-card-code"
type="text"
{...register('code')}
placeholder="CARD-XXX 또는 WILD-XXX"
/>
{errors.code && <p className="text-[10px] text-rose-500">{errors.code.message}</p>}
</div>
{/* Status */}
<div className="space-y-1">
<Typography as="label" variant="small" className="font-semibold block mb-1">협상 적용 여부</Typography>
{isWildcard ? (
<Controller
control={control}
name="status"
render={({ field }) => (
<div className="flex items-center gap-3 p-2 bg-muted/30 border border-border rounded-md h-[34px]">
<button
id="form-card-status-switch"
type="button"
role="switch"
aria-checked={field.value === 'ACTIVE'}
onClick={() => field.onChange(field.value === 'ACTIVE' ? 'INACTIVE' : 'ACTIVE')}
className={`relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-all duration-200 focus:outline-none ${
field.value === 'ACTIVE' ? 'bg-emerald-600 dark:bg-emerald-500' : 'bg-zinc-300 dark:bg-zinc-700'
}`}
>
<span
className={`pointer-events-none block h-4 w-4 rounded-full bg-white shadow transition-all duration-200 ${
field.value === 'ACTIVE' ? 'translate-x-4' : 'translate-x-0'
}`}
/>
</button>
<span className="text-[11px] font-bold text-foreground">
{field.value === 'ACTIVE' ? '적용 승인' : '적용 대기'}
</span>
</div>
)}
/>
) : (
<div className="flex items-center gap-3 p-2 bg-muted/60 border border-border/60 rounded-md h-[34px] cursor-not-allowed select-none">
<button
type="button"
disabled
className="relative inline-flex h-5 w-9 shrink-0 items-center rounded-full border-2 border-transparent transition-all duration-200 bg-blue-400/40 dark:bg-blue-600/30 cursor-not-allowed"
>
<span className="pointer-events-none block h-4 w-4 rounded-full bg-white/70 dark:bg-zinc-400 translate-x-4" />
</button>
<span className="text-[11px] text-muted-foreground font-semibold">상시 항상 적용</span>
</div>
)}
</div>
</div>
{/* Title */}
<div className="space-y-1">
<Typography as="label" variant="small" className="font-semibold">카드이름</Typography>
<Input
id="form-card-title"
type="text"
{...register('title')}
placeholder="예: 최우수 등급 부여 카드"
/>
{errors.title && <p className="text-[10px] text-rose-500">{errors.title.message}</p>}
</div>
{/* Script */}
<div className="space-y-1.5">
<Typography as="label" variant="small" className="font-bold flex items-center gap-1.5">
<span className="h-1.5 w-1.5 rounded-full bg-primary" />
스크립트
</Typography>
<Controller
control={control}
name="editorScript"
render={({ field }) => (
<CardScriptEditor
value={field.value}
onChange={field.onChange}
placeholder="협상 중에 상대에게 발송할 멘트 스크립트를 기술하십시오. 굵게·색상·변수 칩을 활용하세요."
/>
)}
/>
{errors.editorScript && (
<p className="text-[10px] text-rose-500">{errors.editorScript.message as string}</p>
)}
</div>
{/* Wildcard-only fields */}
{isWildcard && (
<div className="space-y-4 p-3 bg-muted/40 rounded border border-border">
<Typography variant="label" className="font-bold text-[10px] block">와일드카드 세부조항</Typography>
<div className="space-y-3 font-mono">
<div className="space-y-1">
<Typography as="label" variant="small" className="font-semibold">사용 조건</Typography>
<Input
id="form-card-trigger"
type="text"
{...register('triggerCondition')}
placeholder="예: 원부자재 시세가 계약일 대조 3.5% 상회 시"
/>
</div>
<div className="space-y-1">
<Typography as="label" variant="small" className="font-semibold">메모</Typography>
<Input
id="form-card-memo"
type="text"
{...register('memo')}
placeholder="예: 특정 원재료 포함 입찰에만 적용"
/>
</div>
</div>
</div>
)}
{/* Footer — 다른 폼 sheet와 동일: 좌측 삭제(edit), 우측 취소/저장 */}
<div className="pt-4 flex items-center justify-between gap-2 border-t border-border mt-8">
{mode === 'edit' && card && (
<Button
type="button"
variant="destructive"
size="sm"
onClick={() => {
onDelete(card.id, card.title);
onClose();
}}
>
삭제
</Button>
)}
<div className="flex items-center gap-2 flex-1 justify-end">
<Button type="button" variant="outline" size="sm" onClick={onClose}>
취소
</Button>
<Button type="submit" id="form-card-submit" size="sm" disabled={isSubmitting}>
{mode === 'create' ? '저장' : '수정'}
</Button>
</div>
</div>
</form>
</Sheet>
);
}

View File

@ -1,14 +1,12 @@
import { Edit3, Trash2 } from 'lucide-react';
import { DataTable } from '@/components/ui/data-table'; import { DataTable } from '@/components/ui/data-table';
import type { NegotiationCard } from '../types'; import type { NegotiationCard } from '../types';
type CardTableProps = { type CardTableProps = {
data: NegotiationCard[]; data: NegotiationCard[];
onEdit: (card: NegotiationCard) => void; onEdit: (card: NegotiationCard) => void;
onDelete: (id: string, title: string) => void;
}; };
export function CardTable({ data, onEdit, onDelete }: CardTableProps) { export function CardTable({ data, onEdit }: CardTableProps) {
return ( return (
<DataTable <DataTable
data={data} data={data}
@ -39,6 +37,7 @@ export function CardTable({ data, onEdit, onDelete }: CardTableProps) {
{ {
header: '카드이름', header: '카드이름',
headClassName: 'w-52', headClassName: 'w-52',
mobileHeader: true, // 모바일 카드뷰 제목(첫 컬럼 '구분' 배지 대신)
cell: (card) => ( cell: (card) => (
<> <>
<div className="font-semibold text-foreground text-sm">{card.title}</div> <div className="font-semibold text-foreground text-sm">{card.title}</div>
@ -53,8 +52,9 @@ export function CardTable({ data, onEdit, onDelete }: CardTableProps) {
{ {
header: '스크립트', header: '스크립트',
cellClassName: 'font-mono text-muted-foreground', cellClassName: 'font-mono text-muted-foreground',
mobileBlock: true, // 긴 미리보기 블록 → 모바일 카드뷰에서 라벨 아래 풀폭
cell: (card) => ( cell: (card) => (
<div className="line-clamp-2 bg-muted/20 p-2.5 rounded border border-border/30 text-[11px] leading-relaxed"> <div className="line-clamp-1 bg-muted/20 px-2 py-1 rounded border border-border/30 text-[11px] leading-snug">
{card.scriptPreview} {card.scriptPreview}
</div> </div>
), ),
@ -84,35 +84,6 @@ export function CardTable({ data, onEdit, onDelete }: CardTableProps) {
<span className="text-muted-foreground font-mono font-medium opacity-65">-</span> <span className="text-muted-foreground font-mono font-medium opacity-65">-</span>
), ),
}, },
{
header: '관리',
align: 'center',
headClassName: 'w-24',
cell: (card) => (
<div className="flex items-center justify-center gap-2">
<button
onClick={(e) => {
e.stopPropagation();
onEdit(card);
}}
className="p-1.5 text-foreground hover:bg-muted rounded cursor-pointer transition-colors"
title="수정"
>
<Edit3 size={14} />
</button>
<button
onClick={(e) => {
e.stopPropagation();
onDelete(card.id, card.title);
}}
className="p-1.5 text-muted-foreground hover:bg-red-50 hover:text-red-500 rounded cursor-pointer transition-colors"
title="삭제"
>
<Trash2 size={14} />
</button>
</div>
),
},
]} ]}
/> />
); );

View File

@ -0,0 +1,82 @@
import { useCallback } from 'react';
import { Slate, Editable } from 'slate-react';
import type { RenderElementProps, RenderLeafProps } from 'slate-react';
import type { Descendant } from 'slate';
import { useCardScriptEditor } from './useCardScriptEditor';
import { CardScriptToolbar } from './CardScriptToolbar';
import { variableLabel } from './variables';
type CardScriptEditorProps = {
value: Descendant[]; // 마운트 시 초기값(폼 리마운트로 갱신)
onChange: (value: Descendant[]) => void;
disabled?: boolean;
placeholder?: string;
};
// 협상카드 스크립트 리치텍스트 에디터. 굵게/밑줄/색상 마크 + {변수} 칩 지원.
// 값(Slate JSON)은 폼이 들고, 평문(script) 직렬화는 저장 시 serializeToText 로 파생한다.
export function CardScriptEditor({ value, onChange, disabled, placeholder }: CardScriptEditorProps) {
const editor = useCardScriptEditor();
const renderElement = useCallback((props: RenderElementProps) => <Element {...props} />, []);
const renderLeaf = useCallback((props: RenderLeafProps) => <Leaf {...props} />, []);
// 선택(set_selection)만 바뀐 경우는 폼 상태를 건드리지 않는다(불필요한 dirty/검증 방지).
const handleChange = (next: Descendant[]) => {
const contentChanged = editor.operations.some((op) => op.type !== 'set_selection');
if (contentChanged) onChange(next);
};
return (
<div className="border border-border rounded-md overflow-hidden bg-background focus-within:border-foreground/30 transition-all">
<Slate editor={editor} initialValue={value} onChange={handleChange}>
{!disabled && <CardScriptToolbar />}
<Editable
readOnly={disabled}
spellCheck={false}
renderElement={renderElement}
renderLeaf={renderLeaf}
placeholder={placeholder}
className="min-h-[88px] w-full p-3 text-xs leading-relaxed font-sans focus:outline-none [&_[data-slate-placeholder]]:text-muted-foreground"
/>
</Slate>
</div>
);
}
function Leaf({ attributes, children, leaf }: RenderLeafProps) {
let node = children;
if (leaf.bold) node = <strong>{node}</strong>;
if (leaf.underline) node = <u>{node}</u>;
return (
<span {...attributes} style={leaf.color ? { color: leaf.color } : undefined}>
{node}
</span>
);
}
// 인라인 void 옆에 커서를 못 두는 Chromium 버그 회피용 zero-width 스페이서(Slate 공식 패턴).
const InlineChromiumBugfix = () => (
<span contentEditable={false} style={{ fontSize: 0 }}>
{String.fromCodePoint(160) /* nbsp */}
</span>
);
function Element(props: RenderElementProps) {
const { attributes, children, element } = props;
if (element.type === 'variable') {
return (
<span
{...attributes}
contentEditable={false}
className="mx-0.5 rounded-md border border-amber-300/60 bg-amber-100/70 px-1.5 py-0.5 text-[11px] font-semibold text-amber-900 dark:border-amber-400/30 dark:bg-amber-400/15 dark:text-amber-200"
>
<InlineChromiumBugfix />
{variableLabel(element.name)}
{children}
<InlineChromiumBugfix />
</span>
);
}
return <p {...attributes}>{children}</p>;
}

View File

@ -0,0 +1,111 @@
import type { MouseEvent, ReactNode } from 'react';
import { useSlate } from 'slate-react';
import { Bold, Underline } from 'lucide-react';
import { cn } from '@/lib/utils';
import {
activeColor,
isMarkActive,
insertVariable,
setColor,
toggleMark,
type TextMark,
} from './slate';
import { CARD_VARIABLES } from './variables';
// 색상 프리셋 — 기본/강조(빨강)/보조(파랑).
// negowiz 동일 프리셋: 검정 / 빨강 / 파랑.
const COLORS: { value: string; label: string }[] = [
{ value: '#151515', label: '검정' },
{ value: '#ED2024', label: '빨강' },
{ value: '#4880EF', label: '파랑' },
];
// 툴바 버튼은 onMouseDown + preventDefault 로 에디터 선택/포커스를 유지해야 한다(클릭 시 blur 방지).
function hold(handler: () => void) {
return (e: MouseEvent) => {
e.preventDefault();
handler();
};
}
export function CardScriptToolbar() {
const editor = useSlate();
const curColor = activeColor(editor);
return (
<div className="flex flex-wrap items-center gap-1 bg-muted/45 px-2 py-1.5 border-b border-border select-none">
<MarkButton mark="bold" active={isMarkActive(editor, 'bold')} onToggle={() => toggleMark(editor, 'bold')}>
<Bold size={13} />
</MarkButton>
<MarkButton
mark="underline"
active={isMarkActive(editor, 'underline')}
onToggle={() => toggleMark(editor, 'underline')}
>
<Underline size={13} />
</MarkButton>
<Divider />
{COLORS.map((c) => (
<button
key={c.value}
type="button"
title={`색상: ${c.label}`}
onMouseDown={hold(() => setColor(editor, c.value))}
className={cn(
'h-5 w-5 rounded-full border transition-all',
curColor === c.value ? 'ring-2 ring-foreground/40 ring-offset-1' : 'border-border',
)}
style={{ backgroundColor: c.value }}
/>
))}
<Divider />
<span className="text-[10px] text-muted-foreground mr-0.5">변수</span>
{CARD_VARIABLES.map((v) => (
<button
key={v.name}
type="button"
title={`{${v.name}} 삽입`}
onMouseDown={hold(() => insertVariable(editor, v.name))}
className="px-1.5 py-0.5 rounded border border-border bg-background text-[10px] font-semibold text-foreground hover:bg-muted cursor-pointer"
>
{v.label}
</button>
))}
</div>
);
}
function MarkButton({
mark,
active,
onToggle,
children,
}: {
mark: TextMark;
active: boolean;
onToggle: () => void;
children: ReactNode;
}) {
return (
<button
type="button"
aria-pressed={active}
title={mark === 'bold' ? '굵게' : '밑줄'}
onMouseDown={hold(onToggle)}
className={cn(
'flex h-6 w-6 items-center justify-center rounded border transition-all cursor-pointer',
active
? 'bg-foreground text-background border-foreground'
: 'bg-background text-foreground border-border hover:bg-muted',
)}
>
{children}
</button>
);
}
const Divider = () => <span className="mx-1 h-4 w-px bg-border" />;

View File

@ -0,0 +1,4 @@
export { CardScriptEditor } from './CardScriptEditor';
// deserialize() 는 항상 새 배열을 반환 → Slate initialValue 로 안전. 공용 mutable 상수는 export 하지 않는다.
export { deserialize, serializeToText } from './slate';
export { CARD_VARIABLES } from './variables';

View File

@ -0,0 +1,144 @@
import { createEditor, Editor, Element as SlateElement, Transforms } from 'slate';
import type { BaseEditor, Descendant } from 'slate';
import type { ReactEditor } from 'slate-react';
import type { HistoryEditor } from 'slate-history';
import { isKnownVariable } from './variables';
// ── 스키마 ────────────────────────────────────────────────
// negowiz 는 곳곳에서 `as any` 로 노드 타입을 우회했지만, 여기선 Slate 의 CustomTypes
// 모듈 보강으로 editor/element/text 를 정적 타입화한다(툴바·렌더·커맨드 전부 타입 안전).
export type TextMark = 'bold' | 'underline';
export type CustomText = {
text: string;
bold?: boolean;
underline?: boolean;
color?: string; // 색상 코드(#RRGGBB)
};
export type VariableElement = {
type: 'variable';
name: string; // CardVariable.name
children: CustomText[]; // void 라 비어있음([{text:''}])
};
export type ParagraphElement = {
type: 'paragraph';
children: (CustomText | VariableElement)[];
};
export type CustomElement = ParagraphElement | VariableElement;
declare module 'slate' {
interface CustomTypes {
Editor: BaseEditor & ReactEditor & HistoryEditor;
Element: CustomElement;
Text: CustomText;
}
}
// 항상 새 배열을 만든다(Slate 가 initialValue 를 직접 mutate 하므로 공유 금지).
const cloneEmpty = (): Descendant[] => [{ type: 'paragraph', children: [{ text: '' }] }];
// ── 플러그인 ──────────────────────────────────────────────
// 변수 노드를 인라인 + void(내용 수정 불가) + markableVoid(마크는 허용)로 동작시킨다.
export function withVariables<T extends Editor>(editor: T): T {
const { isInline, isVoid, markableVoid } = editor;
editor.isInline = (el) => el.type === 'variable' || isInline(el);
editor.isVoid = (el) => el.type === 'variable' || isVoid(el);
editor.markableVoid = (el) => el.type === 'variable' || markableVoid(el);
return editor;
}
export const createCardEditor = () => createEditor();
// ── 마크/색상/변수 커맨드 ──────────────────────────────────
export function isMarkActive(editor: Editor, mark: TextMark): boolean {
const marks = Editor.marks(editor);
return marks ? marks[mark] === true : false;
}
export function toggleMark(editor: Editor, mark: TextMark): void {
if (isMarkActive(editor, mark)) Editor.removeMark(editor, mark);
else Editor.addMark(editor, mark, true);
}
export function activeColor(editor: Editor): string | undefined {
const marks = Editor.marks(editor) as CustomText | null;
return marks?.color;
}
export function setColor(editor: Editor, color: string): void {
Editor.addMark(editor, 'color', color);
}
export function clearColor(editor: Editor): void {
Editor.removeMark(editor, 'color');
}
export function insertVariable(editor: Editor, name: string): void {
const node: VariableElement = { type: 'variable', name, children: [{ text: '' }] };
Transforms.insertNodes(editor, node);
Transforms.move(editor); // 삽입된 void 뒤로 커서 이동
}
// ── 직렬화: Slate 값 → 평문(script) ─────────────────────────
// 변수는 {name} 토큰으로, 마크는 버리고 텍스트만. 백엔드 script(미리보기) 컬럼에 저장.
export function serializeToText(nodes: Descendant[]): string {
return nodes.map(serializeNode).join('\n');
}
function serializeNode(node: Descendant): string {
if (SlateElement.isElement(node)) {
if (node.type === 'variable') return `{${node.name}}`;
return node.children.map(serializeNode).join('');
}
return node.text;
}
// ── 역직렬화: edit_script(JSON) 또는 평문(script) → Slate 값 ──
// 저장된 edit_script 가 있으면 그대로, 없으면(레거시 평문 카드) {name} 토큰을 변수 노드로 복원.
// Slate 는 initialValue 를 레퍼런스로 직접 변경하므로 항상 새 배열을 돌려준다
// (react-query 캐시·공용 상수 오염 방지).
export function deserialize(editScript?: unknown, plainText?: string): Descendant[] {
if (Array.isArray(editScript) && editScript.length > 0) {
return JSON.parse(JSON.stringify(editScript)) as Descendant[];
}
if (plainText && plainText.trim()) return textToNodes(plainText);
return cloneEmpty();
}
function textToNodes(text: string): Descendant[] {
return text.split('\n').map((line) => ({ type: 'paragraph' as const, children: lineToChildren(line) }));
}
function lineToChildren(line: string): (CustomText | VariableElement)[] {
const children: (CustomText | VariableElement)[] = [];
const re = /\{(\w+)\}/g;
let last = 0;
let m: RegExpExecArray | null;
while ((m = re.exec(line)) !== null) {
if (m.index > last) children.push({ text: line.slice(last, m.index) });
if (isKnownVariable(m[1])) children.push({ type: 'variable', name: m[1], children: [{ text: '' }] });
else children.push({ text: m[0] }); // 미등록 토큰은 평문 그대로
last = re.lastIndex;
}
if (last < line.length) children.push({ text: line.slice(last) });
return ensureTextEdges(children);
}
// 인라인 void(변수)는 앞뒤·사이에 텍스트 노드가 있어야 한다(Slate normalize 규칙 선반영).
function ensureTextEdges(
children: (CustomText | VariableElement)[],
): (CustomText | VariableElement)[] {
const out: (CustomText | VariableElement)[] = [];
for (const child of children) {
const isVar = 'type' in child;
const prev = out[out.length - 1];
if (isVar && (!prev || 'type' in prev)) out.push({ text: '' });
out.push(child);
}
const last = out[out.length - 1];
if (!out.length || (last && 'type' in last)) out.push({ text: '' });
return out;
}

View File

@ -0,0 +1,10 @@
import { useMemo } from 'react';
import { withReact } from 'slate-react';
import { withHistory } from 'slate-history';
import { createCardEditor, withVariables } from './slate';
// 카드 스크립트용 Slate 에디터 인스턴스.
// 조합 순서: createEditor → withReact(React 바인딩) → withHistory(undo/redo) → withVariables(변수 노드).
export function useCardScriptEditor() {
return useMemo(() => withVariables(withHistory(withReact(createCardEditor()))), []);
}

View File

@ -0,0 +1,22 @@
// 협상카드 스크립트에 끼워 넣는 치환 변수 카탈로그.
// negowiz 는 Zustand 전역 스토어로 들고 있었지만, 여기선 결합도를 낮추려 순수 상수로 둔다.
// 저장 포맷의 토큰은 {name} (단일 중괄호) — 백엔드/기존 카드 hint 와 동일 표기.
export type CardVariable = {
name: string; // 토큰/직렬화 키 (예: target_price)
label: string; // 칩·툴바에 보이는 한글 라벨 (예: 목표가)
};
export const CARD_VARIABLES: CardVariable[] = [
{ name: 'target_price', label: '목표가' },
{ name: 'anchor_price', label: '앵커가' },
{ name: 'partner_name', label: '협력사명' },
{ name: 'product_name', label: '상품명' },
];
const VARIABLE_NAMES = new Set(CARD_VARIABLES.map((v) => v.name));
export const isKnownVariable = (name: string): boolean => VARIABLE_NAMES.has(name);
export const variableLabel = (name: string): string =>
CARD_VARIABLES.find((v) => v.name === name)?.label ?? name;

Some files were not shown because too many files have changed in this diff Show More