From e236d811ce18df9ceb559982c6747041a34941d0 Mon Sep 17 00:00:00 2001 From: efrilm Date: Mon, 22 Jun 2026 14:44:03 +0700 Subject: [PATCH] feat: exclusive summary --- .../exclusive_summary_loader_bloc.dart | 53 + ...exclusive_summary_loader_bloc.freezed.dart | 617 +++++ .../exclusive_summary_loader_event.dart | 11 + .../exclusive_summary_loader_state.dart | 22 + lib/common/url/api_path.dart | 2 + lib/domain/analytic/analytic.dart | 1 + lib/domain/analytic/analytic.freezed.dart | 1815 ++++++++++++++ .../entities/exclusive_summary_entity.dart | 119 + .../repositories/i_analytic_repository.dart | 6 + .../analytic/analytic_dtos.dart | 1 + .../analytic/analytic_dtos.freezed.dart | 2179 +++++++++++++++++ .../analytic/analytic_dtos.g.dart | 182 ++ .../datasource/remote_data_provider.dart | 31 + .../analytic/dto/exclusive_summary_dto.dart | 181 ++ .../repositories/analytic_repository.dart | 21 + lib/injection.config.dart | 5 + lib/l10n/app_en.arb | 26 +- lib/l10n/app_id.arb | 26 +- lib/l10n/app_localizations.dart | 72 + lib/l10n/app_localizations_en.dart | 36 + lib/l10n/app_localizations_id.dart | 36 + .../exclusive_summary_page.dart | 890 +++++++ .../pages/home/widgets/feature.dart | 6 +- lib/presentation/router/app_router.dart | 3 + lib/presentation/router/app_router.gr.dart | 328 +-- pubspec.yaml | 2 +- 26 files changed, 6510 insertions(+), 161 deletions(-) create mode 100644 lib/application/analytic/exclusive_summary_loader/exclusive_summary_loader_bloc.dart create mode 100644 lib/application/analytic/exclusive_summary_loader/exclusive_summary_loader_bloc.freezed.dart create mode 100644 lib/application/analytic/exclusive_summary_loader/exclusive_summary_loader_event.dart create mode 100644 lib/application/analytic/exclusive_summary_loader/exclusive_summary_loader_state.dart create mode 100644 lib/domain/analytic/entities/exclusive_summary_entity.dart create mode 100644 lib/infrastructure/analytic/dto/exclusive_summary_dto.dart create mode 100644 lib/presentation/pages/exclusive_summary/exclusive_summary_page.dart diff --git a/lib/application/analytic/exclusive_summary_loader/exclusive_summary_loader_bloc.dart b/lib/application/analytic/exclusive_summary_loader/exclusive_summary_loader_bloc.dart new file mode 100644 index 0000000..7f19f0e --- /dev/null +++ b/lib/application/analytic/exclusive_summary_loader/exclusive_summary_loader_bloc.dart @@ -0,0 +1,53 @@ +import 'package:dartz/dartz.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:injectable/injectable.dart'; + +import '../../../domain/analytic/analytic.dart'; +import '../../../domain/analytic/repositories/i_analytic_repository.dart'; + +part 'exclusive_summary_loader_event.dart'; +part 'exclusive_summary_loader_state.dart'; +part 'exclusive_summary_loader_bloc.freezed.dart'; + +@injectable +class ExclusiveSummaryLoaderBloc + extends Bloc { + final IAnalyticRepository _repository; + + ExclusiveSummaryLoaderBloc(this._repository) + : super(ExclusiveSummaryLoaderState.initial()) { + on(_onEvent); + } + + Future _onEvent( + ExclusiveSummaryLoaderEvent event, + Emitter emit, + ) { + return event.map( + rangeDateChanged: (e) async { + emit(state.copyWith(dateFrom: e.dateFrom, dateTo: e.dateTo)); + }, + fetched: (e) async { + emit( + state.copyWith( + isFetching: true, + failureOption: none(), + ), + ); + + final result = await _repository.getExclusiveSummary( + dateFrom: state.dateFrom, + dateTo: state.dateTo, + ); + + final data = result.fold( + (f) => state.copyWith(failureOption: optionOf(f)), + (summary) => state.copyWith(exclusiveSummary: summary), + ); + + emit(data.copyWith(isFetching: false)); + }, + ); + } +} diff --git a/lib/application/analytic/exclusive_summary_loader/exclusive_summary_loader_bloc.freezed.dart b/lib/application/analytic/exclusive_summary_loader/exclusive_summary_loader_bloc.freezed.dart new file mode 100644 index 0000000..550bcc5 --- /dev/null +++ b/lib/application/analytic/exclusive_summary_loader/exclusive_summary_loader_bloc.freezed.dart @@ -0,0 +1,617 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'exclusive_summary_loader_bloc.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); + +/// @nodoc +mixin _$ExclusiveSummaryLoaderEvent { + @optionalTypeArgs + TResult when({ + required TResult Function(DateTime dateFrom, DateTime dateTo) + rangeDateChanged, + required TResult Function() fetched, + }) => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(DateTime dateFrom, DateTime dateTo)? rangeDateChanged, + TResult? Function()? fetched, + }) => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(DateTime dateFrom, DateTime dateTo)? rangeDateChanged, + TResult Function()? fetched, + required TResult orElse(), + }) => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(_RangeDateChanged value) rangeDateChanged, + required TResult Function(_Fetched value) fetched, + }) => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_RangeDateChanged value)? rangeDateChanged, + TResult? Function(_Fetched value)? fetched, + }) => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_RangeDateChanged value)? rangeDateChanged, + TResult Function(_Fetched value)? fetched, + required TResult orElse(), + }) => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $ExclusiveSummaryLoaderEventCopyWith<$Res> { + factory $ExclusiveSummaryLoaderEventCopyWith( + ExclusiveSummaryLoaderEvent value, + $Res Function(ExclusiveSummaryLoaderEvent) then, + ) = + _$ExclusiveSummaryLoaderEventCopyWithImpl< + $Res, + ExclusiveSummaryLoaderEvent + >; +} + +/// @nodoc +class _$ExclusiveSummaryLoaderEventCopyWithImpl< + $Res, + $Val extends ExclusiveSummaryLoaderEvent +> + implements $ExclusiveSummaryLoaderEventCopyWith<$Res> { + _$ExclusiveSummaryLoaderEventCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of ExclusiveSummaryLoaderEvent + /// with the given fields replaced by the non-null parameter values. +} + +/// @nodoc +abstract class _$$RangeDateChangedImplCopyWith<$Res> { + factory _$$RangeDateChangedImplCopyWith( + _$RangeDateChangedImpl value, + $Res Function(_$RangeDateChangedImpl) then, + ) = __$$RangeDateChangedImplCopyWithImpl<$Res>; + @useResult + $Res call({DateTime dateFrom, DateTime dateTo}); +} + +/// @nodoc +class __$$RangeDateChangedImplCopyWithImpl<$Res> + extends + _$ExclusiveSummaryLoaderEventCopyWithImpl<$Res, _$RangeDateChangedImpl> + implements _$$RangeDateChangedImplCopyWith<$Res> { + __$$RangeDateChangedImplCopyWithImpl( + _$RangeDateChangedImpl _value, + $Res Function(_$RangeDateChangedImpl) _then, + ) : super(_value, _then); + + /// Create a copy of ExclusiveSummaryLoaderEvent + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({Object? dateFrom = null, Object? dateTo = null}) { + return _then( + _$RangeDateChangedImpl( + null == dateFrom + ? _value.dateFrom + : dateFrom // ignore: cast_nullable_to_non_nullable + as DateTime, + null == dateTo + ? _value.dateTo + : dateTo // ignore: cast_nullable_to_non_nullable + as DateTime, + ), + ); + } +} + +/// @nodoc + +class _$RangeDateChangedImpl implements _RangeDateChanged { + const _$RangeDateChangedImpl(this.dateFrom, this.dateTo); + + @override + final DateTime dateFrom; + @override + final DateTime dateTo; + + @override + String toString() { + return 'ExclusiveSummaryLoaderEvent.rangeDateChanged(dateFrom: $dateFrom, dateTo: $dateTo)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$RangeDateChangedImpl && + (identical(other.dateFrom, dateFrom) || + other.dateFrom == dateFrom) && + (identical(other.dateTo, dateTo) || other.dateTo == dateTo)); + } + + @override + int get hashCode => Object.hash(runtimeType, dateFrom, dateTo); + + /// Create a copy of ExclusiveSummaryLoaderEvent + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$RangeDateChangedImplCopyWith<_$RangeDateChangedImpl> get copyWith => + __$$RangeDateChangedImplCopyWithImpl<_$RangeDateChangedImpl>( + this, + _$identity, + ); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(DateTime dateFrom, DateTime dateTo) + rangeDateChanged, + required TResult Function() fetched, + }) { + return rangeDateChanged(dateFrom, dateTo); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(DateTime dateFrom, DateTime dateTo)? rangeDateChanged, + TResult? Function()? fetched, + }) { + return rangeDateChanged?.call(dateFrom, dateTo); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(DateTime dateFrom, DateTime dateTo)? rangeDateChanged, + TResult Function()? fetched, + required TResult orElse(), + }) { + if (rangeDateChanged != null) { + return rangeDateChanged(dateFrom, dateTo); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_RangeDateChanged value) rangeDateChanged, + required TResult Function(_Fetched value) fetched, + }) { + return rangeDateChanged(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_RangeDateChanged value)? rangeDateChanged, + TResult? Function(_Fetched value)? fetched, + }) { + return rangeDateChanged?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_RangeDateChanged value)? rangeDateChanged, + TResult Function(_Fetched value)? fetched, + required TResult orElse(), + }) { + if (rangeDateChanged != null) { + return rangeDateChanged(this); + } + return orElse(); + } +} + +abstract class _RangeDateChanged implements ExclusiveSummaryLoaderEvent { + const factory _RangeDateChanged( + final DateTime dateFrom, + final DateTime dateTo, + ) = _$RangeDateChangedImpl; + + DateTime get dateFrom; + DateTime get dateTo; + + /// Create a copy of ExclusiveSummaryLoaderEvent + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + _$$RangeDateChangedImplCopyWith<_$RangeDateChangedImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$FetchedImplCopyWith<$Res> { + factory _$$FetchedImplCopyWith( + _$FetchedImpl value, + $Res Function(_$FetchedImpl) then, + ) = __$$FetchedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$FetchedImplCopyWithImpl<$Res> + extends _$ExclusiveSummaryLoaderEventCopyWithImpl<$Res, _$FetchedImpl> + implements _$$FetchedImplCopyWith<$Res> { + __$$FetchedImplCopyWithImpl( + _$FetchedImpl _value, + $Res Function(_$FetchedImpl) _then, + ) : super(_value, _then); + + /// Create a copy of ExclusiveSummaryLoaderEvent + /// with the given fields replaced by the non-null parameter values. +} + +/// @nodoc + +class _$FetchedImpl implements _Fetched { + const _$FetchedImpl(); + + @override + String toString() { + return 'ExclusiveSummaryLoaderEvent.fetched()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$FetchedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(DateTime dateFrom, DateTime dateTo) + rangeDateChanged, + required TResult Function() fetched, + }) { + return fetched(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(DateTime dateFrom, DateTime dateTo)? rangeDateChanged, + TResult? Function()? fetched, + }) { + return fetched?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(DateTime dateFrom, DateTime dateTo)? rangeDateChanged, + TResult Function()? fetched, + required TResult orElse(), + }) { + if (fetched != null) { + return fetched(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_RangeDateChanged value) rangeDateChanged, + required TResult Function(_Fetched value) fetched, + }) { + return fetched(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_RangeDateChanged value)? rangeDateChanged, + TResult? Function(_Fetched value)? fetched, + }) { + return fetched?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_RangeDateChanged value)? rangeDateChanged, + TResult Function(_Fetched value)? fetched, + required TResult orElse(), + }) { + if (fetched != null) { + return fetched(this); + } + return orElse(); + } +} + +abstract class _Fetched implements ExclusiveSummaryLoaderEvent { + const factory _Fetched() = _$FetchedImpl; +} + +/// @nodoc +mixin _$ExclusiveSummaryLoaderState { + ExclusiveSummary get exclusiveSummary => throw _privateConstructorUsedError; + Option get failureOption => + throw _privateConstructorUsedError; + bool get isFetching => throw _privateConstructorUsedError; + DateTime get dateFrom => throw _privateConstructorUsedError; + DateTime get dateTo => throw _privateConstructorUsedError; + + /// Create a copy of ExclusiveSummaryLoaderState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $ExclusiveSummaryLoaderStateCopyWith + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $ExclusiveSummaryLoaderStateCopyWith<$Res> { + factory $ExclusiveSummaryLoaderStateCopyWith( + ExclusiveSummaryLoaderState value, + $Res Function(ExclusiveSummaryLoaderState) then, + ) = + _$ExclusiveSummaryLoaderStateCopyWithImpl< + $Res, + ExclusiveSummaryLoaderState + >; + @useResult + $Res call({ + ExclusiveSummary exclusiveSummary, + Option failureOption, + bool isFetching, + DateTime dateFrom, + DateTime dateTo, + }); + + $ExclusiveSummaryCopyWith<$Res> get exclusiveSummary; +} + +/// @nodoc +class _$ExclusiveSummaryLoaderStateCopyWithImpl< + $Res, + $Val extends ExclusiveSummaryLoaderState +> + implements $ExclusiveSummaryLoaderStateCopyWith<$Res> { + _$ExclusiveSummaryLoaderStateCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of ExclusiveSummaryLoaderState + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? exclusiveSummary = null, + Object? failureOption = null, + Object? isFetching = null, + Object? dateFrom = null, + Object? dateTo = null, + }) { + return _then( + _value.copyWith( + exclusiveSummary: null == exclusiveSummary + ? _value.exclusiveSummary + : exclusiveSummary // ignore: cast_nullable_to_non_nullable + as ExclusiveSummary, + failureOption: null == failureOption + ? _value.failureOption + : failureOption // ignore: cast_nullable_to_non_nullable + as Option, + isFetching: null == isFetching + ? _value.isFetching + : isFetching // ignore: cast_nullable_to_non_nullable + as bool, + dateFrom: null == dateFrom + ? _value.dateFrom + : dateFrom // ignore: cast_nullable_to_non_nullable + as DateTime, + dateTo: null == dateTo + ? _value.dateTo + : dateTo // ignore: cast_nullable_to_non_nullable + as DateTime, + ) + as $Val, + ); + } + + /// Create a copy of ExclusiveSummaryLoaderState + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $ExclusiveSummaryCopyWith<$Res> get exclusiveSummary { + return $ExclusiveSummaryCopyWith<$Res>(_value.exclusiveSummary, (value) { + return _then(_value.copyWith(exclusiveSummary: value) as $Val); + }); + } +} + +/// @nodoc +abstract class _$$ExclusiveSummaryLoaderStateImplCopyWith<$Res> + implements $ExclusiveSummaryLoaderStateCopyWith<$Res> { + factory _$$ExclusiveSummaryLoaderStateImplCopyWith( + _$ExclusiveSummaryLoaderStateImpl value, + $Res Function(_$ExclusiveSummaryLoaderStateImpl) then, + ) = __$$ExclusiveSummaryLoaderStateImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + ExclusiveSummary exclusiveSummary, + Option failureOption, + bool isFetching, + DateTime dateFrom, + DateTime dateTo, + }); + + @override + $ExclusiveSummaryCopyWith<$Res> get exclusiveSummary; +} + +/// @nodoc +class __$$ExclusiveSummaryLoaderStateImplCopyWithImpl<$Res> + extends + _$ExclusiveSummaryLoaderStateCopyWithImpl< + $Res, + _$ExclusiveSummaryLoaderStateImpl + > + implements _$$ExclusiveSummaryLoaderStateImplCopyWith<$Res> { + __$$ExclusiveSummaryLoaderStateImplCopyWithImpl( + _$ExclusiveSummaryLoaderStateImpl _value, + $Res Function(_$ExclusiveSummaryLoaderStateImpl) _then, + ) : super(_value, _then); + + /// Create a copy of ExclusiveSummaryLoaderState + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? exclusiveSummary = null, + Object? failureOption = null, + Object? isFetching = null, + Object? dateFrom = null, + Object? dateTo = null, + }) { + return _then( + _$ExclusiveSummaryLoaderStateImpl( + exclusiveSummary: null == exclusiveSummary + ? _value.exclusiveSummary + : exclusiveSummary // ignore: cast_nullable_to_non_nullable + as ExclusiveSummary, + failureOption: null == failureOption + ? _value.failureOption + : failureOption // ignore: cast_nullable_to_non_nullable + as Option, + isFetching: null == isFetching + ? _value.isFetching + : isFetching // ignore: cast_nullable_to_non_nullable + as bool, + dateFrom: null == dateFrom + ? _value.dateFrom + : dateFrom // ignore: cast_nullable_to_non_nullable + as DateTime, + dateTo: null == dateTo + ? _value.dateTo + : dateTo // ignore: cast_nullable_to_non_nullable + as DateTime, + ), + ); + } +} + +/// @nodoc + +class _$ExclusiveSummaryLoaderStateImpl + implements _ExclusiveSummaryLoaderState { + const _$ExclusiveSummaryLoaderStateImpl({ + required this.exclusiveSummary, + required this.failureOption, + this.isFetching = false, + required this.dateFrom, + required this.dateTo, + }); + + @override + final ExclusiveSummary exclusiveSummary; + @override + final Option failureOption; + @override + @JsonKey() + final bool isFetching; + @override + final DateTime dateFrom; + @override + final DateTime dateTo; + + @override + String toString() { + return 'ExclusiveSummaryLoaderState(exclusiveSummary: $exclusiveSummary, failureOption: $failureOption, isFetching: $isFetching, dateFrom: $dateFrom, dateTo: $dateTo)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ExclusiveSummaryLoaderStateImpl && + (identical(other.exclusiveSummary, exclusiveSummary) || + other.exclusiveSummary == exclusiveSummary) && + (identical(other.failureOption, failureOption) || + other.failureOption == failureOption) && + (identical(other.isFetching, isFetching) || + other.isFetching == isFetching) && + (identical(other.dateFrom, dateFrom) || + other.dateFrom == dateFrom) && + (identical(other.dateTo, dateTo) || other.dateTo == dateTo)); + } + + @override + int get hashCode => Object.hash( + runtimeType, + exclusiveSummary, + failureOption, + isFetching, + dateFrom, + dateTo, + ); + + /// Create a copy of ExclusiveSummaryLoaderState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$ExclusiveSummaryLoaderStateImplCopyWith<_$ExclusiveSummaryLoaderStateImpl> + get copyWith => + __$$ExclusiveSummaryLoaderStateImplCopyWithImpl< + _$ExclusiveSummaryLoaderStateImpl + >(this, _$identity); +} + +abstract class _ExclusiveSummaryLoaderState + implements ExclusiveSummaryLoaderState { + const factory _ExclusiveSummaryLoaderState({ + required final ExclusiveSummary exclusiveSummary, + required final Option failureOption, + final bool isFetching, + required final DateTime dateFrom, + required final DateTime dateTo, + }) = _$ExclusiveSummaryLoaderStateImpl; + + @override + ExclusiveSummary get exclusiveSummary; + @override + Option get failureOption; + @override + bool get isFetching; + @override + DateTime get dateFrom; + @override + DateTime get dateTo; + + /// Create a copy of ExclusiveSummaryLoaderState + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$ExclusiveSummaryLoaderStateImplCopyWith<_$ExclusiveSummaryLoaderStateImpl> + get copyWith => throw _privateConstructorUsedError; +} diff --git a/lib/application/analytic/exclusive_summary_loader/exclusive_summary_loader_event.dart b/lib/application/analytic/exclusive_summary_loader/exclusive_summary_loader_event.dart new file mode 100644 index 0000000..723569f --- /dev/null +++ b/lib/application/analytic/exclusive_summary_loader/exclusive_summary_loader_event.dart @@ -0,0 +1,11 @@ +part of 'exclusive_summary_loader_bloc.dart'; + +@freezed +class ExclusiveSummaryLoaderEvent with _$ExclusiveSummaryLoaderEvent { + const factory ExclusiveSummaryLoaderEvent.rangeDateChanged( + DateTime dateFrom, + DateTime dateTo, + ) = _RangeDateChanged; + + const factory ExclusiveSummaryLoaderEvent.fetched() = _Fetched; +} diff --git a/lib/application/analytic/exclusive_summary_loader/exclusive_summary_loader_state.dart b/lib/application/analytic/exclusive_summary_loader/exclusive_summary_loader_state.dart new file mode 100644 index 0000000..820216e --- /dev/null +++ b/lib/application/analytic/exclusive_summary_loader/exclusive_summary_loader_state.dart @@ -0,0 +1,22 @@ +part of 'exclusive_summary_loader_bloc.dart'; + +@freezed +class ExclusiveSummaryLoaderState with _$ExclusiveSummaryLoaderState { + const factory ExclusiveSummaryLoaderState({ + required ExclusiveSummary exclusiveSummary, + required Option failureOption, + @Default(false) bool isFetching, + required DateTime dateFrom, + required DateTime dateTo, + }) = _ExclusiveSummaryLoaderState; + + factory ExclusiveSummaryLoaderState.initial() { + final now = DateTime.now(); + return ExclusiveSummaryLoaderState( + exclusiveSummary: ExclusiveSummary.empty(), + failureOption: none(), + dateFrom: DateTime(now.year, now.month, 1), + dateTo: DateTime(now.year, now.month + 1, 0), + ); + } +} diff --git a/lib/common/url/api_path.dart b/lib/common/url/api_path.dart index f113574..a16fba3 100644 --- a/lib/common/url/api_path.dart +++ b/lib/common/url/api_path.dart @@ -12,6 +12,8 @@ class ApiPath { static const String paymentMethodAnalytic = '/api/v1/analytics/paymentMethods'; static const String purchasingAnalytic = '/api/v1/analytics/purchasing'; + static const String exclusiveSummaryAnalytic = + '/api/v1/analytics/exclusive-summary/period'; // Inventory static const String inventoryReportDetail = diff --git a/lib/domain/analytic/analytic.dart b/lib/domain/analytic/analytic.dart index 4c09de3..f1a9030 100644 --- a/lib/domain/analytic/analytic.dart +++ b/lib/domain/analytic/analytic.dart @@ -12,4 +12,5 @@ part 'entities/dashboard_analytic_entity.dart'; part 'entities/product_analytic_entity.dart'; part 'entities/payment_method_analytic_entity.dart'; part 'entities/purchasing_analytic_entity.dart'; +part 'entities/exclusive_summary_entity.dart'; part 'failures/analytic_failure.dart'; diff --git a/lib/domain/analytic/analytic.freezed.dart b/lib/domain/analytic/analytic.freezed.dart index 7f7a3a9..03e03e0 100644 --- a/lib/domain/analytic/analytic.freezed.dart +++ b/lib/domain/analytic/analytic.freezed.dart @@ -8712,6 +8712,1821 @@ abstract class _PurchasingVendorData implements PurchasingVendorData { get copyWith => throw _privateConstructorUsedError; } +/// @nodoc +mixin _$ExclusiveSummary { + String get organizationId => throw _privateConstructorUsedError; + String get outletId => throw _privateConstructorUsedError; + ExclusiveSummaryPeriod get period => throw _privateConstructorUsedError; + ExclusiveSummarySummary get summary => throw _privateConstructorUsedError; + ExclusiveSummaryReimburse get reimburse => throw _privateConstructorUsedError; + List get hppBreakdown => + throw _privateConstructorUsedError; + List get operationalExpenseBreakdown => + throw _privateConstructorUsedError; + List get dailySummary => + throw _privateConstructorUsedError; + List get dailyTransactions => + throw _privateConstructorUsedError; + + /// Create a copy of ExclusiveSummary + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $ExclusiveSummaryCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $ExclusiveSummaryCopyWith<$Res> { + factory $ExclusiveSummaryCopyWith( + ExclusiveSummary value, + $Res Function(ExclusiveSummary) then, + ) = _$ExclusiveSummaryCopyWithImpl<$Res, ExclusiveSummary>; + @useResult + $Res call({ + String organizationId, + String outletId, + ExclusiveSummaryPeriod period, + ExclusiveSummarySummary summary, + ExclusiveSummaryReimburse reimburse, + List hppBreakdown, + List operationalExpenseBreakdown, + List dailySummary, + List dailyTransactions, + }); + + $ExclusiveSummaryPeriodCopyWith<$Res> get period; + $ExclusiveSummarySummaryCopyWith<$Res> get summary; + $ExclusiveSummaryReimburseCopyWith<$Res> get reimburse; +} + +/// @nodoc +class _$ExclusiveSummaryCopyWithImpl<$Res, $Val extends ExclusiveSummary> + implements $ExclusiveSummaryCopyWith<$Res> { + _$ExclusiveSummaryCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of ExclusiveSummary + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? organizationId = null, + Object? outletId = null, + Object? period = null, + Object? summary = null, + Object? reimburse = null, + Object? hppBreakdown = null, + Object? operationalExpenseBreakdown = null, + Object? dailySummary = null, + Object? dailyTransactions = null, + }) { + return _then( + _value.copyWith( + organizationId: null == organizationId + ? _value.organizationId + : organizationId // ignore: cast_nullable_to_non_nullable + as String, + outletId: null == outletId + ? _value.outletId + : outletId // ignore: cast_nullable_to_non_nullable + as String, + period: null == period + ? _value.period + : period // ignore: cast_nullable_to_non_nullable + as ExclusiveSummaryPeriod, + summary: null == summary + ? _value.summary + : summary // ignore: cast_nullable_to_non_nullable + as ExclusiveSummarySummary, + reimburse: null == reimburse + ? _value.reimburse + : reimburse // ignore: cast_nullable_to_non_nullable + as ExclusiveSummaryReimburse, + hppBreakdown: null == hppBreakdown + ? _value.hppBreakdown + : hppBreakdown // ignore: cast_nullable_to_non_nullable + as List, + operationalExpenseBreakdown: null == operationalExpenseBreakdown + ? _value.operationalExpenseBreakdown + : operationalExpenseBreakdown // ignore: cast_nullable_to_non_nullable + as List, + dailySummary: null == dailySummary + ? _value.dailySummary + : dailySummary // ignore: cast_nullable_to_non_nullable + as List, + dailyTransactions: null == dailyTransactions + ? _value.dailyTransactions + : dailyTransactions // ignore: cast_nullable_to_non_nullable + as List, + ) + as $Val, + ); + } + + /// Create a copy of ExclusiveSummary + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $ExclusiveSummaryPeriodCopyWith<$Res> get period { + return $ExclusiveSummaryPeriodCopyWith<$Res>(_value.period, (value) { + return _then(_value.copyWith(period: value) as $Val); + }); + } + + /// Create a copy of ExclusiveSummary + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $ExclusiveSummarySummaryCopyWith<$Res> get summary { + return $ExclusiveSummarySummaryCopyWith<$Res>(_value.summary, (value) { + return _then(_value.copyWith(summary: value) as $Val); + }); + } + + /// Create a copy of ExclusiveSummary + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $ExclusiveSummaryReimburseCopyWith<$Res> get reimburse { + return $ExclusiveSummaryReimburseCopyWith<$Res>(_value.reimburse, (value) { + return _then(_value.copyWith(reimburse: value) as $Val); + }); + } +} + +/// @nodoc +abstract class _$$ExclusiveSummaryImplCopyWith<$Res> + implements $ExclusiveSummaryCopyWith<$Res> { + factory _$$ExclusiveSummaryImplCopyWith( + _$ExclusiveSummaryImpl value, + $Res Function(_$ExclusiveSummaryImpl) then, + ) = __$$ExclusiveSummaryImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + String organizationId, + String outletId, + ExclusiveSummaryPeriod period, + ExclusiveSummarySummary summary, + ExclusiveSummaryReimburse reimburse, + List hppBreakdown, + List operationalExpenseBreakdown, + List dailySummary, + List dailyTransactions, + }); + + @override + $ExclusiveSummaryPeriodCopyWith<$Res> get period; + @override + $ExclusiveSummarySummaryCopyWith<$Res> get summary; + @override + $ExclusiveSummaryReimburseCopyWith<$Res> get reimburse; +} + +/// @nodoc +class __$$ExclusiveSummaryImplCopyWithImpl<$Res> + extends _$ExclusiveSummaryCopyWithImpl<$Res, _$ExclusiveSummaryImpl> + implements _$$ExclusiveSummaryImplCopyWith<$Res> { + __$$ExclusiveSummaryImplCopyWithImpl( + _$ExclusiveSummaryImpl _value, + $Res Function(_$ExclusiveSummaryImpl) _then, + ) : super(_value, _then); + + /// Create a copy of ExclusiveSummary + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? organizationId = null, + Object? outletId = null, + Object? period = null, + Object? summary = null, + Object? reimburse = null, + Object? hppBreakdown = null, + Object? operationalExpenseBreakdown = null, + Object? dailySummary = null, + Object? dailyTransactions = null, + }) { + return _then( + _$ExclusiveSummaryImpl( + organizationId: null == organizationId + ? _value.organizationId + : organizationId // ignore: cast_nullable_to_non_nullable + as String, + outletId: null == outletId + ? _value.outletId + : outletId // ignore: cast_nullable_to_non_nullable + as String, + period: null == period + ? _value.period + : period // ignore: cast_nullable_to_non_nullable + as ExclusiveSummaryPeriod, + summary: null == summary + ? _value.summary + : summary // ignore: cast_nullable_to_non_nullable + as ExclusiveSummarySummary, + reimburse: null == reimburse + ? _value.reimburse + : reimburse // ignore: cast_nullable_to_non_nullable + as ExclusiveSummaryReimburse, + hppBreakdown: null == hppBreakdown + ? _value._hppBreakdown + : hppBreakdown // ignore: cast_nullable_to_non_nullable + as List, + operationalExpenseBreakdown: null == operationalExpenseBreakdown + ? _value._operationalExpenseBreakdown + : operationalExpenseBreakdown // ignore: cast_nullable_to_non_nullable + as List, + dailySummary: null == dailySummary + ? _value._dailySummary + : dailySummary // ignore: cast_nullable_to_non_nullable + as List, + dailyTransactions: null == dailyTransactions + ? _value._dailyTransactions + : dailyTransactions // ignore: cast_nullable_to_non_nullable + as List, + ), + ); + } +} + +/// @nodoc + +class _$ExclusiveSummaryImpl implements _ExclusiveSummary { + const _$ExclusiveSummaryImpl({ + required this.organizationId, + required this.outletId, + required this.period, + required this.summary, + required this.reimburse, + required final List hppBreakdown, + required final List operationalExpenseBreakdown, + required final List dailySummary, + required final List dailyTransactions, + }) : _hppBreakdown = hppBreakdown, + _operationalExpenseBreakdown = operationalExpenseBreakdown, + _dailySummary = dailySummary, + _dailyTransactions = dailyTransactions; + + @override + final String organizationId; + @override + final String outletId; + @override + final ExclusiveSummaryPeriod period; + @override + final ExclusiveSummarySummary summary; + @override + final ExclusiveSummaryReimburse reimburse; + final List _hppBreakdown; + @override + List get hppBreakdown { + if (_hppBreakdown is EqualUnmodifiableListView) return _hppBreakdown; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_hppBreakdown); + } + + final List _operationalExpenseBreakdown; + @override + List get operationalExpenseBreakdown { + if (_operationalExpenseBreakdown is EqualUnmodifiableListView) + return _operationalExpenseBreakdown; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_operationalExpenseBreakdown); + } + + final List _dailySummary; + @override + List get dailySummary { + if (_dailySummary is EqualUnmodifiableListView) return _dailySummary; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_dailySummary); + } + + final List _dailyTransactions; + @override + List get dailyTransactions { + if (_dailyTransactions is EqualUnmodifiableListView) + return _dailyTransactions; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_dailyTransactions); + } + + @override + String toString() { + return 'ExclusiveSummary(organizationId: $organizationId, outletId: $outletId, period: $period, summary: $summary, reimburse: $reimburse, hppBreakdown: $hppBreakdown, operationalExpenseBreakdown: $operationalExpenseBreakdown, dailySummary: $dailySummary, dailyTransactions: $dailyTransactions)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ExclusiveSummaryImpl && + (identical(other.organizationId, organizationId) || + other.organizationId == organizationId) && + (identical(other.outletId, outletId) || + other.outletId == outletId) && + (identical(other.period, period) || other.period == period) && + (identical(other.summary, summary) || other.summary == summary) && + (identical(other.reimburse, reimburse) || + other.reimburse == reimburse) && + const DeepCollectionEquality().equals( + other._hppBreakdown, + _hppBreakdown, + ) && + const DeepCollectionEquality().equals( + other._operationalExpenseBreakdown, + _operationalExpenseBreakdown, + ) && + const DeepCollectionEquality().equals( + other._dailySummary, + _dailySummary, + ) && + const DeepCollectionEquality().equals( + other._dailyTransactions, + _dailyTransactions, + )); + } + + @override + int get hashCode => Object.hash( + runtimeType, + organizationId, + outletId, + period, + summary, + reimburse, + const DeepCollectionEquality().hash(_hppBreakdown), + const DeepCollectionEquality().hash(_operationalExpenseBreakdown), + const DeepCollectionEquality().hash(_dailySummary), + const DeepCollectionEquality().hash(_dailyTransactions), + ); + + /// Create a copy of ExclusiveSummary + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$ExclusiveSummaryImplCopyWith<_$ExclusiveSummaryImpl> get copyWith => + __$$ExclusiveSummaryImplCopyWithImpl<_$ExclusiveSummaryImpl>( + this, + _$identity, + ); +} + +abstract class _ExclusiveSummary implements ExclusiveSummary { + const factory _ExclusiveSummary({ + required final String organizationId, + required final String outletId, + required final ExclusiveSummaryPeriod period, + required final ExclusiveSummarySummary summary, + required final ExclusiveSummaryReimburse reimburse, + required final List hppBreakdown, + required final List operationalExpenseBreakdown, + required final List dailySummary, + required final List dailyTransactions, + }) = _$ExclusiveSummaryImpl; + + @override + String get organizationId; + @override + String get outletId; + @override + ExclusiveSummaryPeriod get period; + @override + ExclusiveSummarySummary get summary; + @override + ExclusiveSummaryReimburse get reimburse; + @override + List get hppBreakdown; + @override + List get operationalExpenseBreakdown; + @override + List get dailySummary; + @override + List get dailyTransactions; + + /// Create a copy of ExclusiveSummary + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$ExclusiveSummaryImplCopyWith<_$ExclusiveSummaryImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +mixin _$ExclusiveSummaryPeriod { + DateTime get dateFrom => throw _privateConstructorUsedError; + DateTime get dateTo => throw _privateConstructorUsedError; + + /// Create a copy of ExclusiveSummaryPeriod + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $ExclusiveSummaryPeriodCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $ExclusiveSummaryPeriodCopyWith<$Res> { + factory $ExclusiveSummaryPeriodCopyWith( + ExclusiveSummaryPeriod value, + $Res Function(ExclusiveSummaryPeriod) then, + ) = _$ExclusiveSummaryPeriodCopyWithImpl<$Res, ExclusiveSummaryPeriod>; + @useResult + $Res call({DateTime dateFrom, DateTime dateTo}); +} + +/// @nodoc +class _$ExclusiveSummaryPeriodCopyWithImpl< + $Res, + $Val extends ExclusiveSummaryPeriod +> + implements $ExclusiveSummaryPeriodCopyWith<$Res> { + _$ExclusiveSummaryPeriodCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of ExclusiveSummaryPeriod + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({Object? dateFrom = null, Object? dateTo = null}) { + return _then( + _value.copyWith( + dateFrom: null == dateFrom + ? _value.dateFrom + : dateFrom // ignore: cast_nullable_to_non_nullable + as DateTime, + dateTo: null == dateTo + ? _value.dateTo + : dateTo // ignore: cast_nullable_to_non_nullable + as DateTime, + ) + as $Val, + ); + } +} + +/// @nodoc +abstract class _$$ExclusiveSummaryPeriodImplCopyWith<$Res> + implements $ExclusiveSummaryPeriodCopyWith<$Res> { + factory _$$ExclusiveSummaryPeriodImplCopyWith( + _$ExclusiveSummaryPeriodImpl value, + $Res Function(_$ExclusiveSummaryPeriodImpl) then, + ) = __$$ExclusiveSummaryPeriodImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({DateTime dateFrom, DateTime dateTo}); +} + +/// @nodoc +class __$$ExclusiveSummaryPeriodImplCopyWithImpl<$Res> + extends + _$ExclusiveSummaryPeriodCopyWithImpl<$Res, _$ExclusiveSummaryPeriodImpl> + implements _$$ExclusiveSummaryPeriodImplCopyWith<$Res> { + __$$ExclusiveSummaryPeriodImplCopyWithImpl( + _$ExclusiveSummaryPeriodImpl _value, + $Res Function(_$ExclusiveSummaryPeriodImpl) _then, + ) : super(_value, _then); + + /// Create a copy of ExclusiveSummaryPeriod + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({Object? dateFrom = null, Object? dateTo = null}) { + return _then( + _$ExclusiveSummaryPeriodImpl( + dateFrom: null == dateFrom + ? _value.dateFrom + : dateFrom // ignore: cast_nullable_to_non_nullable + as DateTime, + dateTo: null == dateTo + ? _value.dateTo + : dateTo // ignore: cast_nullable_to_non_nullable + as DateTime, + ), + ); + } +} + +/// @nodoc + +class _$ExclusiveSummaryPeriodImpl implements _ExclusiveSummaryPeriod { + const _$ExclusiveSummaryPeriodImpl({ + required this.dateFrom, + required this.dateTo, + }); + + @override + final DateTime dateFrom; + @override + final DateTime dateTo; + + @override + String toString() { + return 'ExclusiveSummaryPeriod(dateFrom: $dateFrom, dateTo: $dateTo)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ExclusiveSummaryPeriodImpl && + (identical(other.dateFrom, dateFrom) || + other.dateFrom == dateFrom) && + (identical(other.dateTo, dateTo) || other.dateTo == dateTo)); + } + + @override + int get hashCode => Object.hash(runtimeType, dateFrom, dateTo); + + /// Create a copy of ExclusiveSummaryPeriod + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$ExclusiveSummaryPeriodImplCopyWith<_$ExclusiveSummaryPeriodImpl> + get copyWith => + __$$ExclusiveSummaryPeriodImplCopyWithImpl<_$ExclusiveSummaryPeriodImpl>( + this, + _$identity, + ); +} + +abstract class _ExclusiveSummaryPeriod implements ExclusiveSummaryPeriod { + const factory _ExclusiveSummaryPeriod({ + required final DateTime dateFrom, + required final DateTime dateTo, + }) = _$ExclusiveSummaryPeriodImpl; + + @override + DateTime get dateFrom; + @override + DateTime get dateTo; + + /// Create a copy of ExclusiveSummaryPeriod + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$ExclusiveSummaryPeriodImplCopyWith<_$ExclusiveSummaryPeriodImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +mixin _$ExclusiveSummarySummary { + int get sales => throw _privateConstructorUsedError; + int get hpp => throw _privateConstructorUsedError; + int get grossProfit => throw _privateConstructorUsedError; + int get salaryTotal => throw _privateConstructorUsedError; + int get salaryDw => throw _privateConstructorUsedError; + int get salaryStaff => throw _privateConstructorUsedError; + int get salaryOther => throw _privateConstructorUsedError; + int get otherOperationalExpenses => throw _privateConstructorUsedError; + int get operationalExpensesTotal => throw _privateConstructorUsedError; + int get totalCost => throw _privateConstructorUsedError; + int get netProfit => throw _privateConstructorUsedError; + + /// Create a copy of ExclusiveSummarySummary + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $ExclusiveSummarySummaryCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $ExclusiveSummarySummaryCopyWith<$Res> { + factory $ExclusiveSummarySummaryCopyWith( + ExclusiveSummarySummary value, + $Res Function(ExclusiveSummarySummary) then, + ) = _$ExclusiveSummarySummaryCopyWithImpl<$Res, ExclusiveSummarySummary>; + @useResult + $Res call({ + int sales, + int hpp, + int grossProfit, + int salaryTotal, + int salaryDw, + int salaryStaff, + int salaryOther, + int otherOperationalExpenses, + int operationalExpensesTotal, + int totalCost, + int netProfit, + }); +} + +/// @nodoc +class _$ExclusiveSummarySummaryCopyWithImpl< + $Res, + $Val extends ExclusiveSummarySummary +> + implements $ExclusiveSummarySummaryCopyWith<$Res> { + _$ExclusiveSummarySummaryCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of ExclusiveSummarySummary + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? sales = null, + Object? hpp = null, + Object? grossProfit = null, + Object? salaryTotal = null, + Object? salaryDw = null, + Object? salaryStaff = null, + Object? salaryOther = null, + Object? otherOperationalExpenses = null, + Object? operationalExpensesTotal = null, + Object? totalCost = null, + Object? netProfit = null, + }) { + return _then( + _value.copyWith( + sales: null == sales + ? _value.sales + : sales // ignore: cast_nullable_to_non_nullable + as int, + hpp: null == hpp + ? _value.hpp + : hpp // ignore: cast_nullable_to_non_nullable + as int, + grossProfit: null == grossProfit + ? _value.grossProfit + : grossProfit // ignore: cast_nullable_to_non_nullable + as int, + salaryTotal: null == salaryTotal + ? _value.salaryTotal + : salaryTotal // ignore: cast_nullable_to_non_nullable + as int, + salaryDw: null == salaryDw + ? _value.salaryDw + : salaryDw // ignore: cast_nullable_to_non_nullable + as int, + salaryStaff: null == salaryStaff + ? _value.salaryStaff + : salaryStaff // ignore: cast_nullable_to_non_nullable + as int, + salaryOther: null == salaryOther + ? _value.salaryOther + : salaryOther // ignore: cast_nullable_to_non_nullable + as int, + otherOperationalExpenses: null == otherOperationalExpenses + ? _value.otherOperationalExpenses + : otherOperationalExpenses // ignore: cast_nullable_to_non_nullable + as int, + operationalExpensesTotal: null == operationalExpensesTotal + ? _value.operationalExpensesTotal + : operationalExpensesTotal // ignore: cast_nullable_to_non_nullable + as int, + totalCost: null == totalCost + ? _value.totalCost + : totalCost // ignore: cast_nullable_to_non_nullable + as int, + netProfit: null == netProfit + ? _value.netProfit + : netProfit // ignore: cast_nullable_to_non_nullable + as int, + ) + as $Val, + ); + } +} + +/// @nodoc +abstract class _$$ExclusiveSummarySummaryImplCopyWith<$Res> + implements $ExclusiveSummarySummaryCopyWith<$Res> { + factory _$$ExclusiveSummarySummaryImplCopyWith( + _$ExclusiveSummarySummaryImpl value, + $Res Function(_$ExclusiveSummarySummaryImpl) then, + ) = __$$ExclusiveSummarySummaryImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + int sales, + int hpp, + int grossProfit, + int salaryTotal, + int salaryDw, + int salaryStaff, + int salaryOther, + int otherOperationalExpenses, + int operationalExpensesTotal, + int totalCost, + int netProfit, + }); +} + +/// @nodoc +class __$$ExclusiveSummarySummaryImplCopyWithImpl<$Res> + extends + _$ExclusiveSummarySummaryCopyWithImpl< + $Res, + _$ExclusiveSummarySummaryImpl + > + implements _$$ExclusiveSummarySummaryImplCopyWith<$Res> { + __$$ExclusiveSummarySummaryImplCopyWithImpl( + _$ExclusiveSummarySummaryImpl _value, + $Res Function(_$ExclusiveSummarySummaryImpl) _then, + ) : super(_value, _then); + + /// Create a copy of ExclusiveSummarySummary + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? sales = null, + Object? hpp = null, + Object? grossProfit = null, + Object? salaryTotal = null, + Object? salaryDw = null, + Object? salaryStaff = null, + Object? salaryOther = null, + Object? otherOperationalExpenses = null, + Object? operationalExpensesTotal = null, + Object? totalCost = null, + Object? netProfit = null, + }) { + return _then( + _$ExclusiveSummarySummaryImpl( + sales: null == sales + ? _value.sales + : sales // ignore: cast_nullable_to_non_nullable + as int, + hpp: null == hpp + ? _value.hpp + : hpp // ignore: cast_nullable_to_non_nullable + as int, + grossProfit: null == grossProfit + ? _value.grossProfit + : grossProfit // ignore: cast_nullable_to_non_nullable + as int, + salaryTotal: null == salaryTotal + ? _value.salaryTotal + : salaryTotal // ignore: cast_nullable_to_non_nullable + as int, + salaryDw: null == salaryDw + ? _value.salaryDw + : salaryDw // ignore: cast_nullable_to_non_nullable + as int, + salaryStaff: null == salaryStaff + ? _value.salaryStaff + : salaryStaff // ignore: cast_nullable_to_non_nullable + as int, + salaryOther: null == salaryOther + ? _value.salaryOther + : salaryOther // ignore: cast_nullable_to_non_nullable + as int, + otherOperationalExpenses: null == otherOperationalExpenses + ? _value.otherOperationalExpenses + : otherOperationalExpenses // ignore: cast_nullable_to_non_nullable + as int, + operationalExpensesTotal: null == operationalExpensesTotal + ? _value.operationalExpensesTotal + : operationalExpensesTotal // ignore: cast_nullable_to_non_nullable + as int, + totalCost: null == totalCost + ? _value.totalCost + : totalCost // ignore: cast_nullable_to_non_nullable + as int, + netProfit: null == netProfit + ? _value.netProfit + : netProfit // ignore: cast_nullable_to_non_nullable + as int, + ), + ); + } +} + +/// @nodoc + +class _$ExclusiveSummarySummaryImpl implements _ExclusiveSummarySummary { + const _$ExclusiveSummarySummaryImpl({ + required this.sales, + required this.hpp, + required this.grossProfit, + required this.salaryTotal, + required this.salaryDw, + required this.salaryStaff, + required this.salaryOther, + required this.otherOperationalExpenses, + required this.operationalExpensesTotal, + required this.totalCost, + required this.netProfit, + }); + + @override + final int sales; + @override + final int hpp; + @override + final int grossProfit; + @override + final int salaryTotal; + @override + final int salaryDw; + @override + final int salaryStaff; + @override + final int salaryOther; + @override + final int otherOperationalExpenses; + @override + final int operationalExpensesTotal; + @override + final int totalCost; + @override + final int netProfit; + + @override + String toString() { + return 'ExclusiveSummarySummary(sales: $sales, hpp: $hpp, grossProfit: $grossProfit, salaryTotal: $salaryTotal, salaryDw: $salaryDw, salaryStaff: $salaryStaff, salaryOther: $salaryOther, otherOperationalExpenses: $otherOperationalExpenses, operationalExpensesTotal: $operationalExpensesTotal, totalCost: $totalCost, netProfit: $netProfit)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ExclusiveSummarySummaryImpl && + (identical(other.sales, sales) || other.sales == sales) && + (identical(other.hpp, hpp) || other.hpp == hpp) && + (identical(other.grossProfit, grossProfit) || + other.grossProfit == grossProfit) && + (identical(other.salaryTotal, salaryTotal) || + other.salaryTotal == salaryTotal) && + (identical(other.salaryDw, salaryDw) || + other.salaryDw == salaryDw) && + (identical(other.salaryStaff, salaryStaff) || + other.salaryStaff == salaryStaff) && + (identical(other.salaryOther, salaryOther) || + other.salaryOther == salaryOther) && + (identical( + other.otherOperationalExpenses, + otherOperationalExpenses, + ) || + other.otherOperationalExpenses == otherOperationalExpenses) && + (identical( + other.operationalExpensesTotal, + operationalExpensesTotal, + ) || + other.operationalExpensesTotal == operationalExpensesTotal) && + (identical(other.totalCost, totalCost) || + other.totalCost == totalCost) && + (identical(other.netProfit, netProfit) || + other.netProfit == netProfit)); + } + + @override + int get hashCode => Object.hash( + runtimeType, + sales, + hpp, + grossProfit, + salaryTotal, + salaryDw, + salaryStaff, + salaryOther, + otherOperationalExpenses, + operationalExpensesTotal, + totalCost, + netProfit, + ); + + /// Create a copy of ExclusiveSummarySummary + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$ExclusiveSummarySummaryImplCopyWith<_$ExclusiveSummarySummaryImpl> + get copyWith => + __$$ExclusiveSummarySummaryImplCopyWithImpl< + _$ExclusiveSummarySummaryImpl + >(this, _$identity); +} + +abstract class _ExclusiveSummarySummary implements ExclusiveSummarySummary { + const factory _ExclusiveSummarySummary({ + required final int sales, + required final int hpp, + required final int grossProfit, + required final int salaryTotal, + required final int salaryDw, + required final int salaryStaff, + required final int salaryOther, + required final int otherOperationalExpenses, + required final int operationalExpensesTotal, + required final int totalCost, + required final int netProfit, + }) = _$ExclusiveSummarySummaryImpl; + + @override + int get sales; + @override + int get hpp; + @override + int get grossProfit; + @override + int get salaryTotal; + @override + int get salaryDw; + @override + int get salaryStaff; + @override + int get salaryOther; + @override + int get otherOperationalExpenses; + @override + int get operationalExpensesTotal; + @override + int get totalCost; + @override + int get netProfit; + + /// Create a copy of ExclusiveSummarySummary + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$ExclusiveSummarySummaryImplCopyWith<_$ExclusiveSummarySummaryImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +mixin _$ExclusiveSummaryReimburse { + int get totalCost => throw _privateConstructorUsedError; + int get excludedSalaryStaff => throw _privateConstructorUsedError; + int get totalReimburse => throw _privateConstructorUsedError; + + /// Create a copy of ExclusiveSummaryReimburse + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $ExclusiveSummaryReimburseCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $ExclusiveSummaryReimburseCopyWith<$Res> { + factory $ExclusiveSummaryReimburseCopyWith( + ExclusiveSummaryReimburse value, + $Res Function(ExclusiveSummaryReimburse) then, + ) = _$ExclusiveSummaryReimburseCopyWithImpl<$Res, ExclusiveSummaryReimburse>; + @useResult + $Res call({int totalCost, int excludedSalaryStaff, int totalReimburse}); +} + +/// @nodoc +class _$ExclusiveSummaryReimburseCopyWithImpl< + $Res, + $Val extends ExclusiveSummaryReimburse +> + implements $ExclusiveSummaryReimburseCopyWith<$Res> { + _$ExclusiveSummaryReimburseCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of ExclusiveSummaryReimburse + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? totalCost = null, + Object? excludedSalaryStaff = null, + Object? totalReimburse = null, + }) { + return _then( + _value.copyWith( + totalCost: null == totalCost + ? _value.totalCost + : totalCost // ignore: cast_nullable_to_non_nullable + as int, + excludedSalaryStaff: null == excludedSalaryStaff + ? _value.excludedSalaryStaff + : excludedSalaryStaff // ignore: cast_nullable_to_non_nullable + as int, + totalReimburse: null == totalReimburse + ? _value.totalReimburse + : totalReimburse // ignore: cast_nullable_to_non_nullable + as int, + ) + as $Val, + ); + } +} + +/// @nodoc +abstract class _$$ExclusiveSummaryReimburseImplCopyWith<$Res> + implements $ExclusiveSummaryReimburseCopyWith<$Res> { + factory _$$ExclusiveSummaryReimburseImplCopyWith( + _$ExclusiveSummaryReimburseImpl value, + $Res Function(_$ExclusiveSummaryReimburseImpl) then, + ) = __$$ExclusiveSummaryReimburseImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({int totalCost, int excludedSalaryStaff, int totalReimburse}); +} + +/// @nodoc +class __$$ExclusiveSummaryReimburseImplCopyWithImpl<$Res> + extends + _$ExclusiveSummaryReimburseCopyWithImpl< + $Res, + _$ExclusiveSummaryReimburseImpl + > + implements _$$ExclusiveSummaryReimburseImplCopyWith<$Res> { + __$$ExclusiveSummaryReimburseImplCopyWithImpl( + _$ExclusiveSummaryReimburseImpl _value, + $Res Function(_$ExclusiveSummaryReimburseImpl) _then, + ) : super(_value, _then); + + /// Create a copy of ExclusiveSummaryReimburse + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? totalCost = null, + Object? excludedSalaryStaff = null, + Object? totalReimburse = null, + }) { + return _then( + _$ExclusiveSummaryReimburseImpl( + totalCost: null == totalCost + ? _value.totalCost + : totalCost // ignore: cast_nullable_to_non_nullable + as int, + excludedSalaryStaff: null == excludedSalaryStaff + ? _value.excludedSalaryStaff + : excludedSalaryStaff // ignore: cast_nullable_to_non_nullable + as int, + totalReimburse: null == totalReimburse + ? _value.totalReimburse + : totalReimburse // ignore: cast_nullable_to_non_nullable + as int, + ), + ); + } +} + +/// @nodoc + +class _$ExclusiveSummaryReimburseImpl implements _ExclusiveSummaryReimburse { + const _$ExclusiveSummaryReimburseImpl({ + required this.totalCost, + required this.excludedSalaryStaff, + required this.totalReimburse, + }); + + @override + final int totalCost; + @override + final int excludedSalaryStaff; + @override + final int totalReimburse; + + @override + String toString() { + return 'ExclusiveSummaryReimburse(totalCost: $totalCost, excludedSalaryStaff: $excludedSalaryStaff, totalReimburse: $totalReimburse)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ExclusiveSummaryReimburseImpl && + (identical(other.totalCost, totalCost) || + other.totalCost == totalCost) && + (identical(other.excludedSalaryStaff, excludedSalaryStaff) || + other.excludedSalaryStaff == excludedSalaryStaff) && + (identical(other.totalReimburse, totalReimburse) || + other.totalReimburse == totalReimburse)); + } + + @override + int get hashCode => + Object.hash(runtimeType, totalCost, excludedSalaryStaff, totalReimburse); + + /// Create a copy of ExclusiveSummaryReimburse + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$ExclusiveSummaryReimburseImplCopyWith<_$ExclusiveSummaryReimburseImpl> + get copyWith => + __$$ExclusiveSummaryReimburseImplCopyWithImpl< + _$ExclusiveSummaryReimburseImpl + >(this, _$identity); +} + +abstract class _ExclusiveSummaryReimburse implements ExclusiveSummaryReimburse { + const factory _ExclusiveSummaryReimburse({ + required final int totalCost, + required final int excludedSalaryStaff, + required final int totalReimburse, + }) = _$ExclusiveSummaryReimburseImpl; + + @override + int get totalCost; + @override + int get excludedSalaryStaff; + @override + int get totalReimburse; + + /// Create a copy of ExclusiveSummaryReimburse + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$ExclusiveSummaryReimburseImplCopyWith<_$ExclusiveSummaryReimburseImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +mixin _$ExclusiveSummaryBreakdown { + String get categoryCode => throw _privateConstructorUsedError; + String get categoryName => throw _privateConstructorUsedError; + int get amount => throw _privateConstructorUsedError; + double get percentage => throw _privateConstructorUsedError; + + /// Create a copy of ExclusiveSummaryBreakdown + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $ExclusiveSummaryBreakdownCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $ExclusiveSummaryBreakdownCopyWith<$Res> { + factory $ExclusiveSummaryBreakdownCopyWith( + ExclusiveSummaryBreakdown value, + $Res Function(ExclusiveSummaryBreakdown) then, + ) = _$ExclusiveSummaryBreakdownCopyWithImpl<$Res, ExclusiveSummaryBreakdown>; + @useResult + $Res call({ + String categoryCode, + String categoryName, + int amount, + double percentage, + }); +} + +/// @nodoc +class _$ExclusiveSummaryBreakdownCopyWithImpl< + $Res, + $Val extends ExclusiveSummaryBreakdown +> + implements $ExclusiveSummaryBreakdownCopyWith<$Res> { + _$ExclusiveSummaryBreakdownCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of ExclusiveSummaryBreakdown + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? categoryCode = null, + Object? categoryName = null, + Object? amount = null, + Object? percentage = null, + }) { + return _then( + _value.copyWith( + categoryCode: null == categoryCode + ? _value.categoryCode + : categoryCode // ignore: cast_nullable_to_non_nullable + as String, + categoryName: null == categoryName + ? _value.categoryName + : categoryName // ignore: cast_nullable_to_non_nullable + as String, + amount: null == amount + ? _value.amount + : amount // ignore: cast_nullable_to_non_nullable + as int, + percentage: null == percentage + ? _value.percentage + : percentage // ignore: cast_nullable_to_non_nullable + as double, + ) + as $Val, + ); + } +} + +/// @nodoc +abstract class _$$ExclusiveSummaryBreakdownImplCopyWith<$Res> + implements $ExclusiveSummaryBreakdownCopyWith<$Res> { + factory _$$ExclusiveSummaryBreakdownImplCopyWith( + _$ExclusiveSummaryBreakdownImpl value, + $Res Function(_$ExclusiveSummaryBreakdownImpl) then, + ) = __$$ExclusiveSummaryBreakdownImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + String categoryCode, + String categoryName, + int amount, + double percentage, + }); +} + +/// @nodoc +class __$$ExclusiveSummaryBreakdownImplCopyWithImpl<$Res> + extends + _$ExclusiveSummaryBreakdownCopyWithImpl< + $Res, + _$ExclusiveSummaryBreakdownImpl + > + implements _$$ExclusiveSummaryBreakdownImplCopyWith<$Res> { + __$$ExclusiveSummaryBreakdownImplCopyWithImpl( + _$ExclusiveSummaryBreakdownImpl _value, + $Res Function(_$ExclusiveSummaryBreakdownImpl) _then, + ) : super(_value, _then); + + /// Create a copy of ExclusiveSummaryBreakdown + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? categoryCode = null, + Object? categoryName = null, + Object? amount = null, + Object? percentage = null, + }) { + return _then( + _$ExclusiveSummaryBreakdownImpl( + categoryCode: null == categoryCode + ? _value.categoryCode + : categoryCode // ignore: cast_nullable_to_non_nullable + as String, + categoryName: null == categoryName + ? _value.categoryName + : categoryName // ignore: cast_nullable_to_non_nullable + as String, + amount: null == amount + ? _value.amount + : amount // ignore: cast_nullable_to_non_nullable + as int, + percentage: null == percentage + ? _value.percentage + : percentage // ignore: cast_nullable_to_non_nullable + as double, + ), + ); + } +} + +/// @nodoc + +class _$ExclusiveSummaryBreakdownImpl implements _ExclusiveSummaryBreakdown { + const _$ExclusiveSummaryBreakdownImpl({ + required this.categoryCode, + required this.categoryName, + required this.amount, + required this.percentage, + }); + + @override + final String categoryCode; + @override + final String categoryName; + @override + final int amount; + @override + final double percentage; + + @override + String toString() { + return 'ExclusiveSummaryBreakdown(categoryCode: $categoryCode, categoryName: $categoryName, amount: $amount, percentage: $percentage)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ExclusiveSummaryBreakdownImpl && + (identical(other.categoryCode, categoryCode) || + other.categoryCode == categoryCode) && + (identical(other.categoryName, categoryName) || + other.categoryName == categoryName) && + (identical(other.amount, amount) || other.amount == amount) && + (identical(other.percentage, percentage) || + other.percentage == percentage)); + } + + @override + int get hashCode => + Object.hash(runtimeType, categoryCode, categoryName, amount, percentage); + + /// Create a copy of ExclusiveSummaryBreakdown + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$ExclusiveSummaryBreakdownImplCopyWith<_$ExclusiveSummaryBreakdownImpl> + get copyWith => + __$$ExclusiveSummaryBreakdownImplCopyWithImpl< + _$ExclusiveSummaryBreakdownImpl + >(this, _$identity); +} + +abstract class _ExclusiveSummaryBreakdown implements ExclusiveSummaryBreakdown { + const factory _ExclusiveSummaryBreakdown({ + required final String categoryCode, + required final String categoryName, + required final int amount, + required final double percentage, + }) = _$ExclusiveSummaryBreakdownImpl; + + @override + String get categoryCode; + @override + String get categoryName; + @override + int get amount; + @override + double get percentage; + + /// Create a copy of ExclusiveSummaryBreakdown + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$ExclusiveSummaryBreakdownImplCopyWith<_$ExclusiveSummaryBreakdownImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +mixin _$ExclusiveSummaryDaily { + DateTime get date => throw _privateConstructorUsedError; + int get transactionCount => throw _privateConstructorUsedError; + int get totalCost => throw _privateConstructorUsedError; + + /// Create a copy of ExclusiveSummaryDaily + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $ExclusiveSummaryDailyCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $ExclusiveSummaryDailyCopyWith<$Res> { + factory $ExclusiveSummaryDailyCopyWith( + ExclusiveSummaryDaily value, + $Res Function(ExclusiveSummaryDaily) then, + ) = _$ExclusiveSummaryDailyCopyWithImpl<$Res, ExclusiveSummaryDaily>; + @useResult + $Res call({DateTime date, int transactionCount, int totalCost}); +} + +/// @nodoc +class _$ExclusiveSummaryDailyCopyWithImpl< + $Res, + $Val extends ExclusiveSummaryDaily +> + implements $ExclusiveSummaryDailyCopyWith<$Res> { + _$ExclusiveSummaryDailyCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of ExclusiveSummaryDaily + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? date = null, + Object? transactionCount = null, + Object? totalCost = null, + }) { + return _then( + _value.copyWith( + date: null == date + ? _value.date + : date // ignore: cast_nullable_to_non_nullable + as DateTime, + transactionCount: null == transactionCount + ? _value.transactionCount + : transactionCount // ignore: cast_nullable_to_non_nullable + as int, + totalCost: null == totalCost + ? _value.totalCost + : totalCost // ignore: cast_nullable_to_non_nullable + as int, + ) + as $Val, + ); + } +} + +/// @nodoc +abstract class _$$ExclusiveSummaryDailyImplCopyWith<$Res> + implements $ExclusiveSummaryDailyCopyWith<$Res> { + factory _$$ExclusiveSummaryDailyImplCopyWith( + _$ExclusiveSummaryDailyImpl value, + $Res Function(_$ExclusiveSummaryDailyImpl) then, + ) = __$$ExclusiveSummaryDailyImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({DateTime date, int transactionCount, int totalCost}); +} + +/// @nodoc +class __$$ExclusiveSummaryDailyImplCopyWithImpl<$Res> + extends + _$ExclusiveSummaryDailyCopyWithImpl<$Res, _$ExclusiveSummaryDailyImpl> + implements _$$ExclusiveSummaryDailyImplCopyWith<$Res> { + __$$ExclusiveSummaryDailyImplCopyWithImpl( + _$ExclusiveSummaryDailyImpl _value, + $Res Function(_$ExclusiveSummaryDailyImpl) _then, + ) : super(_value, _then); + + /// Create a copy of ExclusiveSummaryDaily + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? date = null, + Object? transactionCount = null, + Object? totalCost = null, + }) { + return _then( + _$ExclusiveSummaryDailyImpl( + date: null == date + ? _value.date + : date // ignore: cast_nullable_to_non_nullable + as DateTime, + transactionCount: null == transactionCount + ? _value.transactionCount + : transactionCount // ignore: cast_nullable_to_non_nullable + as int, + totalCost: null == totalCost + ? _value.totalCost + : totalCost // ignore: cast_nullable_to_non_nullable + as int, + ), + ); + } +} + +/// @nodoc + +class _$ExclusiveSummaryDailyImpl implements _ExclusiveSummaryDaily { + const _$ExclusiveSummaryDailyImpl({ + required this.date, + required this.transactionCount, + required this.totalCost, + }); + + @override + final DateTime date; + @override + final int transactionCount; + @override + final int totalCost; + + @override + String toString() { + return 'ExclusiveSummaryDaily(date: $date, transactionCount: $transactionCount, totalCost: $totalCost)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ExclusiveSummaryDailyImpl && + (identical(other.date, date) || other.date == date) && + (identical(other.transactionCount, transactionCount) || + other.transactionCount == transactionCount) && + (identical(other.totalCost, totalCost) || + other.totalCost == totalCost)); + } + + @override + int get hashCode => + Object.hash(runtimeType, date, transactionCount, totalCost); + + /// Create a copy of ExclusiveSummaryDaily + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$ExclusiveSummaryDailyImplCopyWith<_$ExclusiveSummaryDailyImpl> + get copyWith => + __$$ExclusiveSummaryDailyImplCopyWithImpl<_$ExclusiveSummaryDailyImpl>( + this, + _$identity, + ); +} + +abstract class _ExclusiveSummaryDaily implements ExclusiveSummaryDaily { + const factory _ExclusiveSummaryDaily({ + required final DateTime date, + required final int transactionCount, + required final int totalCost, + }) = _$ExclusiveSummaryDailyImpl; + + @override + DateTime get date; + @override + int get transactionCount; + @override + int get totalCost; + + /// Create a copy of ExclusiveSummaryDaily + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$ExclusiveSummaryDailyImplCopyWith<_$ExclusiveSummaryDailyImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +mixin _$ExclusiveSummaryTransaction { + DateTime get date => throw _privateConstructorUsedError; + String get categoryCode => throw _privateConstructorUsedError; + String get categoryName => throw _privateConstructorUsedError; + String get description => throw _privateConstructorUsedError; + int get amount => throw _privateConstructorUsedError; + String get source => throw _privateConstructorUsedError; + + /// Create a copy of ExclusiveSummaryTransaction + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $ExclusiveSummaryTransactionCopyWith + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $ExclusiveSummaryTransactionCopyWith<$Res> { + factory $ExclusiveSummaryTransactionCopyWith( + ExclusiveSummaryTransaction value, + $Res Function(ExclusiveSummaryTransaction) then, + ) = + _$ExclusiveSummaryTransactionCopyWithImpl< + $Res, + ExclusiveSummaryTransaction + >; + @useResult + $Res call({ + DateTime date, + String categoryCode, + String categoryName, + String description, + int amount, + String source, + }); +} + +/// @nodoc +class _$ExclusiveSummaryTransactionCopyWithImpl< + $Res, + $Val extends ExclusiveSummaryTransaction +> + implements $ExclusiveSummaryTransactionCopyWith<$Res> { + _$ExclusiveSummaryTransactionCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of ExclusiveSummaryTransaction + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? date = null, + Object? categoryCode = null, + Object? categoryName = null, + Object? description = null, + Object? amount = null, + Object? source = null, + }) { + return _then( + _value.copyWith( + date: null == date + ? _value.date + : date // ignore: cast_nullable_to_non_nullable + as DateTime, + categoryCode: null == categoryCode + ? _value.categoryCode + : categoryCode // ignore: cast_nullable_to_non_nullable + as String, + categoryName: null == categoryName + ? _value.categoryName + : categoryName // ignore: cast_nullable_to_non_nullable + as String, + description: null == description + ? _value.description + : description // ignore: cast_nullable_to_non_nullable + as String, + amount: null == amount + ? _value.amount + : amount // ignore: cast_nullable_to_non_nullable + as int, + source: null == source + ? _value.source + : source // ignore: cast_nullable_to_non_nullable + as String, + ) + as $Val, + ); + } +} + +/// @nodoc +abstract class _$$ExclusiveSummaryTransactionImplCopyWith<$Res> + implements $ExclusiveSummaryTransactionCopyWith<$Res> { + factory _$$ExclusiveSummaryTransactionImplCopyWith( + _$ExclusiveSummaryTransactionImpl value, + $Res Function(_$ExclusiveSummaryTransactionImpl) then, + ) = __$$ExclusiveSummaryTransactionImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + DateTime date, + String categoryCode, + String categoryName, + String description, + int amount, + String source, + }); +} + +/// @nodoc +class __$$ExclusiveSummaryTransactionImplCopyWithImpl<$Res> + extends + _$ExclusiveSummaryTransactionCopyWithImpl< + $Res, + _$ExclusiveSummaryTransactionImpl + > + implements _$$ExclusiveSummaryTransactionImplCopyWith<$Res> { + __$$ExclusiveSummaryTransactionImplCopyWithImpl( + _$ExclusiveSummaryTransactionImpl _value, + $Res Function(_$ExclusiveSummaryTransactionImpl) _then, + ) : super(_value, _then); + + /// Create a copy of ExclusiveSummaryTransaction + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? date = null, + Object? categoryCode = null, + Object? categoryName = null, + Object? description = null, + Object? amount = null, + Object? source = null, + }) { + return _then( + _$ExclusiveSummaryTransactionImpl( + date: null == date + ? _value.date + : date // ignore: cast_nullable_to_non_nullable + as DateTime, + categoryCode: null == categoryCode + ? _value.categoryCode + : categoryCode // ignore: cast_nullable_to_non_nullable + as String, + categoryName: null == categoryName + ? _value.categoryName + : categoryName // ignore: cast_nullable_to_non_nullable + as String, + description: null == description + ? _value.description + : description // ignore: cast_nullable_to_non_nullable + as String, + amount: null == amount + ? _value.amount + : amount // ignore: cast_nullable_to_non_nullable + as int, + source: null == source + ? _value.source + : source // ignore: cast_nullable_to_non_nullable + as String, + ), + ); + } +} + +/// @nodoc + +class _$ExclusiveSummaryTransactionImpl + implements _ExclusiveSummaryTransaction { + const _$ExclusiveSummaryTransactionImpl({ + required this.date, + required this.categoryCode, + required this.categoryName, + required this.description, + required this.amount, + required this.source, + }); + + @override + final DateTime date; + @override + final String categoryCode; + @override + final String categoryName; + @override + final String description; + @override + final int amount; + @override + final String source; + + @override + String toString() { + return 'ExclusiveSummaryTransaction(date: $date, categoryCode: $categoryCode, categoryName: $categoryName, description: $description, amount: $amount, source: $source)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ExclusiveSummaryTransactionImpl && + (identical(other.date, date) || other.date == date) && + (identical(other.categoryCode, categoryCode) || + other.categoryCode == categoryCode) && + (identical(other.categoryName, categoryName) || + other.categoryName == categoryName) && + (identical(other.description, description) || + other.description == description) && + (identical(other.amount, amount) || other.amount == amount) && + (identical(other.source, source) || other.source == source)); + } + + @override + int get hashCode => Object.hash( + runtimeType, + date, + categoryCode, + categoryName, + description, + amount, + source, + ); + + /// Create a copy of ExclusiveSummaryTransaction + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$ExclusiveSummaryTransactionImplCopyWith<_$ExclusiveSummaryTransactionImpl> + get copyWith => + __$$ExclusiveSummaryTransactionImplCopyWithImpl< + _$ExclusiveSummaryTransactionImpl + >(this, _$identity); +} + +abstract class _ExclusiveSummaryTransaction + implements ExclusiveSummaryTransaction { + const factory _ExclusiveSummaryTransaction({ + required final DateTime date, + required final String categoryCode, + required final String categoryName, + required final String description, + required final int amount, + required final String source, + }) = _$ExclusiveSummaryTransactionImpl; + + @override + DateTime get date; + @override + String get categoryCode; + @override + String get categoryName; + @override + String get description; + @override + int get amount; + @override + String get source; + + /// Create a copy of ExclusiveSummaryTransaction + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$ExclusiveSummaryTransactionImplCopyWith<_$ExclusiveSummaryTransactionImpl> + get copyWith => throw _privateConstructorUsedError; +} + /// @nodoc mixin _$AnalyticFailure { @optionalTypeArgs diff --git a/lib/domain/analytic/entities/exclusive_summary_entity.dart b/lib/domain/analytic/entities/exclusive_summary_entity.dart new file mode 100644 index 0000000..e0cf1b6 --- /dev/null +++ b/lib/domain/analytic/entities/exclusive_summary_entity.dart @@ -0,0 +1,119 @@ +part of '../analytic.dart'; + +@freezed +class ExclusiveSummary with _$ExclusiveSummary { + const factory ExclusiveSummary({ + required String organizationId, + required String outletId, + required ExclusiveSummaryPeriod period, + required ExclusiveSummarySummary summary, + required ExclusiveSummaryReimburse reimburse, + required List hppBreakdown, + required List operationalExpenseBreakdown, + required List dailySummary, + required List dailyTransactions, + }) = _ExclusiveSummary; + + factory ExclusiveSummary.empty() => ExclusiveSummary( + organizationId: '', + outletId: '', + period: ExclusiveSummaryPeriod.empty(), + summary: ExclusiveSummarySummary.empty(), + reimburse: ExclusiveSummaryReimburse.empty(), + hppBreakdown: [], + operationalExpenseBreakdown: [], + dailySummary: [], + dailyTransactions: [], + ); +} + +@freezed +class ExclusiveSummaryPeriod with _$ExclusiveSummaryPeriod { + const factory ExclusiveSummaryPeriod({ + required DateTime dateFrom, + required DateTime dateTo, + }) = _ExclusiveSummaryPeriod; + + factory ExclusiveSummaryPeriod.empty() => ExclusiveSummaryPeriod( + dateFrom: DateTime.fromMillisecondsSinceEpoch(0), + dateTo: DateTime.fromMillisecondsSinceEpoch(0), + ); +} + +@freezed +class ExclusiveSummarySummary with _$ExclusiveSummarySummary { + const factory ExclusiveSummarySummary({ + required int sales, + required int hpp, + required int grossProfit, + required int salaryTotal, + required int salaryDw, + required int salaryStaff, + required int salaryOther, + required int otherOperationalExpenses, + required int operationalExpensesTotal, + required int totalCost, + required int netProfit, + }) = _ExclusiveSummarySummary; + + factory ExclusiveSummarySummary.empty() => const ExclusiveSummarySummary( + sales: 0, + hpp: 0, + grossProfit: 0, + salaryTotal: 0, + salaryDw: 0, + salaryStaff: 0, + salaryOther: 0, + otherOperationalExpenses: 0, + operationalExpensesTotal: 0, + totalCost: 0, + netProfit: 0, + ); +} + +@freezed +class ExclusiveSummaryReimburse with _$ExclusiveSummaryReimburse { + const factory ExclusiveSummaryReimburse({ + required int totalCost, + required int excludedSalaryStaff, + required int totalReimburse, + }) = _ExclusiveSummaryReimburse; + + factory ExclusiveSummaryReimburse.empty() => + const ExclusiveSummaryReimburse( + totalCost: 0, + excludedSalaryStaff: 0, + totalReimburse: 0, + ); +} + +@freezed +class ExclusiveSummaryBreakdown with _$ExclusiveSummaryBreakdown { + const factory ExclusiveSummaryBreakdown({ + required String categoryCode, + required String categoryName, + required int amount, + required double percentage, + }) = _ExclusiveSummaryBreakdown; +} + +@freezed +class ExclusiveSummaryDaily with _$ExclusiveSummaryDaily { + const factory ExclusiveSummaryDaily({ + required DateTime date, + required int transactionCount, + required int totalCost, + }) = _ExclusiveSummaryDaily; +} + +@freezed +class ExclusiveSummaryTransaction with _$ExclusiveSummaryTransaction { + const factory ExclusiveSummaryTransaction({ + required DateTime date, + required String categoryCode, + required String categoryName, + required String description, + required int amount, + required String source, + }) = _ExclusiveSummaryTransaction; +} diff --git a/lib/domain/analytic/repositories/i_analytic_repository.dart b/lib/domain/analytic/repositories/i_analytic_repository.dart index b2ae926..394575e 100644 --- a/lib/domain/analytic/repositories/i_analytic_repository.dart +++ b/lib/domain/analytic/repositories/i_analytic_repository.dart @@ -51,4 +51,10 @@ abstract class IAnalyticRepository { String? outletId, String groupBy = 'day', }); + + Future> getExclusiveSummary({ + required DateTime dateFrom, + required DateTime dateTo, + String? outletId, + }); } diff --git a/lib/infrastructure/analytic/analytic_dtos.dart b/lib/infrastructure/analytic/analytic_dtos.dart index bdf49d5..391eec1 100644 --- a/lib/infrastructure/analytic/analytic_dtos.dart +++ b/lib/infrastructure/analytic/analytic_dtos.dart @@ -13,3 +13,4 @@ part 'dto/dashboard_analytic_dto.dart'; part 'dto/product_analytic_dto.dart'; part 'dto/payment_method_analytic_dto.dart'; part 'dto/purchasing_analytic_dto.dart'; +part 'dto/exclusive_summary_dto.dart'; diff --git a/lib/infrastructure/analytic/analytic_dtos.freezed.dart b/lib/infrastructure/analytic/analytic_dtos.freezed.dart index 694d12d..83dfd1e 100644 --- a/lib/infrastructure/analytic/analytic_dtos.freezed.dart +++ b/lib/infrastructure/analytic/analytic_dtos.freezed.dart @@ -10160,3 +10160,2182 @@ abstract class _PurchasingVendorDataDto extends PurchasingVendorDataDto { _$$PurchasingVendorDataDtoImplCopyWith<_$PurchasingVendorDataDtoImpl> get copyWith => throw _privateConstructorUsedError; } + +ExclusiveSummaryDto _$ExclusiveSummaryDtoFromJson(Map json) { + return _ExclusiveSummaryDto.fromJson(json); +} + +/// @nodoc +mixin _$ExclusiveSummaryDto { + @JsonKey(name: 'organization_id') + String? get organizationId => throw _privateConstructorUsedError; + @JsonKey(name: 'outlet_id') + String? get outletId => throw _privateConstructorUsedError; + @JsonKey(name: 'period') + ExclusiveSummaryPeriodDto? get period => throw _privateConstructorUsedError; + @JsonKey(name: 'summary') + ExclusiveSummarySummaryDto? get summary => throw _privateConstructorUsedError; + @JsonKey(name: 'reimburse') + ExclusiveSummaryReimburseDto? get reimburse => + throw _privateConstructorUsedError; + @JsonKey(name: 'hpp_breakdown') + List? get hppBreakdown => + throw _privateConstructorUsedError; + @JsonKey(name: 'operational_expense_breakdown') + List? get operationalExpenseBreakdown => + throw _privateConstructorUsedError; + @JsonKey(name: 'daily_summary') + List? get dailySummary => + throw _privateConstructorUsedError; + @JsonKey(name: 'daily_transactions') + List? get dailyTransactions => + throw _privateConstructorUsedError; + + /// Serializes this ExclusiveSummaryDto to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of ExclusiveSummaryDto + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $ExclusiveSummaryDtoCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $ExclusiveSummaryDtoCopyWith<$Res> { + factory $ExclusiveSummaryDtoCopyWith( + ExclusiveSummaryDto value, + $Res Function(ExclusiveSummaryDto) then, + ) = _$ExclusiveSummaryDtoCopyWithImpl<$Res, ExclusiveSummaryDto>; + @useResult + $Res call({ + @JsonKey(name: 'organization_id') String? organizationId, + @JsonKey(name: 'outlet_id') String? outletId, + @JsonKey(name: 'period') ExclusiveSummaryPeriodDto? period, + @JsonKey(name: 'summary') ExclusiveSummarySummaryDto? summary, + @JsonKey(name: 'reimburse') ExclusiveSummaryReimburseDto? reimburse, + @JsonKey(name: 'hpp_breakdown') + List? hppBreakdown, + @JsonKey(name: 'operational_expense_breakdown') + List? operationalExpenseBreakdown, + @JsonKey(name: 'daily_summary') + List? dailySummary, + @JsonKey(name: 'daily_transactions') + List? dailyTransactions, + }); + + $ExclusiveSummaryPeriodDtoCopyWith<$Res>? get period; + $ExclusiveSummarySummaryDtoCopyWith<$Res>? get summary; + $ExclusiveSummaryReimburseDtoCopyWith<$Res>? get reimburse; +} + +/// @nodoc +class _$ExclusiveSummaryDtoCopyWithImpl<$Res, $Val extends ExclusiveSummaryDto> + implements $ExclusiveSummaryDtoCopyWith<$Res> { + _$ExclusiveSummaryDtoCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of ExclusiveSummaryDto + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? organizationId = freezed, + Object? outletId = freezed, + Object? period = freezed, + Object? summary = freezed, + Object? reimburse = freezed, + Object? hppBreakdown = freezed, + Object? operationalExpenseBreakdown = freezed, + Object? dailySummary = freezed, + Object? dailyTransactions = freezed, + }) { + return _then( + _value.copyWith( + organizationId: freezed == organizationId + ? _value.organizationId + : organizationId // ignore: cast_nullable_to_non_nullable + as String?, + outletId: freezed == outletId + ? _value.outletId + : outletId // ignore: cast_nullable_to_non_nullable + as String?, + period: freezed == period + ? _value.period + : period // ignore: cast_nullable_to_non_nullable + as ExclusiveSummaryPeriodDto?, + summary: freezed == summary + ? _value.summary + : summary // ignore: cast_nullable_to_non_nullable + as ExclusiveSummarySummaryDto?, + reimburse: freezed == reimburse + ? _value.reimburse + : reimburse // ignore: cast_nullable_to_non_nullable + as ExclusiveSummaryReimburseDto?, + hppBreakdown: freezed == hppBreakdown + ? _value.hppBreakdown + : hppBreakdown // ignore: cast_nullable_to_non_nullable + as List?, + operationalExpenseBreakdown: freezed == operationalExpenseBreakdown + ? _value.operationalExpenseBreakdown + : operationalExpenseBreakdown // ignore: cast_nullable_to_non_nullable + as List?, + dailySummary: freezed == dailySummary + ? _value.dailySummary + : dailySummary // ignore: cast_nullable_to_non_nullable + as List?, + dailyTransactions: freezed == dailyTransactions + ? _value.dailyTransactions + : dailyTransactions // ignore: cast_nullable_to_non_nullable + as List?, + ) + as $Val, + ); + } + + /// Create a copy of ExclusiveSummaryDto + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $ExclusiveSummaryPeriodDtoCopyWith<$Res>? get period { + if (_value.period == null) { + return null; + } + + return $ExclusiveSummaryPeriodDtoCopyWith<$Res>(_value.period!, (value) { + return _then(_value.copyWith(period: value) as $Val); + }); + } + + /// Create a copy of ExclusiveSummaryDto + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $ExclusiveSummarySummaryDtoCopyWith<$Res>? get summary { + if (_value.summary == null) { + return null; + } + + return $ExclusiveSummarySummaryDtoCopyWith<$Res>(_value.summary!, (value) { + return _then(_value.copyWith(summary: value) as $Val); + }); + } + + /// Create a copy of ExclusiveSummaryDto + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $ExclusiveSummaryReimburseDtoCopyWith<$Res>? get reimburse { + if (_value.reimburse == null) { + return null; + } + + return $ExclusiveSummaryReimburseDtoCopyWith<$Res>(_value.reimburse!, ( + value, + ) { + return _then(_value.copyWith(reimburse: value) as $Val); + }); + } +} + +/// @nodoc +abstract class _$$ExclusiveSummaryDtoImplCopyWith<$Res> + implements $ExclusiveSummaryDtoCopyWith<$Res> { + factory _$$ExclusiveSummaryDtoImplCopyWith( + _$ExclusiveSummaryDtoImpl value, + $Res Function(_$ExclusiveSummaryDtoImpl) then, + ) = __$$ExclusiveSummaryDtoImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + @JsonKey(name: 'organization_id') String? organizationId, + @JsonKey(name: 'outlet_id') String? outletId, + @JsonKey(name: 'period') ExclusiveSummaryPeriodDto? period, + @JsonKey(name: 'summary') ExclusiveSummarySummaryDto? summary, + @JsonKey(name: 'reimburse') ExclusiveSummaryReimburseDto? reimburse, + @JsonKey(name: 'hpp_breakdown') + List? hppBreakdown, + @JsonKey(name: 'operational_expense_breakdown') + List? operationalExpenseBreakdown, + @JsonKey(name: 'daily_summary') + List? dailySummary, + @JsonKey(name: 'daily_transactions') + List? dailyTransactions, + }); + + @override + $ExclusiveSummaryPeriodDtoCopyWith<$Res>? get period; + @override + $ExclusiveSummarySummaryDtoCopyWith<$Res>? get summary; + @override + $ExclusiveSummaryReimburseDtoCopyWith<$Res>? get reimburse; +} + +/// @nodoc +class __$$ExclusiveSummaryDtoImplCopyWithImpl<$Res> + extends _$ExclusiveSummaryDtoCopyWithImpl<$Res, _$ExclusiveSummaryDtoImpl> + implements _$$ExclusiveSummaryDtoImplCopyWith<$Res> { + __$$ExclusiveSummaryDtoImplCopyWithImpl( + _$ExclusiveSummaryDtoImpl _value, + $Res Function(_$ExclusiveSummaryDtoImpl) _then, + ) : super(_value, _then); + + /// Create a copy of ExclusiveSummaryDto + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? organizationId = freezed, + Object? outletId = freezed, + Object? period = freezed, + Object? summary = freezed, + Object? reimburse = freezed, + Object? hppBreakdown = freezed, + Object? operationalExpenseBreakdown = freezed, + Object? dailySummary = freezed, + Object? dailyTransactions = freezed, + }) { + return _then( + _$ExclusiveSummaryDtoImpl( + organizationId: freezed == organizationId + ? _value.organizationId + : organizationId // ignore: cast_nullable_to_non_nullable + as String?, + outletId: freezed == outletId + ? _value.outletId + : outletId // ignore: cast_nullable_to_non_nullable + as String?, + period: freezed == period + ? _value.period + : period // ignore: cast_nullable_to_non_nullable + as ExclusiveSummaryPeriodDto?, + summary: freezed == summary + ? _value.summary + : summary // ignore: cast_nullable_to_non_nullable + as ExclusiveSummarySummaryDto?, + reimburse: freezed == reimburse + ? _value.reimburse + : reimburse // ignore: cast_nullable_to_non_nullable + as ExclusiveSummaryReimburseDto?, + hppBreakdown: freezed == hppBreakdown + ? _value._hppBreakdown + : hppBreakdown // ignore: cast_nullable_to_non_nullable + as List?, + operationalExpenseBreakdown: freezed == operationalExpenseBreakdown + ? _value._operationalExpenseBreakdown + : operationalExpenseBreakdown // ignore: cast_nullable_to_non_nullable + as List?, + dailySummary: freezed == dailySummary + ? _value._dailySummary + : dailySummary // ignore: cast_nullable_to_non_nullable + as List?, + dailyTransactions: freezed == dailyTransactions + ? _value._dailyTransactions + : dailyTransactions // ignore: cast_nullable_to_non_nullable + as List?, + ), + ); + } +} + +/// @nodoc +@JsonSerializable() +class _$ExclusiveSummaryDtoImpl extends _ExclusiveSummaryDto { + const _$ExclusiveSummaryDtoImpl({ + @JsonKey(name: 'organization_id') this.organizationId, + @JsonKey(name: 'outlet_id') this.outletId, + @JsonKey(name: 'period') this.period, + @JsonKey(name: 'summary') this.summary, + @JsonKey(name: 'reimburse') this.reimburse, + @JsonKey(name: 'hpp_breakdown') + final List? hppBreakdown, + @JsonKey(name: 'operational_expense_breakdown') + final List? operationalExpenseBreakdown, + @JsonKey(name: 'daily_summary') + final List? dailySummary, + @JsonKey(name: 'daily_transactions') + final List? dailyTransactions, + }) : _hppBreakdown = hppBreakdown, + _operationalExpenseBreakdown = operationalExpenseBreakdown, + _dailySummary = dailySummary, + _dailyTransactions = dailyTransactions, + super._(); + + factory _$ExclusiveSummaryDtoImpl.fromJson(Map json) => + _$$ExclusiveSummaryDtoImplFromJson(json); + + @override + @JsonKey(name: 'organization_id') + final String? organizationId; + @override + @JsonKey(name: 'outlet_id') + final String? outletId; + @override + @JsonKey(name: 'period') + final ExclusiveSummaryPeriodDto? period; + @override + @JsonKey(name: 'summary') + final ExclusiveSummarySummaryDto? summary; + @override + @JsonKey(name: 'reimburse') + final ExclusiveSummaryReimburseDto? reimburse; + final List? _hppBreakdown; + @override + @JsonKey(name: 'hpp_breakdown') + List? get hppBreakdown { + final value = _hppBreakdown; + if (value == null) return null; + if (_hppBreakdown is EqualUnmodifiableListView) return _hppBreakdown; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); + } + + final List? _operationalExpenseBreakdown; + @override + @JsonKey(name: 'operational_expense_breakdown') + List? get operationalExpenseBreakdown { + final value = _operationalExpenseBreakdown; + if (value == null) return null; + if (_operationalExpenseBreakdown is EqualUnmodifiableListView) + return _operationalExpenseBreakdown; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); + } + + final List? _dailySummary; + @override + @JsonKey(name: 'daily_summary') + List? get dailySummary { + final value = _dailySummary; + if (value == null) return null; + if (_dailySummary is EqualUnmodifiableListView) return _dailySummary; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); + } + + final List? _dailyTransactions; + @override + @JsonKey(name: 'daily_transactions') + List? get dailyTransactions { + final value = _dailyTransactions; + if (value == null) return null; + if (_dailyTransactions is EqualUnmodifiableListView) + return _dailyTransactions; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); + } + + @override + String toString() { + return 'ExclusiveSummaryDto(organizationId: $organizationId, outletId: $outletId, period: $period, summary: $summary, reimburse: $reimburse, hppBreakdown: $hppBreakdown, operationalExpenseBreakdown: $operationalExpenseBreakdown, dailySummary: $dailySummary, dailyTransactions: $dailyTransactions)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ExclusiveSummaryDtoImpl && + (identical(other.organizationId, organizationId) || + other.organizationId == organizationId) && + (identical(other.outletId, outletId) || + other.outletId == outletId) && + (identical(other.period, period) || other.period == period) && + (identical(other.summary, summary) || other.summary == summary) && + (identical(other.reimburse, reimburse) || + other.reimburse == reimburse) && + const DeepCollectionEquality().equals( + other._hppBreakdown, + _hppBreakdown, + ) && + const DeepCollectionEquality().equals( + other._operationalExpenseBreakdown, + _operationalExpenseBreakdown, + ) && + const DeepCollectionEquality().equals( + other._dailySummary, + _dailySummary, + ) && + const DeepCollectionEquality().equals( + other._dailyTransactions, + _dailyTransactions, + )); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + organizationId, + outletId, + period, + summary, + reimburse, + const DeepCollectionEquality().hash(_hppBreakdown), + const DeepCollectionEquality().hash(_operationalExpenseBreakdown), + const DeepCollectionEquality().hash(_dailySummary), + const DeepCollectionEquality().hash(_dailyTransactions), + ); + + /// Create a copy of ExclusiveSummaryDto + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$ExclusiveSummaryDtoImplCopyWith<_$ExclusiveSummaryDtoImpl> get copyWith => + __$$ExclusiveSummaryDtoImplCopyWithImpl<_$ExclusiveSummaryDtoImpl>( + this, + _$identity, + ); + + @override + Map toJson() { + return _$$ExclusiveSummaryDtoImplToJson(this); + } +} + +abstract class _ExclusiveSummaryDto extends ExclusiveSummaryDto { + const factory _ExclusiveSummaryDto({ + @JsonKey(name: 'organization_id') final String? organizationId, + @JsonKey(name: 'outlet_id') final String? outletId, + @JsonKey(name: 'period') final ExclusiveSummaryPeriodDto? period, + @JsonKey(name: 'summary') final ExclusiveSummarySummaryDto? summary, + @JsonKey(name: 'reimburse') final ExclusiveSummaryReimburseDto? reimburse, + @JsonKey(name: 'hpp_breakdown') + final List? hppBreakdown, + @JsonKey(name: 'operational_expense_breakdown') + final List? operationalExpenseBreakdown, + @JsonKey(name: 'daily_summary') + final List? dailySummary, + @JsonKey(name: 'daily_transactions') + final List? dailyTransactions, + }) = _$ExclusiveSummaryDtoImpl; + const _ExclusiveSummaryDto._() : super._(); + + factory _ExclusiveSummaryDto.fromJson(Map json) = + _$ExclusiveSummaryDtoImpl.fromJson; + + @override + @JsonKey(name: 'organization_id') + String? get organizationId; + @override + @JsonKey(name: 'outlet_id') + String? get outletId; + @override + @JsonKey(name: 'period') + ExclusiveSummaryPeriodDto? get period; + @override + @JsonKey(name: 'summary') + ExclusiveSummarySummaryDto? get summary; + @override + @JsonKey(name: 'reimburse') + ExclusiveSummaryReimburseDto? get reimburse; + @override + @JsonKey(name: 'hpp_breakdown') + List? get hppBreakdown; + @override + @JsonKey(name: 'operational_expense_breakdown') + List? get operationalExpenseBreakdown; + @override + @JsonKey(name: 'daily_summary') + List? get dailySummary; + @override + @JsonKey(name: 'daily_transactions') + List? get dailyTransactions; + + /// Create a copy of ExclusiveSummaryDto + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$ExclusiveSummaryDtoImplCopyWith<_$ExclusiveSummaryDtoImpl> get copyWith => + throw _privateConstructorUsedError; +} + +ExclusiveSummaryPeriodDto _$ExclusiveSummaryPeriodDtoFromJson( + Map json, +) { + return _ExclusiveSummaryPeriodDto.fromJson(json); +} + +/// @nodoc +mixin _$ExclusiveSummaryPeriodDto { + @JsonKey(name: 'date_from') + DateTime? get dateFrom => throw _privateConstructorUsedError; + @JsonKey(name: 'date_to') + DateTime? get dateTo => throw _privateConstructorUsedError; + + /// Serializes this ExclusiveSummaryPeriodDto to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of ExclusiveSummaryPeriodDto + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $ExclusiveSummaryPeriodDtoCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $ExclusiveSummaryPeriodDtoCopyWith<$Res> { + factory $ExclusiveSummaryPeriodDtoCopyWith( + ExclusiveSummaryPeriodDto value, + $Res Function(ExclusiveSummaryPeriodDto) then, + ) = _$ExclusiveSummaryPeriodDtoCopyWithImpl<$Res, ExclusiveSummaryPeriodDto>; + @useResult + $Res call({ + @JsonKey(name: 'date_from') DateTime? dateFrom, + @JsonKey(name: 'date_to') DateTime? dateTo, + }); +} + +/// @nodoc +class _$ExclusiveSummaryPeriodDtoCopyWithImpl< + $Res, + $Val extends ExclusiveSummaryPeriodDto +> + implements $ExclusiveSummaryPeriodDtoCopyWith<$Res> { + _$ExclusiveSummaryPeriodDtoCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of ExclusiveSummaryPeriodDto + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({Object? dateFrom = freezed, Object? dateTo = freezed}) { + return _then( + _value.copyWith( + dateFrom: freezed == dateFrom + ? _value.dateFrom + : dateFrom // ignore: cast_nullable_to_non_nullable + as DateTime?, + dateTo: freezed == dateTo + ? _value.dateTo + : dateTo // ignore: cast_nullable_to_non_nullable + as DateTime?, + ) + as $Val, + ); + } +} + +/// @nodoc +abstract class _$$ExclusiveSummaryPeriodDtoImplCopyWith<$Res> + implements $ExclusiveSummaryPeriodDtoCopyWith<$Res> { + factory _$$ExclusiveSummaryPeriodDtoImplCopyWith( + _$ExclusiveSummaryPeriodDtoImpl value, + $Res Function(_$ExclusiveSummaryPeriodDtoImpl) then, + ) = __$$ExclusiveSummaryPeriodDtoImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + @JsonKey(name: 'date_from') DateTime? dateFrom, + @JsonKey(name: 'date_to') DateTime? dateTo, + }); +} + +/// @nodoc +class __$$ExclusiveSummaryPeriodDtoImplCopyWithImpl<$Res> + extends + _$ExclusiveSummaryPeriodDtoCopyWithImpl< + $Res, + _$ExclusiveSummaryPeriodDtoImpl + > + implements _$$ExclusiveSummaryPeriodDtoImplCopyWith<$Res> { + __$$ExclusiveSummaryPeriodDtoImplCopyWithImpl( + _$ExclusiveSummaryPeriodDtoImpl _value, + $Res Function(_$ExclusiveSummaryPeriodDtoImpl) _then, + ) : super(_value, _then); + + /// Create a copy of ExclusiveSummaryPeriodDto + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({Object? dateFrom = freezed, Object? dateTo = freezed}) { + return _then( + _$ExclusiveSummaryPeriodDtoImpl( + dateFrom: freezed == dateFrom + ? _value.dateFrom + : dateFrom // ignore: cast_nullable_to_non_nullable + as DateTime?, + dateTo: freezed == dateTo + ? _value.dateTo + : dateTo // ignore: cast_nullable_to_non_nullable + as DateTime?, + ), + ); + } +} + +/// @nodoc +@JsonSerializable() +class _$ExclusiveSummaryPeriodDtoImpl extends _ExclusiveSummaryPeriodDto { + const _$ExclusiveSummaryPeriodDtoImpl({ + @JsonKey(name: 'date_from') this.dateFrom, + @JsonKey(name: 'date_to') this.dateTo, + }) : super._(); + + factory _$ExclusiveSummaryPeriodDtoImpl.fromJson(Map json) => + _$$ExclusiveSummaryPeriodDtoImplFromJson(json); + + @override + @JsonKey(name: 'date_from') + final DateTime? dateFrom; + @override + @JsonKey(name: 'date_to') + final DateTime? dateTo; + + @override + String toString() { + return 'ExclusiveSummaryPeriodDto(dateFrom: $dateFrom, dateTo: $dateTo)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ExclusiveSummaryPeriodDtoImpl && + (identical(other.dateFrom, dateFrom) || + other.dateFrom == dateFrom) && + (identical(other.dateTo, dateTo) || other.dateTo == dateTo)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, dateFrom, dateTo); + + /// Create a copy of ExclusiveSummaryPeriodDto + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$ExclusiveSummaryPeriodDtoImplCopyWith<_$ExclusiveSummaryPeriodDtoImpl> + get copyWith => + __$$ExclusiveSummaryPeriodDtoImplCopyWithImpl< + _$ExclusiveSummaryPeriodDtoImpl + >(this, _$identity); + + @override + Map toJson() { + return _$$ExclusiveSummaryPeriodDtoImplToJson(this); + } +} + +abstract class _ExclusiveSummaryPeriodDto extends ExclusiveSummaryPeriodDto { + const factory _ExclusiveSummaryPeriodDto({ + @JsonKey(name: 'date_from') final DateTime? dateFrom, + @JsonKey(name: 'date_to') final DateTime? dateTo, + }) = _$ExclusiveSummaryPeriodDtoImpl; + const _ExclusiveSummaryPeriodDto._() : super._(); + + factory _ExclusiveSummaryPeriodDto.fromJson(Map json) = + _$ExclusiveSummaryPeriodDtoImpl.fromJson; + + @override + @JsonKey(name: 'date_from') + DateTime? get dateFrom; + @override + @JsonKey(name: 'date_to') + DateTime? get dateTo; + + /// Create a copy of ExclusiveSummaryPeriodDto + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$ExclusiveSummaryPeriodDtoImplCopyWith<_$ExclusiveSummaryPeriodDtoImpl> + get copyWith => throw _privateConstructorUsedError; +} + +ExclusiveSummarySummaryDto _$ExclusiveSummarySummaryDtoFromJson( + Map json, +) { + return _ExclusiveSummarySummaryDto.fromJson(json); +} + +/// @nodoc +mixin _$ExclusiveSummarySummaryDto { + @JsonKey(name: 'sales') + num? get sales => throw _privateConstructorUsedError; + @JsonKey(name: 'hpp') + num? get hpp => throw _privateConstructorUsedError; + @JsonKey(name: 'gross_profit') + num? get grossProfit => throw _privateConstructorUsedError; + @JsonKey(name: 'salary_total') + num? get salaryTotal => throw _privateConstructorUsedError; + @JsonKey(name: 'salary_dw') + num? get salaryDw => throw _privateConstructorUsedError; + @JsonKey(name: 'salary_staff') + num? get salaryStaff => throw _privateConstructorUsedError; + @JsonKey(name: 'salary_other') + num? get salaryOther => throw _privateConstructorUsedError; + @JsonKey(name: 'other_operational_expenses') + num? get otherOperationalExpenses => throw _privateConstructorUsedError; + @JsonKey(name: 'operational_expenses_total') + num? get operationalExpensesTotal => throw _privateConstructorUsedError; + @JsonKey(name: 'total_cost') + num? get totalCost => throw _privateConstructorUsedError; + @JsonKey(name: 'net_profit') + num? get netProfit => throw _privateConstructorUsedError; + + /// Serializes this ExclusiveSummarySummaryDto to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of ExclusiveSummarySummaryDto + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $ExclusiveSummarySummaryDtoCopyWith + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $ExclusiveSummarySummaryDtoCopyWith<$Res> { + factory $ExclusiveSummarySummaryDtoCopyWith( + ExclusiveSummarySummaryDto value, + $Res Function(ExclusiveSummarySummaryDto) then, + ) = + _$ExclusiveSummarySummaryDtoCopyWithImpl< + $Res, + ExclusiveSummarySummaryDto + >; + @useResult + $Res call({ + @JsonKey(name: 'sales') num? sales, + @JsonKey(name: 'hpp') num? hpp, + @JsonKey(name: 'gross_profit') num? grossProfit, + @JsonKey(name: 'salary_total') num? salaryTotal, + @JsonKey(name: 'salary_dw') num? salaryDw, + @JsonKey(name: 'salary_staff') num? salaryStaff, + @JsonKey(name: 'salary_other') num? salaryOther, + @JsonKey(name: 'other_operational_expenses') num? otherOperationalExpenses, + @JsonKey(name: 'operational_expenses_total') num? operationalExpensesTotal, + @JsonKey(name: 'total_cost') num? totalCost, + @JsonKey(name: 'net_profit') num? netProfit, + }); +} + +/// @nodoc +class _$ExclusiveSummarySummaryDtoCopyWithImpl< + $Res, + $Val extends ExclusiveSummarySummaryDto +> + implements $ExclusiveSummarySummaryDtoCopyWith<$Res> { + _$ExclusiveSummarySummaryDtoCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of ExclusiveSummarySummaryDto + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? sales = freezed, + Object? hpp = freezed, + Object? grossProfit = freezed, + Object? salaryTotal = freezed, + Object? salaryDw = freezed, + Object? salaryStaff = freezed, + Object? salaryOther = freezed, + Object? otherOperationalExpenses = freezed, + Object? operationalExpensesTotal = freezed, + Object? totalCost = freezed, + Object? netProfit = freezed, + }) { + return _then( + _value.copyWith( + sales: freezed == sales + ? _value.sales + : sales // ignore: cast_nullable_to_non_nullable + as num?, + hpp: freezed == hpp + ? _value.hpp + : hpp // ignore: cast_nullable_to_non_nullable + as num?, + grossProfit: freezed == grossProfit + ? _value.grossProfit + : grossProfit // ignore: cast_nullable_to_non_nullable + as num?, + salaryTotal: freezed == salaryTotal + ? _value.salaryTotal + : salaryTotal // ignore: cast_nullable_to_non_nullable + as num?, + salaryDw: freezed == salaryDw + ? _value.salaryDw + : salaryDw // ignore: cast_nullable_to_non_nullable + as num?, + salaryStaff: freezed == salaryStaff + ? _value.salaryStaff + : salaryStaff // ignore: cast_nullable_to_non_nullable + as num?, + salaryOther: freezed == salaryOther + ? _value.salaryOther + : salaryOther // ignore: cast_nullable_to_non_nullable + as num?, + otherOperationalExpenses: freezed == otherOperationalExpenses + ? _value.otherOperationalExpenses + : otherOperationalExpenses // ignore: cast_nullable_to_non_nullable + as num?, + operationalExpensesTotal: freezed == operationalExpensesTotal + ? _value.operationalExpensesTotal + : operationalExpensesTotal // ignore: cast_nullable_to_non_nullable + as num?, + totalCost: freezed == totalCost + ? _value.totalCost + : totalCost // ignore: cast_nullable_to_non_nullable + as num?, + netProfit: freezed == netProfit + ? _value.netProfit + : netProfit // ignore: cast_nullable_to_non_nullable + as num?, + ) + as $Val, + ); + } +} + +/// @nodoc +abstract class _$$ExclusiveSummarySummaryDtoImplCopyWith<$Res> + implements $ExclusiveSummarySummaryDtoCopyWith<$Res> { + factory _$$ExclusiveSummarySummaryDtoImplCopyWith( + _$ExclusiveSummarySummaryDtoImpl value, + $Res Function(_$ExclusiveSummarySummaryDtoImpl) then, + ) = __$$ExclusiveSummarySummaryDtoImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + @JsonKey(name: 'sales') num? sales, + @JsonKey(name: 'hpp') num? hpp, + @JsonKey(name: 'gross_profit') num? grossProfit, + @JsonKey(name: 'salary_total') num? salaryTotal, + @JsonKey(name: 'salary_dw') num? salaryDw, + @JsonKey(name: 'salary_staff') num? salaryStaff, + @JsonKey(name: 'salary_other') num? salaryOther, + @JsonKey(name: 'other_operational_expenses') num? otherOperationalExpenses, + @JsonKey(name: 'operational_expenses_total') num? operationalExpensesTotal, + @JsonKey(name: 'total_cost') num? totalCost, + @JsonKey(name: 'net_profit') num? netProfit, + }); +} + +/// @nodoc +class __$$ExclusiveSummarySummaryDtoImplCopyWithImpl<$Res> + extends + _$ExclusiveSummarySummaryDtoCopyWithImpl< + $Res, + _$ExclusiveSummarySummaryDtoImpl + > + implements _$$ExclusiveSummarySummaryDtoImplCopyWith<$Res> { + __$$ExclusiveSummarySummaryDtoImplCopyWithImpl( + _$ExclusiveSummarySummaryDtoImpl _value, + $Res Function(_$ExclusiveSummarySummaryDtoImpl) _then, + ) : super(_value, _then); + + /// Create a copy of ExclusiveSummarySummaryDto + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? sales = freezed, + Object? hpp = freezed, + Object? grossProfit = freezed, + Object? salaryTotal = freezed, + Object? salaryDw = freezed, + Object? salaryStaff = freezed, + Object? salaryOther = freezed, + Object? otherOperationalExpenses = freezed, + Object? operationalExpensesTotal = freezed, + Object? totalCost = freezed, + Object? netProfit = freezed, + }) { + return _then( + _$ExclusiveSummarySummaryDtoImpl( + sales: freezed == sales + ? _value.sales + : sales // ignore: cast_nullable_to_non_nullable + as num?, + hpp: freezed == hpp + ? _value.hpp + : hpp // ignore: cast_nullable_to_non_nullable + as num?, + grossProfit: freezed == grossProfit + ? _value.grossProfit + : grossProfit // ignore: cast_nullable_to_non_nullable + as num?, + salaryTotal: freezed == salaryTotal + ? _value.salaryTotal + : salaryTotal // ignore: cast_nullable_to_non_nullable + as num?, + salaryDw: freezed == salaryDw + ? _value.salaryDw + : salaryDw // ignore: cast_nullable_to_non_nullable + as num?, + salaryStaff: freezed == salaryStaff + ? _value.salaryStaff + : salaryStaff // ignore: cast_nullable_to_non_nullable + as num?, + salaryOther: freezed == salaryOther + ? _value.salaryOther + : salaryOther // ignore: cast_nullable_to_non_nullable + as num?, + otherOperationalExpenses: freezed == otherOperationalExpenses + ? _value.otherOperationalExpenses + : otherOperationalExpenses // ignore: cast_nullable_to_non_nullable + as num?, + operationalExpensesTotal: freezed == operationalExpensesTotal + ? _value.operationalExpensesTotal + : operationalExpensesTotal // ignore: cast_nullable_to_non_nullable + as num?, + totalCost: freezed == totalCost + ? _value.totalCost + : totalCost // ignore: cast_nullable_to_non_nullable + as num?, + netProfit: freezed == netProfit + ? _value.netProfit + : netProfit // ignore: cast_nullable_to_non_nullable + as num?, + ), + ); + } +} + +/// @nodoc +@JsonSerializable() +class _$ExclusiveSummarySummaryDtoImpl extends _ExclusiveSummarySummaryDto { + const _$ExclusiveSummarySummaryDtoImpl({ + @JsonKey(name: 'sales') this.sales, + @JsonKey(name: 'hpp') this.hpp, + @JsonKey(name: 'gross_profit') this.grossProfit, + @JsonKey(name: 'salary_total') this.salaryTotal, + @JsonKey(name: 'salary_dw') this.salaryDw, + @JsonKey(name: 'salary_staff') this.salaryStaff, + @JsonKey(name: 'salary_other') this.salaryOther, + @JsonKey(name: 'other_operational_expenses') this.otherOperationalExpenses, + @JsonKey(name: 'operational_expenses_total') this.operationalExpensesTotal, + @JsonKey(name: 'total_cost') this.totalCost, + @JsonKey(name: 'net_profit') this.netProfit, + }) : super._(); + + factory _$ExclusiveSummarySummaryDtoImpl.fromJson( + Map json, + ) => _$$ExclusiveSummarySummaryDtoImplFromJson(json); + + @override + @JsonKey(name: 'sales') + final num? sales; + @override + @JsonKey(name: 'hpp') + final num? hpp; + @override + @JsonKey(name: 'gross_profit') + final num? grossProfit; + @override + @JsonKey(name: 'salary_total') + final num? salaryTotal; + @override + @JsonKey(name: 'salary_dw') + final num? salaryDw; + @override + @JsonKey(name: 'salary_staff') + final num? salaryStaff; + @override + @JsonKey(name: 'salary_other') + final num? salaryOther; + @override + @JsonKey(name: 'other_operational_expenses') + final num? otherOperationalExpenses; + @override + @JsonKey(name: 'operational_expenses_total') + final num? operationalExpensesTotal; + @override + @JsonKey(name: 'total_cost') + final num? totalCost; + @override + @JsonKey(name: 'net_profit') + final num? netProfit; + + @override + String toString() { + return 'ExclusiveSummarySummaryDto(sales: $sales, hpp: $hpp, grossProfit: $grossProfit, salaryTotal: $salaryTotal, salaryDw: $salaryDw, salaryStaff: $salaryStaff, salaryOther: $salaryOther, otherOperationalExpenses: $otherOperationalExpenses, operationalExpensesTotal: $operationalExpensesTotal, totalCost: $totalCost, netProfit: $netProfit)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ExclusiveSummarySummaryDtoImpl && + (identical(other.sales, sales) || other.sales == sales) && + (identical(other.hpp, hpp) || other.hpp == hpp) && + (identical(other.grossProfit, grossProfit) || + other.grossProfit == grossProfit) && + (identical(other.salaryTotal, salaryTotal) || + other.salaryTotal == salaryTotal) && + (identical(other.salaryDw, salaryDw) || + other.salaryDw == salaryDw) && + (identical(other.salaryStaff, salaryStaff) || + other.salaryStaff == salaryStaff) && + (identical(other.salaryOther, salaryOther) || + other.salaryOther == salaryOther) && + (identical( + other.otherOperationalExpenses, + otherOperationalExpenses, + ) || + other.otherOperationalExpenses == otherOperationalExpenses) && + (identical( + other.operationalExpensesTotal, + operationalExpensesTotal, + ) || + other.operationalExpensesTotal == operationalExpensesTotal) && + (identical(other.totalCost, totalCost) || + other.totalCost == totalCost) && + (identical(other.netProfit, netProfit) || + other.netProfit == netProfit)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + sales, + hpp, + grossProfit, + salaryTotal, + salaryDw, + salaryStaff, + salaryOther, + otherOperationalExpenses, + operationalExpensesTotal, + totalCost, + netProfit, + ); + + /// Create a copy of ExclusiveSummarySummaryDto + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$ExclusiveSummarySummaryDtoImplCopyWith<_$ExclusiveSummarySummaryDtoImpl> + get copyWith => + __$$ExclusiveSummarySummaryDtoImplCopyWithImpl< + _$ExclusiveSummarySummaryDtoImpl + >(this, _$identity); + + @override + Map toJson() { + return _$$ExclusiveSummarySummaryDtoImplToJson(this); + } +} + +abstract class _ExclusiveSummarySummaryDto extends ExclusiveSummarySummaryDto { + const factory _ExclusiveSummarySummaryDto({ + @JsonKey(name: 'sales') final num? sales, + @JsonKey(name: 'hpp') final num? hpp, + @JsonKey(name: 'gross_profit') final num? grossProfit, + @JsonKey(name: 'salary_total') final num? salaryTotal, + @JsonKey(name: 'salary_dw') final num? salaryDw, + @JsonKey(name: 'salary_staff') final num? salaryStaff, + @JsonKey(name: 'salary_other') final num? salaryOther, + @JsonKey(name: 'other_operational_expenses') + final num? otherOperationalExpenses, + @JsonKey(name: 'operational_expenses_total') + final num? operationalExpensesTotal, + @JsonKey(name: 'total_cost') final num? totalCost, + @JsonKey(name: 'net_profit') final num? netProfit, + }) = _$ExclusiveSummarySummaryDtoImpl; + const _ExclusiveSummarySummaryDto._() : super._(); + + factory _ExclusiveSummarySummaryDto.fromJson(Map json) = + _$ExclusiveSummarySummaryDtoImpl.fromJson; + + @override + @JsonKey(name: 'sales') + num? get sales; + @override + @JsonKey(name: 'hpp') + num? get hpp; + @override + @JsonKey(name: 'gross_profit') + num? get grossProfit; + @override + @JsonKey(name: 'salary_total') + num? get salaryTotal; + @override + @JsonKey(name: 'salary_dw') + num? get salaryDw; + @override + @JsonKey(name: 'salary_staff') + num? get salaryStaff; + @override + @JsonKey(name: 'salary_other') + num? get salaryOther; + @override + @JsonKey(name: 'other_operational_expenses') + num? get otherOperationalExpenses; + @override + @JsonKey(name: 'operational_expenses_total') + num? get operationalExpensesTotal; + @override + @JsonKey(name: 'total_cost') + num? get totalCost; + @override + @JsonKey(name: 'net_profit') + num? get netProfit; + + /// Create a copy of ExclusiveSummarySummaryDto + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$ExclusiveSummarySummaryDtoImplCopyWith<_$ExclusiveSummarySummaryDtoImpl> + get copyWith => throw _privateConstructorUsedError; +} + +ExclusiveSummaryReimburseDto _$ExclusiveSummaryReimburseDtoFromJson( + Map json, +) { + return _ExclusiveSummaryReimburseDto.fromJson(json); +} + +/// @nodoc +mixin _$ExclusiveSummaryReimburseDto { + @JsonKey(name: 'total_cost') + num? get totalCost => throw _privateConstructorUsedError; + @JsonKey(name: 'excluded_salary_staff') + num? get excludedSalaryStaff => throw _privateConstructorUsedError; + @JsonKey(name: 'total_reimburse') + num? get totalReimburse => throw _privateConstructorUsedError; + + /// Serializes this ExclusiveSummaryReimburseDto to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of ExclusiveSummaryReimburseDto + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $ExclusiveSummaryReimburseDtoCopyWith + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $ExclusiveSummaryReimburseDtoCopyWith<$Res> { + factory $ExclusiveSummaryReimburseDtoCopyWith( + ExclusiveSummaryReimburseDto value, + $Res Function(ExclusiveSummaryReimburseDto) then, + ) = + _$ExclusiveSummaryReimburseDtoCopyWithImpl< + $Res, + ExclusiveSummaryReimburseDto + >; + @useResult + $Res call({ + @JsonKey(name: 'total_cost') num? totalCost, + @JsonKey(name: 'excluded_salary_staff') num? excludedSalaryStaff, + @JsonKey(name: 'total_reimburse') num? totalReimburse, + }); +} + +/// @nodoc +class _$ExclusiveSummaryReimburseDtoCopyWithImpl< + $Res, + $Val extends ExclusiveSummaryReimburseDto +> + implements $ExclusiveSummaryReimburseDtoCopyWith<$Res> { + _$ExclusiveSummaryReimburseDtoCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of ExclusiveSummaryReimburseDto + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? totalCost = freezed, + Object? excludedSalaryStaff = freezed, + Object? totalReimburse = freezed, + }) { + return _then( + _value.copyWith( + totalCost: freezed == totalCost + ? _value.totalCost + : totalCost // ignore: cast_nullable_to_non_nullable + as num?, + excludedSalaryStaff: freezed == excludedSalaryStaff + ? _value.excludedSalaryStaff + : excludedSalaryStaff // ignore: cast_nullable_to_non_nullable + as num?, + totalReimburse: freezed == totalReimburse + ? _value.totalReimburse + : totalReimburse // ignore: cast_nullable_to_non_nullable + as num?, + ) + as $Val, + ); + } +} + +/// @nodoc +abstract class _$$ExclusiveSummaryReimburseDtoImplCopyWith<$Res> + implements $ExclusiveSummaryReimburseDtoCopyWith<$Res> { + factory _$$ExclusiveSummaryReimburseDtoImplCopyWith( + _$ExclusiveSummaryReimburseDtoImpl value, + $Res Function(_$ExclusiveSummaryReimburseDtoImpl) then, + ) = __$$ExclusiveSummaryReimburseDtoImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + @JsonKey(name: 'total_cost') num? totalCost, + @JsonKey(name: 'excluded_salary_staff') num? excludedSalaryStaff, + @JsonKey(name: 'total_reimburse') num? totalReimburse, + }); +} + +/// @nodoc +class __$$ExclusiveSummaryReimburseDtoImplCopyWithImpl<$Res> + extends + _$ExclusiveSummaryReimburseDtoCopyWithImpl< + $Res, + _$ExclusiveSummaryReimburseDtoImpl + > + implements _$$ExclusiveSummaryReimburseDtoImplCopyWith<$Res> { + __$$ExclusiveSummaryReimburseDtoImplCopyWithImpl( + _$ExclusiveSummaryReimburseDtoImpl _value, + $Res Function(_$ExclusiveSummaryReimburseDtoImpl) _then, + ) : super(_value, _then); + + /// Create a copy of ExclusiveSummaryReimburseDto + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? totalCost = freezed, + Object? excludedSalaryStaff = freezed, + Object? totalReimburse = freezed, + }) { + return _then( + _$ExclusiveSummaryReimburseDtoImpl( + totalCost: freezed == totalCost + ? _value.totalCost + : totalCost // ignore: cast_nullable_to_non_nullable + as num?, + excludedSalaryStaff: freezed == excludedSalaryStaff + ? _value.excludedSalaryStaff + : excludedSalaryStaff // ignore: cast_nullable_to_non_nullable + as num?, + totalReimburse: freezed == totalReimburse + ? _value.totalReimburse + : totalReimburse // ignore: cast_nullable_to_non_nullable + as num?, + ), + ); + } +} + +/// @nodoc +@JsonSerializable() +class _$ExclusiveSummaryReimburseDtoImpl extends _ExclusiveSummaryReimburseDto { + const _$ExclusiveSummaryReimburseDtoImpl({ + @JsonKey(name: 'total_cost') this.totalCost, + @JsonKey(name: 'excluded_salary_staff') this.excludedSalaryStaff, + @JsonKey(name: 'total_reimburse') this.totalReimburse, + }) : super._(); + + factory _$ExclusiveSummaryReimburseDtoImpl.fromJson( + Map json, + ) => _$$ExclusiveSummaryReimburseDtoImplFromJson(json); + + @override + @JsonKey(name: 'total_cost') + final num? totalCost; + @override + @JsonKey(name: 'excluded_salary_staff') + final num? excludedSalaryStaff; + @override + @JsonKey(name: 'total_reimburse') + final num? totalReimburse; + + @override + String toString() { + return 'ExclusiveSummaryReimburseDto(totalCost: $totalCost, excludedSalaryStaff: $excludedSalaryStaff, totalReimburse: $totalReimburse)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ExclusiveSummaryReimburseDtoImpl && + (identical(other.totalCost, totalCost) || + other.totalCost == totalCost) && + (identical(other.excludedSalaryStaff, excludedSalaryStaff) || + other.excludedSalaryStaff == excludedSalaryStaff) && + (identical(other.totalReimburse, totalReimburse) || + other.totalReimburse == totalReimburse)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, totalCost, excludedSalaryStaff, totalReimburse); + + /// Create a copy of ExclusiveSummaryReimburseDto + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$ExclusiveSummaryReimburseDtoImplCopyWith< + _$ExclusiveSummaryReimburseDtoImpl + > + get copyWith => + __$$ExclusiveSummaryReimburseDtoImplCopyWithImpl< + _$ExclusiveSummaryReimburseDtoImpl + >(this, _$identity); + + @override + Map toJson() { + return _$$ExclusiveSummaryReimburseDtoImplToJson(this); + } +} + +abstract class _ExclusiveSummaryReimburseDto + extends ExclusiveSummaryReimburseDto { + const factory _ExclusiveSummaryReimburseDto({ + @JsonKey(name: 'total_cost') final num? totalCost, + @JsonKey(name: 'excluded_salary_staff') final num? excludedSalaryStaff, + @JsonKey(name: 'total_reimburse') final num? totalReimburse, + }) = _$ExclusiveSummaryReimburseDtoImpl; + const _ExclusiveSummaryReimburseDto._() : super._(); + + factory _ExclusiveSummaryReimburseDto.fromJson(Map json) = + _$ExclusiveSummaryReimburseDtoImpl.fromJson; + + @override + @JsonKey(name: 'total_cost') + num? get totalCost; + @override + @JsonKey(name: 'excluded_salary_staff') + num? get excludedSalaryStaff; + @override + @JsonKey(name: 'total_reimburse') + num? get totalReimburse; + + /// Create a copy of ExclusiveSummaryReimburseDto + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$ExclusiveSummaryReimburseDtoImplCopyWith< + _$ExclusiveSummaryReimburseDtoImpl + > + get copyWith => throw _privateConstructorUsedError; +} + +ExclusiveSummaryBreakdownDto _$ExclusiveSummaryBreakdownDtoFromJson( + Map json, +) { + return _ExclusiveSummaryBreakdownDto.fromJson(json); +} + +/// @nodoc +mixin _$ExclusiveSummaryBreakdownDto { + @JsonKey(name: 'category_code') + String? get categoryCode => throw _privateConstructorUsedError; + @JsonKey(name: 'category_name') + String? get categoryName => throw _privateConstructorUsedError; + @JsonKey(name: 'amount') + num? get amount => throw _privateConstructorUsedError; + @JsonKey(name: 'percentage') + num? get percentage => throw _privateConstructorUsedError; + + /// Serializes this ExclusiveSummaryBreakdownDto to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of ExclusiveSummaryBreakdownDto + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $ExclusiveSummaryBreakdownDtoCopyWith + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $ExclusiveSummaryBreakdownDtoCopyWith<$Res> { + factory $ExclusiveSummaryBreakdownDtoCopyWith( + ExclusiveSummaryBreakdownDto value, + $Res Function(ExclusiveSummaryBreakdownDto) then, + ) = + _$ExclusiveSummaryBreakdownDtoCopyWithImpl< + $Res, + ExclusiveSummaryBreakdownDto + >; + @useResult + $Res call({ + @JsonKey(name: 'category_code') String? categoryCode, + @JsonKey(name: 'category_name') String? categoryName, + @JsonKey(name: 'amount') num? amount, + @JsonKey(name: 'percentage') num? percentage, + }); +} + +/// @nodoc +class _$ExclusiveSummaryBreakdownDtoCopyWithImpl< + $Res, + $Val extends ExclusiveSummaryBreakdownDto +> + implements $ExclusiveSummaryBreakdownDtoCopyWith<$Res> { + _$ExclusiveSummaryBreakdownDtoCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of ExclusiveSummaryBreakdownDto + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? categoryCode = freezed, + Object? categoryName = freezed, + Object? amount = freezed, + Object? percentage = freezed, + }) { + return _then( + _value.copyWith( + categoryCode: freezed == categoryCode + ? _value.categoryCode + : categoryCode // ignore: cast_nullable_to_non_nullable + as String?, + categoryName: freezed == categoryName + ? _value.categoryName + : categoryName // ignore: cast_nullable_to_non_nullable + as String?, + amount: freezed == amount + ? _value.amount + : amount // ignore: cast_nullable_to_non_nullable + as num?, + percentage: freezed == percentage + ? _value.percentage + : percentage // ignore: cast_nullable_to_non_nullable + as num?, + ) + as $Val, + ); + } +} + +/// @nodoc +abstract class _$$ExclusiveSummaryBreakdownDtoImplCopyWith<$Res> + implements $ExclusiveSummaryBreakdownDtoCopyWith<$Res> { + factory _$$ExclusiveSummaryBreakdownDtoImplCopyWith( + _$ExclusiveSummaryBreakdownDtoImpl value, + $Res Function(_$ExclusiveSummaryBreakdownDtoImpl) then, + ) = __$$ExclusiveSummaryBreakdownDtoImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + @JsonKey(name: 'category_code') String? categoryCode, + @JsonKey(name: 'category_name') String? categoryName, + @JsonKey(name: 'amount') num? amount, + @JsonKey(name: 'percentage') num? percentage, + }); +} + +/// @nodoc +class __$$ExclusiveSummaryBreakdownDtoImplCopyWithImpl<$Res> + extends + _$ExclusiveSummaryBreakdownDtoCopyWithImpl< + $Res, + _$ExclusiveSummaryBreakdownDtoImpl + > + implements _$$ExclusiveSummaryBreakdownDtoImplCopyWith<$Res> { + __$$ExclusiveSummaryBreakdownDtoImplCopyWithImpl( + _$ExclusiveSummaryBreakdownDtoImpl _value, + $Res Function(_$ExclusiveSummaryBreakdownDtoImpl) _then, + ) : super(_value, _then); + + /// Create a copy of ExclusiveSummaryBreakdownDto + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? categoryCode = freezed, + Object? categoryName = freezed, + Object? amount = freezed, + Object? percentage = freezed, + }) { + return _then( + _$ExclusiveSummaryBreakdownDtoImpl( + categoryCode: freezed == categoryCode + ? _value.categoryCode + : categoryCode // ignore: cast_nullable_to_non_nullable + as String?, + categoryName: freezed == categoryName + ? _value.categoryName + : categoryName // ignore: cast_nullable_to_non_nullable + as String?, + amount: freezed == amount + ? _value.amount + : amount // ignore: cast_nullable_to_non_nullable + as num?, + percentage: freezed == percentage + ? _value.percentage + : percentage // ignore: cast_nullable_to_non_nullable + as num?, + ), + ); + } +} + +/// @nodoc +@JsonSerializable() +class _$ExclusiveSummaryBreakdownDtoImpl extends _ExclusiveSummaryBreakdownDto { + const _$ExclusiveSummaryBreakdownDtoImpl({ + @JsonKey(name: 'category_code') this.categoryCode, + @JsonKey(name: 'category_name') this.categoryName, + @JsonKey(name: 'amount') this.amount, + @JsonKey(name: 'percentage') this.percentage, + }) : super._(); + + factory _$ExclusiveSummaryBreakdownDtoImpl.fromJson( + Map json, + ) => _$$ExclusiveSummaryBreakdownDtoImplFromJson(json); + + @override + @JsonKey(name: 'category_code') + final String? categoryCode; + @override + @JsonKey(name: 'category_name') + final String? categoryName; + @override + @JsonKey(name: 'amount') + final num? amount; + @override + @JsonKey(name: 'percentage') + final num? percentage; + + @override + String toString() { + return 'ExclusiveSummaryBreakdownDto(categoryCode: $categoryCode, categoryName: $categoryName, amount: $amount, percentage: $percentage)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ExclusiveSummaryBreakdownDtoImpl && + (identical(other.categoryCode, categoryCode) || + other.categoryCode == categoryCode) && + (identical(other.categoryName, categoryName) || + other.categoryName == categoryName) && + (identical(other.amount, amount) || other.amount == amount) && + (identical(other.percentage, percentage) || + other.percentage == percentage)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, categoryCode, categoryName, amount, percentage); + + /// Create a copy of ExclusiveSummaryBreakdownDto + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$ExclusiveSummaryBreakdownDtoImplCopyWith< + _$ExclusiveSummaryBreakdownDtoImpl + > + get copyWith => + __$$ExclusiveSummaryBreakdownDtoImplCopyWithImpl< + _$ExclusiveSummaryBreakdownDtoImpl + >(this, _$identity); + + @override + Map toJson() { + return _$$ExclusiveSummaryBreakdownDtoImplToJson(this); + } +} + +abstract class _ExclusiveSummaryBreakdownDto + extends ExclusiveSummaryBreakdownDto { + const factory _ExclusiveSummaryBreakdownDto({ + @JsonKey(name: 'category_code') final String? categoryCode, + @JsonKey(name: 'category_name') final String? categoryName, + @JsonKey(name: 'amount') final num? amount, + @JsonKey(name: 'percentage') final num? percentage, + }) = _$ExclusiveSummaryBreakdownDtoImpl; + const _ExclusiveSummaryBreakdownDto._() : super._(); + + factory _ExclusiveSummaryBreakdownDto.fromJson(Map json) = + _$ExclusiveSummaryBreakdownDtoImpl.fromJson; + + @override + @JsonKey(name: 'category_code') + String? get categoryCode; + @override + @JsonKey(name: 'category_name') + String? get categoryName; + @override + @JsonKey(name: 'amount') + num? get amount; + @override + @JsonKey(name: 'percentage') + num? get percentage; + + /// Create a copy of ExclusiveSummaryBreakdownDto + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$ExclusiveSummaryBreakdownDtoImplCopyWith< + _$ExclusiveSummaryBreakdownDtoImpl + > + get copyWith => throw _privateConstructorUsedError; +} + +ExclusiveSummaryDailyDto _$ExclusiveSummaryDailyDtoFromJson( + Map json, +) { + return _ExclusiveSummaryDailyDto.fromJson(json); +} + +/// @nodoc +mixin _$ExclusiveSummaryDailyDto { + @JsonKey(name: 'date') + DateTime? get date => throw _privateConstructorUsedError; + @JsonKey(name: 'transaction_count') + num? get transactionCount => throw _privateConstructorUsedError; + @JsonKey(name: 'total_cost') + num? get totalCost => throw _privateConstructorUsedError; + + /// Serializes this ExclusiveSummaryDailyDto to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of ExclusiveSummaryDailyDto + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $ExclusiveSummaryDailyDtoCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $ExclusiveSummaryDailyDtoCopyWith<$Res> { + factory $ExclusiveSummaryDailyDtoCopyWith( + ExclusiveSummaryDailyDto value, + $Res Function(ExclusiveSummaryDailyDto) then, + ) = _$ExclusiveSummaryDailyDtoCopyWithImpl<$Res, ExclusiveSummaryDailyDto>; + @useResult + $Res call({ + @JsonKey(name: 'date') DateTime? date, + @JsonKey(name: 'transaction_count') num? transactionCount, + @JsonKey(name: 'total_cost') num? totalCost, + }); +} + +/// @nodoc +class _$ExclusiveSummaryDailyDtoCopyWithImpl< + $Res, + $Val extends ExclusiveSummaryDailyDto +> + implements $ExclusiveSummaryDailyDtoCopyWith<$Res> { + _$ExclusiveSummaryDailyDtoCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of ExclusiveSummaryDailyDto + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? date = freezed, + Object? transactionCount = freezed, + Object? totalCost = freezed, + }) { + return _then( + _value.copyWith( + date: freezed == date + ? _value.date + : date // ignore: cast_nullable_to_non_nullable + as DateTime?, + transactionCount: freezed == transactionCount + ? _value.transactionCount + : transactionCount // ignore: cast_nullable_to_non_nullable + as num?, + totalCost: freezed == totalCost + ? _value.totalCost + : totalCost // ignore: cast_nullable_to_non_nullable + as num?, + ) + as $Val, + ); + } +} + +/// @nodoc +abstract class _$$ExclusiveSummaryDailyDtoImplCopyWith<$Res> + implements $ExclusiveSummaryDailyDtoCopyWith<$Res> { + factory _$$ExclusiveSummaryDailyDtoImplCopyWith( + _$ExclusiveSummaryDailyDtoImpl value, + $Res Function(_$ExclusiveSummaryDailyDtoImpl) then, + ) = __$$ExclusiveSummaryDailyDtoImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + @JsonKey(name: 'date') DateTime? date, + @JsonKey(name: 'transaction_count') num? transactionCount, + @JsonKey(name: 'total_cost') num? totalCost, + }); +} + +/// @nodoc +class __$$ExclusiveSummaryDailyDtoImplCopyWithImpl<$Res> + extends + _$ExclusiveSummaryDailyDtoCopyWithImpl< + $Res, + _$ExclusiveSummaryDailyDtoImpl + > + implements _$$ExclusiveSummaryDailyDtoImplCopyWith<$Res> { + __$$ExclusiveSummaryDailyDtoImplCopyWithImpl( + _$ExclusiveSummaryDailyDtoImpl _value, + $Res Function(_$ExclusiveSummaryDailyDtoImpl) _then, + ) : super(_value, _then); + + /// Create a copy of ExclusiveSummaryDailyDto + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? date = freezed, + Object? transactionCount = freezed, + Object? totalCost = freezed, + }) { + return _then( + _$ExclusiveSummaryDailyDtoImpl( + date: freezed == date + ? _value.date + : date // ignore: cast_nullable_to_non_nullable + as DateTime?, + transactionCount: freezed == transactionCount + ? _value.transactionCount + : transactionCount // ignore: cast_nullable_to_non_nullable + as num?, + totalCost: freezed == totalCost + ? _value.totalCost + : totalCost // ignore: cast_nullable_to_non_nullable + as num?, + ), + ); + } +} + +/// @nodoc +@JsonSerializable() +class _$ExclusiveSummaryDailyDtoImpl extends _ExclusiveSummaryDailyDto { + const _$ExclusiveSummaryDailyDtoImpl({ + @JsonKey(name: 'date') this.date, + @JsonKey(name: 'transaction_count') this.transactionCount, + @JsonKey(name: 'total_cost') this.totalCost, + }) : super._(); + + factory _$ExclusiveSummaryDailyDtoImpl.fromJson(Map json) => + _$$ExclusiveSummaryDailyDtoImplFromJson(json); + + @override + @JsonKey(name: 'date') + final DateTime? date; + @override + @JsonKey(name: 'transaction_count') + final num? transactionCount; + @override + @JsonKey(name: 'total_cost') + final num? totalCost; + + @override + String toString() { + return 'ExclusiveSummaryDailyDto(date: $date, transactionCount: $transactionCount, totalCost: $totalCost)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ExclusiveSummaryDailyDtoImpl && + (identical(other.date, date) || other.date == date) && + (identical(other.transactionCount, transactionCount) || + other.transactionCount == transactionCount) && + (identical(other.totalCost, totalCost) || + other.totalCost == totalCost)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, date, transactionCount, totalCost); + + /// Create a copy of ExclusiveSummaryDailyDto + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$ExclusiveSummaryDailyDtoImplCopyWith<_$ExclusiveSummaryDailyDtoImpl> + get copyWith => + __$$ExclusiveSummaryDailyDtoImplCopyWithImpl< + _$ExclusiveSummaryDailyDtoImpl + >(this, _$identity); + + @override + Map toJson() { + return _$$ExclusiveSummaryDailyDtoImplToJson(this); + } +} + +abstract class _ExclusiveSummaryDailyDto extends ExclusiveSummaryDailyDto { + const factory _ExclusiveSummaryDailyDto({ + @JsonKey(name: 'date') final DateTime? date, + @JsonKey(name: 'transaction_count') final num? transactionCount, + @JsonKey(name: 'total_cost') final num? totalCost, + }) = _$ExclusiveSummaryDailyDtoImpl; + const _ExclusiveSummaryDailyDto._() : super._(); + + factory _ExclusiveSummaryDailyDto.fromJson(Map json) = + _$ExclusiveSummaryDailyDtoImpl.fromJson; + + @override + @JsonKey(name: 'date') + DateTime? get date; + @override + @JsonKey(name: 'transaction_count') + num? get transactionCount; + @override + @JsonKey(name: 'total_cost') + num? get totalCost; + + /// Create a copy of ExclusiveSummaryDailyDto + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$ExclusiveSummaryDailyDtoImplCopyWith<_$ExclusiveSummaryDailyDtoImpl> + get copyWith => throw _privateConstructorUsedError; +} + +ExclusiveSummaryTransactionDto _$ExclusiveSummaryTransactionDtoFromJson( + Map json, +) { + return _ExclusiveSummaryTransactionDto.fromJson(json); +} + +/// @nodoc +mixin _$ExclusiveSummaryTransactionDto { + @JsonKey(name: 'date') + DateTime? get date => throw _privateConstructorUsedError; + @JsonKey(name: 'category_code') + String? get categoryCode => throw _privateConstructorUsedError; + @JsonKey(name: 'category_name') + String? get categoryName => throw _privateConstructorUsedError; + @JsonKey(name: 'description') + String? get description => throw _privateConstructorUsedError; + @JsonKey(name: 'amount') + num? get amount => throw _privateConstructorUsedError; + @JsonKey(name: 'source') + String? get source => throw _privateConstructorUsedError; + + /// Serializes this ExclusiveSummaryTransactionDto to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of ExclusiveSummaryTransactionDto + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $ExclusiveSummaryTransactionDtoCopyWith + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $ExclusiveSummaryTransactionDtoCopyWith<$Res> { + factory $ExclusiveSummaryTransactionDtoCopyWith( + ExclusiveSummaryTransactionDto value, + $Res Function(ExclusiveSummaryTransactionDto) then, + ) = + _$ExclusiveSummaryTransactionDtoCopyWithImpl< + $Res, + ExclusiveSummaryTransactionDto + >; + @useResult + $Res call({ + @JsonKey(name: 'date') DateTime? date, + @JsonKey(name: 'category_code') String? categoryCode, + @JsonKey(name: 'category_name') String? categoryName, + @JsonKey(name: 'description') String? description, + @JsonKey(name: 'amount') num? amount, + @JsonKey(name: 'source') String? source, + }); +} + +/// @nodoc +class _$ExclusiveSummaryTransactionDtoCopyWithImpl< + $Res, + $Val extends ExclusiveSummaryTransactionDto +> + implements $ExclusiveSummaryTransactionDtoCopyWith<$Res> { + _$ExclusiveSummaryTransactionDtoCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of ExclusiveSummaryTransactionDto + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? date = freezed, + Object? categoryCode = freezed, + Object? categoryName = freezed, + Object? description = freezed, + Object? amount = freezed, + Object? source = freezed, + }) { + return _then( + _value.copyWith( + date: freezed == date + ? _value.date + : date // ignore: cast_nullable_to_non_nullable + as DateTime?, + categoryCode: freezed == categoryCode + ? _value.categoryCode + : categoryCode // ignore: cast_nullable_to_non_nullable + as String?, + categoryName: freezed == categoryName + ? _value.categoryName + : categoryName // ignore: cast_nullable_to_non_nullable + as String?, + description: freezed == description + ? _value.description + : description // ignore: cast_nullable_to_non_nullable + as String?, + amount: freezed == amount + ? _value.amount + : amount // ignore: cast_nullable_to_non_nullable + as num?, + source: freezed == source + ? _value.source + : source // ignore: cast_nullable_to_non_nullable + as String?, + ) + as $Val, + ); + } +} + +/// @nodoc +abstract class _$$ExclusiveSummaryTransactionDtoImplCopyWith<$Res> + implements $ExclusiveSummaryTransactionDtoCopyWith<$Res> { + factory _$$ExclusiveSummaryTransactionDtoImplCopyWith( + _$ExclusiveSummaryTransactionDtoImpl value, + $Res Function(_$ExclusiveSummaryTransactionDtoImpl) then, + ) = __$$ExclusiveSummaryTransactionDtoImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + @JsonKey(name: 'date') DateTime? date, + @JsonKey(name: 'category_code') String? categoryCode, + @JsonKey(name: 'category_name') String? categoryName, + @JsonKey(name: 'description') String? description, + @JsonKey(name: 'amount') num? amount, + @JsonKey(name: 'source') String? source, + }); +} + +/// @nodoc +class __$$ExclusiveSummaryTransactionDtoImplCopyWithImpl<$Res> + extends + _$ExclusiveSummaryTransactionDtoCopyWithImpl< + $Res, + _$ExclusiveSummaryTransactionDtoImpl + > + implements _$$ExclusiveSummaryTransactionDtoImplCopyWith<$Res> { + __$$ExclusiveSummaryTransactionDtoImplCopyWithImpl( + _$ExclusiveSummaryTransactionDtoImpl _value, + $Res Function(_$ExclusiveSummaryTransactionDtoImpl) _then, + ) : super(_value, _then); + + /// Create a copy of ExclusiveSummaryTransactionDto + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? date = freezed, + Object? categoryCode = freezed, + Object? categoryName = freezed, + Object? description = freezed, + Object? amount = freezed, + Object? source = freezed, + }) { + return _then( + _$ExclusiveSummaryTransactionDtoImpl( + date: freezed == date + ? _value.date + : date // ignore: cast_nullable_to_non_nullable + as DateTime?, + categoryCode: freezed == categoryCode + ? _value.categoryCode + : categoryCode // ignore: cast_nullable_to_non_nullable + as String?, + categoryName: freezed == categoryName + ? _value.categoryName + : categoryName // ignore: cast_nullable_to_non_nullable + as String?, + description: freezed == description + ? _value.description + : description // ignore: cast_nullable_to_non_nullable + as String?, + amount: freezed == amount + ? _value.amount + : amount // ignore: cast_nullable_to_non_nullable + as num?, + source: freezed == source + ? _value.source + : source // ignore: cast_nullable_to_non_nullable + as String?, + ), + ); + } +} + +/// @nodoc +@JsonSerializable() +class _$ExclusiveSummaryTransactionDtoImpl + extends _ExclusiveSummaryTransactionDto { + const _$ExclusiveSummaryTransactionDtoImpl({ + @JsonKey(name: 'date') this.date, + @JsonKey(name: 'category_code') this.categoryCode, + @JsonKey(name: 'category_name') this.categoryName, + @JsonKey(name: 'description') this.description, + @JsonKey(name: 'amount') this.amount, + @JsonKey(name: 'source') this.source, + }) : super._(); + + factory _$ExclusiveSummaryTransactionDtoImpl.fromJson( + Map json, + ) => _$$ExclusiveSummaryTransactionDtoImplFromJson(json); + + @override + @JsonKey(name: 'date') + final DateTime? date; + @override + @JsonKey(name: 'category_code') + final String? categoryCode; + @override + @JsonKey(name: 'category_name') + final String? categoryName; + @override + @JsonKey(name: 'description') + final String? description; + @override + @JsonKey(name: 'amount') + final num? amount; + @override + @JsonKey(name: 'source') + final String? source; + + @override + String toString() { + return 'ExclusiveSummaryTransactionDto(date: $date, categoryCode: $categoryCode, categoryName: $categoryName, description: $description, amount: $amount, source: $source)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ExclusiveSummaryTransactionDtoImpl && + (identical(other.date, date) || other.date == date) && + (identical(other.categoryCode, categoryCode) || + other.categoryCode == categoryCode) && + (identical(other.categoryName, categoryName) || + other.categoryName == categoryName) && + (identical(other.description, description) || + other.description == description) && + (identical(other.amount, amount) || other.amount == amount) && + (identical(other.source, source) || other.source == source)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + date, + categoryCode, + categoryName, + description, + amount, + source, + ); + + /// Create a copy of ExclusiveSummaryTransactionDto + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$ExclusiveSummaryTransactionDtoImplCopyWith< + _$ExclusiveSummaryTransactionDtoImpl + > + get copyWith => + __$$ExclusiveSummaryTransactionDtoImplCopyWithImpl< + _$ExclusiveSummaryTransactionDtoImpl + >(this, _$identity); + + @override + Map toJson() { + return _$$ExclusiveSummaryTransactionDtoImplToJson(this); + } +} + +abstract class _ExclusiveSummaryTransactionDto + extends ExclusiveSummaryTransactionDto { + const factory _ExclusiveSummaryTransactionDto({ + @JsonKey(name: 'date') final DateTime? date, + @JsonKey(name: 'category_code') final String? categoryCode, + @JsonKey(name: 'category_name') final String? categoryName, + @JsonKey(name: 'description') final String? description, + @JsonKey(name: 'amount') final num? amount, + @JsonKey(name: 'source') final String? source, + }) = _$ExclusiveSummaryTransactionDtoImpl; + const _ExclusiveSummaryTransactionDto._() : super._(); + + factory _ExclusiveSummaryTransactionDto.fromJson(Map json) = + _$ExclusiveSummaryTransactionDtoImpl.fromJson; + + @override + @JsonKey(name: 'date') + DateTime? get date; + @override + @JsonKey(name: 'category_code') + String? get categoryCode; + @override + @JsonKey(name: 'category_name') + String? get categoryName; + @override + @JsonKey(name: 'description') + String? get description; + @override + @JsonKey(name: 'amount') + num? get amount; + @override + @JsonKey(name: 'source') + String? get source; + + /// Create a copy of ExclusiveSummaryTransactionDto + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$ExclusiveSummaryTransactionDtoImplCopyWith< + _$ExclusiveSummaryTransactionDtoImpl + > + get copyWith => throw _privateConstructorUsedError; +} diff --git a/lib/infrastructure/analytic/analytic_dtos.g.dart b/lib/infrastructure/analytic/analytic_dtos.g.dart index 22dd6be..abd100e 100644 --- a/lib/infrastructure/analytic/analytic_dtos.g.dart +++ b/lib/infrastructure/analytic/analytic_dtos.g.dart @@ -789,3 +789,185 @@ Map _$$PurchasingVendorDataDtoImplToJson( 'ingredient_count': instance.ingredientCount, 'quantity': instance.quantity, }; + +_$ExclusiveSummaryDtoImpl _$$ExclusiveSummaryDtoImplFromJson( + Map json, +) => _$ExclusiveSummaryDtoImpl( + organizationId: json['organization_id'] as String?, + outletId: json['outlet_id'] as String?, + period: json['period'] == null + ? null + : ExclusiveSummaryPeriodDto.fromJson( + json['period'] as Map, + ), + summary: json['summary'] == null + ? null + : ExclusiveSummarySummaryDto.fromJson( + json['summary'] as Map, + ), + reimburse: json['reimburse'] == null + ? null + : ExclusiveSummaryReimburseDto.fromJson( + json['reimburse'] as Map, + ), + hppBreakdown: (json['hpp_breakdown'] as List?) + ?.map( + (e) => ExclusiveSummaryBreakdownDto.fromJson(e as Map), + ) + .toList(), + operationalExpenseBreakdown: + (json['operational_expense_breakdown'] as List?) + ?.map( + (e) => ExclusiveSummaryBreakdownDto.fromJson( + e as Map, + ), + ) + .toList(), + dailySummary: (json['daily_summary'] as List?) + ?.map((e) => ExclusiveSummaryDailyDto.fromJson(e as Map)) + .toList(), + dailyTransactions: (json['daily_transactions'] as List?) + ?.map( + (e) => + ExclusiveSummaryTransactionDto.fromJson(e as Map), + ) + .toList(), +); + +Map _$$ExclusiveSummaryDtoImplToJson( + _$ExclusiveSummaryDtoImpl instance, +) => { + 'organization_id': instance.organizationId, + 'outlet_id': instance.outletId, + 'period': instance.period, + 'summary': instance.summary, + 'reimburse': instance.reimburse, + 'hpp_breakdown': instance.hppBreakdown, + 'operational_expense_breakdown': instance.operationalExpenseBreakdown, + 'daily_summary': instance.dailySummary, + 'daily_transactions': instance.dailyTransactions, +}; + +_$ExclusiveSummaryPeriodDtoImpl _$$ExclusiveSummaryPeriodDtoImplFromJson( + Map json, +) => _$ExclusiveSummaryPeriodDtoImpl( + dateFrom: json['date_from'] == null + ? null + : DateTime.parse(json['date_from'] as String), + dateTo: json['date_to'] == null + ? null + : DateTime.parse(json['date_to'] as String), +); + +Map _$$ExclusiveSummaryPeriodDtoImplToJson( + _$ExclusiveSummaryPeriodDtoImpl instance, +) => { + 'date_from': instance.dateFrom?.toIso8601String(), + 'date_to': instance.dateTo?.toIso8601String(), +}; + +_$ExclusiveSummarySummaryDtoImpl _$$ExclusiveSummarySummaryDtoImplFromJson( + Map json, +) => _$ExclusiveSummarySummaryDtoImpl( + sales: json['sales'] as num?, + hpp: json['hpp'] as num?, + grossProfit: json['gross_profit'] as num?, + salaryTotal: json['salary_total'] as num?, + salaryDw: json['salary_dw'] as num?, + salaryStaff: json['salary_staff'] as num?, + salaryOther: json['salary_other'] as num?, + otherOperationalExpenses: json['other_operational_expenses'] as num?, + operationalExpensesTotal: json['operational_expenses_total'] as num?, + totalCost: json['total_cost'] as num?, + netProfit: json['net_profit'] as num?, +); + +Map _$$ExclusiveSummarySummaryDtoImplToJson( + _$ExclusiveSummarySummaryDtoImpl instance, +) => { + 'sales': instance.sales, + 'hpp': instance.hpp, + 'gross_profit': instance.grossProfit, + 'salary_total': instance.salaryTotal, + 'salary_dw': instance.salaryDw, + 'salary_staff': instance.salaryStaff, + 'salary_other': instance.salaryOther, + 'other_operational_expenses': instance.otherOperationalExpenses, + 'operational_expenses_total': instance.operationalExpensesTotal, + 'total_cost': instance.totalCost, + 'net_profit': instance.netProfit, +}; + +_$ExclusiveSummaryReimburseDtoImpl _$$ExclusiveSummaryReimburseDtoImplFromJson( + Map json, +) => _$ExclusiveSummaryReimburseDtoImpl( + totalCost: json['total_cost'] as num?, + excludedSalaryStaff: json['excluded_salary_staff'] as num?, + totalReimburse: json['total_reimburse'] as num?, +); + +Map _$$ExclusiveSummaryReimburseDtoImplToJson( + _$ExclusiveSummaryReimburseDtoImpl instance, +) => { + 'total_cost': instance.totalCost, + 'excluded_salary_staff': instance.excludedSalaryStaff, + 'total_reimburse': instance.totalReimburse, +}; + +_$ExclusiveSummaryBreakdownDtoImpl _$$ExclusiveSummaryBreakdownDtoImplFromJson( + Map json, +) => _$ExclusiveSummaryBreakdownDtoImpl( + categoryCode: json['category_code'] as String?, + categoryName: json['category_name'] as String?, + amount: json['amount'] as num?, + percentage: json['percentage'] as num?, +); + +Map _$$ExclusiveSummaryBreakdownDtoImplToJson( + _$ExclusiveSummaryBreakdownDtoImpl instance, +) => { + 'category_code': instance.categoryCode, + 'category_name': instance.categoryName, + 'amount': instance.amount, + 'percentage': instance.percentage, +}; + +_$ExclusiveSummaryDailyDtoImpl _$$ExclusiveSummaryDailyDtoImplFromJson( + Map json, +) => _$ExclusiveSummaryDailyDtoImpl( + date: json['date'] == null ? null : DateTime.parse(json['date'] as String), + transactionCount: json['transaction_count'] as num?, + totalCost: json['total_cost'] as num?, +); + +Map _$$ExclusiveSummaryDailyDtoImplToJson( + _$ExclusiveSummaryDailyDtoImpl instance, +) => { + 'date': instance.date?.toIso8601String(), + 'transaction_count': instance.transactionCount, + 'total_cost': instance.totalCost, +}; + +_$ExclusiveSummaryTransactionDtoImpl +_$$ExclusiveSummaryTransactionDtoImplFromJson(Map json) => + _$ExclusiveSummaryTransactionDtoImpl( + date: json['date'] == null + ? null + : DateTime.parse(json['date'] as String), + categoryCode: json['category_code'] as String?, + categoryName: json['category_name'] as String?, + description: json['description'] as String?, + amount: json['amount'] as num?, + source: json['source'] as String?, + ); + +Map _$$ExclusiveSummaryTransactionDtoImplToJson( + _$ExclusiveSummaryTransactionDtoImpl instance, +) => { + 'date': instance.date?.toIso8601String(), + 'category_code': instance.categoryCode, + 'category_name': instance.categoryName, + 'description': instance.description, + 'amount': instance.amount, + 'source': instance.source, +}; diff --git a/lib/infrastructure/analytic/datasource/remote_data_provider.dart b/lib/infrastructure/analytic/datasource/remote_data_provider.dart index 06eeec4..ce3bc9b 100644 --- a/lib/infrastructure/analytic/datasource/remote_data_provider.dart +++ b/lib/infrastructure/analytic/datasource/remote_data_provider.dart @@ -264,4 +264,35 @@ class AnalyticRemoteDataProvider { return DC.error(AnalyticFailure.serverError(e)); } } + + Future> fetchExclusiveSummary({ + required DateTime dateFrom, + required DateTime dateTo, + String? outletId, + }) async { + try { + final Map params = { + 'date_from': dateFrom.toServerDate, + 'date_to': dateTo.toServerDate, + }; + if (outletId != null) params['outlet_id'] = outletId; + + final response = await _apiClient.get( + ApiPath.exclusiveSummaryAnalytic, + params: params, + headers: getAuthorizationHeader(), + ); + + if (response.data['data'] == null) { + return DC.error(AnalyticFailure.empty()); + } + + final dto = ExclusiveSummaryDto.fromJson(response.data['data']); + + return DC.data(dto); + } on ApiFailure catch (e, s) { + log('fetchExclusiveSummaryError', name: _logName, error: e, stackTrace: s); + return DC.error(AnalyticFailure.serverError(e)); + } + } } diff --git a/lib/infrastructure/analytic/dto/exclusive_summary_dto.dart b/lib/infrastructure/analytic/dto/exclusive_summary_dto.dart new file mode 100644 index 0000000..ceeac54 --- /dev/null +++ b/lib/infrastructure/analytic/dto/exclusive_summary_dto.dart @@ -0,0 +1,181 @@ +part of '../analytic_dtos.dart'; + +@freezed +class ExclusiveSummaryDto with _$ExclusiveSummaryDto { + const ExclusiveSummaryDto._(); + + const factory ExclusiveSummaryDto({ + @JsonKey(name: 'organization_id') String? organizationId, + @JsonKey(name: 'outlet_id') String? outletId, + @JsonKey(name: 'period') ExclusiveSummaryPeriodDto? period, + @JsonKey(name: 'summary') ExclusiveSummarySummaryDto? summary, + @JsonKey(name: 'reimburse') ExclusiveSummaryReimburseDto? reimburse, + @JsonKey(name: 'hpp_breakdown') + List? hppBreakdown, + @JsonKey(name: 'operational_expense_breakdown') + List? operationalExpenseBreakdown, + @JsonKey(name: 'daily_summary') + List? dailySummary, + @JsonKey(name: 'daily_transactions') + List? dailyTransactions, + }) = _ExclusiveSummaryDto; + + factory ExclusiveSummaryDto.fromJson(Map json) => + _$ExclusiveSummaryDtoFromJson(json); + + ExclusiveSummary toDomain() => ExclusiveSummary( + organizationId: organizationId ?? '', + outletId: outletId ?? '', + period: period?.toDomain() ?? ExclusiveSummaryPeriod.empty(), + summary: summary?.toDomain() ?? ExclusiveSummarySummary.empty(), + reimburse: reimburse?.toDomain() ?? ExclusiveSummaryReimburse.empty(), + hppBreakdown: hppBreakdown?.map((e) => e.toDomain()).toList() ?? [], + operationalExpenseBreakdown: + operationalExpenseBreakdown?.map((e) => e.toDomain()).toList() ?? [], + dailySummary: dailySummary?.map((e) => e.toDomain()).toList() ?? [], + dailyTransactions: + dailyTransactions?.map((e) => e.toDomain()).toList() ?? [], + ); +} + +@freezed +class ExclusiveSummaryPeriodDto with _$ExclusiveSummaryPeriodDto { + const ExclusiveSummaryPeriodDto._(); + + const factory ExclusiveSummaryPeriodDto({ + @JsonKey(name: 'date_from') DateTime? dateFrom, + @JsonKey(name: 'date_to') DateTime? dateTo, + }) = _ExclusiveSummaryPeriodDto; + + factory ExclusiveSummaryPeriodDto.fromJson(Map json) => + _$ExclusiveSummaryPeriodDtoFromJson(json); + + ExclusiveSummaryPeriod toDomain() => ExclusiveSummaryPeriod( + dateFrom: dateFrom ?? DateTime.fromMillisecondsSinceEpoch(0), + dateTo: dateTo ?? DateTime.fromMillisecondsSinceEpoch(0), + ); +} + +@freezed +class ExclusiveSummarySummaryDto with _$ExclusiveSummarySummaryDto { + const ExclusiveSummarySummaryDto._(); + + const factory ExclusiveSummarySummaryDto({ + @JsonKey(name: 'sales') num? sales, + @JsonKey(name: 'hpp') num? hpp, + @JsonKey(name: 'gross_profit') num? grossProfit, + @JsonKey(name: 'salary_total') num? salaryTotal, + @JsonKey(name: 'salary_dw') num? salaryDw, + @JsonKey(name: 'salary_staff') num? salaryStaff, + @JsonKey(name: 'salary_other') num? salaryOther, + @JsonKey(name: 'other_operational_expenses') num? otherOperationalExpenses, + @JsonKey(name: 'operational_expenses_total') num? operationalExpensesTotal, + @JsonKey(name: 'total_cost') num? totalCost, + @JsonKey(name: 'net_profit') num? netProfit, + }) = _ExclusiveSummarySummaryDto; + + factory ExclusiveSummarySummaryDto.fromJson(Map json) => + _$ExclusiveSummarySummaryDtoFromJson(json); + + ExclusiveSummarySummary toDomain() => ExclusiveSummarySummary( + sales: sales?.toInt() ?? 0, + hpp: hpp?.toInt() ?? 0, + grossProfit: grossProfit?.toInt() ?? 0, + salaryTotal: salaryTotal?.toInt() ?? 0, + salaryDw: salaryDw?.toInt() ?? 0, + salaryStaff: salaryStaff?.toInt() ?? 0, + salaryOther: salaryOther?.toInt() ?? 0, + otherOperationalExpenses: otherOperationalExpenses?.toInt() ?? 0, + operationalExpensesTotal: operationalExpensesTotal?.toInt() ?? 0, + totalCost: totalCost?.toInt() ?? 0, + netProfit: netProfit?.toInt() ?? 0, + ); +} + +@freezed +class ExclusiveSummaryReimburseDto with _$ExclusiveSummaryReimburseDto { + const ExclusiveSummaryReimburseDto._(); + + const factory ExclusiveSummaryReimburseDto({ + @JsonKey(name: 'total_cost') num? totalCost, + @JsonKey(name: 'excluded_salary_staff') num? excludedSalaryStaff, + @JsonKey(name: 'total_reimburse') num? totalReimburse, + }) = _ExclusiveSummaryReimburseDto; + + factory ExclusiveSummaryReimburseDto.fromJson(Map json) => + _$ExclusiveSummaryReimburseDtoFromJson(json); + + ExclusiveSummaryReimburse toDomain() => ExclusiveSummaryReimburse( + totalCost: totalCost?.toInt() ?? 0, + excludedSalaryStaff: excludedSalaryStaff?.toInt() ?? 0, + totalReimburse: totalReimburse?.toInt() ?? 0, + ); +} + +@freezed +class ExclusiveSummaryBreakdownDto with _$ExclusiveSummaryBreakdownDto { + const ExclusiveSummaryBreakdownDto._(); + + const factory ExclusiveSummaryBreakdownDto({ + @JsonKey(name: 'category_code') String? categoryCode, + @JsonKey(name: 'category_name') String? categoryName, + @JsonKey(name: 'amount') num? amount, + @JsonKey(name: 'percentage') num? percentage, + }) = _ExclusiveSummaryBreakdownDto; + + factory ExclusiveSummaryBreakdownDto.fromJson(Map json) => + _$ExclusiveSummaryBreakdownDtoFromJson(json); + + ExclusiveSummaryBreakdown toDomain() => ExclusiveSummaryBreakdown( + categoryCode: categoryCode ?? '', + categoryName: categoryName ?? '', + amount: amount?.toInt() ?? 0, + percentage: percentage?.toDouble() ?? 0, + ); +} + +@freezed +class ExclusiveSummaryDailyDto with _$ExclusiveSummaryDailyDto { + const ExclusiveSummaryDailyDto._(); + + const factory ExclusiveSummaryDailyDto({ + @JsonKey(name: 'date') DateTime? date, + @JsonKey(name: 'transaction_count') num? transactionCount, + @JsonKey(name: 'total_cost') num? totalCost, + }) = _ExclusiveSummaryDailyDto; + + factory ExclusiveSummaryDailyDto.fromJson(Map json) => + _$ExclusiveSummaryDailyDtoFromJson(json); + + ExclusiveSummaryDaily toDomain() => ExclusiveSummaryDaily( + date: date ?? DateTime.fromMillisecondsSinceEpoch(0), + transactionCount: transactionCount?.toInt() ?? 0, + totalCost: totalCost?.toInt() ?? 0, + ); +} + +@freezed +class ExclusiveSummaryTransactionDto with _$ExclusiveSummaryTransactionDto { + const ExclusiveSummaryTransactionDto._(); + + const factory ExclusiveSummaryTransactionDto({ + @JsonKey(name: 'date') DateTime? date, + @JsonKey(name: 'category_code') String? categoryCode, + @JsonKey(name: 'category_name') String? categoryName, + @JsonKey(name: 'description') String? description, + @JsonKey(name: 'amount') num? amount, + @JsonKey(name: 'source') String? source, + }) = _ExclusiveSummaryTransactionDto; + + factory ExclusiveSummaryTransactionDto.fromJson(Map json) => + _$ExclusiveSummaryTransactionDtoFromJson(json); + + ExclusiveSummaryTransaction toDomain() => ExclusiveSummaryTransaction( + date: date ?? DateTime.fromMillisecondsSinceEpoch(0), + categoryCode: categoryCode ?? '', + categoryName: categoryName ?? '', + description: description ?? '', + amount: amount?.toInt() ?? 0, + source: source ?? '', + ); +} diff --git a/lib/infrastructure/analytic/repositories/analytic_repository.dart b/lib/infrastructure/analytic/repositories/analytic_repository.dart index 82b1d0d..284fc64 100644 --- a/lib/infrastructure/analytic/repositories/analytic_repository.dart +++ b/lib/infrastructure/analytic/repositories/analytic_repository.dart @@ -199,4 +199,25 @@ class AnalyticRepository implements IAnalyticRepository { return left(const AnalyticFailure.unexpectedError()); } } + + @override + Future> getExclusiveSummary({ + required DateTime dateFrom, + required DateTime dateTo, + String? outletId, + }) async { + try { + final result = await _dataProvider.fetchExclusiveSummary( + dateFrom: dateFrom, + dateTo: dateTo, + outletId: _resolveOutletId(outletId), + ); + + if (result.hasError) return left(result.error!); + return right(result.data!.toDomain()); + } catch (e, s) { + log('getExclusiveSummaryError', name: _logName, error: e, stackTrace: s); + return left(const AnalyticFailure.unexpectedError()); + } + } } diff --git a/lib/injection.config.dart b/lib/injection.config.dart index 86428dd..f56e5e9 100644 --- a/lib/injection.config.dart +++ b/lib/injection.config.dart @@ -13,6 +13,8 @@ import 'package:apskel_owner_flutter/application/analytic/category_analytic_load as _i1038; import 'package:apskel_owner_flutter/application/analytic/dashboard_analytic_loader/dashboard_analytic_loader_bloc.dart' as _i516; +import 'package:apskel_owner_flutter/application/analytic/exclusive_summary_loader/exclusive_summary_loader_bloc.dart' + as _i702; import 'package:apskel_owner_flutter/application/analytic/inventory_analytic_loader/inventory_analytic_loader_bloc.dart' as _i785; import 'package:apskel_owner_flutter/application/analytic/payment_method_analytic_loader/payment_method_analytic_loader_bloc.dart' @@ -285,6 +287,9 @@ extension GetItInjectableX on _i174.GetIt { gh.factory<_i516.DashboardAnalyticLoaderBloc>( () => _i516.DashboardAnalyticLoaderBloc(gh<_i477.IAnalyticRepository>()), ); + gh.factory<_i702.ExclusiveSummaryLoaderBloc>( + () => _i702.ExclusiveSummaryLoaderBloc(gh<_i477.IAnalyticRepository>()), + ); gh.factory<_i945.AuthBloc>( () => _i945.AuthBloc(gh<_i49.IAuthRepository>()), ); diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 44777f0..b85a943 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -431,5 +431,29 @@ "device": "Device", "@device": {}, "profit_loss": "Laba Rugi", - "@profit_loss": {} + "@profit_loss": {}, + "exclusive_summary": "Exclusive Summary", + "@exclusive_summary": {}, + "hpp_breakdown": "HPP Breakdown", + "@hpp_breakdown": {}, + "operational_expense_breakdown": "Operational Expense Breakdown", + "@operational_expense_breakdown": {}, + "daily_summary": "Daily Summary", + "@daily_summary": {}, + "daily_transactions": "Daily Transactions", + "@daily_transactions": {}, + "reimburse_summary": "Reimburse Summary", + "@reimburse_summary": {}, + "total_reimburse": "Total Reimburse", + "@total_reimburse": {}, + "excluded_salary_staff": "Excluded Salary Staff", + "@excluded_salary_staff": {}, + "hpp": "HPP", + "@hpp": {}, + "salary_total": "Total Salary", + "@salary_total": {}, + "operational_expenses": "Operational Expenses", + "@operational_expenses": {}, + "total_cost": "Total Cost", + "@total_cost": {} } diff --git a/lib/l10n/app_id.arb b/lib/l10n/app_id.arb index f07c475..4615078 100644 --- a/lib/l10n/app_id.arb +++ b/lib/l10n/app_id.arb @@ -431,5 +431,29 @@ "device": "Perangkat", "@device": {}, "profit_loss": "Laba Rugi", - "@profit_loss": {} + "@profit_loss": {}, + "exclusive_summary": "Ringkasan Eksklusif", + "@exclusive_summary": {}, + "hpp_breakdown": "Rincian HPP", + "@hpp_breakdown": {}, + "operational_expense_breakdown": "Rincian Biaya Operasional", + "@operational_expense_breakdown": {}, + "daily_summary": "Ringkasan Harian", + "@daily_summary": {}, + "daily_transactions": "Transaksi Harian", + "@daily_transactions": {}, + "reimburse_summary": "Ringkasan Reimburse", + "@reimburse_summary": {}, + "total_reimburse": "Total Reimburse", + "@total_reimburse": {}, + "excluded_salary_staff": "Gaji Staf (Dikecualikan)", + "@excluded_salary_staff": {}, + "hpp": "HPP", + "@hpp": {}, + "salary_total": "Total Gaji", + "@salary_total": {}, + "operational_expenses": "Biaya Operasional", + "@operational_expenses": {}, + "total_cost": "Total Biaya", + "@total_cost": {} } diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart index 91ab6c4..0afcc88 100644 --- a/lib/l10n/app_localizations.dart +++ b/lib/l10n/app_localizations.dart @@ -1306,6 +1306,78 @@ abstract class AppLocalizations { /// In en, this message translates to: /// **'Laba Rugi'** String get profit_loss; + + /// No description provided for @exclusive_summary. + /// + /// In en, this message translates to: + /// **'Exclusive Summary'** + String get exclusive_summary; + + /// No description provided for @hpp_breakdown. + /// + /// In en, this message translates to: + /// **'HPP Breakdown'** + String get hpp_breakdown; + + /// No description provided for @operational_expense_breakdown. + /// + /// In en, this message translates to: + /// **'Operational Expense Breakdown'** + String get operational_expense_breakdown; + + /// No description provided for @daily_summary. + /// + /// In en, this message translates to: + /// **'Daily Summary'** + String get daily_summary; + + /// No description provided for @daily_transactions. + /// + /// In en, this message translates to: + /// **'Daily Transactions'** + String get daily_transactions; + + /// No description provided for @reimburse_summary. + /// + /// In en, this message translates to: + /// **'Reimburse Summary'** + String get reimburse_summary; + + /// No description provided for @total_reimburse. + /// + /// In en, this message translates to: + /// **'Total Reimburse'** + String get total_reimburse; + + /// No description provided for @excluded_salary_staff. + /// + /// In en, this message translates to: + /// **'Excluded Salary Staff'** + String get excluded_salary_staff; + + /// No description provided for @hpp. + /// + /// In en, this message translates to: + /// **'HPP'** + String get hpp; + + /// No description provided for @salary_total. + /// + /// In en, this message translates to: + /// **'Total Salary'** + String get salary_total; + + /// No description provided for @operational_expenses. + /// + /// In en, this message translates to: + /// **'Operational Expenses'** + String get operational_expenses; + + /// No description provided for @total_cost. + /// + /// In en, this message translates to: + /// **'Total Cost'** + String get total_cost; } class _AppLocalizationsDelegate extends LocalizationsDelegate { diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart index 4f371d7..493d2e0 100644 --- a/lib/l10n/app_localizations_en.dart +++ b/lib/l10n/app_localizations_en.dart @@ -621,4 +621,40 @@ class AppLocalizationsEn extends AppLocalizations { @override String get profit_loss => 'Laba Rugi'; + + @override + String get exclusive_summary => 'Exclusive Summary'; + + @override + String get hpp_breakdown => 'HPP Breakdown'; + + @override + String get operational_expense_breakdown => 'Operational Expense Breakdown'; + + @override + String get daily_summary => 'Daily Summary'; + + @override + String get daily_transactions => 'Daily Transactions'; + + @override + String get reimburse_summary => 'Reimburse Summary'; + + @override + String get total_reimburse => 'Total Reimburse'; + + @override + String get excluded_salary_staff => 'Excluded Salary Staff'; + + @override + String get hpp => 'HPP'; + + @override + String get salary_total => 'Total Salary'; + + @override + String get operational_expenses => 'Operational Expenses'; + + @override + String get total_cost => 'Total Cost'; } diff --git a/lib/l10n/app_localizations_id.dart b/lib/l10n/app_localizations_id.dart index 2c66dcf..3af50e6 100644 --- a/lib/l10n/app_localizations_id.dart +++ b/lib/l10n/app_localizations_id.dart @@ -621,4 +621,40 @@ class AppLocalizationsId extends AppLocalizations { @override String get profit_loss => 'Laba Rugi'; + + @override + String get exclusive_summary => 'Ringkasan Eksklusif'; + + @override + String get hpp_breakdown => 'Rincian HPP'; + + @override + String get operational_expense_breakdown => 'Rincian Biaya Operasional'; + + @override + String get daily_summary => 'Ringkasan Harian'; + + @override + String get daily_transactions => 'Transaksi Harian'; + + @override + String get reimburse_summary => 'Ringkasan Reimburse'; + + @override + String get total_reimburse => 'Total Reimburse'; + + @override + String get excluded_salary_staff => 'Gaji Staf (Dikecualikan)'; + + @override + String get hpp => 'HPP'; + + @override + String get salary_total => 'Total Gaji'; + + @override + String get operational_expenses => 'Biaya Operasional'; + + @override + String get total_cost => 'Total Biaya'; } diff --git a/lib/presentation/pages/exclusive_summary/exclusive_summary_page.dart b/lib/presentation/pages/exclusive_summary/exclusive_summary_page.dart new file mode 100644 index 0000000..dfbc8b0 --- /dev/null +++ b/lib/presentation/pages/exclusive_summary/exclusive_summary_page.dart @@ -0,0 +1,890 @@ +import 'package:auto_route/auto_route.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:line_icons/line_icons.dart'; +import 'package:shimmer/shimmer.dart'; + +import '../../../application/analytic/exclusive_summary_loader/exclusive_summary_loader_bloc.dart'; +import '../../../common/extension/extension.dart'; +import '../../../common/theme/theme.dart'; +import '../../../domain/analytic/analytic.dart'; +import '../../../injection.dart'; +import '../../components/appbar/appbar.dart'; +import '../../components/field/date_range_picker_field.dart'; +import '../../components/spacer/spacer.dart'; + +@RoutePage() +class ExclusiveSummaryPage extends StatefulWidget + implements AutoRouteWrapper { + const ExclusiveSummaryPage({super.key}); + + @override + State createState() => _ExclusiveSummaryPageState(); + + @override + Widget wrappedRoute(BuildContext context) => BlocProvider( + create: (context) => getIt() + ..add(ExclusiveSummaryLoaderEvent.fetched()), + child: this, + ); +} + +class _ExclusiveSummaryPageState extends State + with TickerProviderStateMixin { + late AnimationController _fadeController; + late AnimationController _slideController; + late Animation _fadeAnimation; + late Animation _slideAnimation; + + @override + void initState() { + super.initState(); + + _fadeController = AnimationController( + duration: const Duration(milliseconds: 800), + vsync: this, + ); + _slideController = AnimationController( + duration: const Duration(milliseconds: 900), + vsync: this, + ); + + _fadeAnimation = Tween(begin: 0.0, end: 1.0).animate( + CurvedAnimation(parent: _fadeController, curve: Curves.easeOut), + ); + _slideAnimation = + Tween(begin: const Offset(0, 0.3), end: Offset.zero).animate( + CurvedAnimation(parent: _slideController, curve: Curves.easeOutCubic), + ); + + _fadeController.forward(); + _slideController.forward(); + } + + @override + void dispose() { + _fadeController.dispose(); + _slideController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColor.background, + body: BlocListener( + listenWhen: (prev, curr) => + prev.dateFrom != curr.dateFrom || prev.dateTo != curr.dateTo, + listener: (context, state) { + context + .read() + .add(ExclusiveSummaryLoaderEvent.fetched()); + }, + child: BlocBuilder( + builder: (context, state) { + return RefreshIndicator( + color: AppColor.primary, + onRefresh: () async { + context + .read() + .add(ExclusiveSummaryLoaderEvent.fetched()); + await context + .read() + .stream + .firstWhere((s) => !s.isFetching); + }, + child: CustomScrollView( + physics: const AlwaysScrollableScrollPhysics(), + slivers: [ + // App Bar + SliverAppBar( + expandedHeight: 120, + floating: false, + pinned: true, + backgroundColor: AppColor.primary, + flexibleSpace: CustomAppBar( + title: context.lang.exclusive_summary, + ), + ), + + // Date Range Picker + SliverToBoxAdapter( + child: FadeTransition( + opacity: _fadeAnimation, + child: Padding( + padding: const EdgeInsets.all(16), + child: DateRangePickerField( + maxDate: DateTime.now(), + startDate: state.dateFrom, + endDate: state.dateTo, + onChanged: (startDate, endDate) { + context.read().add( + ExclusiveSummaryLoaderEvent.rangeDateChanged( + startDate!, + endDate!, + ), + ); + }, + ), + ), + ), + ), + + // Content + SliverToBoxAdapter( + child: SlideTransition( + position: _slideAnimation, + child: FadeTransition( + opacity: _fadeAnimation, + child: state.isFetching + ? _buildShimmer() + : _buildContent(state.exclusiveSummary), + ), + ), + ), + + const SliverToBoxAdapter(child: SpaceHeight(80)), + ], + ), + ); + }, + ), + ), + ); + } + + // ─── SHIMMER ──────────────────────────────────────────────────────────────── + + Widget _buildShimmer() { + return Padding( + padding: const EdgeInsets.all(16), + child: Column( + children: [ + _shimmerBox(height: 160), + const SpaceHeight(16), + Row(children: [ + Expanded(child: _shimmerBox(height: 100)), + const SpaceWidth(12), + Expanded(child: _shimmerBox(height: 100)), + ]), + const SpaceHeight(16), + _shimmerBox(height: 200), + const SpaceHeight(16), + _shimmerBox(height: 150), + ], + ), + ); + } + + Widget _shimmerBox({required double height}) { + return Shimmer.fromColors( + baseColor: Colors.grey[300]!, + highlightColor: Colors.grey[100]!, + child: Container( + height: height, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16), + ), + ), + ); + } + + // ─── CONTENT ──────────────────────────────────────────────────────────────── + + Widget _buildContent(ExclusiveSummary data) { + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _buildNetProfitCard(data.summary), + const SpaceHeight(16), + _buildSummaryGrid(data.summary), + const SpaceHeight(16), + _buildReimburseCard(data.reimburse), + const SpaceHeight(16), + if (data.hppBreakdown.isNotEmpty) ...[ + _buildBreakdownSection( + title: context.lang.hpp_breakdown, + icon: LineIcons.shoppingBag, + color: AppColor.error, + items: data.hppBreakdown, + ), + const SpaceHeight(16), + ], + if (data.operationalExpenseBreakdown.isNotEmpty) ...[ + _buildBreakdownSection( + title: context.lang.operational_expense_breakdown, + icon: LineIcons.receipt, + color: AppColor.warning, + items: data.operationalExpenseBreakdown, + ), + const SpaceHeight(16), + ], + if (data.dailySummary.isNotEmpty) ...[ + _buildDailySummarySection(data.dailySummary), + const SpaceHeight(16), + ], + if (data.dailyTransactions.isNotEmpty) ...[ + _buildTransactionsSection(data.dailyTransactions), + const SpaceHeight(16), + ], + ], + ), + ); + } + + // ─── NET PROFIT HERO CARD ─────────────────────────────────────────────────── + + Widget _buildNetProfitCard(ExclusiveSummarySummary summary) { + final isPositive = summary.netProfit >= 0; + final gradientColors = isPositive + ? AppColor.successGradient + : [AppColor.error, AppColor.error.withOpacity(0.7)]; + + return TweenAnimationBuilder( + tween: Tween(begin: 0.0, end: 1.0), + duration: const Duration(milliseconds: 900), + curve: Curves.elasticOut, + builder: (context, value, _) => Transform.scale( + scale: value.clamp(0.0, 1.0), + child: Container( + width: double.infinity, + padding: const EdgeInsets.all(24), + decoration: BoxDecoration( + gradient: LinearGradient( + colors: gradientColors, + begin: Alignment.topLeft, + end: Alignment.bottomRight, + ), + borderRadius: BorderRadius.circular(20), + boxShadow: [ + BoxShadow( + color: (isPositive ? AppColor.success : AppColor.error) + .withOpacity(0.3), + blurRadius: 20, + offset: const Offset(0, 8), + ), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + padding: const EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.white.withOpacity(0.2), + borderRadius: BorderRadius.circular(12), + ), + child: Icon( + isPositive ? LineIcons.lineChart : LineIcons.arrowDown, + color: Colors.white, + size: 22, + ), + ), + const SpaceWidth(12), + Text( + context.lang.net_profit, + style: const TextStyle( + color: Colors.white, + fontSize: 16, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + const SpaceHeight(16), + Text( + summary.netProfit.currencyFormatRp, + style: const TextStyle( + color: Colors.white, + fontSize: 32, + fontWeight: FontWeight.bold, + letterSpacing: -0.5, + ), + ), + const SpaceHeight(8), + Row( + children: [ + _buildHeroStat( + context.lang.total_sales, + summary.sales.currencyFormatRp, + ), + const SpaceWidth(24), + _buildHeroStat( + context.lang.total_cost, + summary.totalCost.currencyFormatRp, + ), + ], + ), + ], + ), + ), + ), + ); + } + + Widget _buildHeroStat(String label, String value) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + label, + style: TextStyle( + color: Colors.white.withOpacity(0.8), + fontSize: 12, + ), + ), + Text( + value, + style: const TextStyle( + color: Colors.white, + fontSize: 15, + fontWeight: FontWeight.bold, + ), + ), + ], + ); + } + + // ─── SUMMARY GRID ─────────────────────────────────────────────────────────── + + Widget _buildSummaryGrid(ExclusiveSummarySummary summary) { + return Column( + children: [ + Row( + children: [ + Expanded( + child: _buildStatCard( + icon: LineIcons.arrowUp, + label: context.lang.gross_profit, + value: summary.grossProfit.currencyFormatRp, + color: AppColor.success, + ), + ), + const SpaceWidth(12), + Expanded( + child: _buildStatCard( + icon: LineIcons.shoppingBag, + label: context.lang.hpp, + value: summary.hpp.currencyFormatRp, + color: AppColor.error, + ), + ), + ], + ), + const SpaceHeight(12), + Row( + children: [ + Expanded( + child: _buildStatCard( + icon: LineIcons.users, + label: context.lang.salary_total, + value: summary.salaryTotal.currencyFormatRp, + color: AppColor.info, + ), + ), + const SpaceWidth(12), + Expanded( + child: _buildStatCard( + icon: LineIcons.receipt, + label: context.lang.operational_expenses, + value: summary.operationalExpensesTotal.currencyFormatRp, + color: AppColor.warning, + ), + ), + ], + ), + ], + ); + } + + Widget _buildStatCard({ + required IconData icon, + required String label, + required String value, + required Color color, + }) { + return Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: AppColor.white, + borderRadius: BorderRadius.circular(16), + boxShadow: [ + BoxShadow( + color: color.withOpacity(0.08), + blurRadius: 12, + offset: const Offset(0, 4), + ), + ], + border: Border.all(color: color.withOpacity(0.12)), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: const EdgeInsets.all(8), + decoration: BoxDecoration( + color: color.withOpacity(0.1), + borderRadius: BorderRadius.circular(10), + ), + child: Icon(icon, color: color, size: 18), + ), + const SpaceHeight(10), + Text( + label, + style: AppStyle.sm.copyWith(color: AppColor.textSecondary), + ), + const SpaceHeight(4), + Text( + value, + style: AppStyle.md.copyWith( + color: AppColor.textPrimary, + fontWeight: FontWeight.bold, + ), + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + ], + ), + ); + } + + // ─── REIMBURSE CARD ───────────────────────────────────────────────────────── + + Widget _buildReimburseCard(ExclusiveSummaryReimburse reimburse) { + return Container( + padding: const EdgeInsets.all(20), + decoration: BoxDecoration( + color: AppColor.white, + borderRadius: BorderRadius.circular(16), + boxShadow: [ + BoxShadow( + color: AppColor.primary.withOpacity(0.08), + blurRadius: 12, + offset: const Offset(0, 4), + ), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + padding: const EdgeInsets.all(8), + decoration: BoxDecoration( + color: AppColor.primary.withOpacity(0.1), + borderRadius: BorderRadius.circular(10), + ), + child: const Icon( + LineIcons.moneyBill, + color: AppColor.primary, + size: 18, + ), + ), + const SpaceWidth(10), + Text( + context.lang.reimburse_summary, + style: AppStyle.lg.copyWith(fontWeight: FontWeight.bold), + ), + ], + ), + const SpaceHeight(16), + _buildReimburseRow( + context.lang.total_cost, + reimburse.totalCost.currencyFormatRp, + ), + const Divider(height: 20), + _buildReimburseRow( + context.lang.excluded_salary_staff, + reimburse.excludedSalaryStaff.currencyFormatRp, + ), + const Divider(height: 20), + _buildReimburseRow( + context.lang.total_reimburse, + reimburse.totalReimburse.currencyFormatRp, + isHighlighted: true, + ), + ], + ), + ); + } + + Widget _buildReimburseRow( + String label, + String value, { + bool isHighlighted = false, + }) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + label, + style: AppStyle.sm.copyWith( + color: isHighlighted + ? AppColor.textPrimary + : AppColor.textSecondary, + fontWeight: + isHighlighted ? FontWeight.bold : FontWeight.normal, + ), + ), + Text( + value, + style: AppStyle.sm.copyWith( + color: isHighlighted ? AppColor.primary : AppColor.textPrimary, + fontWeight: + isHighlighted ? FontWeight.bold : FontWeight.w600, + ), + ), + ], + ); + } + + // ─── BREAKDOWN SECTION ────────────────────────────────────────────────────── + + Widget _buildBreakdownSection({ + required String title, + required IconData icon, + required Color color, + required List items, + }) { + return Container( + padding: const EdgeInsets.all(20), + decoration: BoxDecoration( + color: AppColor.white, + borderRadius: BorderRadius.circular(16), + boxShadow: [ + BoxShadow( + color: Colors.black.withOpacity(0.04), + blurRadius: 10, + offset: const Offset(0, 4), + ), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + padding: const EdgeInsets.all(8), + decoration: BoxDecoration( + color: color.withOpacity(0.1), + borderRadius: BorderRadius.circular(10), + ), + child: Icon(icon, color: color, size: 18), + ), + const SpaceWidth(10), + Expanded( + child: Text( + title, + style: AppStyle.lg.copyWith(fontWeight: FontWeight.bold), + ), + ), + ], + ), + const SpaceHeight(16), + ...items.map((item) => _buildBreakdownItem(item, color)), + ], + ), + ); + } + + Widget _buildBreakdownItem( + ExclusiveSummaryBreakdown item, + Color color, + ) { + return Padding( + padding: const EdgeInsets.only(bottom: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Text( + item.categoryName, + style: AppStyle.sm.copyWith( + fontWeight: FontWeight.w600, + color: AppColor.textPrimary, + ), + ), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + item.amount.currencyFormatRp, + style: AppStyle.sm.copyWith( + fontWeight: FontWeight.bold, + color: color, + ), + ), + Text( + '${item.percentage.toStringAsFixed(1)}%', + style: AppStyle.xs.copyWith( + color: AppColor.textSecondary, + ), + ), + ], + ), + ], + ), + const SpaceHeight(6), + ClipRRect( + borderRadius: BorderRadius.circular(4), + child: TweenAnimationBuilder( + tween: Tween(begin: 0.0, end: item.percentage / 100), + duration: const Duration(milliseconds: 800), + curve: Curves.easeOutCubic, + builder: (context, value, _) => LinearProgressIndicator( + value: value.clamp(0.0, 1.0), + backgroundColor: color.withOpacity(0.1), + valueColor: AlwaysStoppedAnimation(color), + minHeight: 6, + ), + ), + ), + ], + ), + ); + } + + // ─── DAILY SUMMARY ────────────────────────────────────────────────────────── + + Widget _buildDailySummarySection(List items) { + return Container( + padding: const EdgeInsets.all(20), + decoration: BoxDecoration( + color: AppColor.white, + borderRadius: BorderRadius.circular(16), + boxShadow: [ + BoxShadow( + color: Colors.black.withOpacity(0.04), + blurRadius: 10, + offset: const Offset(0, 4), + ), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + padding: const EdgeInsets.all(8), + decoration: BoxDecoration( + color: AppColor.info.withOpacity(0.1), + borderRadius: BorderRadius.circular(10), + ), + child: const Icon( + LineIcons.calendar, + color: AppColor.info, + size: 18, + ), + ), + const SpaceWidth(10), + Text( + context.lang.daily_summary, + style: AppStyle.lg.copyWith(fontWeight: FontWeight.bold), + ), + ], + ), + const SpaceHeight(16), + ListView.separated( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemCount: items.length, + separatorBuilder: (_, __) => const Divider(height: 16), + itemBuilder: (context, index) { + final item = items[index]; + return Row( + children: [ + Container( + padding: const EdgeInsets.all(8), + decoration: BoxDecoration( + color: AppColor.primary.withOpacity(0.08), + borderRadius: BorderRadius.circular(8), + ), + child: Text( + '${item.date.day}', + style: AppStyle.md.copyWith( + color: AppColor.primary, + fontWeight: FontWeight.bold, + ), + ), + ), + const SpaceWidth(12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + item.date.toDate, + style: AppStyle.sm.copyWith( + fontWeight: FontWeight.w600, + ), + ), + Text( + '${item.transactionCount} ${context.lang.transactions}', + style: AppStyle.xs.copyWith( + color: AppColor.textSecondary, + ), + ), + ], + ), + ), + Text( + item.totalCost.currencyFormatRp, + style: AppStyle.sm.copyWith( + fontWeight: FontWeight.bold, + color: AppColor.error, + ), + ), + ], + ); + }, + ), + ], + ), + ); + } + + // ─── DAILY TRANSACTIONS ───────────────────────────────────────────────────── + + Widget _buildTransactionsSection( + List items) { + return Container( + padding: const EdgeInsets.all(20), + decoration: BoxDecoration( + color: AppColor.white, + borderRadius: BorderRadius.circular(16), + boxShadow: [ + BoxShadow( + color: Colors.black.withOpacity(0.04), + blurRadius: 10, + offset: const Offset(0, 4), + ), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + padding: const EdgeInsets.all(8), + decoration: BoxDecoration( + color: AppColor.secondary.withOpacity(0.1), + borderRadius: BorderRadius.circular(10), + ), + child: const Icon( + LineIcons.list, + color: AppColor.secondary, + size: 18, + ), + ), + const SpaceWidth(10), + Text( + context.lang.daily_transactions, + style: AppStyle.lg.copyWith(fontWeight: FontWeight.bold), + ), + ], + ), + const SpaceHeight(16), + ListView.separated( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemCount: items.length, + separatorBuilder: (_, __) => const Divider(height: 16), + itemBuilder: (context, index) { + final tx = items[index]; + return Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: const EdgeInsets.symmetric( + horizontal: 8, + vertical: 4, + ), + decoration: BoxDecoration( + color: _sourceColor(tx.source).withOpacity(0.1), + borderRadius: BorderRadius.circular(8), + ), + child: Text( + _sourceLabel(tx.source), + style: AppStyle.xs.copyWith( + color: _sourceColor(tx.source), + fontWeight: FontWeight.w600, + ), + ), + ), + const SpaceWidth(10), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + tx.description, + style: AppStyle.sm.copyWith( + fontWeight: FontWeight.w600, + ), + ), + Text( + '${tx.categoryName} · ${tx.date.toShortDate}', + style: AppStyle.xs.copyWith( + color: AppColor.textSecondary, + ), + ), + ], + ), + ), + Text( + tx.amount.currencyFormatRp, + style: AppStyle.sm.copyWith( + fontWeight: FontWeight.bold, + color: AppColor.error, + ), + ), + ], + ); + }, + ), + ], + ), + ); + } + + Color _sourceColor(String source) { + switch (source) { + case 'purchase_order': + return AppColor.info; + case 'salary': + return AppColor.warning; + case 'operational': + return AppColor.secondary; + default: + return AppColor.primary; + } + } + + String _sourceLabel(String source) { + switch (source) { + case 'purchase_order': + return 'PO'; + case 'salary': + return 'Gaji'; + case 'operational': + return 'Ops'; + default: + return source; + } + } +} diff --git a/lib/presentation/pages/home/widgets/feature.dart b/lib/presentation/pages/home/widgets/feature.dart index 79a6ce1..4cc4a45 100644 --- a/lib/presentation/pages/home/widgets/feature.dart +++ b/lib/presentation/pages/home/widgets/feature.dart @@ -52,9 +52,9 @@ class HomeFeature extends StatelessWidget { onTap: () => context.router.push(FinanceRoute()), ), HomeFeatureTile( - title: context.lang.product, - iconPath: Assets.icons.icReportProduct.path, - onTap: () => context.router.push(ProductAnalyticRoute()), + title: context.lang.exclusive_summary, + iconPath: Assets.icons.icReportExclusiveSummary.path, + onTap: () => context.router.push(ExclusiveSummaryRoute()), ), // HomeFeatureTile( // title: context.lang.inventory, diff --git a/lib/presentation/router/app_router.dart b/lib/presentation/router/app_router.dart index 3bc5124..cca2477 100644 --- a/lib/presentation/router/app_router.dart +++ b/lib/presentation/router/app_router.dart @@ -50,6 +50,9 @@ class AppRouter extends RootStackRouter { // Finance page AutoRoute(page: FinanceRoute.page), + // Exclusive Summary + AutoRoute(page: ExclusiveSummaryRoute.page), + // Order AutoRoute(page: OrderDetailRoute.page), diff --git a/lib/presentation/router/app_router.gr.dart b/lib/presentation/router/app_router.gr.dart index 9a88721..fabc63f 100644 --- a/lib/presentation/router/app_router.gr.dart +++ b/lib/presentation/router/app_router.gr.dart @@ -9,12 +9,12 @@ // coverage:ignore-file // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'package:apskel_owner_flutter/domain/order/order.dart' as _i28; -import 'package:apskel_owner_flutter/domain/user/user.dart' as _i29; +import 'package:apskel_owner_flutter/domain/order/order.dart' as _i29; +import 'package:apskel_owner_flutter/domain/user/user.dart' as _i30; import 'package:apskel_owner_flutter/presentation/pages/about_app/about_app_page.dart' as _i1; import 'package:apskel_owner_flutter/presentation/pages/auth/login/login_page.dart' - as _i11; + as _i12; import 'package:apskel_owner_flutter/presentation/pages/coming_soon/coming_soon_page.dart' as _i2; import 'package:apskel_owner_flutter/presentation/pages/customer/customer_page.dart' @@ -23,56 +23,58 @@ import 'package:apskel_owner_flutter/presentation/pages/download/download_report as _i5; import 'package:apskel_owner_flutter/presentation/pages/error/error_page.dart' as _i6; -import 'package:apskel_owner_flutter/presentation/pages/finance/finance_page.dart' +import 'package:apskel_owner_flutter/presentation/pages/exclusive_summary/exclusive_summary_page.dart' as _i7; +import 'package:apskel_owner_flutter/presentation/pages/finance/finance_page.dart' + as _i8; import 'package:apskel_owner_flutter/presentation/pages/form/daily_task_form_page.dart' as _i4; import 'package:apskel_owner_flutter/presentation/pages/home/home_page.dart' - as _i8; -import 'package:apskel_owner_flutter/presentation/pages/inventory/inventory_page.dart' as _i9; -import 'package:apskel_owner_flutter/presentation/pages/language/language_page.dart' +import 'package:apskel_owner_flutter/presentation/pages/inventory/inventory_page.dart' as _i10; +import 'package:apskel_owner_flutter/presentation/pages/language/language_page.dart' + as _i11; import 'package:apskel_owner_flutter/presentation/pages/main/main_page.dart' - as _i12; -import 'package:apskel_owner_flutter/presentation/pages/order/order_detail/order_detail_page.dart' as _i13; -import 'package:apskel_owner_flutter/presentation/pages/order/order_list/order_page.dart' +import 'package:apskel_owner_flutter/presentation/pages/order/order_detail/order_detail_page.dart' as _i14; -import 'package:apskel_owner_flutter/presentation/pages/outlet/outlet_information_page.dart' +import 'package:apskel_owner_flutter/presentation/pages/order/order_list/order_page.dart' as _i15; -import 'package:apskel_owner_flutter/presentation/pages/product/product_analytic/product_analytic_page.dart' +import 'package:apskel_owner_flutter/presentation/pages/outlet/outlet_information_page.dart' as _i16; -import 'package:apskel_owner_flutter/presentation/pages/product/product_list/product_page.dart' +import 'package:apskel_owner_flutter/presentation/pages/product/product_analytic/product_analytic_page.dart' as _i17; -import 'package:apskel_owner_flutter/presentation/pages/profile/pages/profile_change_password/profile_change_password_page.dart' +import 'package:apskel_owner_flutter/presentation/pages/product/product_list/product_page.dart' as _i18; -import 'package:apskel_owner_flutter/presentation/pages/profile/pages/profile_edit/profile_edit_page.dart' +import 'package:apskel_owner_flutter/presentation/pages/profile/pages/profile_change_password/profile_change_password_page.dart' as _i19; -import 'package:apskel_owner_flutter/presentation/pages/profile/profile_page.dart' +import 'package:apskel_owner_flutter/presentation/pages/profile/pages/profile_edit/profile_edit_page.dart' as _i20; -import 'package:apskel_owner_flutter/presentation/pages/purchase/purchase_page.dart' +import 'package:apskel_owner_flutter/presentation/pages/profile/profile_page.dart' as _i21; -import 'package:apskel_owner_flutter/presentation/pages/report/report_page.dart' +import 'package:apskel_owner_flutter/presentation/pages/purchase/purchase_page.dart' as _i22; -import 'package:apskel_owner_flutter/presentation/pages/sales/sales_page.dart' +import 'package:apskel_owner_flutter/presentation/pages/report/report_page.dart' as _i23; -import 'package:apskel_owner_flutter/presentation/pages/schedule/schedule_page.dart' +import 'package:apskel_owner_flutter/presentation/pages/sales/sales_page.dart' as _i24; -import 'package:apskel_owner_flutter/presentation/pages/splash/splash_page.dart' +import 'package:apskel_owner_flutter/presentation/pages/schedule/schedule_page.dart' as _i25; -import 'package:auto_route/auto_route.dart' as _i26; -import 'package:flutter/material.dart' as _i27; +import 'package:apskel_owner_flutter/presentation/pages/splash/splash_page.dart' + as _i26; +import 'package:auto_route/auto_route.dart' as _i27; +import 'package:flutter/material.dart' as _i28; /// generated route for /// [_i1.AboutAppPage] -class AboutAppRoute extends _i26.PageRouteInfo { - const AboutAppRoute({List<_i26.PageRouteInfo>? children}) +class AboutAppRoute extends _i27.PageRouteInfo { + const AboutAppRoute({List<_i27.PageRouteInfo>? children}) : super(AboutAppRoute.name, initialChildren: children); static const String name = 'AboutAppRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i27.PageInfo page = _i27.PageInfo( name, builder: (data) { return const _i1.AboutAppPage(); @@ -82,13 +84,13 @@ class AboutAppRoute extends _i26.PageRouteInfo { /// generated route for /// [_i2.ComingSoonPage] -class ComingSoonRoute extends _i26.PageRouteInfo { - const ComingSoonRoute({List<_i26.PageRouteInfo>? children}) +class ComingSoonRoute extends _i27.PageRouteInfo { + const ComingSoonRoute({List<_i27.PageRouteInfo>? children}) : super(ComingSoonRoute.name, initialChildren: children); static const String name = 'ComingSoonRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i27.PageInfo page = _i27.PageInfo( name, builder: (data) { return const _i2.ComingSoonPage(); @@ -98,29 +100,29 @@ class ComingSoonRoute extends _i26.PageRouteInfo { /// generated route for /// [_i3.CustomerPage] -class CustomerRoute extends _i26.PageRouteInfo { - const CustomerRoute({List<_i26.PageRouteInfo>? children}) +class CustomerRoute extends _i27.PageRouteInfo { + const CustomerRoute({List<_i27.PageRouteInfo>? children}) : super(CustomerRoute.name, initialChildren: children); static const String name = 'CustomerRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i27.PageInfo page = _i27.PageInfo( name, builder: (data) { - return _i26.WrappedRoute(child: const _i3.CustomerPage()); + return _i27.WrappedRoute(child: const _i3.CustomerPage()); }, ); } /// generated route for /// [_i4.DailyTasksFormPage] -class DailyTasksFormRoute extends _i26.PageRouteInfo { - const DailyTasksFormRoute({List<_i26.PageRouteInfo>? children}) +class DailyTasksFormRoute extends _i27.PageRouteInfo { + const DailyTasksFormRoute({List<_i27.PageRouteInfo>? children}) : super(DailyTasksFormRoute.name, initialChildren: children); static const String name = 'DailyTasksFormRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i27.PageInfo page = _i27.PageInfo( name, builder: (data) { return const _i4.DailyTasksFormPage(); @@ -130,32 +132,32 @@ class DailyTasksFormRoute extends _i26.PageRouteInfo { /// generated route for /// [_i5.DownloadReportPage] -class DownloadReportRoute extends _i26.PageRouteInfo { - const DownloadReportRoute({List<_i26.PageRouteInfo>? children}) +class DownloadReportRoute extends _i27.PageRouteInfo { + const DownloadReportRoute({List<_i27.PageRouteInfo>? children}) : super(DownloadReportRoute.name, initialChildren: children); static const String name = 'DownloadReportRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i27.PageInfo page = _i27.PageInfo( name, builder: (data) { - return _i26.WrappedRoute(child: const _i5.DownloadReportPage()); + return _i27.WrappedRoute(child: const _i5.DownloadReportPage()); }, ); } /// generated route for /// [_i6.ErrorPage] -class ErrorRoute extends _i26.PageRouteInfo { +class ErrorRoute extends _i27.PageRouteInfo { ErrorRoute({ - _i27.Key? key, + _i28.Key? key, String? title, String? message, - _i27.VoidCallback? onRetry, - _i27.VoidCallback? onBack, + _i28.VoidCallback? onRetry, + _i28.VoidCallback? onBack, String? errorCode, - _i27.IconData? errorIcon, - List<_i26.PageRouteInfo>? children, + _i28.IconData? errorIcon, + List<_i27.PageRouteInfo>? children, }) : super( ErrorRoute.name, args: ErrorRouteArgs( @@ -172,7 +174,7 @@ class ErrorRoute extends _i26.PageRouteInfo { static const String name = 'ErrorRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i27.PageInfo page = _i27.PageInfo( name, builder: (data) { final args = data.argsAs( @@ -202,19 +204,19 @@ class ErrorRouteArgs { this.errorIcon, }); - final _i27.Key? key; + final _i28.Key? key; final String? title; final String? message; - final _i27.VoidCallback? onRetry; + final _i28.VoidCallback? onRetry; - final _i27.VoidCallback? onBack; + final _i28.VoidCallback? onBack; final String? errorCode; - final _i27.IconData? errorIcon; + final _i28.IconData? errorIcon; @override String toString() { @@ -223,108 +225,124 @@ class ErrorRouteArgs { } /// generated route for -/// [_i7.FinancePage] -class FinanceRoute extends _i26.PageRouteInfo { - const FinanceRoute({List<_i26.PageRouteInfo>? children}) +/// [_i7.ExclusiveSummaryPage] +class ExclusiveSummaryRoute extends _i27.PageRouteInfo { + const ExclusiveSummaryRoute({List<_i27.PageRouteInfo>? children}) + : super(ExclusiveSummaryRoute.name, initialChildren: children); + + static const String name = 'ExclusiveSummaryRoute'; + + static _i27.PageInfo page = _i27.PageInfo( + name, + builder: (data) { + return _i27.WrappedRoute(child: const _i7.ExclusiveSummaryPage()); + }, + ); +} + +/// generated route for +/// [_i8.FinancePage] +class FinanceRoute extends _i27.PageRouteInfo { + const FinanceRoute({List<_i27.PageRouteInfo>? children}) : super(FinanceRoute.name, initialChildren: children); static const String name = 'FinanceRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i27.PageInfo page = _i27.PageInfo( name, builder: (data) { - return _i26.WrappedRoute(child: const _i7.FinancePage()); + return _i27.WrappedRoute(child: const _i8.FinancePage()); }, ); } /// generated route for -/// [_i8.HomePage] -class HomeRoute extends _i26.PageRouteInfo { - const HomeRoute({List<_i26.PageRouteInfo>? children}) +/// [_i9.HomePage] +class HomeRoute extends _i27.PageRouteInfo { + const HomeRoute({List<_i27.PageRouteInfo>? children}) : super(HomeRoute.name, initialChildren: children); static const String name = 'HomeRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i27.PageInfo page = _i27.PageInfo( name, builder: (data) { - return _i26.WrappedRoute(child: const _i8.HomePage()); + return _i27.WrappedRoute(child: const _i9.HomePage()); }, ); } /// generated route for -/// [_i9.InventoryPage] -class InventoryRoute extends _i26.PageRouteInfo { - const InventoryRoute({List<_i26.PageRouteInfo>? children}) +/// [_i10.InventoryPage] +class InventoryRoute extends _i27.PageRouteInfo { + const InventoryRoute({List<_i27.PageRouteInfo>? children}) : super(InventoryRoute.name, initialChildren: children); static const String name = 'InventoryRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i27.PageInfo page = _i27.PageInfo( name, builder: (data) { - return _i26.WrappedRoute(child: const _i9.InventoryPage()); + return _i27.WrappedRoute(child: const _i10.InventoryPage()); }, ); } /// generated route for -/// [_i10.LanguagePage] -class LanguageRoute extends _i26.PageRouteInfo { - const LanguageRoute({List<_i26.PageRouteInfo>? children}) +/// [_i11.LanguagePage] +class LanguageRoute extends _i27.PageRouteInfo { + const LanguageRoute({List<_i27.PageRouteInfo>? children}) : super(LanguageRoute.name, initialChildren: children); static const String name = 'LanguageRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i27.PageInfo page = _i27.PageInfo( name, builder: (data) { - return const _i10.LanguagePage(); + return const _i11.LanguagePage(); }, ); } /// generated route for -/// [_i11.LoginPage] -class LoginRoute extends _i26.PageRouteInfo { - const LoginRoute({List<_i26.PageRouteInfo>? children}) +/// [_i12.LoginPage] +class LoginRoute extends _i27.PageRouteInfo { + const LoginRoute({List<_i27.PageRouteInfo>? children}) : super(LoginRoute.name, initialChildren: children); static const String name = 'LoginRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i27.PageInfo page = _i27.PageInfo( name, builder: (data) { - return _i26.WrappedRoute(child: const _i11.LoginPage()); + return _i27.WrappedRoute(child: const _i12.LoginPage()); }, ); } /// generated route for -/// [_i12.MainPage] -class MainRoute extends _i26.PageRouteInfo { - const MainRoute({List<_i26.PageRouteInfo>? children}) +/// [_i13.MainPage] +class MainRoute extends _i27.PageRouteInfo { + const MainRoute({List<_i27.PageRouteInfo>? children}) : super(MainRoute.name, initialChildren: children); static const String name = 'MainRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i27.PageInfo page = _i27.PageInfo( name, builder: (data) { - return const _i12.MainPage(); + return const _i13.MainPage(); }, ); } /// generated route for -/// [_i13.OrderDetailPage] -class OrderDetailRoute extends _i26.PageRouteInfo { +/// [_i14.OrderDetailPage] +class OrderDetailRoute extends _i27.PageRouteInfo { OrderDetailRoute({ - _i27.Key? key, - required _i28.Order order, - List<_i26.PageRouteInfo>? children, + _i28.Key? key, + required _i29.Order order, + List<_i27.PageRouteInfo>? children, }) : super( OrderDetailRoute.name, args: OrderDetailRouteArgs(key: key, order: order), @@ -333,11 +351,11 @@ class OrderDetailRoute extends _i26.PageRouteInfo { static const String name = 'OrderDetailRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i27.PageInfo page = _i27.PageInfo( name, builder: (data) { final args = data.argsAs(); - return _i13.OrderDetailPage(key: args.key, order: args.order); + return _i14.OrderDetailPage(key: args.key, order: args.order); }, ); } @@ -345,9 +363,9 @@ class OrderDetailRoute extends _i26.PageRouteInfo { class OrderDetailRouteArgs { const OrderDetailRouteArgs({this.key, required this.order}); - final _i27.Key? key; + final _i28.Key? key; - final _i28.Order order; + final _i29.Order order; @override String toString() { @@ -356,92 +374,92 @@ class OrderDetailRouteArgs { } /// generated route for -/// [_i14.OrderPage] -class OrderRoute extends _i26.PageRouteInfo { - const OrderRoute({List<_i26.PageRouteInfo>? children}) +/// [_i15.OrderPage] +class OrderRoute extends _i27.PageRouteInfo { + const OrderRoute({List<_i27.PageRouteInfo>? children}) : super(OrderRoute.name, initialChildren: children); static const String name = 'OrderRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i27.PageInfo page = _i27.PageInfo( name, builder: (data) { - return _i26.WrappedRoute(child: const _i14.OrderPage()); + return _i27.WrappedRoute(child: const _i15.OrderPage()); }, ); } /// generated route for -/// [_i15.OutletInformationPage] -class OutletInformationRoute extends _i26.PageRouteInfo { - const OutletInformationRoute({List<_i26.PageRouteInfo>? children}) +/// [_i16.OutletInformationPage] +class OutletInformationRoute extends _i27.PageRouteInfo { + const OutletInformationRoute({List<_i27.PageRouteInfo>? children}) : super(OutletInformationRoute.name, initialChildren: children); static const String name = 'OutletInformationRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i27.PageInfo page = _i27.PageInfo( name, builder: (data) { - return _i26.WrappedRoute(child: const _i15.OutletInformationPage()); + return _i27.WrappedRoute(child: const _i16.OutletInformationPage()); }, ); } /// generated route for -/// [_i16.ProductAnalyticPage] -class ProductAnalyticRoute extends _i26.PageRouteInfo { - const ProductAnalyticRoute({List<_i26.PageRouteInfo>? children}) +/// [_i17.ProductAnalyticPage] +class ProductAnalyticRoute extends _i27.PageRouteInfo { + const ProductAnalyticRoute({List<_i27.PageRouteInfo>? children}) : super(ProductAnalyticRoute.name, initialChildren: children); static const String name = 'ProductAnalyticRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i27.PageInfo page = _i27.PageInfo( name, builder: (data) { - return _i26.WrappedRoute(child: const _i16.ProductAnalyticPage()); + return _i27.WrappedRoute(child: const _i17.ProductAnalyticPage()); }, ); } /// generated route for -/// [_i17.ProductPage] -class ProductRoute extends _i26.PageRouteInfo { - const ProductRoute({List<_i26.PageRouteInfo>? children}) +/// [_i18.ProductPage] +class ProductRoute extends _i27.PageRouteInfo { + const ProductRoute({List<_i27.PageRouteInfo>? children}) : super(ProductRoute.name, initialChildren: children); static const String name = 'ProductRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i27.PageInfo page = _i27.PageInfo( name, builder: (data) { - return _i26.WrappedRoute(child: const _i17.ProductPage()); + return _i27.WrappedRoute(child: const _i18.ProductPage()); }, ); } /// generated route for -/// [_i18.ProfileChangePasswordPage] -class ProfileChangePasswordRoute extends _i26.PageRouteInfo { - const ProfileChangePasswordRoute({List<_i26.PageRouteInfo>? children}) +/// [_i19.ProfileChangePasswordPage] +class ProfileChangePasswordRoute extends _i27.PageRouteInfo { + const ProfileChangePasswordRoute({List<_i27.PageRouteInfo>? children}) : super(ProfileChangePasswordRoute.name, initialChildren: children); static const String name = 'ProfileChangePasswordRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i27.PageInfo page = _i27.PageInfo( name, builder: (data) { - return _i26.WrappedRoute(child: const _i18.ProfileChangePasswordPage()); + return _i27.WrappedRoute(child: const _i19.ProfileChangePasswordPage()); }, ); } /// generated route for -/// [_i19.ProfileEditPage] -class ProfileEditRoute extends _i26.PageRouteInfo { +/// [_i20.ProfileEditPage] +class ProfileEditRoute extends _i27.PageRouteInfo { ProfileEditRoute({ - _i27.Key? key, - required _i29.User user, - List<_i26.PageRouteInfo>? children, + _i28.Key? key, + required _i30.User user, + List<_i27.PageRouteInfo>? children, }) : super( ProfileEditRoute.name, args: ProfileEditRouteArgs(key: key, user: user), @@ -450,12 +468,12 @@ class ProfileEditRoute extends _i26.PageRouteInfo { static const String name = 'ProfileEditRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i27.PageInfo page = _i27.PageInfo( name, builder: (data) { final args = data.argsAs(); - return _i26.WrappedRoute( - child: _i19.ProfileEditPage(key: args.key, user: args.user), + return _i27.WrappedRoute( + child: _i20.ProfileEditPage(key: args.key, user: args.user), ); }, ); @@ -464,9 +482,9 @@ class ProfileEditRoute extends _i26.PageRouteInfo { class ProfileEditRouteArgs { const ProfileEditRouteArgs({this.key, required this.user}); - final _i27.Key? key; + final _i28.Key? key; - final _i29.User user; + final _i30.User user; @override String toString() { @@ -475,97 +493,97 @@ class ProfileEditRouteArgs { } /// generated route for -/// [_i20.ProfilePage] -class ProfileRoute extends _i26.PageRouteInfo { - const ProfileRoute({List<_i26.PageRouteInfo>? children}) +/// [_i21.ProfilePage] +class ProfileRoute extends _i27.PageRouteInfo { + const ProfileRoute({List<_i27.PageRouteInfo>? children}) : super(ProfileRoute.name, initialChildren: children); static const String name = 'ProfileRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i27.PageInfo page = _i27.PageInfo( name, builder: (data) { - return _i26.WrappedRoute(child: const _i20.ProfilePage()); + return _i27.WrappedRoute(child: const _i21.ProfilePage()); }, ); } /// generated route for -/// [_i21.PurchasePage] -class PurchaseRoute extends _i26.PageRouteInfo { - const PurchaseRoute({List<_i26.PageRouteInfo>? children}) +/// [_i22.PurchasePage] +class PurchaseRoute extends _i27.PageRouteInfo { + const PurchaseRoute({List<_i27.PageRouteInfo>? children}) : super(PurchaseRoute.name, initialChildren: children); static const String name = 'PurchaseRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i27.PageInfo page = _i27.PageInfo( name, builder: (data) { - return _i26.WrappedRoute(child: const _i21.PurchasePage()); + return _i27.WrappedRoute(child: const _i22.PurchasePage()); }, ); } /// generated route for -/// [_i22.ReportPage] -class ReportRoute extends _i26.PageRouteInfo { - const ReportRoute({List<_i26.PageRouteInfo>? children}) +/// [_i23.ReportPage] +class ReportRoute extends _i27.PageRouteInfo { + const ReportRoute({List<_i27.PageRouteInfo>? children}) : super(ReportRoute.name, initialChildren: children); static const String name = 'ReportRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i27.PageInfo page = _i27.PageInfo( name, builder: (data) { - return _i26.WrappedRoute(child: const _i22.ReportPage()); + return _i27.WrappedRoute(child: const _i23.ReportPage()); }, ); } /// generated route for -/// [_i23.SalesPage] -class SalesRoute extends _i26.PageRouteInfo { - const SalesRoute({List<_i26.PageRouteInfo>? children}) +/// [_i24.SalesPage] +class SalesRoute extends _i27.PageRouteInfo { + const SalesRoute({List<_i27.PageRouteInfo>? children}) : super(SalesRoute.name, initialChildren: children); static const String name = 'SalesRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i27.PageInfo page = _i27.PageInfo( name, builder: (data) { - return _i26.WrappedRoute(child: const _i23.SalesPage()); + return _i27.WrappedRoute(child: const _i24.SalesPage()); }, ); } /// generated route for -/// [_i24.SchedulePage] -class ScheduleRoute extends _i26.PageRouteInfo { - const ScheduleRoute({List<_i26.PageRouteInfo>? children}) +/// [_i25.SchedulePage] +class ScheduleRoute extends _i27.PageRouteInfo { + const ScheduleRoute({List<_i27.PageRouteInfo>? children}) : super(ScheduleRoute.name, initialChildren: children); static const String name = 'ScheduleRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i27.PageInfo page = _i27.PageInfo( name, builder: (data) { - return const _i24.SchedulePage(); + return const _i25.SchedulePage(); }, ); } /// generated route for -/// [_i25.SplashPage] -class SplashRoute extends _i26.PageRouteInfo { - const SplashRoute({List<_i26.PageRouteInfo>? children}) +/// [_i26.SplashPage] +class SplashRoute extends _i27.PageRouteInfo { + const SplashRoute({List<_i27.PageRouteInfo>? children}) : super(SplashRoute.name, initialChildren: children); static const String name = 'SplashRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i27.PageInfo page = _i27.PageInfo( name, builder: (data) { - return const _i25.SplashPage(); + return const _i26.SplashPage(); }, ); } diff --git a/pubspec.yaml b/pubspec.yaml index 1790c71..c88996f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: "A new Flutter project." publish_to: "none" -version: 1.0.2+7 +version: 1.0.3+8 environment: sdk: ^3.8.1