Invoice constructor

  1. @JsonSerializable(explicitToJson: true)
const Invoice({
  1. @Default('') String id,
  2. @Default('') @JsonKey(name: 'user_id') String createdById,
  3. @Default('') @JsonKey(name: 'assigned_user_id') String assignedToId,
  4. @Default(0) @JsonKey(name: 'created_at') int createdAt,
  5. @Default(0) @JsonKey(name: 'updated_at') int updatedAt,
  6. @Default(0) @JsonKey(name: 'archived_at') int archivedAt,
  7. @Default(false) @JsonKey(name: 'is_deleted') bool isDeleted,
  8. @Default('') @JsonKey(name: 'custom_value1') String customValue1,
  9. @Default('') @JsonKey(name: 'custom_value2') String customValue2,
  10. @Default('') @JsonKey(name: 'custom_value3') String customValue3,
  11. @Default('') @JsonKey(name: 'custom_value4') String customValue4,
  12. @Default('') @JsonKey(name: 'client_id') String clientId,
  13. @Default(<InvoiceLineItem>[]) @JsonKey(name: 'line_items') List<InvoiceLineItem> lineItems,
  14. @Default(<InvoiceInvitation>[]) List<InvoiceInvitation> invitations,
  15. @Default(0) double amount,
  16. @Default(0) double balance,
  17. @Default('') @JsonKey(name: 'status_id') String statusId,
  18. @Default('') @JsonKey(name: 'design_id') String designId,
  19. @Default('') String number,
  20. @Default(0) double discount,
  21. @Default('') @JsonKey(name: 'po_number') String poNumber,
  22. @Default('') String date,
  23. @Default('') @JsonKey(name: 'last_sent_date') String lastSentDate,
  24. @Default('') @JsonKey(name: 'next_send_date') String nextSendDate,
  25. @Default('') @JsonKey(name: 'due_date') String dueDate,
  26. @Default('') String terms,
  27. @Default('') @JsonKey(name: 'public_notes') String publicNotes,
  28. @Default('') @JsonKey(name: 'private_notes') String privateNotes,
  29. @Default(false) @JsonKey(name: 'uses_inclusive_taxes') bool usesInclusiveTaxes,
  30. @Default('') @JsonKey(name: 'tax_name1') String taxName1,
  31. @Default(0) @JsonKey(name: 'tax_rate1') double taxRate1,
  32. @Default('') @JsonKey(name: 'tax_name2') String taxName2,
  33. @Default(0) @JsonKey(name: 'tax_rate2') double taxRate2,
  34. @Default('') @JsonKey(name: 'tax_name3') String taxName3,
  35. @Default(0) @JsonKey(name: 'tax_rate3') double taxRate3,
  36. @Default(0) @JsonKey(name: 'total_taxes') double totalTaxes,
  37. @Default(false) @JsonKey(name: 'is_amount_discount') bool isAmountDiscount,
  38. @Default('') String footer,
  39. @Default(0) double partial,
  40. @Default('') @JsonKey(name: 'partial_due_date') String partialDueDate,
  41. @Default(false) @JsonKey(name: 'has_tasks') bool hasTasks,
  42. @Default(false) @JsonKey(name: 'has_expenses') bool hasExpenses,
  43. @Default(0) @JsonKey(name: 'custom_surcharge1') double customSurcharge1,
  44. @Default(0) @JsonKey(name: 'custom_surcharge2') double customSurcharge2,
  45. @Default(0) @JsonKey(name: 'custom_surcharge3') double customSurcharge3,
  46. @Default(0) @JsonKey(name: 'custom_surcharge4') double customSurcharge4,
  47. @Default(false) @JsonKey(name: 'custom_surcharge_tax1') bool customSurchargeTax1,
  48. @Default(false) @JsonKey(name: 'custom_surcharge_tax2') bool customSurchargeTax2,
  49. @Default(false) @JsonKey(name: 'custom_surcharge_tax3') bool customSurchargeTax3,
  50. @Default(false) @JsonKey(name: 'custom_surcharge_tax4') bool customSurchargeTax4,
  51. @Default(<Document>[]) List<Document> documents,
  52. @Default('') @JsonKey(name: 'vendor_id') String vendorId,
})

