TenvioDispatchGuide constructor

const TenvioDispatchGuide({
  1. required String id,
  2. @TenvioDispatchGuideStatusConverter() required TenvioDispatchGuideStatus status,
  3. String? qrCode,
  4. Asset? warehouse,
  5. String? warehouseId,
  6. TenvioDriver? driver,
  7. String? driverId,
  8. User? loader,
  9. String? loaderId,
  10. @Default.new([]) List<TenvioPackage> packages,
  11. @Default.new([]) List<String> packagesIds,
  12. @Default.new(false) bool hasRoute,
  13. @Default.new([]) List<String> route,
  14. @TimestampConverter() required DateTime createdAt,
  15. @TimestampConverter() required DateTime updatedAt,
})

Implementation

const factory TenvioDispatchGuide({
  /// [id] is the unique identifier of the dispatch guide
  required String id,

  /// [status] is the current status of the dispatch guide
  @TenvioDispatchGuideStatusConverter() required TenvioDispatchGuideStatus status,

  /// [qrCode] is the QR code of the dispatch guide
  String? qrCode,

  /// [warehouse] is the warehouse where the dispatch guide was created
  Asset? warehouse,

  /// [warehouseId] is the unique identifier of the warehouse where the dispatch guide was created
  String? warehouseId,

  /// [driver] is the driver assigned to the dispatch guide
  TenvioDriver? driver,

  /// [driverId] is the unique identifier of the driver assigned to the dispatch guide
  String? driverId,

  /// [loader] is the loader assigned to the dispatch guide
  User? loader,

  /// [loaderId] is the unique identifier of the loader assigned to the dispatch guide
  String? loaderId,

  /// [packages] is the list of packages assigned to the dispatch guide
  @Default([]) List<TenvioPackage> packages,

  /// [packagesIds] is the list of packages' ids assigned to the dispatch guide
  @Default([]) List<String> packagesIds,

  /// [hasRoute] is a flag that indicates if the dispatch guide has a route
  @Default(false) bool hasRoute,

  /// [route] is the route assigned to the dispatch guide
  /// Is a list of packages' ids (ordered by the delivery sequence)
  @Default([]) List<String> route,

  /// [createdAt] is the date and time when the dispatch guide was created
  @TimestampConverter() required DateTime createdAt,

  /// [updatedAt] is the date and time when the dispatch guide was last updated
  @TimestampConverter() required DateTime updatedAt,
}) = _TenvioDispatchGuide;