// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'project_submission_model.dart';

// **************************************************************************
// TypeAdapterGenerator
// **************************************************************************

class ProjectSubmissionModelAdapter
    extends TypeAdapter<ProjectSubmissionModel> {
  @override
  final typeId = 14;

  @override
  ProjectSubmissionModel read(BinaryReader reader) {
    final numOfFields = reader.readByte();
    final fields = <int, dynamic>{
      for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
    };
    return ProjectSubmissionModel(
      submissionId: fields[0] as String,
      userId: fields[1] as String,
      projectName: fields[2] as String,
      projectAddress: fields[3] as String,
      projectValue: (fields[4] as num).toDouble(),
      projectType: fields[5] as ProjectType,
      beforePhotos: fields[6] as String?,
      afterPhotos: fields[7] as String?,
      invoices: fields[8] as String?,
      status: fields[9] as SubmissionStatus,
      reviewNotes: fields[10] as String?,
      rejectionReason: fields[11] as String?,
      pointsEarned: (fields[12] as num?)?.toInt(),
      submittedAt: fields[13] as DateTime,
      reviewedAt: fields[14] as DateTime?,
      reviewedBy: fields[15] as String?,
    );
  }

  @override
  void write(BinaryWriter writer, ProjectSubmissionModel obj) {
    writer
      ..writeByte(16)
      ..writeByte(0)
      ..write(obj.submissionId)
      ..writeByte(1)
      ..write(obj.userId)
      ..writeByte(2)
      ..write(obj.projectName)
      ..writeByte(3)
      ..write(obj.projectAddress)
      ..writeByte(4)
      ..write(obj.projectValue)
      ..writeByte(5)
      ..write(obj.projectType)
      ..writeByte(6)
      ..write(obj.beforePhotos)
      ..writeByte(7)
      ..write(obj.afterPhotos)
      ..writeByte(8)
      ..write(obj.invoices)
      ..writeByte(9)
      ..write(obj.status)
      ..writeByte(10)
      ..write(obj.reviewNotes)
      ..writeByte(11)
      ..write(obj.rejectionReason)
      ..writeByte(12)
      ..write(obj.pointsEarned)
      ..writeByte(13)
      ..write(obj.submittedAt)
      ..writeByte(14)
      ..write(obj.reviewedAt)
      ..writeByte(15)
      ..write(obj.reviewedBy);
  }

  @override
  int get hashCode => typeId.hashCode;

  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      other is ProjectSubmissionModelAdapter &&
          runtimeType == other.runtimeType &&
          typeId == other.typeId;
}
