chore: automated housekeeping...

This commit is contained in:
Pieter Vander Vennet 2024-11-14 02:21:10 +01:00
parent 47281a8d6c
commit 3fd14e82a0
84 changed files with 2093 additions and 1450 deletions

View file

@ -371,7 +371,7 @@ export default class LinkedDataLoader {
const match = maxstay.match(/P([0-9]+)D/)
if (match) {
const days = Number(match[1])
if(days === 30){
if (days === 30) {
// 30 is the default which is set if velopark didn't know the actual value
return undefined
}

View file

@ -17,7 +17,7 @@ export default class VeloparkLoader {
private static readonly coder = new CountryCoder(
Constants.countryCoderEndpoint,
Utils.downloadJson,
Utils.downloadJson
)
public static convert(veloparkData: VeloparkData): Feature {
@ -46,14 +46,14 @@ export default class VeloparkLoader {
if (veloparkData.contactPoint?.email) {
properties["operator:email"] = VeloparkLoader.emailReformatting.reformat(
veloparkData.contactPoint?.email,
veloparkData.contactPoint?.email
)
}
if (veloparkData.contactPoint?.telephone) {
properties["operator:phone"] = VeloparkLoader.phoneValidator.reformat(
veloparkData.contactPoint?.telephone,
() => "be",
() => "be"
)
}
@ -78,7 +78,7 @@ export default class VeloparkLoader {
) {
const duration = g.maximumParkingDuration.substring(
1,
g.maximumParkingDuration.length - 1,
g.maximumParkingDuration.length - 1
)
if (duration !== "30") {
// We don't set maxstay if it is 30, they are the default value that velopark chose for "unknown"
@ -97,11 +97,11 @@ export default class VeloparkLoader {
const startHour = spec.opens
const endHour = spec.closes === "23:59" ? "24:00" : spec.closes
const merged = OH.MergeTimes(
OH.ParseRule(dayOfWeek + " " + startHour + "-" + endHour),
OH.ParseRule(dayOfWeek + " " + startHour + "-" + endHour)
)
return OH.ToString(merged)
})
.join("; "),
.join("; ")
)
properties.opening_hours = oh
}