import 'package:domain/entity/garage_sale_rent_detail_entity.dart';
import 'package:domain/entity/paid_service_detail_entity.dart';
import 'package:widgets/load_state_layout.dart';

class ServiceCleanDetailState {
  //页面 LoadView 状态的展示
  LoadState loadingState;
  String? errorMessage;

  // dialog 状态的展示
  LoadState dialogLoadingState;
  String? dialogErrorMessage;

  final int? id;
  final String? type;

  double? get urgentPrice => datas?.urgentPrice?.toDouble(); // 加急价格
  double? get holidayPrice => datas?.holidayPrice?.toDouble(); // 节假日价格
  double? get nightPrice => datas?.nightPrice?.toDouble(); // 夜间价格

  String?  get servicePeriodStart => datas?.servicePeriodStart; // 服务开始时间
  String? get servicePeriodEnd => datas?.servicePeriodEnd; // 服务结束时间
  int? get servicePeriodInterval => datas?.servicePeriodInterval; // 服务时间间隔

  PaidServiceDetailEntity? datas;

  ServiceCleanDetailState({
    this.loadingState = LoadState.State_Loading,
    this.errorMessage,
    this.dialogLoadingState = LoadState.State_Loading,
    this.dialogErrorMessage,
    this.id,
    this.type,
    required this.datas,
  });

  ServiceCleanDetailState copyWith({
    PaidServiceDetailEntity? datas,
    LoadState? loadingState,
    String? errorMessage,
    LoadState? dialogLoadingState,
    String? dialogErrorMessage,
    double? totalPrice,
    int? id,
    String? type,
  }) {
    return ServiceCleanDetailState(
      loadingState: loadingState ?? this.loadingState,
      errorMessage: errorMessage ?? this.errorMessage,
      dialogLoadingState: dialogLoadingState ?? this.dialogLoadingState,
      dialogErrorMessage: dialogErrorMessage ?? this.dialogErrorMessage,
      id: id ?? this.id,
      type: type ?? this.type,
      datas: datas?? this.datas,
    );
  }
}