feat: category analytic source

This commit is contained in:
efrilm
2025-08-17 22:46:25 +07:00
parent 50b06da627
commit 8eef620c16
13 changed files with 1929 additions and 638 deletions
@@ -2670,3 +2670,591 @@ abstract class _ProfitLossProductDataDto extends ProfitLossProductDataDto {
_$$ProfitLossProductDataDtoImplCopyWith<_$ProfitLossProductDataDtoImpl>
get copyWith => throw _privateConstructorUsedError;
}
CategoryAnalyticDto _$CategoryAnalyticDtoFromJson(Map<String, dynamic> json) {
return _CategoryAnalyticDto.fromJson(json);
}
/// @nodoc
mixin _$CategoryAnalyticDto {
@JsonKey(name: 'organization_id')
String? get organizationId => throw _privateConstructorUsedError;
@JsonKey(name: 'outlet_id')
String? get outletId => throw _privateConstructorUsedError;
@JsonKey(name: 'date_from')
String? get dateFrom => throw _privateConstructorUsedError;
@JsonKey(name: 'date_to')
String? get dateTo => throw _privateConstructorUsedError;
@JsonKey(name: 'data')
List<CategoryAnalyticItemDto>? get data => throw _privateConstructorUsedError;
/// Serializes this CategoryAnalyticDto to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of CategoryAnalyticDto
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$CategoryAnalyticDtoCopyWith<CategoryAnalyticDto> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $CategoryAnalyticDtoCopyWith<$Res> {
factory $CategoryAnalyticDtoCopyWith(
CategoryAnalyticDto value,
$Res Function(CategoryAnalyticDto) then,
) = _$CategoryAnalyticDtoCopyWithImpl<$Res, CategoryAnalyticDto>;
@useResult
$Res call({
@JsonKey(name: 'organization_id') String? organizationId,
@JsonKey(name: 'outlet_id') String? outletId,
@JsonKey(name: 'date_from') String? dateFrom,
@JsonKey(name: 'date_to') String? dateTo,
@JsonKey(name: 'data') List<CategoryAnalyticItemDto>? data,
});
}
/// @nodoc
class _$CategoryAnalyticDtoCopyWithImpl<$Res, $Val extends CategoryAnalyticDto>
implements $CategoryAnalyticDtoCopyWith<$Res> {
_$CategoryAnalyticDtoCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of CategoryAnalyticDto
/// 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? dateFrom = freezed,
Object? dateTo = freezed,
Object? data = 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?,
dateFrom: freezed == dateFrom
? _value.dateFrom
: dateFrom // ignore: cast_nullable_to_non_nullable
as String?,
dateTo: freezed == dateTo
? _value.dateTo
: dateTo // ignore: cast_nullable_to_non_nullable
as String?,
data: freezed == data
? _value.data
: data // ignore: cast_nullable_to_non_nullable
as List<CategoryAnalyticItemDto>?,
)
as $Val,
);
}
}
/// @nodoc
abstract class _$$CategoryAnalyticDtoImplCopyWith<$Res>
implements $CategoryAnalyticDtoCopyWith<$Res> {
factory _$$CategoryAnalyticDtoImplCopyWith(
_$CategoryAnalyticDtoImpl value,
$Res Function(_$CategoryAnalyticDtoImpl) then,
) = __$$CategoryAnalyticDtoImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
@JsonKey(name: 'organization_id') String? organizationId,
@JsonKey(name: 'outlet_id') String? outletId,
@JsonKey(name: 'date_from') String? dateFrom,
@JsonKey(name: 'date_to') String? dateTo,
@JsonKey(name: 'data') List<CategoryAnalyticItemDto>? data,
});
}
/// @nodoc
class __$$CategoryAnalyticDtoImplCopyWithImpl<$Res>
extends _$CategoryAnalyticDtoCopyWithImpl<$Res, _$CategoryAnalyticDtoImpl>
implements _$$CategoryAnalyticDtoImplCopyWith<$Res> {
__$$CategoryAnalyticDtoImplCopyWithImpl(
_$CategoryAnalyticDtoImpl _value,
$Res Function(_$CategoryAnalyticDtoImpl) _then,
) : super(_value, _then);
/// Create a copy of CategoryAnalyticDto
/// 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? dateFrom = freezed,
Object? dateTo = freezed,
Object? data = freezed,
}) {
return _then(
_$CategoryAnalyticDtoImpl(
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?,
dateFrom: freezed == dateFrom
? _value.dateFrom
: dateFrom // ignore: cast_nullable_to_non_nullable
as String?,
dateTo: freezed == dateTo
? _value.dateTo
: dateTo // ignore: cast_nullable_to_non_nullable
as String?,
data: freezed == data
? _value._data
: data // ignore: cast_nullable_to_non_nullable
as List<CategoryAnalyticItemDto>?,
),
);
}
}
/// @nodoc
@JsonSerializable()
class _$CategoryAnalyticDtoImpl extends _CategoryAnalyticDto {
const _$CategoryAnalyticDtoImpl({
@JsonKey(name: 'organization_id') this.organizationId,
@JsonKey(name: 'outlet_id') this.outletId,
@JsonKey(name: 'date_from') this.dateFrom,
@JsonKey(name: 'date_to') this.dateTo,
@JsonKey(name: 'data') final List<CategoryAnalyticItemDto>? data,
}) : _data = data,
super._();
factory _$CategoryAnalyticDtoImpl.fromJson(Map<String, dynamic> json) =>
_$$CategoryAnalyticDtoImplFromJson(json);
@override
@JsonKey(name: 'organization_id')
final String? organizationId;
@override
@JsonKey(name: 'outlet_id')
final String? outletId;
@override
@JsonKey(name: 'date_from')
final String? dateFrom;
@override
@JsonKey(name: 'date_to')
final String? dateTo;
final List<CategoryAnalyticItemDto>? _data;
@override
@JsonKey(name: 'data')
List<CategoryAnalyticItemDto>? get data {
final value = _data;
if (value == null) return null;
if (_data is EqualUnmodifiableListView) return _data;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(value);
}
@override
String toString() {
return 'CategoryAnalyticDto(organizationId: $organizationId, outletId: $outletId, dateFrom: $dateFrom, dateTo: $dateTo, data: $data)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$CategoryAnalyticDtoImpl &&
(identical(other.organizationId, organizationId) ||
other.organizationId == organizationId) &&
(identical(other.outletId, outletId) ||
other.outletId == outletId) &&
(identical(other.dateFrom, dateFrom) ||
other.dateFrom == dateFrom) &&
(identical(other.dateTo, dateTo) || other.dateTo == dateTo) &&
const DeepCollectionEquality().equals(other._data, _data));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
organizationId,
outletId,
dateFrom,
dateTo,
const DeepCollectionEquality().hash(_data),
);
/// Create a copy of CategoryAnalyticDto
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$CategoryAnalyticDtoImplCopyWith<_$CategoryAnalyticDtoImpl> get copyWith =>
__$$CategoryAnalyticDtoImplCopyWithImpl<_$CategoryAnalyticDtoImpl>(
this,
_$identity,
);
@override
Map<String, dynamic> toJson() {
return _$$CategoryAnalyticDtoImplToJson(this);
}
}
abstract class _CategoryAnalyticDto extends CategoryAnalyticDto {
const factory _CategoryAnalyticDto({
@JsonKey(name: 'organization_id') final String? organizationId,
@JsonKey(name: 'outlet_id') final String? outletId,
@JsonKey(name: 'date_from') final String? dateFrom,
@JsonKey(name: 'date_to') final String? dateTo,
@JsonKey(name: 'data') final List<CategoryAnalyticItemDto>? data,
}) = _$CategoryAnalyticDtoImpl;
const _CategoryAnalyticDto._() : super._();
factory _CategoryAnalyticDto.fromJson(Map<String, dynamic> json) =
_$CategoryAnalyticDtoImpl.fromJson;
@override
@JsonKey(name: 'organization_id')
String? get organizationId;
@override
@JsonKey(name: 'outlet_id')
String? get outletId;
@override
@JsonKey(name: 'date_from')
String? get dateFrom;
@override
@JsonKey(name: 'date_to')
String? get dateTo;
@override
@JsonKey(name: 'data')
List<CategoryAnalyticItemDto>? get data;
/// Create a copy of CategoryAnalyticDto
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$CategoryAnalyticDtoImplCopyWith<_$CategoryAnalyticDtoImpl> get copyWith =>
throw _privateConstructorUsedError;
}
CategoryAnalyticItemDto _$CategoryAnalyticItemDtoFromJson(
Map<String, dynamic> json,
) {
return _CategoryAnalyticItemDto.fromJson(json);
}
/// @nodoc
mixin _$CategoryAnalyticItemDto {
@JsonKey(name: 'category_id')
String? get categoryId => throw _privateConstructorUsedError;
@JsonKey(name: 'category_name')
String? get categoryName => throw _privateConstructorUsedError;
@JsonKey(name: 'total_revenue')
int? get totalRevenue => throw _privateConstructorUsedError;
@JsonKey(name: 'total_quantity')
int? get totalQuantity => throw _privateConstructorUsedError;
@JsonKey(name: 'product_count')
int? get productCount => throw _privateConstructorUsedError;
@JsonKey(name: 'order_count')
int? get orderCount => throw _privateConstructorUsedError;
/// Serializes this CategoryAnalyticItemDto to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of CategoryAnalyticItemDto
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$CategoryAnalyticItemDtoCopyWith<CategoryAnalyticItemDto> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $CategoryAnalyticItemDtoCopyWith<$Res> {
factory $CategoryAnalyticItemDtoCopyWith(
CategoryAnalyticItemDto value,
$Res Function(CategoryAnalyticItemDto) then,
) = _$CategoryAnalyticItemDtoCopyWithImpl<$Res, CategoryAnalyticItemDto>;
@useResult
$Res call({
@JsonKey(name: 'category_id') String? categoryId,
@JsonKey(name: 'category_name') String? categoryName,
@JsonKey(name: 'total_revenue') int? totalRevenue,
@JsonKey(name: 'total_quantity') int? totalQuantity,
@JsonKey(name: 'product_count') int? productCount,
@JsonKey(name: 'order_count') int? orderCount,
});
}
/// @nodoc
class _$CategoryAnalyticItemDtoCopyWithImpl<
$Res,
$Val extends CategoryAnalyticItemDto
>
implements $CategoryAnalyticItemDtoCopyWith<$Res> {
_$CategoryAnalyticItemDtoCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of CategoryAnalyticItemDto
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? categoryId = freezed,
Object? categoryName = freezed,
Object? totalRevenue = freezed,
Object? totalQuantity = freezed,
Object? productCount = freezed,
Object? orderCount = freezed,
}) {
return _then(
_value.copyWith(
categoryId: freezed == categoryId
? _value.categoryId
: categoryId // ignore: cast_nullable_to_non_nullable
as String?,
categoryName: freezed == categoryName
? _value.categoryName
: categoryName // ignore: cast_nullable_to_non_nullable
as String?,
totalRevenue: freezed == totalRevenue
? _value.totalRevenue
: totalRevenue // ignore: cast_nullable_to_non_nullable
as int?,
totalQuantity: freezed == totalQuantity
? _value.totalQuantity
: totalQuantity // ignore: cast_nullable_to_non_nullable
as int?,
productCount: freezed == productCount
? _value.productCount
: productCount // ignore: cast_nullable_to_non_nullable
as int?,
orderCount: freezed == orderCount
? _value.orderCount
: orderCount // ignore: cast_nullable_to_non_nullable
as int?,
)
as $Val,
);
}
}
/// @nodoc
abstract class _$$CategoryAnalyticItemDtoImplCopyWith<$Res>
implements $CategoryAnalyticItemDtoCopyWith<$Res> {
factory _$$CategoryAnalyticItemDtoImplCopyWith(
_$CategoryAnalyticItemDtoImpl value,
$Res Function(_$CategoryAnalyticItemDtoImpl) then,
) = __$$CategoryAnalyticItemDtoImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
@JsonKey(name: 'category_id') String? categoryId,
@JsonKey(name: 'category_name') String? categoryName,
@JsonKey(name: 'total_revenue') int? totalRevenue,
@JsonKey(name: 'total_quantity') int? totalQuantity,
@JsonKey(name: 'product_count') int? productCount,
@JsonKey(name: 'order_count') int? orderCount,
});
}
/// @nodoc
class __$$CategoryAnalyticItemDtoImplCopyWithImpl<$Res>
extends
_$CategoryAnalyticItemDtoCopyWithImpl<
$Res,
_$CategoryAnalyticItemDtoImpl
>
implements _$$CategoryAnalyticItemDtoImplCopyWith<$Res> {
__$$CategoryAnalyticItemDtoImplCopyWithImpl(
_$CategoryAnalyticItemDtoImpl _value,
$Res Function(_$CategoryAnalyticItemDtoImpl) _then,
) : super(_value, _then);
/// Create a copy of CategoryAnalyticItemDto
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? categoryId = freezed,
Object? categoryName = freezed,
Object? totalRevenue = freezed,
Object? totalQuantity = freezed,
Object? productCount = freezed,
Object? orderCount = freezed,
}) {
return _then(
_$CategoryAnalyticItemDtoImpl(
categoryId: freezed == categoryId
? _value.categoryId
: categoryId // ignore: cast_nullable_to_non_nullable
as String?,
categoryName: freezed == categoryName
? _value.categoryName
: categoryName // ignore: cast_nullable_to_non_nullable
as String?,
totalRevenue: freezed == totalRevenue
? _value.totalRevenue
: totalRevenue // ignore: cast_nullable_to_non_nullable
as int?,
totalQuantity: freezed == totalQuantity
? _value.totalQuantity
: totalQuantity // ignore: cast_nullable_to_non_nullable
as int?,
productCount: freezed == productCount
? _value.productCount
: productCount // ignore: cast_nullable_to_non_nullable
as int?,
orderCount: freezed == orderCount
? _value.orderCount
: orderCount // ignore: cast_nullable_to_non_nullable
as int?,
),
);
}
}
/// @nodoc
@JsonSerializable()
class _$CategoryAnalyticItemDtoImpl extends _CategoryAnalyticItemDto {
const _$CategoryAnalyticItemDtoImpl({
@JsonKey(name: 'category_id') this.categoryId,
@JsonKey(name: 'category_name') this.categoryName,
@JsonKey(name: 'total_revenue') this.totalRevenue,
@JsonKey(name: 'total_quantity') this.totalQuantity,
@JsonKey(name: 'product_count') this.productCount,
@JsonKey(name: 'order_count') this.orderCount,
}) : super._();
factory _$CategoryAnalyticItemDtoImpl.fromJson(Map<String, dynamic> json) =>
_$$CategoryAnalyticItemDtoImplFromJson(json);
@override
@JsonKey(name: 'category_id')
final String? categoryId;
@override
@JsonKey(name: 'category_name')
final String? categoryName;
@override
@JsonKey(name: 'total_revenue')
final int? totalRevenue;
@override
@JsonKey(name: 'total_quantity')
final int? totalQuantity;
@override
@JsonKey(name: 'product_count')
final int? productCount;
@override
@JsonKey(name: 'order_count')
final int? orderCount;
@override
String toString() {
return 'CategoryAnalyticItemDto(categoryId: $categoryId, categoryName: $categoryName, totalRevenue: $totalRevenue, totalQuantity: $totalQuantity, productCount: $productCount, orderCount: $orderCount)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$CategoryAnalyticItemDtoImpl &&
(identical(other.categoryId, categoryId) ||
other.categoryId == categoryId) &&
(identical(other.categoryName, categoryName) ||
other.categoryName == categoryName) &&
(identical(other.totalRevenue, totalRevenue) ||
other.totalRevenue == totalRevenue) &&
(identical(other.totalQuantity, totalQuantity) ||
other.totalQuantity == totalQuantity) &&
(identical(other.productCount, productCount) ||
other.productCount == productCount) &&
(identical(other.orderCount, orderCount) ||
other.orderCount == orderCount));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
categoryId,
categoryName,
totalRevenue,
totalQuantity,
productCount,
orderCount,
);
/// Create a copy of CategoryAnalyticItemDto
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$CategoryAnalyticItemDtoImplCopyWith<_$CategoryAnalyticItemDtoImpl>
get copyWith =>
__$$CategoryAnalyticItemDtoImplCopyWithImpl<
_$CategoryAnalyticItemDtoImpl
>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$CategoryAnalyticItemDtoImplToJson(this);
}
}
abstract class _CategoryAnalyticItemDto extends CategoryAnalyticItemDto {
const factory _CategoryAnalyticItemDto({
@JsonKey(name: 'category_id') final String? categoryId,
@JsonKey(name: 'category_name') final String? categoryName,
@JsonKey(name: 'total_revenue') final int? totalRevenue,
@JsonKey(name: 'total_quantity') final int? totalQuantity,
@JsonKey(name: 'product_count') final int? productCount,
@JsonKey(name: 'order_count') final int? orderCount,
}) = _$CategoryAnalyticItemDtoImpl;
const _CategoryAnalyticItemDto._() : super._();
factory _CategoryAnalyticItemDto.fromJson(Map<String, dynamic> json) =
_$CategoryAnalyticItemDtoImpl.fromJson;
@override
@JsonKey(name: 'category_id')
String? get categoryId;
@override
@JsonKey(name: 'category_name')
String? get categoryName;
@override
@JsonKey(name: 'total_revenue')
int? get totalRevenue;
@override
@JsonKey(name: 'total_quantity')
int? get totalQuantity;
@override
@JsonKey(name: 'product_count')
int? get productCount;
@override
@JsonKey(name: 'order_count')
int? get orderCount;
/// Create a copy of CategoryAnalyticItemDto
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$CategoryAnalyticItemDtoImplCopyWith<_$CategoryAnalyticItemDtoImpl>
get copyWith => throw _privateConstructorUsedError;
}