Class: MOCO::InvoiceReminder
- Inherits:
-
BaseEntity
- Object
- BaseEntity
- MOCO::InvoiceReminder
- Defined in:
- lib/moco/entities/invoice_reminder.rb
Overview
Represents a MOCO invoice reminder (Mahnung / Zahlungserinnerung)
Required attributes for create:
invoice_id - Integer, overdue invoice ID
Optional attributes:
title - String, reminder title (uses default if omitted)
text - String, reminder message (uses default if omitted)
fee - Float, late payment fee
date - String, "YYYY-MM-DD" reminder date
due_date - String, "YYYY-MM-DD" new payment due date
Read-only attributes:
id, status ("created" or "sent"), file_url, invoice (Hash),
created_at, updated_at
Example:
moco.invoice_reminders.create(
invoice_id: 456,
title: "Payment Reminder",
text: "Please remit payment within 14 days.",
fee: 25.0,
date: "2024-02-01",
due_date: "2024-02-15"
)
Send by email:
moco.post("invoice_reminders/123/send_email", {
emails_to: "customer@example.com",
subject: "Payment Reminder",
text: "Please see attached reminder."
})
Filtering:
moco.invoice_reminders.where(invoice_id: 456)
moco.invoice_reminders.where(date_from: "2024-01-01", date_to: "2024-01-31")
Instance Attribute Summary
Attributes inherited from BaseEntity
Instance Method Summary collapse
-
#invoice ⇒ Object
Associations.
- #to_s ⇒ Object
Methods inherited from BaseEntity
#==, #association, #destroy, #eql?, #has_many, #hash, #id, #initialize, #inspect, #reload, #save, #to_h, #to_json, #update
Constructor Details
This class inherits a constructor from MOCO::BaseEntity
Instance Method Details
#invoice ⇒ Object
Associations
43 44 45 |
# File 'lib/moco/entities/invoice_reminder.rb', line 43 def invoice association(:invoice) end |
#to_s ⇒ Object
47 48 49 |
# File 'lib/moco/entities/invoice_reminder.rb', line 47 def to_s "Reminder ##{id} (#{date})" end |