add printer checker checks

This commit is contained in:
Efril
2026-05-28 18:11:02 +07:00
parent b9fcd79962
commit 2ab20a1150
13 changed files with 128 additions and 10 deletions
@@ -40,6 +40,7 @@ class ProductDto with _$ProductDto {
@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,
@@ -63,6 +64,7 @@ class ProductDto with _$ProductDto {
businessType: businessType ?? '',
imageUrl: imageUrl ?? '',
printerType: printerType ?? '',
printToChecker: printToChecker ?? false,
metadata: metadata ?? {},
isActive: isActive ?? false,
createdAt: createdAt ?? '',
@@ -82,6 +84,7 @@ class ProductDto with _$ProductDto {
'business_type': businessType,
'image_url': imageUrl,
'printer_type': printerType,
'print_to_checker': printToChecker == true ? 1 : 0,
'metadata': metadata != null ? jsonEncode(metadata) : null,
'is_active': isActive == true ? 1 : 0,
'created_at': createdAt,
@@ -103,6 +106,9 @@ class ProductDto with _$ProductDto {
businessType: map['business_type'] as String?,
imageUrl: map['image_url'] as String?,
printerType: map['printer_type'] as String?,
printToChecker: map['print_to_checker'] != null
? (map['print_to_checker'] as int) == 1
: null,
metadata: map['metadata'] != null
? jsonDecode(map['metadata'] as String) as Map<String, dynamic>
: null,
@@ -125,6 +131,7 @@ class ProductDto with _$ProductDto {
businessType: product.businessType,
imageUrl: product.imageUrl,
printerType: product.printerType,
printToChecker: product.printToChecker,
metadata: product.metadata,
isActive: product.isActive,
createdAt: product.createdAt,
@@ -321,6 +321,8 @@ mixin _$ProductDto {
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")
@@ -361,6 +363,7 @@ abstract class $ProductDtoCopyWith<$Res> {
@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,
@@ -395,6 +398,7 @@ class _$ProductDtoCopyWithImpl<$Res, $Val extends ProductDto>
Object? businessType = freezed,
Object? imageUrl = freezed,
Object? printerType = freezed,
Object? printToChecker = freezed,
Object? metadata = freezed,
Object? isActive = freezed,
Object? createdAt = freezed,
@@ -447,6 +451,10 @@ class _$ProductDtoCopyWithImpl<$Res, $Val extends ProductDto>
? _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
@@ -494,6 +502,7 @@ abstract class _$$ProductDtoImplCopyWith<$Res>
@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,
@@ -527,6 +536,7 @@ class __$$ProductDtoImplCopyWithImpl<$Res>
Object? businessType = freezed,
Object? imageUrl = freezed,
Object? printerType = freezed,
Object? printToChecker = freezed,
Object? metadata = freezed,
Object? isActive = freezed,
Object? createdAt = freezed,
@@ -579,6 +589,10 @@ class __$$ProductDtoImplCopyWithImpl<$Res>
? _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
@@ -619,6 +633,7 @@ class _$ProductDtoImpl extends _ProductDto {
@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,
@@ -664,6 +679,9 @@ class _$ProductDtoImpl extends _ProductDto {
@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")
@@ -697,7 +715,7 @@ class _$ProductDtoImpl extends _ProductDto {
@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, metadata: $metadata, isActive: $isActive, createdAt: $createdAt, updatedAt: $updatedAt, variants: $variants)';
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)';
}
@override
@@ -722,6 +740,8 @@ class _$ProductDtoImpl extends _ProductDto {
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) &&
@@ -747,6 +767,7 @@ class _$ProductDtoImpl extends _ProductDto {
businessType,
imageUrl,
printerType,
printToChecker,
const DeepCollectionEquality().hash(_metadata),
isActive,
createdAt,
@@ -781,6 +802,7 @@ abstract class _ProductDto extends ProductDto {
@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,
@@ -826,6 +848,9 @@ abstract class _ProductDto extends ProductDto {
@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
@@ -40,6 +40,7 @@ _$ProductDtoImpl _$$ProductDtoImplFromJson(Map<String, dynamic> json) =>
businessType: json['business_type'] as String?,
imageUrl: json['image_url'] as String?,
printerType: json['printer_type'] as String?,
printToChecker: json['print_to_checker'] as bool?,
metadata: json['metadata'] as Map<String, dynamic>?,
isActive: json['is_active'] as bool?,
createdAt: json['created_at'] as String?,
@@ -62,6 +63,7 @@ Map<String, dynamic> _$$ProductDtoImplToJson(_$ProductDtoImpl instance) =>
'business_type': instance.businessType,
'image_url': instance.imageUrl,
'printer_type': instance.printerType,
'print_to_checker': instance.printToChecker,
'metadata': instance.metadata,
'is_active': instance.isActive,
'created_at': instance.createdAt,