주석화 진행상황 정리하고 핵심 모듈에 한글 주석 추가

This commit is contained in:
JiWoong Sul
2025-09-29 19:39:35 +09:00
parent 9467b8c87f
commit 47c87dc118
82 changed files with 596 additions and 5 deletions

View File

@@ -3,6 +3,7 @@ import 'package:superport_v2/core/common/utils/json_utils.dart';
import '../../domain/entities/warehouse.dart';
/// 창고(Warehouse) API 응답을 표현하는 DTO.
class WarehouseDto {
WarehouseDto({
this.id,
@@ -28,6 +29,7 @@ class WarehouseDto {
final DateTime? createdAt;
final DateTime? updatedAt;
/// JSON에서 창고 정보를 파싱한다.
factory WarehouseDto.fromJson(Map<String, dynamic> json) {
return WarehouseDto(
id: json['id'] as int?,
@@ -47,6 +49,7 @@ class WarehouseDto {
);
}
/// DTO를 JSON 맵으로 직렬화한다.
Map<String, dynamic> toJson() {
return {
if (id != null) 'id': id,
@@ -62,6 +65,7 @@ class WarehouseDto {
};
}
/// DTO를 도메인 [Warehouse] 엔티티로 변환한다.
Warehouse toEntity() => Warehouse(
id: id,
warehouseCode: warehouseCode,
@@ -75,6 +79,7 @@ class WarehouseDto {
updatedAt: updatedAt,
);
/// 페이징 응답을 [PaginatedResult]로 변환한다.
static PaginatedResult<Warehouse> parsePaginated(Map<String, dynamic>? json) {
final rawItems = JsonUtils.extractList(json, keys: const ['items']);
final items = rawItems
@@ -90,6 +95,7 @@ class WarehouseDto {
}
}
/// 창고 주소에 대한 우편번호 정보를 담는 DTO.
class WarehouseZipcodeDto {
WarehouseZipcodeDto({
required this.zipcode,
@@ -103,6 +109,7 @@ class WarehouseZipcodeDto {
final String? sigungu;
final String? roadName;
/// JSON에서 우편번호 정보를 파싱한다.
factory WarehouseZipcodeDto.fromJson(Map<String, dynamic> json) {
return WarehouseZipcodeDto(
zipcode: json['zipcode'] as String,
@@ -112,6 +119,7 @@ class WarehouseZipcodeDto {
);
}
/// DTO를 JSON 맵으로 직렬화한다.
Map<String, dynamic> toJson() {
return {
'zipcode': zipcode,
@@ -121,6 +129,7 @@ class WarehouseZipcodeDto {
};
}
/// DTO를 [WarehouseZipcode] 엔티티로 변환한다.
WarehouseZipcode toEntity() => WarehouseZipcode(
zipcode: zipcode,
sido: sido,
@@ -129,6 +138,7 @@ class WarehouseZipcodeDto {
);
}
/// 문자열/DateTime 값을 파싱해 [DateTime]으로 변환한다.
DateTime? _parseDate(Object? value) {
if (value == null) return null;
if (value is DateTime) return value;
@@ -136,6 +146,7 @@ DateTime? _parseDate(Object? value) {
return null;
}
/// 창고 입력 모델을 API 요청 바디로 변환한다.
Map<String, dynamic> warehouseInputToJson(WarehouseInput input) {
final map = input.toPayload();
map.removeWhere((key, value) => value == null);