-
Notifications
You must be signed in to change notification settings - Fork 0
[FEAT] 엑셀 upload로 소매 재고 관리 기능 구현 #149 #155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import pandas as pd | ||
|
|
||
| # Create sample data | ||
| data = { | ||
| 'Product Code': ['P00000LM000D', 'P00000WA000B', 'P00000IP000A'], | ||
| 'Quantity': [10, 5, 20], | ||
| 'Applied At': ['2023-12-01 10:00:00', '2023-12-01 11:00:00', ''] | ||
| } | ||
|
Comment on lines
+4
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 샘플 데이터 컬럼 위치가 RetailService와 일치하지 않습니다.
다음과 같이 수정하여 컬럼 위치를 맞추세요: data = {
- 'Product Code': ['P00000LM000D', 'P00000WA000B', 'P00000IP000A'],
- 'Quantity': [10, 5, 20],
- 'Applied At': ['2023-12-01 10:00:00', '2023-12-01 11:00:00', '']
+ 'Empty': ['', '', ''], # Cell 0
+ 'POS Code': ['P00000LM000D', 'P00000WA000B', 'P00000IP000A'], # Cell 1
+ 'Empty2': ['', '', ''], # Cell 2
+ 'Quantity': [10, 5, 20], # Cell 3
+ 'Applied At': ['2023-12-01 10:00:00', '2023-12-01 11:00:00', ''] # Cell 4 (미사용)
}🤖 Prompt for AI Agents |
||
|
|
||
| # Create DataFrame | ||
| df = pd.DataFrame(data) | ||
|
|
||
| # Save to Excel | ||
| df.to_excel('sample_retail.xlsx', index=False) | ||
|
|
||
| print("Sample Excel file 'sample_retail.xlsx' created successfully.") | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,11 +33,14 @@ public class Product extends BaseTimeEntity { | |
| @JoinColumn(name = "vendor_id", nullable = false) | ||
| private Vendor vendor; | ||
|
|
||
| @Column(name = "name", length = 30, nullable = false) | ||
| @Column(name = "name", length = 255, nullable = false) | ||
| private String name; | ||
|
|
||
| @Column(name = "code", length = 30, nullable = false) | ||
| private String code; | ||
| @Column(name = "cafe24_code", length = 50, nullable = false) | ||
| private String cafe24Code; | ||
|
|
||
| @Column(name = "pos_code", length = 50, nullable = false) | ||
| private String posCode; | ||
|
Comment on lines
+36
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: cat -n src/main/java/com/almang/inventory/product/domain/Product.java | head -100Repository: almang2/inventory-server Length of output: 3638 🏁 Script executed: # Search for migration files and flyway/liquibase configuration
find . -type f \( -name "*.sql" -o -name "*.yaml" -o -name "*.yml" -o -name "application*.properties" \) | grep -E "(migration|db|flyway|liquibase)" | head -20Repository: almang2/inventory-server Length of output: 50 🏁 Script executed: # Check for migration directories
find . -type d \( -name "migration*" -o -name "db" -o -name "flyway" -o -name "liquibase" \) 2>/dev/nullRepository: almang2/inventory-server Length of output: 50 🏁 Script executed: # Search for cafe24_code or pos_code references in SQL or migration files
rg -i "cafe24|pos_code" --type sql --type yaml -l 2>/dev/null || echo "No matches found"Repository: almang2/inventory-server Length of output: 94 🏁 Script executed: cat docs/rds_create_tables.sql | grep -A 5 -B 5 "cafe24\|pos_code"Repository: almang2/inventory-server Length of output: 980 🏁 Script executed: # Search for Flyway or Liquibase migration directories
find . -type d -name "db" -o -name "migration" 2>/dev/null | head -10Repository: almang2/inventory-server Length of output: 50 🏁 Script executed: # Check for migration files in common locations
find . -path "*/db/migration*" -o -path "*/flyway*" -o -path "*/liquibase*" 2>/dev/null | head -20Repository: almang2/inventory-server Length of output: 50 🏁 Script executed: # Look at the structure of migration/db directories if they exist
ls -la src/main/resources/ 2>/dev/null | grep -E "db|migration|flyway"Repository: almang2/inventory-server Length of output: 50 🏁 Script executed: cat docs/rds_create_tables.sql | grep -n "CREATE TABLE.*products"Repository: almang2/inventory-server Length of output: 50 🏁 Script executed: cat docs/rds_create_tables.sqlRepository: almang2/inventory-server Length of output: 2017 🏁 Script executed: # Search for any mention of cafe24_code or pos_code in the entire codebase
rg "cafe24_code|pos_code" --type sqlRepository: almang2/inventory-server Length of output: 50 🏁 Script executed: # Search for products table definition anywhere in codebase
rg "CREATE TABLE.*products" --type sqlRepository: almang2/inventory-server Length of output: 50 🏁 Script executed: # Find all SQL files
fd -e sqlRepository: almang2/inventory-server Length of output: 94 🏁 Script executed: # Search for any SQL files or migration-related files
find . -type f \( -name "*.sql" -o -name "*.ddl" \) 2>/dev/nullRepository: almang2/inventory-server Length of output: 96 🏁 Script executed: # Check if there's an existing products table schema somewhere else
rg "products" -t sqlRepository: almang2/inventory-server Length of output: 175 🏁 Script executed: # Look for any schema or DDL comments in Java files
rg "cafe24_code|pos_code" -A 3 -B 3Repository: almang2/inventory-server Length of output: 1003 Database migration script required for The new Before merging, create a database migration script that:
Without this migration, the application will fail when Hibernate attempts to persist or update products. |
||
|
|
||
| @Enumerated(EnumType.STRING) | ||
| @Column(name = "unit", nullable = false) | ||
|
|
@@ -73,12 +76,15 @@ public void updateVendor(Vendor vendor) { | |
| } | ||
| } | ||
|
|
||
| public void updateBasicInfo(String name, String code, ProductUnit unit) { | ||
| public void updateBasicInfo(String name, String cafe24Code, String posCode, ProductUnit unit) { | ||
| if (name != null) { | ||
| this.name = name; | ||
| } | ||
| if (code != null) { | ||
| this.code = code; | ||
| if (cafe24Code != null) { | ||
| this.cafe24Code = cafe24Code; | ||
| } | ||
| if (posCode != null) { | ||
| this.posCode = posCode; | ||
| } | ||
| if (unit != null) { | ||
| this.unit = unit; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,15 +7,16 @@ | |
| import java.math.BigDecimal; | ||
|
|
||
| public record UpdateProductRequest( | ||
| @NotNull Long vendorId, | ||
| String name, | ||
| String code, | ||
| ProductUnit unit, | ||
| BigDecimal boxWeightG, | ||
| @Positive Integer unitPerBox, | ||
| BigDecimal unitWeightG, | ||
| Boolean isActivated, | ||
| @Min(0) Integer costPrice, | ||
| @Min(0) Integer retailPrice, | ||
| @Min(0) Integer wholesalePrice | ||
| ) {} | ||
| @NotNull Long vendorId, | ||
| String name, | ||
| String cafe24Code, | ||
| String posCode, | ||
| ProductUnit unit, | ||
| BigDecimal boxWeightG, | ||
| @Positive Integer unitPerBox, | ||
| BigDecimal unitWeightG, | ||
| Boolean isActivated, | ||
| @Min(0) Integer costPrice, | ||
| @Min(0) Integer retailPrice, | ||
| @Min(0) Integer wholesalePrice) { | ||
| } | ||
|
Comment on lines
9
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Find and examine CreateProductRequest
echo "=== CreateProductRequest.java ==="
fd -t f "CreateProductRequest.java" --exec cat {}
# Find the test file and relevant test method
echo "=== ProductControllerTest - validation test ==="
fd -t f "ProductControllerTest.java" --exec wc -l {} \;Repository: almang2/inventory-server Length of output: 1069 🏁 Script executed: #!/bin/bash
# Search for the specific test mentioned in the review (line 369-381 or 178-204)
echo "=== Test method searching for empty string validation ==="
rg -n -B 2 -A 15 "empty|Empty|빈.*문자" src/test/java/com/almang/inventory/product/controller/ --type java | head -100Repository: almang2/inventory-server Length of output: 125 🏁 Script executed: #!/bin/bash
# Check UpdateProductRequest current validation state more thoroughly
echo "=== Full UpdateProductRequest.java ==="
fd -t f "UpdateProductRequest.java" --exec cat {}Repository: almang2/inventory-server Length of output: 889 🏁 Script executed: #!/bin/bash
# Find test methods in ProductControllerTest that test update product validation
echo "=== Test methods for update product ==="
rg -n "void.*update|updateProduct|PUT|patch" src/test/java/com/almang/inventory/product/controller/ProductControllerTest.java -A 3
# Also search for test assertions with invalid input or validation
echo "=== Test validation assertions ==="
rg -n "INVALID_INPUT_VALUE|BindException|valid" src/test/java/com/almang/inventory/product/controller/ProductControllerTest.java | head -30Repository: almang2/inventory-server Length of output: 4505 🏁 Script executed: #!/bin/bash
# Read the test file to check for update-related tests
echo "=== ProductControllerTest content (lines 350-400) ==="
sed -n '350,400p' src/test/java/com/almang/inventory/product/controller/ProductControllerTest.java
echo "=== ProductControllerTest content (lines 1-50) to find test class structure ==="
head -50 src/test/java/com/almang/inventory/product/controller/ProductControllerTest.javaRepository: almang2/inventory-server Length of output: 5370 UpdateProductRequest의 검증 어노테이션 누락 확인됨.
일관성 유지와 입력값 검증을 위해 🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,24 +9,25 @@ | |
|
|
||
| public interface ProductRepository extends JpaRepository<Product, Long> { | ||
|
|
||
| Page<Product> findAllByStoreId(Long storeId, Pageable pageable); | ||
| Page<Product> findAllByStoreId(Long storeId, Pageable pageable); | ||
|
|
||
| Page<Product> findAllByStoreIdAndActivatedTrue(Long storeId, Pageable pageable); | ||
| Page<Product> findAllByStoreIdAndActivatedTrue(Long storeId, Pageable pageable); | ||
|
|
||
| Page<Product> findAllByStoreIdAndActivatedFalse(Long storeId, Pageable pageable); | ||
| Page<Product> findAllByStoreIdAndActivatedFalse(Long storeId, Pageable pageable); | ||
|
|
||
| Page<Product> findAllByStoreIdAndNameContainingIgnoreCase(Long storeId, String name, Pageable pageable); | ||
| Page<Product> findAllByStoreIdAndNameContainingIgnoreCase(Long storeId, String name, Pageable pageable); | ||
|
|
||
| Page<Product> findAllByStoreIdAndActivatedTrueAndNameContainingIgnoreCase( | ||
| Long storeId, String name, Pageable pageable | ||
| ); | ||
| Page<Product> findAllByStoreIdAndActivatedTrueAndNameContainingIgnoreCase( | ||
| Long storeId, String name, Pageable pageable); | ||
|
|
||
| Page<Product> findAllByStoreIdAndActivatedFalseAndNameContainingIgnoreCase( | ||
| Long storeId, String name, Pageable pageable | ||
| ); | ||
| Page<Product> findAllByStoreIdAndActivatedFalseAndNameContainingIgnoreCase( | ||
| Long storeId, String name, Pageable pageable); | ||
|
|
||
| boolean existsByVendorId(Long vendorId); | ||
| boolean existsByVendorId(Long vendorId); | ||
|
|
||
| // 상품 코드로 상품 찾기 (카페24 주문 처리용) | ||
| Optional<Product> findByCode(String code); | ||
| // 상품 코드로 상품 찾기 (카페24 주문 처리용) | ||
| Optional<Product> findByCafe24Code(String cafe24Code); | ||
|
|
||
| // POS 코드로 상품 찾기 (소매 판매 엑셀 업로드용) | ||
| Optional<Product> findByPosCode(String posCode); | ||
|
Comment on lines
+28
to
+32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # Find and examine ProductRepository.java
find . -type f -name "ProductRepository.java" | head -5Repository: almang2/inventory-server Length of output: 146 🏁 Script executed: # Find and examine Product entity class
find . -type f -name "Product.java" | grep -E "entity|model" | head -5Repository: almang2/inventory-server Length of output: 50 🏁 Script executed: # Search for cafe24Code and posCode field definitions
rg -n "cafe24Code|posCode" --type java -B2 -A2Repository: almang2/inventory-server Length of output: 24586 🏁 Script executed: # Read the full Product entity class to check for unique constraints
cat -n src/main/java/com/almang/inventory/product/domain/Product.java | head -70Repository: almang2/inventory-server Length of output: 2557 Add unique constraints on The Add 🤖 Prompt for AI Agents |
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: almang2/inventory-server
Length of output: 72
🌐 Web query:
Apache POI poi-ooxml 5.2.3 security vulnerabilities CVE💡 Result:
Yes — poi-ooxml 5.2.3 is vulnerable to CVE-2025-31672 (Improper Input Validation: OOXML ZIP entries with duplicate names). The issue affects all poi-ooxml versions < 5.4.0; upgrade to >= 5.4.0 to fix it. [1][2][3]
Sources:
🌐 Web query:
Apache POI latest version 2024 2025💡 Result:
Latest Apache POI releases (relevant to 2024–2025):
Sources: Apache POI changelog and download page. [1] https://poi.apache.org/changes.html [2] https://poi.apache.org/download.cgi
Upgrade Apache POI to patch CVE-2025-31672.
poi-ooxml:5.2.3is vulnerable to CVE-2025-31672 (improper input validation in OOXML ZIP entries with duplicate names). This affects all versions below 5.4.0. Upgrade to at least5.4.0(or5.5.0, the current latest stable release).🤖 Prompt for AI Agents