add vendor address list

This commit is contained in:
gowthaman
2024-04-29 22:43:34 +05:30
parent 4d7f5ccdfb
commit ae11f05aba
4 changed files with 46 additions and 7 deletions

View File

@@ -251,8 +251,13 @@ class SafeStringDeserializer : JsonDeserializer<String>() {
}
}
enum class AddressType {
BILLING, SHIPPING
}
data class ContactPerson(val name: String = "", val email: String = "", val mobile: String = "")
data class Address(val type: AddressType = AddressType.BILLING,
val address: String = "",
val pincode: String = "")
@Entity
open class Vendor : BaseTenantModel() {
fun patchValues(updatedVendor: Vendor) {
@@ -264,6 +269,7 @@ open class Vendor : BaseTenantModel() {
this.contacts = updatedVendor.contacts
this.outstanding = updatedVendor.outstanding
this.asOnWhichDate = updatedVendor.asOnWhichDate
this.addressList = updatedVendor.addressList
}
var name: String = ""
@@ -274,6 +280,8 @@ open class Vendor : BaseTenantModel() {
var outstanding: Double? = 0.0
var asOnWhichDate: LocalDate? = null
@DbJsonB
var addressList: List<Address>? = mutableListOf()
@DbJsonB
var contacts: List<ContactPerson> = mutableListOf()