From d28a3215d19dd95de14904f4a5358bc8a1b2580e Mon Sep 17 00:00:00 2001 From: gowthaman Date: Mon, 29 Apr 2024 19:49:53 +0530 Subject: [PATCH] add gst% --- src/main/kotlin/com/restapi/domain/models.kt | 4 +++- src/main/resources/dbmigration/1.26.sql | 7 +++++++ src/main/resources/dbmigration/model/1.26.model.xml | 9 +++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/dbmigration/1.26.sql create mode 100644 src/main/resources/dbmigration/model/1.26.model.xml diff --git a/src/main/kotlin/com/restapi/domain/models.kt b/src/main/kotlin/com/restapi/domain/models.kt index ae44333..b9338a5 100644 --- a/src/main/kotlin/com/restapi/domain/models.kt +++ b/src/main/kotlin/com/restapi/domain/models.kt @@ -306,7 +306,7 @@ open class PurchaseOrder : BaseTenantModel() { } enum class UOM { - NOS, LTR, MTR, ALL + KG, CFT, TON, LTR, NUMBER, MTR, BOX, CUM, PACKET, ALL, NOS; } enum class TypeOfProduct { @@ -330,6 +330,8 @@ open class Product : BaseTenantModel() { @Enumerated(EnumType.STRING) var uom: UOM? = null + var gstPct: Double? = 0.0 + @Enumerated(EnumType.STRING) var type: TypeOfProduct? = null diff --git a/src/main/resources/dbmigration/1.26.sql b/src/main/resources/dbmigration/1.26.sql new file mode 100644 index 0000000..7f0734c --- /dev/null +++ b/src/main/resources/dbmigration/1.26.sql @@ -0,0 +1,7 @@ +-- drop dependencies +alter table product drop constraint if exists ck_product_uom; +-- apply alter tables +alter table product alter column uom type varchar(6); +alter table product add column if not exists gst_pct float; +-- apply post alter +alter table product add constraint ck_product_uom check ( uom in ('KG','CFT','TON','LTR','NUMBER','MTR','BOX','CUM','PACKET','ALL','NOS')); diff --git a/src/main/resources/dbmigration/model/1.26.model.xml b/src/main/resources/dbmigration/model/1.26.model.xml new file mode 100644 index 0000000..cbd3e70 --- /dev/null +++ b/src/main/resources/dbmigration/model/1.26.model.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file