feat: Anschrift unter „Alle Kontaktinfos" anzeigen

Jede Kontaktquelle zeigt ihre Anschrift (inkl. Zusatz, Land nur im
Ausland), sofern das ERP eine pflegt. Die Anschrift zählt beim
Zusammenführen gleicher Quellen mit — gleicher Name an anderer Adresse
bleibt eine eigene Karte. API-Client neu generiert.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Dennis Nemec
2026-09-25 16:26:01 +02:00
parent 335cf02a9f
commit 5a9e16dc10
12 changed files with 205 additions and 17 deletions

View File

@ -9,6 +9,7 @@ import 'package:holzleitner_api/api.dart';
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**abteilung** | **String** | | [optional]
**address** | [**Address**](Address.md) | Anschrift dieses Adress-Datensatzes; `None`, wenn im ERP weder Straße noch Ort gepflegt sind (z. B. reiner Ansprechpartner). | [optional]
**anrede** | **String** | | [optional]
**deliveryId** | **String** | |
**funktion** | **String** | | [optional]

View File

@ -9,6 +9,7 @@ import 'package:holzleitner_api/api.dart';
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**abteilung** | **String** | | [optional]
**address** | [**Address**](Address.md) | Anschrift dieses Adress-Datensatzes, falls gepflegt. | [optional]
**anrede** | **String** | | [optional]
**channels** | [**BuiltList&lt;SyncContactChannel&gt;**](SyncContactChannel.md) | | [optional]
**funktion** | **String** | | [optional]

View File

