// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'quote_model.dart';

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

class QuoteModelAdapter extends TypeAdapter<QuoteModel> {
  @override
  final typeId = 16;

  @override
  QuoteModel read(BinaryReader reader) {
    final numOfFields = reader.readByte();
    final fields = <int, dynamic>{
      for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
    };
    return QuoteModel(
      quoteId: fields[0] as String,
      quoteNumber: fields[1] as String,
      userId: fields[2] as String,
      status: fields[3] as QuoteStatus,
      totalAmount: (fields[4] as num).toDouble(),
      discountAmount: (fields[5] as num).toDouble(),
      finalAmount: (fields[6] as num).toDouble(),
      projectName: fields[7] as String?,
      deliveryAddress: fields[8] as String?,
      paymentTerms: fields[9] as String?,
      notes: fields[10] as String?,
      validUntil: fields[11] as DateTime?,
      convertedOrderId: fields[12] as String?,
      erpnextQuotation: fields[13] as String?,
      createdAt: fields[14] as DateTime,
      updatedAt: fields[15] as DateTime?,
    );
  }

  @override
  void write(BinaryWriter writer, QuoteModel obj) {
    writer
      ..writeByte(16)
      ..writeByte(0)
      ..write(obj.quoteId)
      ..writeByte(1)
      ..write(obj.quoteNumber)
      ..writeByte(2)
      ..write(obj.userId)
      ..writeByte(3)
      ..write(obj.status)
      ..writeByte(4)
      ..write(obj.totalAmount)
      ..writeByte(5)
      ..write(obj.discountAmount)
      ..writeByte(6)
      ..write(obj.finalAmount)
      ..writeByte(7)
      ..write(obj.projectName)
      ..writeByte(8)
      ..write(obj.deliveryAddress)
      ..writeByte(9)
      ..write(obj.paymentTerms)
      ..writeByte(10)
      ..write(obj.notes)
      ..writeByte(11)
      ..write(obj.validUntil)
      ..writeByte(12)
      ..write(obj.convertedOrderId)
      ..writeByte(13)
      ..write(obj.erpnextQuotation)
      ..writeByte(14)
      ..write(obj.createdAt)
      ..writeByte(15)
      ..write(obj.updatedAt);
  }

  @override
  int get hashCode => typeId.hashCode;

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