From aa97275b9cc1cc7f1984f06592a31fdeb0987d0e Mon Sep 17 00:00:00 2001 From: arsalan Date: Fri, 19 Jan 2024 15:03:45 +0530 Subject: [PATCH] add filters --- build.gradle.kts | 2 ++ src/main/kotlin/com/restapi/controllers/Entities.kt | 1 - src/main/kotlin/com/restapi/controllers/Excel.kt | 9 +++++++++ src/main/kotlin/com/restapi/domain/models.kt | 11 +++++------ 4 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 src/main/kotlin/com/restapi/controllers/Excel.kt diff --git a/build.gradle.kts b/build.gradle.kts index 5d620f1..2894a75 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -36,6 +36,8 @@ dependencies { implementation("org.yaml:snakeyaml:2.2") implementation("io.minio:minio:8.5.7") implementation("org.apache.httpcomponents:httpclient:4.5.14") + implementation("org.apache.poi:poi:5.0.0") + implementation("org.apache.poi:poi-ooxml:5.0.0") api ("net.cactusthorn.config:config-core:0.81") api ("net.cactusthorn.config:config-yaml:0.81") kapt("net.cactusthorn.config:config-compiler:0.81") diff --git a/src/main/kotlin/com/restapi/controllers/Entities.kt b/src/main/kotlin/com/restapi/controllers/Entities.kt index 1aff54e..96b088c 100644 --- a/src/main/kotlin/com/restapi/controllers/Entities.kt +++ b/src/main/kotlin/com/restapi/controllers/Entities.kt @@ -574,5 +574,4 @@ object ReqForQuote { //shuld we compare the new body fields with preexisting ones and prepare a sql query to update those fields?? } - } \ No newline at end of file diff --git a/src/main/kotlin/com/restapi/controllers/Excel.kt b/src/main/kotlin/com/restapi/controllers/Excel.kt new file mode 100644 index 0000000..84e8f45 --- /dev/null +++ b/src/main/kotlin/com/restapi/controllers/Excel.kt @@ -0,0 +1,9 @@ +package com.restapi.controllers +import org.apache.poi +import java.io.FileOutputStream +enum class DataType { + QUOTE, PO, VENDOR +} +fun CreateExcel(cols :List, excelFor :DataType) { + val wb = HSSFWorkbook() +} \ No newline at end of file diff --git a/src/main/kotlin/com/restapi/domain/models.kt b/src/main/kotlin/com/restapi/domain/models.kt index dab5b6b..2c444cd 100644 --- a/src/main/kotlin/com/restapi/domain/models.kt +++ b/src/main/kotlin/com/restapi/domain/models.kt @@ -239,7 +239,6 @@ class SafeStringDeserializer : JsonDeserializer() { if (!regex.matches(text)) throw IllegalArgumentException() return text } - } data class ContactPerson(val name: String, val email: String, val mobile: String) @@ -271,7 +270,7 @@ open class PurchaseOrder :BaseTenantModel() { } enum class UOM { - NOS, LTR, MTR + NOS, LTR, MTR, ALL } @Entity open class Product :BaseTenantModel() { @@ -288,7 +287,7 @@ open class Quotation :BaseTenantModel() { var products :MutableList = mutableListOf() @ManyToOne var vendor :Vendor? = null - var totalAmount :Int = 0 + var totalAmount :Long = 0 var reqForQuoteNum: String = "" var quoteNum: String = "" @@ -301,14 +300,14 @@ open class Quotation :BaseTenantModel() { var documents: MutableList = arrayListOf() } -enum class DOCTYPE{ - PO, QUOTE, INVOICE +enum class DocType{ + PO, QUOTE, INVOICE, ALL } @Entity open class Document :BaseTenantModel() { var name :String = "" @Enumerated(EnumType.STRING) - var typeOfDoc :DOCTYPE? = null + var typeOfDoc :DocType? = null var refId: Long? = null var description :String = "" var url :String = ""