feat: Adresszusatz (Ortsteil/Etage/Hinweis) anzeigen, Land nur im Ausland

- Address.addition aus dem Backend (ERP-Freitext, praktisch Ortsteil,
  Etage oder Hinweis); API-Client neu generiert.
- Listen (Sortieren, Beladen, Liefer-Übersicht): Adresse mit Zusatz in
  Klammern, z. B. „… 41472 Neuss (Holzheim)".
- Lieferdetails: „Zusatz: …" unter der Anschrift von Empfänger und
  Besteller; Land nur außerhalb Deutschlands.
- Maps-Suche weiter ohne Zusatz (sonst stört „3 Etage" die Suche).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Dennis Nemec
2026-09-25 16:13:28 +02:00
parent d650c735f8
commit 335cf02a9f
13 changed files with 142 additions and 14 deletions

View File

@ -11,16 +11,22 @@ part 'address.g.dart';
/// Postanschrift — wird sowohl als aktuelle Kundenanschrift in [`Customer`] als auch als unveränderlicher Snapshot in [`crate::domain::Delivery`] verwendet (`delivery_address_snapshot`). Bewusst als Value Object modelliert: gleiche Adresse = gleicher Wert. Strikte Equality erleichtert Sync-Diffs zwischen ERP und Backend. [`Customer`]: crate::domain::Customer
///
/// Properties:
/// * [addition] - Freier Adresszusatz. Kommt aus dem ERP-Textfeld `Adressen.Land`, das die Sachbearbeitung praktisch für Ortsteil, Etage oder Hinweise nutzt (z. B. „Holzheim\", „3. Etage\", „Parterre\"). `None`, wenn leer.
/// * [city]
/// * [country]
/// * [country] - Land laut ERP-Länderstamm (`Adressen.LandID` → `Laender.Land`), z. B. „Deutschland\" oder „Belgien\". Leer, wenn im ERP kein Land verknüpft ist.
/// * [houseNumber]
/// * [postalCode]
/// * [street]
@BuiltValue()
abstract class Address implements Built<Address, AddressBuilder> {
/// Freier Adresszusatz. Kommt aus dem ERP-Textfeld `Adressen.Land`, das die Sachbearbeitung praktisch für Ortsteil, Etage oder Hinweise nutzt (z. B. „Holzheim\", „3. Etage\", „Parterre\"). `None`, wenn leer.
@BuiltValueField(wireName: r'addition')
String? get addition;
@BuiltValueField(wireName: r'city')
String get city;
/// Land laut ERP-Länderstamm (`Adressen.LandID` → `Laender.Land`), z. B. „Deutschland\" oder „Belgien\". Leer, wenn im ERP kein Land verknüpft ist.
@BuiltValueField(wireName: r'country')
String get country;
@ -56,6 +62,13 @@ class _$AddressSerializer implements PrimitiveSerializer<Address> {
Address object, {
FullType specifiedType = FullType.unspecified,
}) sync* {
if (object.addition != null) {
yield r'addition';
yield serializers.serialize(
object.addition,
specifiedType: const FullType.nullable(String),
);
}
yield r'city';
yield serializers.serialize(
object.city,
@ -104,6 +117,14 @@ class _$AddressSerializer implements PrimitiveSerializer<Address> {
final key = serializedList[i] as String;
final value = serializedList[i + 1];
switch (key) {
case r'addition':
final valueDes = serializers.deserialize(
value,
specifiedType: const FullType.nullable(String),
) as String?;
if (valueDes == null) continue;
result.addition = valueDes;
break;
case r'city':
final valueDes = serializers.deserialize(
value,

View File

@ -7,6 +7,8 @@ part of 'address.dart';
// **************************************************************************
class _$Address extends Address {
@override
final String? addition;
@override
final String city;
@override
@ -22,7 +24,8 @@ class _$Address extends Address {
(AddressBuilder()..update(updates))._build();
_$Address._(
{required this.city,
{this.addition,
required this.city,
required this.country,
required this.houseNumber,
required this.postalCode,
@ -39,6 +42,7 @@ class _$Address extends Address {
bool operator ==(Object other) {
if (identical(other, this)) return true;
return other is Address &&
addition == other.addition &&
city == other.city &&
country == other.country &&
houseNumber == other.houseNumber &&
@ -49,6 +53,7 @@ class _$Address extends Address {
@override
int get hashCode {
var _$hash = 0;
_$hash = $jc(_$hash, addition.hashCode);
_$hash = $jc(_$hash, city.hashCode);
_$hash = $jc(_$hash, country.hashCode);
_$hash = $jc(_$hash, houseNumber.hashCode);
@ -61,6 +66,7 @@ class _$Address extends Address {
@override
String toString() {
return (newBuiltValueToStringHelper(r'Address')
..add('addition', addition)
..add('city', city)
..add('country', country)
..add('houseNumber', houseNumber)
@ -73,6 +79,10 @@ class _$Address extends Address {
class AddressBuilder implements Builder<Address, AddressBuilder> {
_$Address? _$v;
String? _addition;
String? get addition => _$this._addition;
set addition(String? addition) => _$this._addition = addition;
String? _city;
String? get city => _$this._city;
set city(String? city) => _$this._city = city;
@ -100,6 +110,7 @@ class AddressBuilder implements Builder<Address, AddressBuilder> {
AddressBuilder get _$this {
final $v = _$v;
if ($v != null) {
_addition = $v.addition;
_city = $v.city;
_country = $v.country;
_houseNumber = $v.houseNumber;
@ -126,6 +137,7 @@ class AddressBuilder implements Builder<Address, AddressBuilder> {
_$Address _build() {
final _$result = _$v ??
_$Address._(
addition: addition,
city: BuiltValueNullFieldError.checkNotNull(city, r'Address', 'city'),
country: BuiltValueNullFieldError.checkNotNull(
country, r'Address', 'country'),