summaryrefslogtreecommitdiff
path: root/lib/items-tech/service.ts
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-07-21 07:54:26 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-07-21 07:54:26 +0000
commit14f61e24947fb92dd71ec0a7196a6e815f8e66da (patch)
tree317c501d64662d05914330628f867467fba78132 /lib/items-tech/service.ts
parent194bd4bd7e6144d5c09c5e3f5476d254234dce72 (diff)
(최겸)기술영업 RFQ 담당자 초대, 요구사항 반영
Diffstat (limited to 'lib/items-tech/service.ts')
-rw-r--r--lib/items-tech/service.ts34
1 files changed, 32 insertions, 2 deletions
diff --git a/lib/items-tech/service.ts b/lib/items-tech/service.ts
index bf2684d7..d93c5f96 100644
--- a/lib/items-tech/service.ts
+++ b/lib/items-tech/service.ts
@@ -405,7 +405,14 @@ export async function createShipbuildingItem(input: TypedItemCreateData) {
unstable_noStore()
try {
- // itemCode는 nullable하게 변경
+ if (!input.itemCode) {
+ return {
+ success: false,
+ message: "아이템 코드는 필수입니다",
+ data: null,
+ error: "필수 필드 누락"
+ }
+ }
const shipData = input as ShipbuildingItemCreateData;
const result = await db.insert(itemShipbuilding).values({
@@ -459,7 +466,14 @@ export async function createShipbuildingImportItem(input: {
unstable_noStore();
try {
- // itemCode는 nullable하게 변경
+ if (!input.itemCode) {
+ return {
+ success: false,
+ message: "아이템 코드는 필수입니다",
+ data: null,
+ error: "필수 필드 누락"
+ }
+ }
// 기존 아이템 및 선종 확인 (itemCode가 있을 경우에만)
if (input.itemCode) {
@@ -525,6 +539,14 @@ export async function createOffshoreTopItem(data: OffshoreTopItemCreateData) {
unstable_noStore();
try {
+ if (!data.itemCode) {
+ return {
+ success: false,
+ message: "아이템 코드는 필수입니다",
+ data: null,
+ error: "필수 필드 누락"
+ }
+ }
// itemCode가 있는 경우 중복 체크
if (data.itemCode && data.itemCode.trim() !== "") {
const existingItem = await db
@@ -586,6 +608,14 @@ export async function createOffshoreHullItem(data: OffshoreHullItemCreateData) {
unstable_noStore();
try {
+ if (!data.itemCode) {
+ return {
+ success: false,
+ message: "아이템 코드는 필수입니다",
+ data: null,
+ error: "필수 필드 누락"
+ }
+ }
// itemCode가 있는 경우 중복 체크
if (data.itemCode && data.itemCode.trim() !== "") {
const existingItem = await db