Files
apskel-pos-flutter-v2/lib/infrastructure/product/product_dtos.freezed.dart
T
efrilmandClaude Opus 5 1505a83dd3 feat: dukung penjualan produk per timbangan
Produk kini punya cara jual `unit` (cacah) atau `weight` (timbangan),
mengikuti kontrak backend di docs/integration-weight-based-products.md.

- tipe SellBy, domain/infrastructure unit baru, dan endpoint /api/v1/units
- dialog input berat saat produk timbangan ditambahkan ke keranjang
- tiap penimbangan jadi baris keranjang sendiri; total baris dihitung
  berat x harga satuan, sedangkan produk cacah tetap digabung
- request ke backend mengirim quantity 1 dan membawa berat
- migrasi DB v3: kolom sell_by, unit_id, unit_name, unit_abbreviation
  di tabel products supaya satuan tetap tampil saat offline
- tampilan keranjang, struk, split bill, void, dan refund memakai berat
- test/weight_based_products_test.dart menutup perilaku di atas (9 test)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-06 23:03:31 +07:00

1589 lines
53 KiB
Dart

// 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 'product_dtos.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
T _$identity<T>(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',
);
ListProductDto _$ListProductDtoFromJson(Map<String, dynamic> json) {
return _ListProductDto.fromJson(json);
}
/// @nodoc
mixin _$ListProductDto {
@JsonKey(name: "products")
List<ProductDto> get products => throw _privateConstructorUsedError;
@JsonKey(name: "total_count")
int get totalCount => throw _privateConstructorUsedError;
@JsonKey(name: "page")
int get page => throw _privateConstructorUsedError;
@JsonKey(name: "limit")
int get limit => throw _privateConstructorUsedError;
@JsonKey(name: "total_pages")
int get totalPages => throw _privateConstructorUsedError;
/// Serializes this ListProductDto to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of ListProductDto
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$ListProductDtoCopyWith<ListProductDto> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $ListProductDtoCopyWith<$Res> {
factory $ListProductDtoCopyWith(
ListProductDto value,
$Res Function(ListProductDto) then,
) = _$ListProductDtoCopyWithImpl<$Res, ListProductDto>;
@useResult
$Res call({
@JsonKey(name: "products") List<ProductDto> products,
@JsonKey(name: "total_count") int totalCount,
@JsonKey(name: "page") int page,
@JsonKey(name: "limit") int limit,
@JsonKey(name: "total_pages") int totalPages,
});
}
/// @nodoc
class _$ListProductDtoCopyWithImpl<$Res, $Val extends ListProductDto>
implements $ListProductDtoCopyWith<$Res> {
_$ListProductDtoCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of ListProductDto
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? products = null,
Object? totalCount = null,
Object? page = null,
Object? limit = null,
Object? totalPages = null,
}) {
return _then(
_value.copyWith(
products: null == products
? _value.products
: products // ignore: cast_nullable_to_non_nullable
as List<ProductDto>,
totalCount: null == totalCount
? _value.totalCount
: totalCount // ignore: cast_nullable_to_non_nullable
as int,
page: null == page
? _value.page
: page // ignore: cast_nullable_to_non_nullable
as int,
limit: null == limit
? _value.limit
: limit // ignore: cast_nullable_to_non_nullable
as int,
totalPages: null == totalPages
? _value.totalPages
: totalPages // ignore: cast_nullable_to_non_nullable
as int,
)
as $Val,
);
}
}
/// @nodoc
abstract class _$$ListProductDtoImplCopyWith<$Res>
implements $ListProductDtoCopyWith<$Res> {
factory _$$ListProductDtoImplCopyWith(
_$ListProductDtoImpl value,
$Res Function(_$ListProductDtoImpl) then,
) = __$$ListProductDtoImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
@JsonKey(name: "products") List<ProductDto> products,
@JsonKey(name: "total_count") int totalCount,
@JsonKey(name: "page") int page,
@JsonKey(name: "limit") int limit,
@JsonKey(name: "total_pages") int totalPages,
});
}
/// @nodoc
class __$$ListProductDtoImplCopyWithImpl<$Res>
extends _$ListProductDtoCopyWithImpl<$Res, _$ListProductDtoImpl>
implements _$$ListProductDtoImplCopyWith<$Res> {
__$$ListProductDtoImplCopyWithImpl(
_$ListProductDtoImpl _value,
$Res Function(_$ListProductDtoImpl) _then,
) : super(_value, _then);
/// Create a copy of ListProductDto
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? products = null,
Object? totalCount = null,
Object? page = null,
Object? limit = null,
Object? totalPages = null,
}) {
return _then(
_$ListProductDtoImpl(
products: null == products
? _value._products
: products // ignore: cast_nullable_to_non_nullable
as List<ProductDto>,
totalCount: null == totalCount
? _value.totalCount
: totalCount // ignore: cast_nullable_to_non_nullable
as int,
page: null == page
? _value.page
: page // ignore: cast_nullable_to_non_nullable
as int,
limit: null == limit
? _value.limit
: limit // ignore: cast_nullable_to_non_nullable
as int,
totalPages: null == totalPages
? _value.totalPages
: totalPages // ignore: cast_nullable_to_non_nullable
as int,
),
);
}
}
/// @nodoc
@JsonSerializable()
class _$ListProductDtoImpl extends _ListProductDto {
const _$ListProductDtoImpl({
@JsonKey(name: "products") required final List<ProductDto> products,
@JsonKey(name: "total_count") required this.totalCount,
@JsonKey(name: "page") required this.page,
@JsonKey(name: "limit") required this.limit,
@JsonKey(name: "total_pages") required this.totalPages,
}) : _products = products,
super._();
factory _$ListProductDtoImpl.fromJson(Map<String, dynamic> json) =>
_$$ListProductDtoImplFromJson(json);
final List<ProductDto> _products;
@override
@JsonKey(name: "products")
List<ProductDto> get products {
if (_products is EqualUnmodifiableListView) return _products;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_products);
}
@override
@JsonKey(name: "total_count")
final int totalCount;
@override
@JsonKey(name: "page")
final int page;
@override
@JsonKey(name: "limit")
final int limit;
@override
@JsonKey(name: "total_pages")
final int totalPages;
@override
String toString() {
return 'ListProductDto(products: $products, totalCount: $totalCount, page: $page, limit: $limit, totalPages: $totalPages)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ListProductDtoImpl &&
const DeepCollectionEquality().equals(other._products, _products) &&
(identical(other.totalCount, totalCount) ||
other.totalCount == totalCount) &&
(identical(other.page, page) || other.page == page) &&
(identical(other.limit, limit) || other.limit == limit) &&
(identical(other.totalPages, totalPages) ||
other.totalPages == totalPages));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
const DeepCollectionEquality().hash(_products),
totalCount,
page,
limit,
totalPages,
);
/// Create a copy of ListProductDto
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ListProductDtoImplCopyWith<_$ListProductDtoImpl> get copyWith =>
__$$ListProductDtoImplCopyWithImpl<_$ListProductDtoImpl>(
this,
_$identity,
);
@override
Map<String, dynamic> toJson() {
return _$$ListProductDtoImplToJson(this);
}
}
abstract class _ListProductDto extends ListProductDto {
const factory _ListProductDto({
@JsonKey(name: "products") required final List<ProductDto> products,
@JsonKey(name: "total_count") required final int totalCount,
@JsonKey(name: "page") required final int page,
@JsonKey(name: "limit") required final int limit,
@JsonKey(name: "total_pages") required final int totalPages,
}) = _$ListProductDtoImpl;
const _ListProductDto._() : super._();
factory _ListProductDto.fromJson(Map<String, dynamic> json) =
_$ListProductDtoImpl.fromJson;
@override
@JsonKey(name: "products")
List<ProductDto> get products;
@override
@JsonKey(name: "total_count")
int get totalCount;
@override
@JsonKey(name: "page")
int get page;
@override
@JsonKey(name: "limit")
int get limit;
@override
@JsonKey(name: "total_pages")
int get totalPages;
/// Create a copy of ListProductDto
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ListProductDtoImplCopyWith<_$ListProductDtoImpl> get copyWith =>
throw _privateConstructorUsedError;
}
ProductUnitDto _$ProductUnitDtoFromJson(Map<String, dynamic> json) {
return _ProductUnitDto.fromJson(json);
}
/// @nodoc
mixin _$ProductUnitDto {
@JsonKey(name: "id")
String? get id => throw _privateConstructorUsedError;
@JsonKey(name: "name")
String? get name => throw _privateConstructorUsedError;
@JsonKey(name: "abbreviation")
String? get abbreviation => throw _privateConstructorUsedError;
/// Serializes this ProductUnitDto to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of ProductUnitDto
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$ProductUnitDtoCopyWith<ProductUnitDto> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $ProductUnitDtoCopyWith<$Res> {
factory $ProductUnitDtoCopyWith(
ProductUnitDto value,
$Res Function(ProductUnitDto) then,
) = _$ProductUnitDtoCopyWithImpl<$Res, ProductUnitDto>;
@useResult
$Res call({
@JsonKey(name: "id") String? id,
@JsonKey(name: "name") String? name,
@JsonKey(name: "abbreviation") String? abbreviation,
});
}
/// @nodoc
class _$ProductUnitDtoCopyWithImpl<$Res, $Val extends ProductUnitDto>
implements $ProductUnitDtoCopyWith<$Res> {
_$ProductUnitDtoCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of ProductUnitDto
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? id = freezed,
Object? name = freezed,
Object? abbreviation = freezed,
}) {
return _then(
_value.copyWith(
id: freezed == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as String?,
name: freezed == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String?,
abbreviation: freezed == abbreviation
? _value.abbreviation
: abbreviation // ignore: cast_nullable_to_non_nullable
as String?,
)
as $Val,
);
}
}
/// @nodoc
abstract class _$$ProductUnitDtoImplCopyWith<$Res>
implements $ProductUnitDtoCopyWith<$Res> {
factory _$$ProductUnitDtoImplCopyWith(
_$ProductUnitDtoImpl value,
$Res Function(_$ProductUnitDtoImpl) then,
) = __$$ProductUnitDtoImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
@JsonKey(name: "id") String? id,
@JsonKey(name: "name") String? name,
@JsonKey(name: "abbreviation") String? abbreviation,
});
}
/// @nodoc
class __$$ProductUnitDtoImplCopyWithImpl<$Res>
extends _$ProductUnitDtoCopyWithImpl<$Res, _$ProductUnitDtoImpl>
implements _$$ProductUnitDtoImplCopyWith<$Res> {
__$$ProductUnitDtoImplCopyWithImpl(
_$ProductUnitDtoImpl _value,
$Res Function(_$ProductUnitDtoImpl) _then,
) : super(_value, _then);
/// Create a copy of ProductUnitDto
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? id = freezed,
Object? name = freezed,
Object? abbreviation = freezed,
}) {
return _then(
_$ProductUnitDtoImpl(
id: freezed == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as String?,
name: freezed == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String?,
abbreviation: freezed == abbreviation
? _value.abbreviation
: abbreviation // ignore: cast_nullable_to_non_nullable
as String?,
),
);
}
}
/// @nodoc
@JsonSerializable()
class _$ProductUnitDtoImpl extends _ProductUnitDto {
const _$ProductUnitDtoImpl({
@JsonKey(name: "id") this.id,
@JsonKey(name: "name") this.name,
@JsonKey(name: "abbreviation") this.abbreviation,
}) : super._();
factory _$ProductUnitDtoImpl.fromJson(Map<String, dynamic> json) =>
_$$ProductUnitDtoImplFromJson(json);
@override
@JsonKey(name: "id")
final String? id;
@override
@JsonKey(name: "name")
final String? name;
@override
@JsonKey(name: "abbreviation")
final String? abbreviation;
@override
String toString() {
return 'ProductUnitDto(id: $id, name: $name, abbreviation: $abbreviation)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ProductUnitDtoImpl &&
(identical(other.id, id) || other.id == id) &&
(identical(other.name, name) || other.name == name) &&
(identical(other.abbreviation, abbreviation) ||
other.abbreviation == abbreviation));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, id, name, abbreviation);
/// Create a copy of ProductUnitDto
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ProductUnitDtoImplCopyWith<_$ProductUnitDtoImpl> get copyWith =>
__$$ProductUnitDtoImplCopyWithImpl<_$ProductUnitDtoImpl>(
this,
_$identity,
);
@override
Map<String, dynamic> toJson() {
return _$$ProductUnitDtoImplToJson(this);
}
}
abstract class _ProductUnitDto extends ProductUnitDto {
const factory _ProductUnitDto({
@JsonKey(name: "id") final String? id,
@JsonKey(name: "name") final String? name,
@JsonKey(name: "abbreviation") final String? abbreviation,
}) = _$ProductUnitDtoImpl;
const _ProductUnitDto._() : super._();
factory _ProductUnitDto.fromJson(Map<String, dynamic> json) =
_$ProductUnitDtoImpl.fromJson;
@override
@JsonKey(name: "id")
String? get id;
@override
@JsonKey(name: "name")
String? get name;
@override
@JsonKey(name: "abbreviation")
String? get abbreviation;
/// Create a copy of ProductUnitDto
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ProductUnitDtoImplCopyWith<_$ProductUnitDtoImpl> get copyWith =>
throw _privateConstructorUsedError;
}
ProductDto _$ProductDtoFromJson(Map<String, dynamic> json) {
return _ProductDto.fromJson(json);
}
/// @nodoc
mixin _$ProductDto {
@JsonKey(name: "id")
String? get id => throw _privateConstructorUsedError;
@JsonKey(name: "organization_id")
String? get organizationId => throw _privateConstructorUsedError;
@JsonKey(name: "category_id")
String? get categoryId => throw _privateConstructorUsedError;
@JsonKey(name: "sku")
String? get sku => throw _privateConstructorUsedError;
@JsonKey(name: "name")
String? get name => throw _privateConstructorUsedError;
@JsonKey(name: "description")
String? get description => throw _privateConstructorUsedError;
@JsonKey(name: "price")
double? get price => throw _privateConstructorUsedError;
@JsonKey(name: "cost")
double? get cost => throw _privateConstructorUsedError;
@JsonKey(name: "business_type")
String? get businessType => throw _privateConstructorUsedError;
@JsonKey(name: "image_url")
String? get imageUrl => throw _privateConstructorUsedError;
@JsonKey(name: "printer_type")
String? get printerType => throw _privateConstructorUsedError;
@JsonKey(name: "print_to_checker")
bool? get printToChecker => throw _privateConstructorUsedError;
@JsonKey(name: "metadata")
Map<String, dynamic>? get metadata => throw _privateConstructorUsedError;
@JsonKey(name: "is_active")
bool? get isActive => throw _privateConstructorUsedError;
@JsonKey(name: "created_at")
String? get createdAt => throw _privateConstructorUsedError;
@JsonKey(name: "updated_at")
String? get updatedAt => throw _privateConstructorUsedError;
@JsonKey(name: "variants")
List<ProductVariantDto>? get variants => throw _privateConstructorUsedError;
@JsonKey(name: "sell_by")
String? get sellBy => throw _privateConstructorUsedError;
@JsonKey(name: "unit_id")
String? get unitId => throw _privateConstructorUsedError;
@JsonKey(name: "unit_name")
String? get unitName => throw _privateConstructorUsedError;
@JsonKey(name: "unit_abbreviation")
String? get unitAbbreviation => throw _privateConstructorUsedError;
@JsonKey(name: "unit")
ProductUnitDto? get unit => throw _privateConstructorUsedError;
/// Serializes this ProductDto to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of ProductDto
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$ProductDtoCopyWith<ProductDto> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $ProductDtoCopyWith<$Res> {
factory $ProductDtoCopyWith(
ProductDto value,
$Res Function(ProductDto) then,
) = _$ProductDtoCopyWithImpl<$Res, ProductDto>;
@useResult
$Res call({
@JsonKey(name: "id") String? id,
@JsonKey(name: "organization_id") String? organizationId,
@JsonKey(name: "category_id") String? categoryId,
@JsonKey(name: "sku") String? sku,
@JsonKey(name: "name") String? name,
@JsonKey(name: "description") String? description,
@JsonKey(name: "price") double? price,
@JsonKey(name: "cost") double? cost,
@JsonKey(name: "business_type") String? businessType,
@JsonKey(name: "image_url") String? imageUrl,
@JsonKey(name: "printer_type") String? printerType,
@JsonKey(name: "print_to_checker") bool? printToChecker,
@JsonKey(name: "metadata") Map<String, dynamic>? metadata,
@JsonKey(name: "is_active") bool? isActive,
@JsonKey(name: "created_at") String? createdAt,
@JsonKey(name: "updated_at") String? updatedAt,
@JsonKey(name: "variants") List<ProductVariantDto>? variants,
@JsonKey(name: "sell_by") String? sellBy,
@JsonKey(name: "unit_id") String? unitId,
@JsonKey(name: "unit_name") String? unitName,
@JsonKey(name: "unit_abbreviation") String? unitAbbreviation,
@JsonKey(name: "unit") ProductUnitDto? unit,
});
$ProductUnitDtoCopyWith<$Res>? get unit;
}
/// @nodoc
class _$ProductDtoCopyWithImpl<$Res, $Val extends ProductDto>
implements $ProductDtoCopyWith<$Res> {
_$ProductDtoCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of ProductDto
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? id = freezed,
Object? organizationId = freezed,
Object? categoryId = freezed,
Object? sku = freezed,
Object? name = freezed,
Object? description = freezed,
Object? price = freezed,
Object? cost = freezed,
Object? businessType = freezed,
Object? imageUrl = freezed,
Object? printerType = freezed,
Object? printToChecker = freezed,
Object? metadata = freezed,
Object? isActive = freezed,
Object? createdAt = freezed,
Object? updatedAt = freezed,
Object? variants = freezed,
Object? sellBy = freezed,
Object? unitId = freezed,
Object? unitName = freezed,
Object? unitAbbreviation = freezed,
Object? unit = freezed,
}) {
return _then(
_value.copyWith(
id: freezed == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as String?,
organizationId: freezed == organizationId
? _value.organizationId
: organizationId // ignore: cast_nullable_to_non_nullable
as String?,
categoryId: freezed == categoryId
? _value.categoryId
: categoryId // ignore: cast_nullable_to_non_nullable
as String?,
sku: freezed == sku
? _value.sku
: sku // ignore: cast_nullable_to_non_nullable
as String?,
name: freezed == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String?,
description: freezed == description
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String?,
price: freezed == price
? _value.price
: price // ignore: cast_nullable_to_non_nullable
as double?,
cost: freezed == cost
? _value.cost
: cost // ignore: cast_nullable_to_non_nullable
as double?,
businessType: freezed == businessType
? _value.businessType
: businessType // ignore: cast_nullable_to_non_nullable
as String?,
imageUrl: freezed == imageUrl
? _value.imageUrl
: imageUrl // ignore: cast_nullable_to_non_nullable
as String?,
printerType: freezed == printerType
? _value.printerType
: printerType // ignore: cast_nullable_to_non_nullable
as String?,
printToChecker: freezed == printToChecker
? _value.printToChecker
: printToChecker // ignore: cast_nullable_to_non_nullable
as bool?,
metadata: freezed == metadata
? _value.metadata
: metadata // ignore: cast_nullable_to_non_nullable
as Map<String, dynamic>?,
isActive: freezed == isActive
? _value.isActive
: isActive // ignore: cast_nullable_to_non_nullable
as bool?,
createdAt: freezed == createdAt
? _value.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
as String?,
updatedAt: freezed == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as String?,
variants: freezed == variants
? _value.variants
: variants // ignore: cast_nullable_to_non_nullable
as List<ProductVariantDto>?,
sellBy: freezed == sellBy
? _value.sellBy
: sellBy // ignore: cast_nullable_to_non_nullable
as String?,
unitId: freezed == unitId
? _value.unitId
: unitId // ignore: cast_nullable_to_non_nullable
as String?,
unitName: freezed == unitName
? _value.unitName
: unitName // ignore: cast_nullable_to_non_nullable
as String?,
unitAbbreviation: freezed == unitAbbreviation
? _value.unitAbbreviation
: unitAbbreviation // ignore: cast_nullable_to_non_nullable
as String?,
unit: freezed == unit
? _value.unit
: unit // ignore: cast_nullable_to_non_nullable
as ProductUnitDto?,
)
as $Val,
);
}
/// Create a copy of ProductDto
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ProductUnitDtoCopyWith<$Res>? get unit {
if (_value.unit == null) {
return null;
}
return $ProductUnitDtoCopyWith<$Res>(_value.unit!, (value) {
return _then(_value.copyWith(unit: value) as $Val);
});
}
}
/// @nodoc
abstract class _$$ProductDtoImplCopyWith<$Res>
implements $ProductDtoCopyWith<$Res> {
factory _$$ProductDtoImplCopyWith(
_$ProductDtoImpl value,
$Res Function(_$ProductDtoImpl) then,
) = __$$ProductDtoImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
@JsonKey(name: "id") String? id,
@JsonKey(name: "organization_id") String? organizationId,
@JsonKey(name: "category_id") String? categoryId,
@JsonKey(name: "sku") String? sku,
@JsonKey(name: "name") String? name,
@JsonKey(name: "description") String? description,
@JsonKey(name: "price") double? price,
@JsonKey(name: "cost") double? cost,
@JsonKey(name: "business_type") String? businessType,
@JsonKey(name: "image_url") String? imageUrl,
@JsonKey(name: "printer_type") String? printerType,
@JsonKey(name: "print_to_checker") bool? printToChecker,
@JsonKey(name: "metadata") Map<String, dynamic>? metadata,
@JsonKey(name: "is_active") bool? isActive,
@JsonKey(name: "created_at") String? createdAt,
@JsonKey(name: "updated_at") String? updatedAt,
@JsonKey(name: "variants") List<ProductVariantDto>? variants,
@JsonKey(name: "sell_by") String? sellBy,
@JsonKey(name: "unit_id") String? unitId,
@JsonKey(name: "unit_name") String? unitName,
@JsonKey(name: "unit_abbreviation") String? unitAbbreviation,
@JsonKey(name: "unit") ProductUnitDto? unit,
});
@override
$ProductUnitDtoCopyWith<$Res>? get unit;
}
/// @nodoc
class __$$ProductDtoImplCopyWithImpl<$Res>
extends _$ProductDtoCopyWithImpl<$Res, _$ProductDtoImpl>
implements _$$ProductDtoImplCopyWith<$Res> {
__$$ProductDtoImplCopyWithImpl(
_$ProductDtoImpl _value,
$Res Function(_$ProductDtoImpl) _then,
) : super(_value, _then);
/// Create a copy of ProductDto
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? id = freezed,
Object? organizationId = freezed,
Object? categoryId = freezed,
Object? sku = freezed,
Object? name = freezed,
Object? description = freezed,
Object? price = freezed,
Object? cost = freezed,
Object? businessType = freezed,
Object? imageUrl = freezed,
Object? printerType = freezed,
Object? printToChecker = freezed,
Object? metadata = freezed,
Object? isActive = freezed,
Object? createdAt = freezed,
Object? updatedAt = freezed,
Object? variants = freezed,
Object? sellBy = freezed,
Object? unitId = freezed,
Object? unitName = freezed,
Object? unitAbbreviation = freezed,
Object? unit = freezed,
}) {
return _then(
_$ProductDtoImpl(
id: freezed == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as String?,
organizationId: freezed == organizationId
? _value.organizationId
: organizationId // ignore: cast_nullable_to_non_nullable
as String?,
categoryId: freezed == categoryId
? _value.categoryId
: categoryId // ignore: cast_nullable_to_non_nullable
as String?,
sku: freezed == sku
? _value.sku
: sku // ignore: cast_nullable_to_non_nullable
as String?,
name: freezed == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String?,
description: freezed == description
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String?,
price: freezed == price
? _value.price
: price // ignore: cast_nullable_to_non_nullable
as double?,
cost: freezed == cost
? _value.cost
: cost // ignore: cast_nullable_to_non_nullable
as double?,
businessType: freezed == businessType
? _value.businessType
: businessType // ignore: cast_nullable_to_non_nullable
as String?,
imageUrl: freezed == imageUrl
? _value.imageUrl
: imageUrl // ignore: cast_nullable_to_non_nullable
as String?,
printerType: freezed == printerType
? _value.printerType
: printerType // ignore: cast_nullable_to_non_nullable
as String?,
printToChecker: freezed == printToChecker
? _value.printToChecker
: printToChecker // ignore: cast_nullable_to_non_nullable
as bool?,
metadata: freezed == metadata
? _value._metadata
: metadata // ignore: cast_nullable_to_non_nullable
as Map<String, dynamic>?,
isActive: freezed == isActive
? _value.isActive
: isActive // ignore: cast_nullable_to_non_nullable
as bool?,
createdAt: freezed == createdAt
? _value.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
as String?,
updatedAt: freezed == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as String?,
variants: freezed == variants
? _value._variants
: variants // ignore: cast_nullable_to_non_nullable
as List<ProductVariantDto>?,
sellBy: freezed == sellBy
? _value.sellBy
: sellBy // ignore: cast_nullable_to_non_nullable
as String?,
unitId: freezed == unitId
? _value.unitId
: unitId // ignore: cast_nullable_to_non_nullable
as String?,
unitName: freezed == unitName
? _value.unitName
: unitName // ignore: cast_nullable_to_non_nullable
as String?,
unitAbbreviation: freezed == unitAbbreviation
? _value.unitAbbreviation
: unitAbbreviation // ignore: cast_nullable_to_non_nullable
as String?,
unit: freezed == unit
? _value.unit
: unit // ignore: cast_nullable_to_non_nullable
as ProductUnitDto?,
),
);
}
}
/// @nodoc
@JsonSerializable()
class _$ProductDtoImpl extends _ProductDto {
const _$ProductDtoImpl({
@JsonKey(name: "id") this.id,
@JsonKey(name: "organization_id") this.organizationId,
@JsonKey(name: "category_id") this.categoryId,
@JsonKey(name: "sku") this.sku,
@JsonKey(name: "name") this.name,
@JsonKey(name: "description") this.description,
@JsonKey(name: "price") this.price,
@JsonKey(name: "cost") this.cost,
@JsonKey(name: "business_type") this.businessType,
@JsonKey(name: "image_url") this.imageUrl,
@JsonKey(name: "printer_type") this.printerType,
@JsonKey(name: "print_to_checker") this.printToChecker,
@JsonKey(name: "metadata") final Map<String, dynamic>? metadata,
@JsonKey(name: "is_active") this.isActive,
@JsonKey(name: "created_at") this.createdAt,
@JsonKey(name: "updated_at") this.updatedAt,
@JsonKey(name: "variants") final List<ProductVariantDto>? variants,
@JsonKey(name: "sell_by") this.sellBy,
@JsonKey(name: "unit_id") this.unitId,
@JsonKey(name: "unit_name") this.unitName,
@JsonKey(name: "unit_abbreviation") this.unitAbbreviation,
@JsonKey(name: "unit") this.unit,
}) : _metadata = metadata,
_variants = variants,
super._();
factory _$ProductDtoImpl.fromJson(Map<String, dynamic> json) =>
_$$ProductDtoImplFromJson(json);
@override
@JsonKey(name: "id")
final String? id;
@override
@JsonKey(name: "organization_id")
final String? organizationId;
@override
@JsonKey(name: "category_id")
final String? categoryId;
@override
@JsonKey(name: "sku")
final String? sku;
@override
@JsonKey(name: "name")
final String? name;
@override
@JsonKey(name: "description")
final String? description;
@override
@JsonKey(name: "price")
final double? price;
@override
@JsonKey(name: "cost")
final double? cost;
@override
@JsonKey(name: "business_type")
final String? businessType;
@override
@JsonKey(name: "image_url")
final String? imageUrl;
@override
@JsonKey(name: "printer_type")
final String? printerType;
@override
@JsonKey(name: "print_to_checker")
final bool? printToChecker;
final Map<String, dynamic>? _metadata;
@override
@JsonKey(name: "metadata")
Map<String, dynamic>? get metadata {
final value = _metadata;
if (value == null) return null;
if (_metadata is EqualUnmodifiableMapView) return _metadata;
// ignore: implicit_dynamic_type
return EqualUnmodifiableMapView(value);
}
@override
@JsonKey(name: "is_active")
final bool? isActive;
@override
@JsonKey(name: "created_at")
final String? createdAt;
@override
@JsonKey(name: "updated_at")
final String? updatedAt;
final List<ProductVariantDto>? _variants;
@override
@JsonKey(name: "variants")
List<ProductVariantDto>? get variants {
final value = _variants;
if (value == null) return null;
if (_variants is EqualUnmodifiableListView) return _variants;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(value);
}
@override
@JsonKey(name: "sell_by")
final String? sellBy;
@override
@JsonKey(name: "unit_id")
final String? unitId;
@override
@JsonKey(name: "unit_name")
final String? unitName;
@override
@JsonKey(name: "unit_abbreviation")
final String? unitAbbreviation;
@override
@JsonKey(name: "unit")
final ProductUnitDto? unit;
@override
String toString() {
return 'ProductDto(id: $id, organizationId: $organizationId, categoryId: $categoryId, sku: $sku, name: $name, description: $description, price: $price, cost: $cost, businessType: $businessType, imageUrl: $imageUrl, printerType: $printerType, printToChecker: $printToChecker, metadata: $metadata, isActive: $isActive, createdAt: $createdAt, updatedAt: $updatedAt, variants: $variants, sellBy: $sellBy, unitId: $unitId, unitName: $unitName, unitAbbreviation: $unitAbbreviation, unit: $unit)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ProductDtoImpl &&
(identical(other.id, id) || other.id == id) &&
(identical(other.organizationId, organizationId) ||
other.organizationId == organizationId) &&
(identical(other.categoryId, categoryId) ||
other.categoryId == categoryId) &&
(identical(other.sku, sku) || other.sku == sku) &&
(identical(other.name, name) || other.name == name) &&
(identical(other.description, description) ||
other.description == description) &&
(identical(other.price, price) || other.price == price) &&
(identical(other.cost, cost) || other.cost == cost) &&
(identical(other.businessType, businessType) ||
other.businessType == businessType) &&
(identical(other.imageUrl, imageUrl) ||
other.imageUrl == imageUrl) &&
(identical(other.printerType, printerType) ||
other.printerType == printerType) &&
(identical(other.printToChecker, printToChecker) ||
other.printToChecker == printToChecker) &&
const DeepCollectionEquality().equals(other._metadata, _metadata) &&
(identical(other.isActive, isActive) ||
other.isActive == isActive) &&
(identical(other.createdAt, createdAt) ||
other.createdAt == createdAt) &&
(identical(other.updatedAt, updatedAt) ||
other.updatedAt == updatedAt) &&
const DeepCollectionEquality().equals(other._variants, _variants) &&
(identical(other.sellBy, sellBy) || other.sellBy == sellBy) &&
(identical(other.unitId, unitId) || other.unitId == unitId) &&
(identical(other.unitName, unitName) ||
other.unitName == unitName) &&
(identical(other.unitAbbreviation, unitAbbreviation) ||
other.unitAbbreviation == unitAbbreviation) &&
(identical(other.unit, unit) || other.unit == unit));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hashAll([
runtimeType,
id,
organizationId,
categoryId,
sku,
name,
description,
price,
cost,
businessType,
imageUrl,
printerType,
printToChecker,
const DeepCollectionEquality().hash(_metadata),
isActive,
createdAt,
updatedAt,
const DeepCollectionEquality().hash(_variants),
sellBy,
unitId,
unitName,
unitAbbreviation,
unit,
]);
/// Create a copy of ProductDto
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ProductDtoImplCopyWith<_$ProductDtoImpl> get copyWith =>
__$$ProductDtoImplCopyWithImpl<_$ProductDtoImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$ProductDtoImplToJson(this);
}
}
abstract class _ProductDto extends ProductDto {
const factory _ProductDto({
@JsonKey(name: "id") final String? id,
@JsonKey(name: "organization_id") final String? organizationId,
@JsonKey(name: "category_id") final String? categoryId,
@JsonKey(name: "sku") final String? sku,
@JsonKey(name: "name") final String? name,
@JsonKey(name: "description") final String? description,
@JsonKey(name: "price") final double? price,
@JsonKey(name: "cost") final double? cost,
@JsonKey(name: "business_type") final String? businessType,
@JsonKey(name: "image_url") final String? imageUrl,
@JsonKey(name: "printer_type") final String? printerType,
@JsonKey(name: "print_to_checker") final bool? printToChecker,
@JsonKey(name: "metadata") final Map<String, dynamic>? metadata,
@JsonKey(name: "is_active") final bool? isActive,
@JsonKey(name: "created_at") final String? createdAt,
@JsonKey(name: "updated_at") final String? updatedAt,
@JsonKey(name: "variants") final List<ProductVariantDto>? variants,
@JsonKey(name: "sell_by") final String? sellBy,
@JsonKey(name: "unit_id") final String? unitId,
@JsonKey(name: "unit_name") final String? unitName,
@JsonKey(name: "unit_abbreviation") final String? unitAbbreviation,
@JsonKey(name: "unit") final ProductUnitDto? unit,
}) = _$ProductDtoImpl;
const _ProductDto._() : super._();
factory _ProductDto.fromJson(Map<String, dynamic> json) =
_$ProductDtoImpl.fromJson;
@override
@JsonKey(name: "id")
String? get id;
@override
@JsonKey(name: "organization_id")
String? get organizationId;
@override
@JsonKey(name: "category_id")
String? get categoryId;
@override
@JsonKey(name: "sku")
String? get sku;
@override
@JsonKey(name: "name")
String? get name;
@override
@JsonKey(name: "description")
String? get description;
@override
@JsonKey(name: "price")
double? get price;
@override
@JsonKey(name: "cost")
double? get cost;
@override
@JsonKey(name: "business_type")
String? get businessType;
@override
@JsonKey(name: "image_url")
String? get imageUrl;
@override
@JsonKey(name: "printer_type")
String? get printerType;
@override
@JsonKey(name: "print_to_checker")
bool? get printToChecker;
@override
@JsonKey(name: "metadata")
Map<String, dynamic>? get metadata;
@override
@JsonKey(name: "is_active")
bool? get isActive;
@override
@JsonKey(name: "created_at")
String? get createdAt;
@override
@JsonKey(name: "updated_at")
String? get updatedAt;
@override
@JsonKey(name: "variants")
List<ProductVariantDto>? get variants;
@override
@JsonKey(name: "sell_by")
String? get sellBy;
@override
@JsonKey(name: "unit_id")
String? get unitId;
@override
@JsonKey(name: "unit_name")
String? get unitName;
@override
@JsonKey(name: "unit_abbreviation")
String? get unitAbbreviation;
@override
@JsonKey(name: "unit")
ProductUnitDto? get unit;
/// Create a copy of ProductDto
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ProductDtoImplCopyWith<_$ProductDtoImpl> get copyWith =>
throw _privateConstructorUsedError;
}
ProductVariantDto _$ProductVariantDtoFromJson(Map<String, dynamic> json) {
return _ProductVariantDto.fromJson(json);
}
/// @nodoc
mixin _$ProductVariantDto {
@JsonKey(name: "id")
String? get id => throw _privateConstructorUsedError;
@JsonKey(name: "product_id")
String? get productId => throw _privateConstructorUsedError;
@JsonKey(name: "name")
String? get name => throw _privateConstructorUsedError;
@JsonKey(name: "price_modifier")
double? get priceModifier => throw _privateConstructorUsedError;
@JsonKey(name: "cost")
double? get cost => throw _privateConstructorUsedError;
@JsonKey(name: "metadata")
Map<String, dynamic>? get metadata => throw _privateConstructorUsedError;
@JsonKey(name: "created_at")
String? get createdAt => throw _privateConstructorUsedError;
@JsonKey(name: "updated_at")
String? get updatedAt => throw _privateConstructorUsedError;
/// Serializes this ProductVariantDto to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of ProductVariantDto
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$ProductVariantDtoCopyWith<ProductVariantDto> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $ProductVariantDtoCopyWith<$Res> {
factory $ProductVariantDtoCopyWith(
ProductVariantDto value,
$Res Function(ProductVariantDto) then,
) = _$ProductVariantDtoCopyWithImpl<$Res, ProductVariantDto>;
@useResult
$Res call({
@JsonKey(name: "id") String? id,
@JsonKey(name: "product_id") String? productId,
@JsonKey(name: "name") String? name,
@JsonKey(name: "price_modifier") double? priceModifier,
@JsonKey(name: "cost") double? cost,
@JsonKey(name: "metadata") Map<String, dynamic>? metadata,
@JsonKey(name: "created_at") String? createdAt,
@JsonKey(name: "updated_at") String? updatedAt,
});
}
/// @nodoc
class _$ProductVariantDtoCopyWithImpl<$Res, $Val extends ProductVariantDto>
implements $ProductVariantDtoCopyWith<$Res> {
_$ProductVariantDtoCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of ProductVariantDto
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? id = freezed,
Object? productId = freezed,
Object? name = freezed,
Object? priceModifier = freezed,
Object? cost = freezed,
Object? metadata = freezed,
Object? createdAt = freezed,
Object? updatedAt = freezed,
}) {
return _then(
_value.copyWith(
id: freezed == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as String?,
productId: freezed == productId
? _value.productId
: productId // ignore: cast_nullable_to_non_nullable
as String?,
name: freezed == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String?,
priceModifier: freezed == priceModifier
? _value.priceModifier
: priceModifier // ignore: cast_nullable_to_non_nullable
as double?,
cost: freezed == cost
? _value.cost
: cost // ignore: cast_nullable_to_non_nullable
as double?,
metadata: freezed == metadata
? _value.metadata
: metadata // ignore: cast_nullable_to_non_nullable
as Map<String, dynamic>?,
createdAt: freezed == createdAt
? _value.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
as String?,
updatedAt: freezed == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as String?,
)
as $Val,
);
}
}
/// @nodoc
abstract class _$$ProductVariantDtoImplCopyWith<$Res>
implements $ProductVariantDtoCopyWith<$Res> {
factory _$$ProductVariantDtoImplCopyWith(
_$ProductVariantDtoImpl value,
$Res Function(_$ProductVariantDtoImpl) then,
) = __$$ProductVariantDtoImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
@JsonKey(name: "id") String? id,
@JsonKey(name: "product_id") String? productId,
@JsonKey(name: "name") String? name,
@JsonKey(name: "price_modifier") double? priceModifier,
@JsonKey(name: "cost") double? cost,
@JsonKey(name: "metadata") Map<String, dynamic>? metadata,
@JsonKey(name: "created_at") String? createdAt,
@JsonKey(name: "updated_at") String? updatedAt,
});
}
/// @nodoc
class __$$ProductVariantDtoImplCopyWithImpl<$Res>
extends _$ProductVariantDtoCopyWithImpl<$Res, _$ProductVariantDtoImpl>
implements _$$ProductVariantDtoImplCopyWith<$Res> {
__$$ProductVariantDtoImplCopyWithImpl(
_$ProductVariantDtoImpl _value,
$Res Function(_$ProductVariantDtoImpl) _then,
) : super(_value, _then);
/// Create a copy of ProductVariantDto
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? id = freezed,
Object? productId = freezed,
Object? name = freezed,
Object? priceModifier = freezed,
Object? cost = freezed,
Object? metadata = freezed,
Object? createdAt = freezed,
Object? updatedAt = freezed,
}) {
return _then(
_$ProductVariantDtoImpl(
id: freezed == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as String?,
productId: freezed == productId
? _value.productId
: productId // ignore: cast_nullable_to_non_nullable
as String?,
name: freezed == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String?,
priceModifier: freezed == priceModifier
? _value.priceModifier
: priceModifier // ignore: cast_nullable_to_non_nullable
as double?,
cost: freezed == cost
? _value.cost
: cost // ignore: cast_nullable_to_non_nullable
as double?,
metadata: freezed == metadata
? _value._metadata
: metadata // ignore: cast_nullable_to_non_nullable
as Map<String, dynamic>?,
createdAt: freezed == createdAt
? _value.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
as String?,
updatedAt: freezed == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as String?,
),
);
}
}
/// @nodoc
@JsonSerializable()
class _$ProductVariantDtoImpl extends _ProductVariantDto {
const _$ProductVariantDtoImpl({
@JsonKey(name: "id") this.id,
@JsonKey(name: "product_id") this.productId,
@JsonKey(name: "name") this.name,
@JsonKey(name: "price_modifier") this.priceModifier,
@JsonKey(name: "cost") this.cost,
@JsonKey(name: "metadata") final Map<String, dynamic>? metadata,
@JsonKey(name: "created_at") this.createdAt,
@JsonKey(name: "updated_at") this.updatedAt,
}) : _metadata = metadata,
super._();
factory _$ProductVariantDtoImpl.fromJson(Map<String, dynamic> json) =>
_$$ProductVariantDtoImplFromJson(json);
@override
@JsonKey(name: "id")
final String? id;
@override
@JsonKey(name: "product_id")
final String? productId;
@override
@JsonKey(name: "name")
final String? name;
@override
@JsonKey(name: "price_modifier")
final double? priceModifier;
@override
@JsonKey(name: "cost")
final double? cost;
final Map<String, dynamic>? _metadata;
@override
@JsonKey(name: "metadata")
Map<String, dynamic>? get metadata {
final value = _metadata;
if (value == null) return null;
if (_metadata is EqualUnmodifiableMapView) return _metadata;
// ignore: implicit_dynamic_type
return EqualUnmodifiableMapView(value);
}
@override
@JsonKey(name: "created_at")
final String? createdAt;
@override
@JsonKey(name: "updated_at")
final String? updatedAt;
@override
String toString() {
return 'ProductVariantDto(id: $id, productId: $productId, name: $name, priceModifier: $priceModifier, cost: $cost, metadata: $metadata, createdAt: $createdAt, updatedAt: $updatedAt)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ProductVariantDtoImpl &&
(identical(other.id, id) || other.id == id) &&
(identical(other.productId, productId) ||
other.productId == productId) &&
(identical(other.name, name) || other.name == name) &&
(identical(other.priceModifier, priceModifier) ||
other.priceModifier == priceModifier) &&
(identical(other.cost, cost) || other.cost == cost) &&
const DeepCollectionEquality().equals(other._metadata, _metadata) &&
(identical(other.createdAt, createdAt) ||
other.createdAt == createdAt) &&
(identical(other.updatedAt, updatedAt) ||
other.updatedAt == updatedAt));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
id,
productId,
name,
priceModifier,
cost,
const DeepCollectionEquality().hash(_metadata),
createdAt,
updatedAt,
);
/// Create a copy of ProductVariantDto
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ProductVariantDtoImplCopyWith<_$ProductVariantDtoImpl> get copyWith =>
__$$ProductVariantDtoImplCopyWithImpl<_$ProductVariantDtoImpl>(
this,
_$identity,
);
@override
Map<String, dynamic> toJson() {
return _$$ProductVariantDtoImplToJson(this);
}
}
abstract class _ProductVariantDto extends ProductVariantDto {
const factory _ProductVariantDto({
@JsonKey(name: "id") final String? id,
@JsonKey(name: "product_id") final String? productId,
@JsonKey(name: "name") final String? name,
@JsonKey(name: "price_modifier") final double? priceModifier,
@JsonKey(name: "cost") final double? cost,
@JsonKey(name: "metadata") final Map<String, dynamic>? metadata,
@JsonKey(name: "created_at") final String? createdAt,
@JsonKey(name: "updated_at") final String? updatedAt,
}) = _$ProductVariantDtoImpl;
const _ProductVariantDto._() : super._();
factory _ProductVariantDto.fromJson(Map<String, dynamic> json) =
_$ProductVariantDtoImpl.fromJson;
@override
@JsonKey(name: "id")
String? get id;
@override
@JsonKey(name: "product_id")
String? get productId;
@override
@JsonKey(name: "name")
String? get name;
@override
@JsonKey(name: "price_modifier")
double? get priceModifier;
@override
@JsonKey(name: "cost")
double? get cost;
@override
@JsonKey(name: "metadata")
Map<String, dynamic>? get metadata;
@override
@JsonKey(name: "created_at")
String? get createdAt;
@override
@JsonKey(name: "updated_at")
String? get updatedAt;
/// Create a copy of ProductVariantDto
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ProductVariantDtoImplCopyWith<_$ProductVariantDtoImpl> get copyWith =>
throw _privateConstructorUsedError;
}