handle job
This commit is contained in:
parent
fc43e84302
commit
9aafe5a95c
@ -33,6 +33,7 @@ enum class QueryParamType {
|
||||
sealed class QueryParam {
|
||||
data class StrParam(val str: String) : QueryParam()
|
||||
data class NumberParam(val nbr: Number) : QueryParam()
|
||||
data class BooleanParam(val bool: Boolean) : QueryParam()
|
||||
data class ComplexParam(val type: QueryParamType, val value: String) : QueryParam() {
|
||||
fun getValueComplex(): Any {
|
||||
return when (type) {
|
||||
@ -63,6 +64,7 @@ sealed class QueryParam {
|
||||
is ComplexParam -> getValueComplex()
|
||||
is StrParam -> str
|
||||
is NumberParam -> nbr
|
||||
is BooleanParam -> bool
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -74,6 +76,8 @@ class QueryParamDeSerializer : JsonDeserializer<QueryParam>() {
|
||||
QueryParam.StrParam(node.asText())
|
||||
} else if (node.isNumber) {
|
||||
QueryParam.NumberParam(node.numberValue())
|
||||
} else if (node.isBoolean) {
|
||||
QueryParam.BooleanParam(node.booleanValue())
|
||||
} else if (node.isObject) {
|
||||
QueryParam.ComplexParam(
|
||||
QueryParamType.valueOf(node.get("type").textValue()),
|
||||
@ -109,6 +113,7 @@ object Entities {
|
||||
}
|
||||
|
||||
e.update()
|
||||
ctx.json(OK)
|
||||
}
|
||||
|
||||
fun update(ctx: Context) {
|
||||
|
||||
@ -38,7 +38,7 @@ open class IncomingInventory : BaseTenantModel() {
|
||||
}
|
||||
|
||||
enum class OutMode {
|
||||
PERSON, VEHICLE, ALL
|
||||
PERSON, VEHICLE, ALL, JOB, OFFICE
|
||||
}
|
||||
|
||||
@Entity
|
||||
|
||||
4
src/main/resources/dbmigration/1.35.sql
Normal file
4
src/main/resources/dbmigration/1.35.sql
Normal file
@ -0,0 +1,4 @@
|
||||
-- drop dependencies
|
||||
alter table outgoing_inventory drop constraint if exists ck_outgoing_inventory_out_mode;
|
||||
-- apply post alter
|
||||
alter table outgoing_inventory add constraint ck_outgoing_inventory_out_mode check ( out_mode in ('PERSON','VEHICLE','ALL','JOB','OFFICE'));
|
||||
6
src/main/resources/dbmigration/model/1.35.model.xml
Normal file
6
src/main/resources/dbmigration/model/1.35.model.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<migration xmlns="http://ebean-orm.github.io/xml/ns/dbmigration">
|
||||
<changeSet type="apply">
|
||||
<alterColumn columnName="out_mode" tableName="outgoing_inventory" checkConstraint="check ( out_mode in ('PERSON','VEHICLE','ALL','JOB','OFFICE'))" checkConstraintName="ck_outgoing_inventory_out_mode"/>
|
||||
</changeSet>
|
||||
</migration>
|
||||
Loading…
x
Reference in New Issue
Block a user