156 lines
3.9 KiB
Dart
156 lines
3.9 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'ai_rule.dart';
|
|
|
|
// **************************************************************************
|
|
// TypeAdapterGenerator
|
|
// **************************************************************************
|
|
|
|
class AiRuleAdapter extends TypeAdapter<AiRule> {
|
|
@override
|
|
final typeId = 23;
|
|
|
|
@override
|
|
AiRule read(BinaryReader reader) {
|
|
final numOfFields = reader.readByte();
|
|
final fields = <int, dynamic>{
|
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
|
};
|
|
return AiRule(
|
|
id: fields[0] as String?,
|
|
name: fields[1] as String,
|
|
type: fields[2] as AiRuleType,
|
|
isActive: fields[3] == null ? true : fields[3] as bool,
|
|
confidencePercentage: fields[4] == null ? 80 : (fields[4] as num).toInt(),
|
|
processingStatus: fields[5] == null
|
|
? ProcessingStatus.processed
|
|
: fields[5] as ProcessingStatus,
|
|
merchantPattern: fields[6] as String?,
|
|
categoryId: fields[7] as String?,
|
|
skipRegex: fields[8] as String?,
|
|
createdAt: fields[9] as DateTime?,
|
|
updatedAt: fields[10] as DateTime?,
|
|
);
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, AiRule obj) {
|
|
writer
|
|
..writeByte(11)
|
|
..writeByte(0)
|
|
..write(obj.id)
|
|
..writeByte(1)
|
|
..write(obj.name)
|
|
..writeByte(2)
|
|
..write(obj.type)
|
|
..writeByte(3)
|
|
..write(obj.isActive)
|
|
..writeByte(4)
|
|
..write(obj.confidencePercentage)
|
|
..writeByte(5)
|
|
..write(obj.processingStatus)
|
|
..writeByte(6)
|
|
..write(obj.merchantPattern)
|
|
..writeByte(7)
|
|
..write(obj.categoryId)
|
|
..writeByte(8)
|
|
..write(obj.skipRegex)
|
|
..writeByte(9)
|
|
..write(obj.createdAt)
|
|
..writeByte(10)
|
|
..write(obj.updatedAt);
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is AiRuleAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|
|
|
|
class AiRuleTypeAdapter extends TypeAdapter<AiRuleType> {
|
|
@override
|
|
final typeId = 20;
|
|
|
|
@override
|
|
AiRuleType read(BinaryReader reader) {
|
|
switch (reader.readByte()) {
|
|
case 0:
|
|
return AiRuleType.pointOfSale;
|
|
case 1:
|
|
return AiRuleType.skipTemplate;
|
|
default:
|
|
return AiRuleType.pointOfSale;
|
|
}
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, AiRuleType obj) {
|
|
switch (obj) {
|
|
case AiRuleType.pointOfSale:
|
|
writer.writeByte(0);
|
|
case AiRuleType.skipTemplate:
|
|
writer.writeByte(1);
|
|
}
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is AiRuleTypeAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|
|
|
|
class ProcessingStatusAdapter extends TypeAdapter<ProcessingStatus> {
|
|
@override
|
|
final typeId = 24;
|
|
|
|
@override
|
|
ProcessingStatus read(BinaryReader reader) {
|
|
switch (reader.readByte()) {
|
|
case 0:
|
|
return ProcessingStatus.created;
|
|
case 1:
|
|
return ProcessingStatus.processed;
|
|
case 2:
|
|
return ProcessingStatus.needsAttention;
|
|
case 3:
|
|
return ProcessingStatus.rejected;
|
|
default:
|
|
return ProcessingStatus.created;
|
|
}
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, ProcessingStatus obj) {
|
|
switch (obj) {
|
|
case ProcessingStatus.created:
|
|
writer.writeByte(0);
|
|
case ProcessingStatus.processed:
|
|
writer.writeByte(1);
|
|
case ProcessingStatus.needsAttention:
|
|
writer.writeByte(2);
|
|
case ProcessingStatus.rejected:
|
|
writer.writeByte(3);
|
|
}
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is ProcessingStatusAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|