Payment constructor

  1. @JsonSerializable(explicitToJson: true)
Payment({
  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('') @JsonKey(name: 'invitation_id') String invitationId,
  14. @Default('') @JsonKey(name: 'client_contact_id') String clientContactId,
  15. @Default('') @JsonKey(name: 'type_id') String typeId,
  16. @Default('') @JsonKey(name: 'date') String date,
  17. @Default('') @JsonKey(name: 'transaction_reference') String transactionReference,
  18. @Default('') @JsonKey(name: 'private_notes') String privateNotes,
  19. @Default(false) @JsonKey(name: 'is_manual') bool isManual,
  20. @Default(0.0) @JsonKey(name: 'amount') double amount,
  21. @Default(0.0) @JsonKey(name: 'applied') double applied,
  22. @Default(0.0) @JsonKey(name: 'refunded') double refunded,
  23. @Default(0.0) @JsonKey(name: 'company_gateway_id') double companyGatewayId,
  24. @Default(<Paymentable>[]) @JsonKey(name: 'paymentables') List<Paymentable> paymentables,
  25. @Default(<Paymentable>[]) @JsonKey(name: 'invoices') List<Paymentable> invoices,
  26. @Default(<Paymentable>[]) @JsonKey(name: 'credits') List<Paymentable> credits,
  27. @Default(<Document>[]) List<Document> documents,
})

Payment factory constructor

Implementation

@JsonSerializable(explicitToJson: true)
factory Payment({
  @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('') @JsonKey(name: 'invitation_id') String invitationId,
  @Default('') @JsonKey(name: 'client_contact_id') String clientContactId,
  @Default('') @JsonKey(name: 'type_id') String typeId,
  @Default('') @JsonKey(name: 'date') String date,
  @Default('')
  @JsonKey(name: 'transaction_reference')
      String transactionReference,
  @Default('') @JsonKey(name: 'private_notes') String privateNotes,
  @Default(false) @JsonKey(name: 'is_manual') bool isManual,
  @Default(0.0) @JsonKey(name: 'amount') double amount,
  @Default(0.0) @JsonKey(name: 'applied') double applied,
  @Default(0.0) @JsonKey(name: 'refunded') double refunded,
  @Default(0.0) @JsonKey(name: 'company_gateway_id') double companyGatewayId,
  @Default(<Paymentable>[])
  @JsonKey(name: 'paymentables')
      List<Paymentable> paymentables,
  @Default(<Paymentable>[])
  @JsonKey(name: 'invoices')
      List<Paymentable> invoices,
  @Default(<Paymentable>[])
  @JsonKey(name: 'credits')
      List<Paymentable> credits,
  @Default(<Document>[]) List<Document> documents,
}) = _Payment;