Files
fin-tracker/app/packages/api_client/lib/src/model/lot_out.dart
T
2026-09-18 14:20:50 +03:00

191 lines
2.9 KiB
Dart

//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'lot_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class LotOut {
/// Returns a new [LotOut] instance.
LotOut({
required this.accountId,
required this.closedAt,
required this.costCurrency,
required this.costPerUnit,
required this.costTotalRub,
required this.id,
required this.openDate,
required this.qtyOpen,
required this.qtyRemaining,
});
@JsonKey(
name: r'account_id',
required: true,
includeIfNull: false,
)
final int accountId;
@JsonKey(
name: r'closed_at',
required: true,
includeIfNull: true,
)
final DateTime? closedAt;
@JsonKey(
name: r'cost_currency',
required: true,
includeIfNull: false,
)
final String costCurrency;
/// decimal as string
@JsonKey(
name: r'cost_per_unit',
required: true,
includeIfNull: false,
)
final String costPerUnit;
/// decimal as string
@JsonKey(
name: r'cost_total_rub',
required: true,
includeIfNull: true,
)
final String? costTotalRub;
@JsonKey(
name: r'id',
required: true,
includeIfNull: false,
)
final int id;
@JsonKey(
name: r'open_date',
required: true,
includeIfNull: false,
)
final DateTime openDate;
/// decimal as string
@JsonKey(
name: r'qty_open',
required: true,
includeIfNull: false,
)
final String qtyOpen;
/// decimal as string
@JsonKey(
name: r'qty_remaining',
required: true,
includeIfNull: false,
)
final String qtyRemaining;
@override
bool operator ==(Object other) => identical(this, other) || other is LotOut &&
other.accountId == accountId &&
other.closedAt == closedAt &&
other.costCurrency == costCurrency &&
other.costPerUnit == costPerUnit &&
other.costTotalRub == costTotalRub &&
other.id == id &&
other.openDate == openDate &&
other.qtyOpen == qtyOpen &&
other.qtyRemaining == qtyRemaining;
@override
int get hashCode =>
accountId.hashCode +
(closedAt == null ? 0 : closedAt.hashCode) +
costCurrency.hashCode +
costPerUnit.hashCode +
(costTotalRub == null ? 0 : costTotalRub.hashCode) +
id.hashCode +
openDate.hashCode +
qtyOpen.hashCode +
qtyRemaining.hashCode;
factory LotOut.fromJson(Map<String, dynamic> json) => _$LotOutFromJson(json);
Map<String, dynamic> toJson() => _$LotOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}