I'm experimenting with a database model for contracts and their associated fulfillment obligations.
Some services offer duration-based discounts: the longer a customer commits, the lower the monthly price. Every product has a base price, but only some have these discounts.
The challenge is that base prices and discount tiers can change independently over time. I'd like to use an append-only approach, preserving the exact pricing terms that applied when a contract was signed.
I've put together a simplified ER diagram, but I'm unsure about the relationships.
Would foreign keys referencing immutable price and discount versions be sufficient? Does a composite key make sense here, or would storing price snapshots on contract items be more appropriate?
I'm also curious how others would ensure that signed contractual terms remain immutable while still allowing later amendments.
Any thoughts on the relational design would be appreciated!
submitted by