Invoice factory constructor

Implementation

@JsonSerializable(explicitToJson: true)
const factory Invoice({
  @Default('') String id,
  @Default('') @JsonKey(name: 'user_id') String createdById,
  @Default('') @JsonKey(name: 'assigned_user_id') String assignedToId,
  @Default(0) @JsonKey(name: 'created_at') int createdAt,
  @Default(0) @JsonKey(name: 'updated_at') int updatedAt,
  @Default(0) @JsonKey(name: 'archived_at') int archivedAt,
  @Default(false) @JsonKey(name: 'is_deleted') bool isDeleted,
  @Default('') @JsonKey(name: 'custom_value1') String customValue1,
  @Default('') @JsonKey(name: 'custom_value2') String customValue2,
  @Default('') @JsonKey(name: 'custom_value3') String customValue3,
  @Default('') @JsonKey(name: 'custom_value4') String customValue4,
  @Default('') @JsonKey(name: 'client_id') String clientId,
  @Default(<InvoiceLineItem>[])
  @JsonKey(name: 'line_items')
      List<InvoiceLineItem> lineItems,
  @Default(<InvoiceInvitation>[]) List<InvoiceInvitation> invitations,
  @Default(0) double amount,
  @Default(0) double balance,
  @Default('') @JsonKey(name: 'status_id') String statusId,
  @Default('') @JsonKey(name: 'design_id') String designId,
  @Default('') String number,
  @Default(0) double discount,
  @Default('') @JsonKey(name: 'po_number') String poNumber,
  @Default('') String date,
  @Default('') @JsonKey(name: 'last_sent_date') String lastSentDate,
  @Default('') @JsonKey(name: 'next_send_date') String nextSendDate,
  @Default('') @JsonKey(name: 'due_date') String dueDate,
  @Default('') String terms,
  @Default('') @JsonKey(name: 'public_notes') String publicNotes,
  @Default('') @JsonKey(name: 'private_notes') String privateNotes,
  @Default(false)
  @JsonKey(name: 'uses_inclusive_taxes')
      bool usesInclusiveTaxes,
  @Default('') @JsonKey(name: 'tax_name1') String taxName1,
  @Default(0) @JsonKey(name: 'tax_rate1') double taxRate1,
  @Default('') @JsonKey(name: 'tax_name2') String taxName2,
  @Default(0) @JsonKey(name: 'tax_rate2') double taxRate2,
  @Default('') @JsonKey(name: 'tax_name3') String taxName3,
  @Default(0) @JsonKey(name: 'tax_rate3') double taxRate3,
  @Default(0) @JsonKey(name: 'total_taxes') double totalTaxes,
  @Default(false) @JsonKey(name: 'is_amount_discount') bool isAmountDiscount,
  @Default('') String footer,
  @Default(0) double partial,
  @Default('') @JsonKey(name: 'partial_due_date') String partialDueDate,
  @Default(false) @JsonKey(name: 'has_tasks') bool hasTasks,
  @Default(false) @JsonKey(name: 'has_expenses') bool hasExpenses,
  @Default(0) @JsonKey(name: 'custom_surcharge1') double customSurcharge1,
  @Default(0) @JsonKey(name: 'custom_surcharge2') double customSurcharge2,
  @Default(0) @JsonKey(name: 'custom_surcharge3') double customSurcharge3,
  @Default(0) @JsonKey(name: 'custom_surcharge4') double customSurcharge4,
  @Default(false)
  @JsonKey(name: 'custom_surcharge_tax1')
      bool customSurchargeTax1,
  @Default(false)
  @JsonKey(name: 'custom_surcharge_tax2')
      bool customSurchargeTax2,
  @Default(false)
  @JsonKey(name: 'custom_surcharge_tax3')
      bool customSurchargeTax3,
  @Default(false)
  @JsonKey(name: 'custom_surcharge_tax4')
      bool customSurchargeTax4,
  @Default(<Document>[]) List<Document> documents,
  @Default('') @JsonKey(name: 'vendor_id') String vendorId,
}) = _Invoice;