This commit is contained in:
KoenDR06 2025-06-04 13:42:18 +02:00
parent 335464f7d1
commit f8ab085875
2 changed files with 7 additions and 9 deletions

View file

@ -21,11 +21,9 @@ fun main() {
return return
} }
val offers = getOffers(rooms.map { it.wocasId }).offers.filter { offer -> val offers = getOffers(rooms.map { it.wocasId }).offers.filter { offer ->
offer.adres[0].plaats !in listOf( offer.adres[0].plaats in listOf(
"ZWOLLE", "UTRECHT",
"GRONINGEN", ) + if (config.general.allowZeist) "ZEIST" else ""
"TILBURG"
) + if (!config.general.allowZeist) "ZEIST" else ""
} }
val coupled = rooms.mapNotNull { room -> val coupled = rooms.mapNotNull { room ->
@ -77,7 +75,7 @@ fun main() {
str.append("\n\n") str.append("\n\n")
} }
out.writeText(str.toString()) out.writeText(out.readText() + "\n\n" + str.toString())
inputFile.writeText(roomsFound.joinToString("\n") + rooms.joinToString("\n") { it.wocasId }) inputFile.writeText(roomsFound.joinToString("\n") + "\n" + rooms.joinToString("\n") { it.wocasId })
println("${coupled.size} offers found, wrote to $fileName") println("${coupled.size} offers found, wrote to $fileName")
} }

View file

@ -27,7 +27,7 @@ data class Room(
@SerialName("ContractStartDate") val contractStartDate: String, @SerialName("ContractStartDate") val contractStartDate: String,
@SerialName("UnitType") val unitType: String, @SerialName("UnitType") val unitType: String,
@SerialName("NumberOfRooms") val numberOfRooms: Int, @SerialName("NumberOfRooms") val numberOfRooms: Int,
@SerialName("Image") val image: Image, @SerialName("Image") val image: Image?,
@SerialName("ContractType") val contractType: String, @SerialName("ContractType") val contractType: String,
@SerialName("FlowId") val flowId: Int, @SerialName("FlowId") val flowId: Int,
@SerialName("WocasId") val wocasId: String, @SerialName("WocasId") val wocasId: String,
@ -38,4 +38,4 @@ fun getRooms(): List<Room> {
val response = getEndpoint("offer") val response = getEndpoint("offer")
return Json.decodeFromString<List<Room>>(response) return Json.decodeFromString<List<Room>>(response)
} }