/// 단위(UOM) 도메인 엔티티.
class Uom {
  Uom({
    this.id,
    required this.uomName,
    this.isDefault = false,
    this.isActive = true,
    this.isDeleted = false,
    this.note,
    this.createdAt,
    this.updatedAt,
  });

  final int? id;
  final String uomName;
  final bool isDefault;
  final bool isActive;
  final bool isDeleted;
  final String? note;
  final DateTime? createdAt;
  final DateTime? updatedAt;

  /// 선택한 속성만 변경한 새 인스턴스를 반환한다.
  Uom copyWith({
    int? id,
    String? uomName,
    bool? isDefault,
    bool? isActive,
    bool? isDeleted,
    String? note,
    DateTime? createdAt,
    DateTime? updatedAt,
  }) {
    return Uom(
      id: id ?? this.id,
      uomName: uomName ?? this.uomName,
      isDefault: isDefault ?? this.isDefault,
      isActive: isActive ?? this.isActive,
      isDeleted: isDeleted ?? this.isDeleted,
      note: note ?? this.note,
      createdAt: createdAt ?? this.createdAt,
      updatedAt: updatedAt ?? this.updatedAt,
    );
  }
}
