Merge branch 'dev' of https://git.hanasys.jp/qcast3/onsitesurvey into feature/inquiry
This commit is contained in:
commit
78f8072211
@ -7,6 +7,13 @@ NEXT_PUBLIC_API_URL=http://localhost:3000
|
|||||||
NEXT_PUBLIC_QSP_API_URL=http://1.248.227.176:8120
|
NEXT_PUBLIC_QSP_API_URL=http://1.248.227.176:8120
|
||||||
|
|
||||||
#1:1문의 api
|
#1:1문의 api
|
||||||
|
# NEXT_PUBLIC_INQUIRY_API_URL=http://1.248.227.176:38080
|
||||||
NEXT_PUBLIC_INQUIRY_API_URL=http://172.23.4.129:8110
|
NEXT_PUBLIC_INQUIRY_API_URL=http://172.23.4.129:8110
|
||||||
|
|
||||||
|
|
||||||
|
#QPARTNER 로그인 api
|
||||||
|
DB_HOST=asdf
|
||||||
|
DB_USER=asdf
|
||||||
|
DB_PASSWORD=asdf
|
||||||
|
DB_DATABASE=asdf
|
||||||
|
DB_PORT=3306
|
||||||
@ -7,3 +7,11 @@ NEXT_PUBLIC_QSP_API_URL=http://1.248.227.176:8120
|
|||||||
#1:1문의 api
|
#1:1문의 api
|
||||||
# NEXT_PUBLIC_INQUIRY_API_URL=http://1.248.227.176:38080
|
# NEXT_PUBLIC_INQUIRY_API_URL=http://1.248.227.176:38080
|
||||||
NEXT_PUBLIC_INQUIRY_API_URL=http://172.23.4.129:8110
|
NEXT_PUBLIC_INQUIRY_API_URL=http://172.23.4.129:8110
|
||||||
|
|
||||||
|
|
||||||
|
#QPARTNER 로그인 api
|
||||||
|
DB_HOST=asdf
|
||||||
|
DB_USER=asdf
|
||||||
|
DB_PASSWORD=asdf
|
||||||
|
DB_DATABASE=asdf
|
||||||
|
DB_PORT=3306
|
||||||
@ -9,7 +9,7 @@
|
|||||||
"lint": "next lint"
|
"lint": "next lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@prisma/client": "^6.5.0",
|
"@prisma/client": "^6.7.0",
|
||||||
"@tanstack/react-query": "^5.71.0",
|
"@tanstack/react-query": "^5.71.0",
|
||||||
"@tanstack/react-query-devtools": "^5.71.0",
|
"@tanstack/react-query-devtools": "^5.71.0",
|
||||||
"axios": "^1.8.4",
|
"axios": "^1.8.4",
|
||||||
@ -29,7 +29,7 @@
|
|||||||
"@types/node": "^20",
|
"@types/node": "^20",
|
||||||
"@types/react": "^19",
|
"@types/react": "^19",
|
||||||
"@types/react-dom": "^19",
|
"@types/react-dom": "^19",
|
||||||
"prisma": "^6.5.0",
|
"prisma": "^6.7.0",
|
||||||
"tailwindcss": "^4",
|
"tailwindcss": "^4",
|
||||||
"typescript": "^5"
|
"typescript": "^5"
|
||||||
}
|
}
|
||||||
|
|||||||
78
pnpm-lock.yaml
generated
78
pnpm-lock.yaml
generated
@ -9,8 +9,8 @@ importers:
|
|||||||
.:
|
.:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@prisma/client':
|
'@prisma/client':
|
||||||
specifier: ^6.5.0
|
specifier: ^6.7.0
|
||||||
version: 6.5.0(prisma@6.5.0(typescript@5.8.2))(typescript@5.8.2)
|
version: 6.7.0(prisma@6.7.0(typescript@5.8.2))(typescript@5.8.2)
|
||||||
'@tanstack/react-query':
|
'@tanstack/react-query':
|
||||||
specifier: ^5.71.0
|
specifier: ^5.71.0
|
||||||
version: 5.71.0(react@19.1.0)
|
version: 5.71.0(react@19.1.0)
|
||||||
@ -64,8 +64,8 @@ importers:
|
|||||||
specifier: ^19
|
specifier: ^19
|
||||||
version: 19.0.4(@types/react@19.0.12)
|
version: 19.0.4(@types/react@19.0.12)
|
||||||
prisma:
|
prisma:
|
||||||
specifier: ^6.5.0
|
specifier: ^6.7.0
|
||||||
version: 6.5.0(typescript@5.8.2)
|
version: 6.7.0(typescript@5.8.2)
|
||||||
tailwindcss:
|
tailwindcss:
|
||||||
specifier: ^4
|
specifier: ^4
|
||||||
version: 4.0.17
|
version: 4.0.17
|
||||||
@ -541,8 +541,8 @@ packages:
|
|||||||
resolution: {integrity: sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg==}
|
resolution: {integrity: sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg==}
|
||||||
engines: {node: '>= 10.0.0'}
|
engines: {node: '>= 10.0.0'}
|
||||||
|
|
||||||
'@prisma/client@6.5.0':
|
'@prisma/client@6.7.0':
|
||||||
resolution: {integrity: sha512-M6w1Ql/BeiGoZmhMdAZUXHu5sz5HubyVcKukbLs3l0ELcQb8hTUJxtGEChhv4SVJ0QJlwtLnwOLgIRQhpsm9dw==}
|
resolution: {integrity: sha512-+k61zZn1XHjbZul8q6TdQLpuI/cvyfil87zqK2zpreNIXyXtpUv3+H/oM69hcsFcZXaokHJIzPAt5Z8C8eK2QA==}
|
||||||
engines: {node: '>=18.18'}
|
engines: {node: '>=18.18'}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
prisma: '*'
|
prisma: '*'
|
||||||
@ -553,23 +553,23 @@ packages:
|
|||||||
typescript:
|
typescript:
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@prisma/config@6.5.0':
|
'@prisma/config@6.7.0':
|
||||||
resolution: {integrity: sha512-sOH/2Go9Zer67DNFLZk6pYOHj+rumSb0VILgltkoxOjYnlLqUpHPAN826vnx8HigqnOCxj9LRhT6U7uLiIIWgw==}
|
resolution: {integrity: sha512-di8QDdvSz7DLUi3OOcCHSwxRNeW7jtGRUD2+Z3SdNE3A+pPiNT8WgUJoUyOwJmUr5t+JA2W15P78C/N+8RXrOA==}
|
||||||
|
|
||||||
'@prisma/debug@6.5.0':
|
'@prisma/debug@6.7.0':
|
||||||
resolution: {integrity: sha512-fc/nusYBlJMzDmDepdUtH9aBsJrda2JNErP9AzuHbgUEQY0/9zQYZdNlXmKoIWENtio+qarPNe/+DQtrX5kMcQ==}
|
resolution: {integrity: sha512-RabHn9emKoYFsv99RLxvfG2GHzWk2ZI1BuVzqYtmMSIcuGboHY5uFt3Q3boOREM9de6z5s3bQoyKeWnq8Fz22w==}
|
||||||
|
|
||||||
'@prisma/engines-version@6.5.0-73.173f8d54f8d52e692c7e27e72a88314ec7aeff60':
|
'@prisma/engines-version@6.7.0-36.3cff47a7f5d65c3ea74883f1d736e41d68ce91ed':
|
||||||
resolution: {integrity: sha512-iK3EmiVGFDCmXjSpdsKGNqy9hOdLnvYBrJB61far/oP03hlIxrb04OWmDjNTwtmZ3UZdA5MCvI+f+3k2jPTflQ==}
|
resolution: {integrity: sha512-EvpOFEWf1KkJpDsBCrih0kg3HdHuaCnXmMn7XFPObpFTzagK1N0Q0FMnYPsEhvARfANP5Ok11QyoTIRA2hgJTA==}
|
||||||
|
|
||||||
'@prisma/engines@6.5.0':
|
'@prisma/engines@6.7.0':
|
||||||
resolution: {integrity: sha512-FVPQYHgOllJklN9DUyujXvh3hFJCY0NX86sDmBErLvoZjy2OXGiZ5FNf3J/C4/RZZmCypZBYpBKEhx7b7rEsdw==}
|
resolution: {integrity: sha512-3wDMesnOxPrOsq++e5oKV9LmIiEazFTRFZrlULDQ8fxdub5w4NgRBoxtWbvXmj2nJVCnzuz6eFix3OhIqsZ1jw==}
|
||||||
|
|
||||||
'@prisma/fetch-engine@6.5.0':
|
'@prisma/fetch-engine@6.7.0':
|
||||||
resolution: {integrity: sha512-3LhYA+FXP6pqY8FLHCjewyE8pGXXJ7BxZw2rhPq+CZAhvflVzq4K8Qly3OrmOkn6wGlz79nyLQdknyCG2HBTuA==}
|
resolution: {integrity: sha512-zLlAGnrkmioPKJR4Yf7NfW3hftcvqeNNEHleMZK9yX7RZSkhmxacAYyfGsCcqRt47jiZ7RKdgE0Wh2fWnm7WsQ==}
|
||||||
|
|
||||||
'@prisma/get-platform@6.5.0':
|
'@prisma/get-platform@6.7.0':
|
||||||
resolution: {integrity: sha512-xYcvyJwNMg2eDptBYFqFLUCfgi+wZLcj6HDMsj0Qw0irvauG4IKmkbywnqwok0B+k+W+p+jThM2DKTSmoPCkzw==}
|
resolution: {integrity: sha512-i9IH5lO4fQwnMLvQLYNdgVh9TK3PuWBfQd7QLk/YurnAIg+VeADcZDbmhAi4XBBDD+hDif9hrKyASu0hbjwabw==}
|
||||||
|
|
||||||
'@swc/counter@0.1.3':
|
'@swc/counter@0.1.3':
|
||||||
resolution: {integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==}
|
resolution: {integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==}
|
||||||
@ -1187,8 +1187,8 @@ packages:
|
|||||||
resolution: {integrity: sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==}
|
resolution: {integrity: sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==}
|
||||||
engines: {node: ^10 || ^12 || >=14}
|
engines: {node: ^10 || ^12 || >=14}
|
||||||
|
|
||||||
prisma@6.5.0:
|
prisma@6.7.0:
|
||||||
resolution: {integrity: sha512-yUGXmWqv5F4PByMSNbYFxke/WbnyTLjnJ5bKr8fLkcnY7U5rU9rUTh/+Fja+gOrRxEgtCbCtca94IeITj4j/pg==}
|
resolution: {integrity: sha512-vArg+4UqnQ13CVhc2WUosemwh6hr6cr6FY2uzDvCIFwH8pu8BXVv38PktoMLVjtX7sbYThxbnZF5YiR8sN2clw==}
|
||||||
engines: {node: '>=18.18'}
|
engines: {node: '>=18.18'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
@ -1760,38 +1760,38 @@ snapshots:
|
|||||||
'@parcel/watcher-win32-x64': 2.5.1
|
'@parcel/watcher-win32-x64': 2.5.1
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@prisma/client@6.5.0(prisma@6.5.0(typescript@5.8.2))(typescript@5.8.2)':
|
'@prisma/client@6.7.0(prisma@6.7.0(typescript@5.8.2))(typescript@5.8.2)':
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
prisma: 6.5.0(typescript@5.8.2)
|
prisma: 6.7.0(typescript@5.8.2)
|
||||||
typescript: 5.8.2
|
typescript: 5.8.2
|
||||||
|
|
||||||
'@prisma/config@6.5.0':
|
'@prisma/config@6.7.0':
|
||||||
dependencies:
|
dependencies:
|
||||||
esbuild: 0.25.2
|
esbuild: 0.25.2
|
||||||
esbuild-register: 3.6.0(esbuild@0.25.2)
|
esbuild-register: 3.6.0(esbuild@0.25.2)
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
'@prisma/debug@6.5.0': {}
|
'@prisma/debug@6.7.0': {}
|
||||||
|
|
||||||
'@prisma/engines-version@6.5.0-73.173f8d54f8d52e692c7e27e72a88314ec7aeff60': {}
|
'@prisma/engines-version@6.7.0-36.3cff47a7f5d65c3ea74883f1d736e41d68ce91ed': {}
|
||||||
|
|
||||||
'@prisma/engines@6.5.0':
|
'@prisma/engines@6.7.0':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@prisma/debug': 6.5.0
|
'@prisma/debug': 6.7.0
|
||||||
'@prisma/engines-version': 6.5.0-73.173f8d54f8d52e692c7e27e72a88314ec7aeff60
|
'@prisma/engines-version': 6.7.0-36.3cff47a7f5d65c3ea74883f1d736e41d68ce91ed
|
||||||
'@prisma/fetch-engine': 6.5.0
|
'@prisma/fetch-engine': 6.7.0
|
||||||
'@prisma/get-platform': 6.5.0
|
'@prisma/get-platform': 6.7.0
|
||||||
|
|
||||||
'@prisma/fetch-engine@6.5.0':
|
'@prisma/fetch-engine@6.7.0':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@prisma/debug': 6.5.0
|
'@prisma/debug': 6.7.0
|
||||||
'@prisma/engines-version': 6.5.0-73.173f8d54f8d52e692c7e27e72a88314ec7aeff60
|
'@prisma/engines-version': 6.7.0-36.3cff47a7f5d65c3ea74883f1d736e41d68ce91ed
|
||||||
'@prisma/get-platform': 6.5.0
|
'@prisma/get-platform': 6.7.0
|
||||||
|
|
||||||
'@prisma/get-platform@6.5.0':
|
'@prisma/get-platform@6.7.0':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@prisma/debug': 6.5.0
|
'@prisma/debug': 6.7.0
|
||||||
|
|
||||||
'@swc/counter@0.1.3': {}
|
'@swc/counter@0.1.3': {}
|
||||||
|
|
||||||
@ -2421,10 +2421,10 @@ snapshots:
|
|||||||
picocolors: 1.1.1
|
picocolors: 1.1.1
|
||||||
source-map-js: 1.2.1
|
source-map-js: 1.2.1
|
||||||
|
|
||||||
prisma@6.5.0(typescript@5.8.2):
|
prisma@6.7.0(typescript@5.8.2):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@prisma/config': 6.5.0
|
'@prisma/config': 6.7.0
|
||||||
'@prisma/engines': 6.5.0
|
'@prisma/engines': 6.7.0
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
fsevents: 2.3.3
|
fsevents: 2.3.3
|
||||||
typescript: 5.8.2
|
typescript: 5.8.2
|
||||||
|
|||||||
@ -57,65 +57,65 @@ model MS_SUITABLE {
|
|||||||
updated_at DateTime @updatedAt
|
updated_at DateTime @updatedAt
|
||||||
}
|
}
|
||||||
|
|
||||||
model SD_SERVEY_SALES_BASIC_INFO {
|
model SD_SURVEY_SALES_BASIC_INFO {
|
||||||
id Int @id @default(autoincrement())
|
ID Int @id @default(autoincrement())
|
||||||
representative String @db.VarChar(200)
|
REPRESENTATIVE String @db.VarChar(200)
|
||||||
store String? @db.VarChar(200)
|
STORE String? @db.VarChar(200)
|
||||||
construction_point String? @db.VarChar(200)
|
CONSTRUCTION_POINT String? @db.VarChar(200)
|
||||||
investigation_date String? @db.VarChar(10)
|
INVESTIGATION_DATE String? @db.VarChar(10)
|
||||||
building_name String? @db.VarChar(200)
|
BUILDING_NAME String? @db.VarChar(200)
|
||||||
customer_name String? @db.VarChar(200)
|
CUSTOMER_NAME String? @db.VarChar(200)
|
||||||
post_code String? @db.VarChar(10)
|
POST_CODE String? @db.VarChar(10)
|
||||||
address String? @db.VarChar(200)
|
ADDRESS String? @db.VarChar(200)
|
||||||
address_detail String? @db.VarChar(300)
|
ADDRESS_DETAIL String? @db.VarChar(300)
|
||||||
submission_status Boolean @default(false)
|
SUBMISSION_STATUS Boolean @default(false)
|
||||||
submission_date DateTime? @db.Date
|
SUBMISSION_DATE DateTime? @db.Date
|
||||||
created_at DateTime @default(now())
|
REG_DT DateTime @default(now())
|
||||||
updated_at DateTime @updatedAt
|
UPT_DT DateTime @updatedAt
|
||||||
detail_info SD_SERVEY_SALES_DETAIL_INFO?
|
DETAIL_INFO SD_SURVEY_SALES_DETAIL_INFO?
|
||||||
}
|
}
|
||||||
|
|
||||||
model SD_SERVEY_SALES_DETAIL_INFO {
|
model SD_SURVEY_SALES_DETAIL_INFO {
|
||||||
id Int @id @default(autoincrement())
|
ID Int @id @default(autoincrement())
|
||||||
contract_capacity String? @db.VarChar(20)
|
CONTRACT_CAPACITY String? @db.VarChar(20)
|
||||||
retail_company String? @db.VarChar(100)
|
RETAIL_COMPANY String? @db.VarChar(100)
|
||||||
supplementary_facilities String? @db.VarChar(20)
|
SUPPLEMENTARY_FACILITIES String? @db.VarChar(20)
|
||||||
supplementary_facilities_etc String? @db.VarChar(200)
|
SUPPLEMENTARY_FACILITIES_ETC String? @db.VarChar(200)
|
||||||
installation_system Int?
|
INSTALLATION_SYSTEM String? @db.VarChar(20)
|
||||||
installation_system_etc String? @db.VarChar(200)
|
INSTALLATION_SYSTEM_ETC String? @db.VarChar(200)
|
||||||
construction_year Int?
|
CONSTRUCTION_YEAR String? @db.VarChar(200)
|
||||||
construction_year_etc String? @db.VarChar(200)
|
CONSTRUCTION_YEAR_ETC String? @db.VarChar(200)
|
||||||
roof_material String? @db.VarChar(20)
|
ROOF_MATERIAL String? @db.VarChar(20)
|
||||||
roof_material_etc String? @db.VarChar(200)
|
ROOF_MATERIAL_ETC String? @db.VarChar(200)
|
||||||
roof_shape Int?
|
ROOF_SHAPE String? @db.VarChar(20)
|
||||||
roof_shape_etc String? @db.VarChar(200)
|
ROOF_SHAPE_ETC String? @db.VarChar(200)
|
||||||
roof_slope String? @db.VarChar(5)
|
ROOF_SLOPE String? @db.VarChar(5)
|
||||||
house_structure Int?
|
HOUSE_STRUCTURE String? @db.VarChar(20)
|
||||||
house_structure_etc String? @db.VarChar(200)
|
HOUSE_STRUCTURE_ETC String? @db.VarChar(200)
|
||||||
rafter_material Int?
|
RAFTER_MATERIAL String? @db.VarChar(20)
|
||||||
rafter_material_etc String? @db.VarChar(200)
|
RAFTER_MATERIAL_ETC String? @db.VarChar(200)
|
||||||
rafter_size Int?
|
RAFTER_SIZE String? @db.VarChar(20)
|
||||||
rafter_size_etc String? @db.VarChar(200)
|
RAFTER_SIZE_ETC String? @db.VarChar(200)
|
||||||
rafter_pitch Int?
|
RAFTER_PITCH String? @db.VarChar(20)
|
||||||
rafter_pitch_etc String? @db.VarChar(200)
|
RAFTER_PITCH_ETC String? @db.VarChar(200)
|
||||||
rafter_direction Int?
|
RAFTER_DIRECTION String? @db.VarChar(20)
|
||||||
open_field_plate_kind Int?
|
OPEN_FIELD_PLATE_KIND String? @db.VarChar(20)
|
||||||
open_field_plate_kind_etc String? @db.VarChar(200)
|
OPEN_FIELD_PLATE_KIND_ETC String? @db.VarChar(200)
|
||||||
open_field_plate_thickness String? @db.VarChar(5)
|
OPEN_FIELD_PLATE_THICKNESS String? @db.VarChar(5)
|
||||||
leak_trace Boolean? @default(false)
|
LEAK_TRACE Boolean? @default(false)
|
||||||
waterproof_material Int?
|
WATERPROOF_MATERIAL String? @db.VarChar(20)
|
||||||
waterproof_material_etc String? @db.VarChar(200)
|
WATERPROOF_MATERIAL_ETC String? @db.VarChar(200)
|
||||||
insulation_presence Int?
|
INSULATION_PRESENCE String? @db.VarChar(20)
|
||||||
insulation_presence_etc String? @db.VarChar(200)
|
INSULATION_PRESENCE_ETC String? @db.VarChar(200)
|
||||||
structure_order Int?
|
STRUCTURE_ORDER String? @db.VarChar(20)
|
||||||
structure_order_etc String? @db.VarChar(200)
|
STRUCTURE_ORDER_ETC String? @db.VarChar(200)
|
||||||
installation_availability Int?
|
INSTALLATION_AVAILABILITY String? @db.VarChar(20)
|
||||||
installation_availability_etc String? @db.VarChar(200)
|
INSTALLATION_AVAILABILITY_ETC String? @db.VarChar(200)
|
||||||
memo String? @db.VarChar(500)
|
MEMO String? @db.VarChar(500)
|
||||||
created_at DateTime @default(now())
|
REG_DT DateTime @default(now())
|
||||||
updated_at DateTime @updatedAt
|
UPT_DT DateTime @updatedAt
|
||||||
basic_info_id Int @unique
|
BASIC_INFO_ID Int @unique
|
||||||
basic_info SD_SERVEY_SALES_BASIC_INFO @relation(fields: [basic_info_id], references: [id])
|
BASIC_INFO SD_SURVEY_SALES_BASIC_INFO @relation(fields: [BASIC_INFO_ID], references: [ID])
|
||||||
}
|
}
|
||||||
|
|
||||||
model BC_COMM_H {
|
model BC_COMM_H {
|
||||||
@ -177,3 +177,33 @@ model BC_COMM_L {
|
|||||||
|
|
||||||
@@id([HEAD_CD, CODE], map: "PK_BC_COMM_L")
|
@@id([HEAD_CD, CODE], map: "PK_BC_COMM_L")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
model MS_SUITABLE_ROOF_MATERIAL_GROUP {
|
||||||
|
ID Int @id @default(autoincrement())
|
||||||
|
ROOF_MATERIAL_GROUP String @db.VarChar(200)
|
||||||
|
ROOF_MT_CD String @db.VarChar(200)
|
||||||
|
REG_DT DateTime @default(now(), map: "DF__MS_SUITAB__creat__4F7CD00D")
|
||||||
|
UPT_DT DateTime
|
||||||
|
}
|
||||||
|
|
||||||
|
model MS_SUITABLE_DETAIL {
|
||||||
|
ID Int @id @default(autoincrement())
|
||||||
|
MAIN_ID Int
|
||||||
|
TRESTLE_MFPC_CD String? @db.VarChar(200)
|
||||||
|
TRESTLE_MANUFACTURER_PRODUCT_NAME String? @db.VarChar(200)
|
||||||
|
MEMO String? @db.VarChar(500)
|
||||||
|
REG_DT DateTime @default(now(), map: "DF__MS_SUITAB__creat__571DF1D5")
|
||||||
|
UPT_DT DateTime?
|
||||||
|
MS_SUITABLE_MAIN MS_SUITABLE_MAIN @relation(fields: [MAIN_ID], references: [ID], onUpdate: NoAction, map: "MS_SUITABLE_DETAIL_MS_SUITABLE_MAIN_FK")
|
||||||
|
}
|
||||||
|
|
||||||
|
model MS_SUITABLE_MAIN {
|
||||||
|
ID Int @id @default(autoincrement())
|
||||||
|
PRODUCT_NAME String @db.VarChar(200)
|
||||||
|
MANU_FT_CD String? @db.VarChar(200)
|
||||||
|
ROOF_MT_CD String? @db.VarChar(100)
|
||||||
|
ROOF_SH_CD String? @db.VarChar(200)
|
||||||
|
REG_DT DateTime @default(now(), map: "DF__MS_SUITAB__creat__5441852A")
|
||||||
|
UPT_DT DateTime?
|
||||||
|
MS_SUITABLE_DETAIL MS_SUITABLE_DETAIL[]
|
||||||
|
}
|
||||||
|
|||||||
30
src/hooks/useSuitable.ts
Normal file
30
src/hooks/useSuitable.ts
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import { suitableApi } from '@/api/suitable'
|
||||||
|
|
||||||
|
export function useSuitable() {
|
||||||
|
const getCategories = async () => {
|
||||||
|
try {
|
||||||
|
return await suitableApi.getCategory()
|
||||||
|
} catch (error) {
|
||||||
|
console.error('카테고리 데이터 로드 실패:', error)
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const getSuitables = async () => {
|
||||||
|
try {
|
||||||
|
return await suitableApi.getList()
|
||||||
|
} catch (error) {
|
||||||
|
console.error('지붕재 데이터 로드 실패:', error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const updateSearchResults = async (selectedCategory: string | undefined, searchValue: string | undefined) => {
|
||||||
|
try {
|
||||||
|
return await suitableApi.getList(selectedCategory, searchValue)
|
||||||
|
} catch (error) {
|
||||||
|
console.error('지붕재 데이터 검색 실패:', error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return { getCategories, getSuitables, updateSearchResults }
|
||||||
|
}
|
||||||
68
src/store/useSuitableStore.ts
Normal file
68
src/store/useSuitableStore.ts
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
import { create } from 'zustand'
|
||||||
|
import { Suitable, suitableApi } from '@/api/suitable'
|
||||||
|
|
||||||
|
interface SuitableState {
|
||||||
|
// // 검색 결과 리스트
|
||||||
|
// searchResults: Suitable[]
|
||||||
|
// // 초기 데이터 로드
|
||||||
|
// fetchInitializeData: () => Promise<void>
|
||||||
|
// // 검색 결과 설정
|
||||||
|
// setSearchResults: (results: Suitable[]) => void
|
||||||
|
// // 검색 결과 초기화
|
||||||
|
// resetSearchResults: () => void
|
||||||
|
|
||||||
|
// 선택된 아이템 리스트
|
||||||
|
selectedItems: Suitable[]
|
||||||
|
// 선택된 아이템 추가
|
||||||
|
addSelectedItem: (item: Suitable) => void
|
||||||
|
// 선택된 아이템 제거
|
||||||
|
removeSelectedItem: (itemId: number) => void
|
||||||
|
// 선택된 아이템 모두 제거
|
||||||
|
clearSelectedItems: () => void
|
||||||
|
}
|
||||||
|
|
||||||
|
export const useSuitableStore = create<SuitableState>((set) => ({
|
||||||
|
// // 초기 상태
|
||||||
|
// searchResults: [],
|
||||||
|
|
||||||
|
// // 초기 데이터 로드
|
||||||
|
// fetchInitializeData: async () => {
|
||||||
|
// const suitables = await fetchInitialSuitablee()
|
||||||
|
// set({ searchResults: suitables })
|
||||||
|
// },
|
||||||
|
|
||||||
|
// // 검색 결과 설정
|
||||||
|
// setSearchResults: (results) => set({ searchResults: results }),
|
||||||
|
|
||||||
|
// // 검색 결과 초기화
|
||||||
|
// resetSearchResults: () => set({ searchResults: [] }),
|
||||||
|
|
||||||
|
// 초기 상태
|
||||||
|
selectedItems: [],
|
||||||
|
|
||||||
|
// 선택된 아이템 추가 (중복 방지)
|
||||||
|
addSelectedItem: (item) =>
|
||||||
|
set((state) => ({
|
||||||
|
selectedItems: state.selectedItems.some((i) => i.id === item.id) ? state.selectedItems : [...state.selectedItems, item],
|
||||||
|
})),
|
||||||
|
|
||||||
|
// 선택된 아이템 제거
|
||||||
|
removeSelectedItem: (itemId) =>
|
||||||
|
set((state) => ({
|
||||||
|
selectedItems: state.selectedItems.filter((item) => item.id !== itemId),
|
||||||
|
})),
|
||||||
|
|
||||||
|
// 선택된 아이템 모두 제거
|
||||||
|
clearSelectedItems: () => set({ selectedItems: [] }),
|
||||||
|
}))
|
||||||
|
|
||||||
|
// // 전체 데이터 초기화 함수
|
||||||
|
// async function fetchInitialSuitablee() {
|
||||||
|
// try {
|
||||||
|
// const suitable = await suitableApi.getList()
|
||||||
|
// return suitable
|
||||||
|
// } catch (error) {
|
||||||
|
// console.error('초기 데이터 로드 실패:', error)
|
||||||
|
// return []
|
||||||
|
// }
|
||||||
|
// }
|
||||||
Loading…
x
Reference in New Issue
Block a user