|
|
@@ -495,7 +495,14 @@ open class ProjectsService( |
|
|
|
} |
|
|
|
|
|
|
|
open fun allBuildingTypes(): List<BuildingType> { |
|
|
|
return buildingTypeRepository.findAll() |
|
|
|
val sortedBuildingType = buildingTypeRepository.findAll().sortedBy { it.name }.sortedWith { a, b -> |
|
|
|
when { |
|
|
|
a.startsWith("Others") && !b.startsWith("Others") -> 1 // Move "Others" to the end |
|
|
|
!a.startsWith("Others") && b.startsWith("Others") -> -1 // Keep non-"Others" items above |
|
|
|
else -> 0 // Maintain relative order for other items |
|
|
|
} |
|
|
|
} |
|
|
|
return sortedBuildingType; |
|
|
|
} |
|
|
|
|
|
|
|
open fun allWorkNatures(): List<WorkNature> { |
|
|
|