View Source Glific.Partners.Invoice (Glific v5.1.6)
Invoice model wrapper
Link to this section Summary
Functions
Standard changeset pattern we use for all data types
Return the count of invoices, based on filters
Create an invoice record
Fetch an invoice record by clauses
Update an invoice record
Update the status of an invoice
Link to this section Types
@type t() :: %Glific.Partners.Invoice{ __meta__: Ecto.Schema.Metadata.t(), amount: integer(), consulting_hours: integer(), customer_id: String.t() | nil, end_date: :utc_datetime_usec | nil, id: non_neg_integer() | nil, inserted_at: :utc_datetime | nil, invoice_id: String.t() | nil, line_items: map(), messages: integer(), organization: Glific.Partners.Organization.t() | Ecto.Association.NotLoaded.t() | nil, organization_id: non_neg_integer() | nil, start_date: :utc_datetime_usec | nil, status: String.t() | nil, updated_at: :utc_datetime | nil, users: integer() }
Link to this section Functions
@spec changeset(t(), map()) :: Ecto.Changeset.t()
Standard changeset pattern we use for all data types
Return the count of invoices, based on filters
Create an invoice record
Fetch an invoice record by clauses
@spec update_invoice(t(), map()) :: t() | {:error, Ecto.Changeset.t()}
Update an invoice record
@spec update_invoice_status(non_neg_integer(), String.t()) :: {:ok | :error, String.t()}
Update the status of an invoice