@ -3,16 +3,18 @@
//
// ignore_for_file: unused_element
import 'package:holzleitner_api/src/model/address.dart';
import 'package:holzleitner_api/src/model/contact_role.dart';
import 'package:built_value/built_value.dart';
import 'package:built_value/serializer.dart';
part 'contact_source.g.dart';
/// Snapshot eines ERP-Adress-Datensatzes, der zum Zeitpunkt des Tour-Syncs an einer Lieferung hing — Namensblock ohne Anschrift, weil die Adresse ihrerseits schon im Lieferungs-Snapshot steckt (`snap_*`-Spalten). Die eigentlichen Telefonnummern, E-Mails etc. liegen in den zugehörigen [`ContactChannel`]s.
/// Snapshot eines ERP-Adress-Datensatzes, der zum Zeitpunkt des Tour-Syncs an einer Lieferung hing — Namensblock plus (falls im ERP gepflegt) die Anschrift dieses Datensatzes. Die eigentlichen Telefonnummern, E-Mails etc. liegen in den zugehörigen [`ContactChannel`]s.
///
/// Properties:
/// * [abteilung]
/// * [address] - Anschrift dieses Adress-Datensatzes; `None`, wenn im ERP weder Straße noch Ort gepflegt sind (z. B. reiner Ansprechpartner).
/// * [anrede]
/// * [deliveryId]
/// * [funktion]
@ -27,6 +29,10 @@ abstract class ContactSource implements Built<ContactSource, ContactSourceBuilde
@BuiltValueField(wireName: r'abteilung')
String? get abteilung;
/// Anschrift dieses Adress-Datensatzes; `None`, wenn im ERP weder Straße noch Ort gepflegt sind (z. B. reiner Ansprechpartner).
@BuiltValueField(wireName: r'address')
Address? get address;
@BuiltValueField(wireName: r'anrede')
String? get anrede;
@ -85,6 +91,13 @@ class _$ContactSourceSerializer implements PrimitiveSerializer<ContactSource> {
specifiedType: const FullType.nullable(String),
);
}
if (object.address != null) {
yield r'address';
yield serializers.serialize(
object.address,
specifiedType: const FullType.nullable(Address),
);
}
if (object.anrede != null) {
yield r'anrede';
yield serializers.serialize(
@ -173,6 +186,14 @@ class _$ContactSourceSerializer implements PrimitiveSerializer<ContactSource> {
if (valueDes == null) continue;
result.abteilung = valueDes;
break;
case r'address':
final valueDes = serializers.deserialize(
value,
specifiedType: const FullType.nullable(Address),
) as Address?;
if (valueDes == null) continue;
result.address.replace(valueDes);
break;
case r'anrede':
final valueDes = serializers.deserialize(
value,

View File

@ -10,6 +10,8 @@ class _$ContactSource extends ContactSource {
@override
final String? abteilung;
@override
final Address? address;
@override
final String? anrede;
@override
final String deliveryId;
@ -33,6 +35,7 @@ class _$ContactSource extends ContactSource {
_$ContactSource._(
{this.abteilung,
this.address,
this.anrede,
required this.deliveryId,
this.funktion,
@ -55,6 +58,7 @@ class _$ContactSource extends ContactSource {
if (identical(other, this)) return true;
return other is ContactSource &&
abteilung == other.abteilung &&
address == other.address &&
anrede == other.anrede &&
deliveryId == other.deliveryId &&
funktion == other.funktion &&
@ -70,6 +74,7 @@ class _$ContactSource extends ContactSource {
int get hashCode {
var _$hash = 0;
_$hash = $jc(_$hash, abteilung.hashCode);
_$hash = $jc(_$hash, address.hashCode);
_$hash = $jc(_$hash, anrede.hashCode);
_$hash = $jc(_$hash, deliveryId.hashCode);
_$hash = $jc(_$hash, funktion.hashCode);
@ -87,6 +92,7 @@ class _$ContactSource extends ContactSource {
String toString() {
return (newBuiltValueToStringHelper(r'ContactSource')
..add('abteilung', abteilung)
..add('address', address)
..add('anrede', anrede)
..add('deliveryId', deliveryId)
..add('funktion', funktion)
@ -108,6 +114,10 @@ class ContactSourceBuilder
String? get abteilung => _$this._abteilung;
set abteilung(String? abteilung) => _$this._abteilung = abteilung;
AddressBuilder? _address;
AddressBuilder get address => _$this._address ??= AddressBuilder();
set address(AddressBuilder? address) => _$this._address = address;
String? _anrede;
String? get anrede => _$this._anrede;
set anrede(String? anrede) => _$this._anrede = anrede;
@ -152,6 +162,7 @@ class ContactSourceBuilder
final $v = _$v;
if ($v != null) {
_abteilung = $v.abteilung;
_address = $v.address?.toBuilder();
_anrede = $v.anrede;
_deliveryId = $v.deliveryId;
_funktion = $v.funktion;
@ -180,21 +191,36 @@ class ContactSourceBuilder
ContactSource build() => _build();
_$ContactSource _build() {
final _$result = _$v ??
_$ContactSource._(
abteilung: abteilung,
anrede: anrede,
deliveryId: BuiltValueNullFieldError.checkNotNull(
deliveryId, r'ContactSource', 'deliveryId'),
funktion: funktion,
id: BuiltValueNullFieldError.checkNotNull(id, r'ContactSource', 'id'),
name1: name1,
name2: name2,
name3: name3,
role: BuiltValueNullFieldError.checkNotNull(
role, r'ContactSource', 'role'),
titel: titel,
);
_$ContactSource _$result;
try {
_$result = _$v ??
_$ContactSource._(
abteilung: abteilung,
address: _address?.build(),
anrede: anrede,
deliveryId: BuiltValueNullFieldError.checkNotNull(
deliveryId, r'ContactSource', 'deliveryId'),
funktion: funktion,
id: BuiltValueNullFieldError.checkNotNull(
id, r'ContactSource', 'id'),
name1: name1,
name2: name2,
name3: name3,
role: BuiltValueNullFieldError.checkNotNull(
role, r'ContactSource', 'role'),
titel: titel,
);
} catch (_) {
late String _$failedField;
try {
_$failedField = 'address';
_address?.build();
} catch (e) {
throw BuiltValueNestedFieldError(
r'ContactSource', _$failedField, e.toString());
}
rethrow;
}
replace(_$result);
return _$result;
}

View File

@ -3,6 +3,7 @@
//
// ignore_for_file: unused_element
import 'package:holzleitner_api/src/model/address.dart';
import 'package:holzleitner_api/src/model/contact_role.dart';
import 'package:built_collection/built_collection.dart';
import 'package:holzleitner_api/src/model/sync_contact_channel.dart';
@ -15,6 +16,7 @@ part 'sync_contact_source.g.dart';
///
/// Properties:
/// * [abteilung]
/// * [address] - Anschrift dieses Adress-Datensatzes, falls gepflegt.
/// * [anrede]
/// * [channels]
/// * [funktion]
@ -28,6 +30,10 @@ abstract class SyncContactSource implements Built<SyncContactSource, SyncContact
@BuiltValueField(wireName: r'abteilung')
String? get abteilung;
/// Anschrift dieses Adress-Datensatzes, falls gepflegt.
@BuiltValueField(wireName: r'address')
Address? get address;
@BuiltValueField(wireName: r'anrede')
String? get anrede;
@ -83,6 +89,13 @@ class _$SyncContactSourceSerializer implements PrimitiveSerializer<SyncContactSo
specifiedType: const FullType.nullable(String),
);
}
if (object.address != null) {
yield r'address';
yield serializers.serialize(
object.address,
specifiedType: const FullType.nullable(Address),
);
}
if (object.anrede != null) {
yield r'anrede';
yield serializers.serialize(
@ -168,6 +181,14 @@ class _$SyncContactSourceSerializer implements PrimitiveSerializer<SyncContactSo
if (valueDes == null) continue;
result.abteilung = valueDes;
break;
case r'address':
final valueDes = serializers.deserialize(
value,
specifiedType: const FullType.nullable(Address),
) as Address?;
if (valueDes == null) continue;
result.address.replace(valueDes);
break;
case r'anrede':
final valueDes = serializers.deserialize(
value,

View File

@ -10,6 +10,8 @@ class _$SyncContactSource extends SyncContactSource {
@override
final String? abteilung;
@override
final Address? address;
@override
final String? anrede;
@override
final BuiltList<SyncContactChannel>? channels;
@ -32,6 +34,7 @@ class _$SyncContactSource extends SyncContactSource {
_$SyncContactSource._(
{this.abteilung,
this.address,
this.anrede,
this.channels,
this.funktion,
@ -54,6 +57,7 @@ class _$SyncContactSource extends SyncContactSource {
if (identical(other, this)) return true;
return other is SyncContactSource &&
abteilung == other.abteilung &&
address == other.address &&
anrede == other.anrede &&
channels == other.channels &&
funktion == other.funktion &&
@ -68,6 +72,7 @@ class _$SyncContactSource extends SyncContactSource {
int get hashCode {
var _$hash = 0;
_$hash = $jc(_$hash, abteilung.hashCode);
_$hash = $jc(_$hash, address.hashCode);
_$hash = $jc(_$hash, anrede.hashCode);
_$hash = $jc(_$hash, channels.hashCode);
_$hash = $jc(_$hash, funktion.hashCode);
@ -84,6 +89,7 @@ class _$SyncContactSource extends SyncContactSource {
String toString() {
return (newBuiltValueToStringHelper(r'SyncContactSource')
..add('abteilung', abteilung)
..add('address', address)
..add('anrede', anrede)
..add('channels', channels)
..add('funktion', funktion)
@ -104,6 +110,10 @@ class SyncContactSourceBuilder
String? get abteilung => _$this._abteilung;
set abteilung(String? abteilung) => _$this._abteilung = abteilung;
AddressBuilder? _address;
AddressBuilder get address => _$this._address ??= AddressBuilder();
set address(AddressBuilder? address) => _$this._address = address;
String? _anrede;
String? get anrede => _$this._anrede;
set anrede(String? anrede) => _$this._anrede = anrede;
@ -146,6 +156,7 @@ class SyncContactSourceBuilder
final $v = _$v;
if ($v != null) {
_abteilung = $v.abteilung;
_address = $v.address?.toBuilder();
_anrede = $v.anrede;
_channels = $v.channels?.toBuilder();
_funktion = $v.funktion;
@ -178,6 +189,7 @@ class SyncContactSourceBuilder
_$result = _$v ??
_$SyncContactSource._(
abteilung: abteilung,
address: _address?.build(),
anrede: anrede,
channels: _channels?.build(),
funktion: funktion,
@ -191,6 +203,9 @@ class SyncContactSourceBuilder
} catch (_) {
late String _$failedField;
try {
_$failedField = 'address';
_address?.build();
_$failedField = 'channels';
_channels?.build();
} catch (e) {