고객사 목록 쿼리스트링 연동 및 공통 JSON 파서 도입

This commit is contained in:
JiWoong Sul
2025-09-25 20:13:46 +09:00
parent 8a6ad1e81b
commit 900990c46b
27 changed files with 1458 additions and 176 deletions

View File

@@ -0,0 +1,51 @@
import '../../domain/entities/postal_code.dart';
/// 우편번호 검색 결과를 표현하는 모델.
class PostalSearchResult {
PostalSearchResult({
required this.zipcode,
this.sido,
this.sigungu,
this.roadName,
this.buildingNumber,
});
final String zipcode;
final String? sido;
final String? sigungu;
final String? roadName;
final String? buildingNumber;
factory PostalSearchResult.fromPostalCode(PostalCode postalCode) {
final buildingValue = postalCode.buildingNumber;
return PostalSearchResult(
zipcode: postalCode.zipcode,
sido: postalCode.sido,
sigungu: postalCode.sigungu,
roadName: postalCode.roadName,
buildingNumber: buildingValue.isEmpty ? null : buildingValue,
);
}
/// 주소 구성요소를 공백으로 이어 붙인 표시 문자열.
String get fullAddress {
final segments = <String>[];
final sidoValue = sido;
if (sidoValue != null && sidoValue.isNotEmpty) {
segments.add(sidoValue);
}
final sigunguValue = sigungu;
if (sigunguValue != null && sigunguValue.isNotEmpty) {
segments.add(sigunguValue);
}
final roadNameValue = roadName;
if (roadNameValue != null && roadNameValue.isNotEmpty) {
segments.add(roadNameValue);
}
final buildingNumberValue = buildingNumber;
if (buildingNumberValue != null && buildingNumberValue.isNotEmpty) {
segments.add(buildingNumberValue);
}
return segments.join(' ');
}
}