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