/// Zeitfenster mit Postleitzahl für das Setzen der BWV-Location. class BwvTimeWindow { final int fromUtc; final int toUtc; final String postalCode; BwvTimeWindow({ required this.fromUtc, required this.toUtc, required this.postalCode, }); Map toJson() => { 'fromUtc': fromUtc, 'toUtc': toUtc, 'postalCode': postalCode, }; } /// Payload für das Topic `set_bwv_location`. class SetBwvLocationMessage { final int timestamp; final BwvTimeWindow? availabilityStart; final BwvTimeWindow? bwvLocationPreference; SetBwvLocationMessage({ required this.timestamp, this.availabilityStart, this.bwvLocationPreference, }); Map toJson() { final map = {'timestamp': timestamp}; if (availabilityStart != null) { map['availabilityStart'] = availabilityStart!.toJson(); } if (bwvLocationPreference != null) { map['bwvLocationPreference'] = bwvLocationPreference!.toJson(); } return map; } }