I am looking at Fluent Validation for my rich domain model: https://github.com/JeremySkinner/FluentValidation
Lets say I have a class called: Customer. The Customer must have a surname. I can do this:
RuleFor(customer => customer.Surname).NotEmpty();
I can do something similar to make sure they are over a certain age etc. Now lets say I want to provide offers to a customer who is between the ages of 18 and 25. Is this something I should be doing using the Fluent API? If not then is there another tool/pattern that I should be using?
All as I need to do is return a message if the person is between those ages i.e. you are entitled to the following offers: x,y, and z". Please note this is for one customer rather than a collection of customers.
Is it normal to test domain rules using Fluent API? For example, if user is between 18-25, then show them this offer (string); if they are 25-40 then show them this offer etc. These are not validation errors i.e. it is perfectly reasonable for someone to be 25 years old or 40 years old etc.