I read through this tutorial on property rentals written in DAML (love this end to end tutorial example btw) and noticed the use of party
as well as text
for a contract key. Here’s the specific code.
key (agency, registerId) : (Party, Text)
maintainer key._1
I presume this helps create more uniqueness for a key to avoid conflicts? I thought this was a good idea so I implemented this in my code as well but then I came to the realisation that in the rental application example, a rental licence is probably only offered to each party once(?)
Whereas in my app, I have agents that can issue multiple proposals and I wanted to setup a key that would be unique via agent and the proposaliD. I.e. it’s the difference between a one-to-one relationship and a one-to-many.
So my question is: is it necessary for me to take things a step further in some way or is the code example above a good enough solution?
I did notice the increment
function but I wasn’t sure if this would be a little overkill?
Hope my question makes sense?