From 7b97d4d6ca4ca3dc3d6313f05ba4a77f4d5cedab Mon Sep 17 00:00:00 2001 From: "MSI\\derek" Date: Mon, 10 Mar 2025 19:05:50 +0800 Subject: [PATCH] drop isConsum in product --- .../java/com/ffii/fpsms/modules/master/entity/Product.kt | 4 ---- .../com/ffii/fpsms/modules/master/service/ProductService.kt | 5 +++-- .../changes/20250310_01_derek/03_drop_consum_product.sql | 6 ++++++ 3 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 src/main/resources/db/changelog/changes/20250310_01_derek/03_drop_consum_product.sql diff --git a/src/main/java/com/ffii/fpsms/modules/master/entity/Product.kt b/src/main/java/com/ffii/fpsms/modules/master/entity/Product.kt index 969df77..0ad4270 100644 --- a/src/main/java/com/ffii/fpsms/modules/master/entity/Product.kt +++ b/src/main/java/com/ffii/fpsms/modules/master/entity/Product.kt @@ -23,10 +23,6 @@ open class Product : BaseEntity() { @Column(name = "remarks") open var remarks: String? = null - @NotNull - @Column(name = "isConsumables") - open var isConsumables: Boolean? = null - @OneToMany(mappedBy = "product", cascade = [CascadeType.ALL], orphanRemoval = true) @JsonManagedReference("product-weight-unit") @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/src/main/java/com/ffii/fpsms/modules/master/service/ProductService.kt b/src/main/java/com/ffii/fpsms/modules/master/service/ProductService.kt index d481544..68f807f 100644 --- a/src/main/java/com/ffii/fpsms/modules/master/service/ProductService.kt +++ b/src/main/java/com/ffii/fpsms/modules/master/service/ProductService.kt @@ -7,10 +7,12 @@ import com.ffii.fpsms.modules.master.entity.Product import com.ffii.fpsms.modules.master.entity.ProductRepository import com.ffii.fpsms.modules.master.web.models.NewProductRequest import com.ffii.fpsms.modules.master.web.models.NewProductResponse +import org.springframework.stereotype.Service import org.springframework.transaction.annotation.Transactional import kotlin.jvm.optionals.getOrNull -class ProductService( +@Service +open class ProductService( private val jdbcDao: JdbcDao, private val productRepository: ProductRepository, private val uomService: ProductMaterialUomService, @@ -44,7 +46,6 @@ class ProductService( product.apply { code = request.code name = request.name - isConsumables = request.isConsumables description = request.description remarks = request.remarks shelfLife = request.shelfLife diff --git a/src/main/resources/db/changelog/changes/20250310_01_derek/03_drop_consum_product.sql b/src/main/resources/db/changelog/changes/20250310_01_derek/03_drop_consum_product.sql new file mode 100644 index 0000000..15fbd1c --- /dev/null +++ b/src/main/resources/db/changelog/changes/20250310_01_derek/03_drop_consum_product.sql @@ -0,0 +1,6 @@ +-- liquibase formatted sql + +-- changeset derek:drop isConsumables product + +ALTER TABLE `product` +DROP COLUMN `isConsumables`; \ No newline at end of file