add entities and db migrations
This commit is contained in:
@@ -7,11 +7,12 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize
|
||||
import io.ebean.Model
|
||||
import io.ebean.annotation.*
|
||||
import io.ebean.annotation.Index
|
||||
import java.time.LocalDate
|
||||
import java.time.LocalDateTime
|
||||
import javax.persistence.*
|
||||
|
||||
data class Comments(val text: String = "", val by: String = "", val at: LocalDateTime = LocalDateTime.now())
|
||||
|
||||
data class POProducts(val productId: String = "", val unitPrice :Double = 0.0, val quantity: Double = 0.0, val description :String = "")
|
||||
enum class ApprovalStatus {
|
||||
PENDING, APPROVED, REJECTED
|
||||
}
|
||||
@@ -214,6 +215,8 @@ open class DataModel : BaseTenantModel() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Entity
|
||||
@Index(unique = true, name = "unique_session_id", columnNames = ["session_id"])
|
||||
open class AnonSession : BaseTenantModel() {
|
||||
@@ -238,3 +241,69 @@ class SafeStringDeserializer : JsonDeserializer<String>() {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
data class ContactPerson(val name: String, val email: String, val mobile: String)
|
||||
@Entity
|
||||
open class Vendor :BaseTenantModel() {
|
||||
var name :String = ""
|
||||
var msme :String = ""
|
||||
var gstNumber :String = ""
|
||||
var address :String = ""
|
||||
var rating :Double = 0.0
|
||||
@DbJsonB
|
||||
var contacts :List<ContactPerson> = mutableListOf()
|
||||
}
|
||||
@Entity
|
||||
open class PurchaseOrder :BaseTenantModel() {
|
||||
@DbJsonB
|
||||
var products :MutableList<POProducts> = mutableListOf()
|
||||
@ManyToOne
|
||||
var vendor :Vendor? = null
|
||||
var referenceQuotation :String = ""
|
||||
var totalAmount :Int = 0
|
||||
var poNum: String = ""
|
||||
var poDate: LocalDate? = null
|
||||
var validTill: LocalDate? = null
|
||||
@DbArray
|
||||
var tnc: List<String> = arrayListOf()
|
||||
@DbArray
|
||||
var documents: MutableList<Long> = arrayListOf()
|
||||
}
|
||||
|
||||
enum class UOM {
|
||||
NOS, LTR, MTR
|
||||
}
|
||||
@Entity
|
||||
open class Product :BaseTenantModel() {
|
||||
var name :String = ""
|
||||
var description :String = ""
|
||||
var hsnCode :String = ""
|
||||
@Enumerated(EnumType.STRING)
|
||||
var uom: UOM? = null
|
||||
}
|
||||
|
||||
@Entity
|
||||
open class Quotation :BaseTenantModel() {
|
||||
@DbJsonB
|
||||
var products :MutableList<POProducts> = mutableListOf()
|
||||
@ManyToOne
|
||||
var vendor :Vendor? = null
|
||||
var totalAmount :Int = 0
|
||||
|
||||
var quoteNum: String = ""
|
||||
var quoteDate: LocalDate? = null
|
||||
var validTill: LocalDate? = null
|
||||
@DbArray
|
||||
var tnc: List<String> = arrayListOf()
|
||||
|
||||
@DbArray
|
||||
var documents: MutableList<Long> = arrayListOf()
|
||||
}
|
||||
|
||||
@Entity
|
||||
open class Document :BaseTenantModel() {
|
||||
var name :String = ""
|
||||
var typeOfDoc :String = ""
|
||||
var description :String = ""
|
||||
var url :String = ""
|
||||
}
|
||||
Reference in New Issue
Block a user