I have a Person class with a one to many relationship to Employment. A Person in the CRM can have multiple Employments (historic data).
My current REST URI for this class looks like this:
http://domain/persons GET [collection]
http://domain/persons/{id} GET [resource]
http://domain/persons/{id}/employments GET [collection]
To get the CURRENT active employment (so the employment where the endDate is NULL) should I create a URI or should this be done using a QueryParam?
Basically should I do this:
http://domain/persons/{id}/employments/current GET [resource]
or
http://domain/persons/{id}/employments?current GET [collection with query param filter]
I'm thinking the second one (with the queryparam) because as far as I understand REST a resource should be identified with a non changable URI. Since the current employment position can change it should be done with a QueryParam.
What are your suggestions?