Let's assume that an external API is being polled for payments. The actual external API is irrelevant to this task, what really matters is that each payment
has a line_item_id
and belongs to a service.
A line_item_id
is unique in the scope of a service.
Assume that you are already given an ActiveRecord object (and underlying table) for representing a payment. It was already designed by another team member, it has been deployed and is being actively used in production.
class Payment < ActiveRecord::Base