주석화 진행상황 정리하고 핵심 모듈에 한글 주석 추가
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:superport_v2/core/common/utils/json_utils.dart';
|
||||
|
||||
import '../../domain/entities/uom.dart';
|
||||
|
||||
/// 단위(UOM) API 응답을 표현하는 DTO.
|
||||
class UomDto {
|
||||
UomDto({
|
||||
this.id,
|
||||
@@ -24,6 +25,7 @@ class UomDto {
|
||||
final DateTime? createdAt;
|
||||
final DateTime? updatedAt;
|
||||
|
||||
/// JSON에서 단위 정보를 파싱한다.
|
||||
factory UomDto.fromJson(Map<String, dynamic> json) {
|
||||
return UomDto(
|
||||
id: json['id'] as int?,
|
||||
@@ -37,6 +39,7 @@ class UomDto {
|
||||
);
|
||||
}
|
||||
|
||||
/// DTO를 도메인 [Uom] 엔티티로 변환한다.
|
||||
Uom toEntity() => Uom(
|
||||
id: id,
|
||||
uomName: uomName,
|
||||
@@ -48,6 +51,7 @@ class UomDto {
|
||||
updatedAt: updatedAt,
|
||||
);
|
||||
|
||||
/// 페이징 응답을 [PaginatedResult]로 변환한다.
|
||||
static PaginatedResult<Uom> parsePaginated(Map<String, dynamic>? json) {
|
||||
final rawItems = JsonUtils.extractList(json, keys: const ['items']);
|
||||
final items = rawItems
|
||||
@@ -63,6 +67,7 @@ class UomDto {
|
||||
}
|
||||
}
|
||||
|
||||
/// 문자열/DateTime을 파싱해 [DateTime]으로 변환한다.
|
||||
DateTime? _parseDate(Object? value) {
|
||||
if (value == null) return null;
|
||||
if (value is DateTime) return value;
|
||||
|
||||
@@ -6,6 +6,7 @@ import '../../domain/entities/uom.dart';
|
||||
import '../../domain/repositories/uom_repository.dart';
|
||||
import '../dtos/uom_dto.dart';
|
||||
|
||||
/// 단위(UOM) 마스터 API를 호출하는 원격 저장소.
|
||||
class UomRepositoryRemote implements UomRepository {
|
||||
UomRepositoryRemote({required ApiClient apiClient}) : _api = apiClient;
|
||||
|
||||
@@ -13,6 +14,7 @@ class UomRepositoryRemote implements UomRepository {
|
||||
|
||||
static const _basePath = '/uoms';
|
||||
|
||||
/// UOM 목록을 조회한다.
|
||||
@override
|
||||
Future<PaginatedResult<Uom>> list({
|
||||
int page = 1,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/// 단위(UOM) 도메인 엔티티.
|
||||
class Uom {
|
||||
Uom({
|
||||
this.id,
|
||||
@@ -19,6 +20,7 @@ class Uom {
|
||||
final DateTime? createdAt;
|
||||
final DateTime? updatedAt;
|
||||
|
||||
/// 선택한 속성만 변경한 새 인스턴스를 반환한다.
|
||||
Uom copyWith({
|
||||
int? id,
|
||||
String? uomName,
|
||||
|
||||
Reference in New Issue
Block a user