Skip to content

Commit

Permalink
draft list of leis and changes to getCompanies function
Browse files Browse the repository at this point in the history
  • Loading branch information
juliacialkowski committed Feb 11, 2025
1 parent a1729bd commit 6da309d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package org.dataland.datalandbackend

object LEIList {
val leis =
mapOf(
"Adidas AG" to "549300JSX0Z4CW0V5023",
"Airbus SE" to "MINO79WLOO247M1IL051",
"Allianz SE" to "529900K9B0N5BT694847",
"BASF SE" to "529900PM64WH8AF1E917",
"Bayer AG" to "549300J4U55H3WP1XT59",
"Bayerische Motoren Werke AG" to "YEH5ZCD6E441RHVHD759",
"Beiersdorf AG" to "529900CL12XL7MJQHS82",
"Brenntag SE" to "NNROIXVWJ7CPSR27SV97",
"Commerzbank AG" to "851WYGNLUQLFZBSYGB56",
"Continental Aktiengesellschaft" to "529900A7YD9C0LLXM621",
"Covestro AG" to "3912005AWHKLQ1CPLV11",
"Daimler Truck Holding AG" to "529900PW78JIYOUBSR24",
"Delivery Hero SE" to "529900C3EX1FZGE48X78",
"Deutsche Bank Aktiengesellschaft" to "529900IH9V4I3VHQVO92",
"Deutsche Börse Aktiengesellschaft" to "529900G3SW56SHYNPR95",
)
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.dataland.datalandbackend.services

import org.dataland.datalandbackend.LEIList
import org.dataland.datalandbackend.entities.BasicCompanyInformation
import org.dataland.datalandbackend.entities.StoredCompanyEntity
import org.dataland.datalandbackend.interfaces.CompanyIdAndName
Expand Down Expand Up @@ -49,10 +50,14 @@ class CompanyQueryManager(
val offset = chunkIndex * (chunkSize ?: 0)
return if (filter.searchStringLength == 0) {
if (areAllDropdownFiltersDeactivated(filter)) {
companyRepository
.getAllCompaniesWithDataset(
chunkSize, offset,
)
val listOfAllCompanies =
companyRepository
.getAllCompaniesWithDataset(
chunkSize, offset,
)
val listOfLeis = LEIList.leis.values
val (filteredCompanies, remainingCompanies) = listOfAllCompanies.partition { it.lei in listOfLeis }
filteredCompanies + remainingCompanies
} else {
companyRepository.searchCompaniesWithoutSearchString(filter, chunkSize, offset)
}
Expand Down

0 comments on commit 6da309d

Please sign in to comment.