public Intention( decimal lowestPrice, decimal maximumPrice, int bedroom, EState state, string city, string neighborhood, EPropertyType propertyType, EPropertySituation propertySituation) { LowestPrice = lowestPrice; MaximumPrice = maximumPrice; Bedroom = bedroom; State = state; City = city; Neighborhood = neighborhood; PropertyType = propertyType; PropertySituation = propertySituation; AddNotifications(new Contract() .Requires() .IsNotNullOrEmpty(City, "Intention.City", "Cidade deve ser preenchido.") .HasMaxLen(City, 50, "Intention.City", "Cidade excedeu o tamanho máximo.") .IsNotNullOrEmpty(Neighborhood, "Intention.Neighborhood", "Bairro deve ser preenchido.") .HasMaxLen(Neighborhood, 50, "Intention.Neighborhood", "Bairro excedeu o tamanho máximo.") .IsGreaterThan(MaximumPrice, LowestPrice, "Intention.LowestPrice", "Preço minímo não pode ser maior que preço máximo.")); }
public CreateIntentionCommand( Guid prospectId, decimal?rent, decimal lowestPrice, decimal maximumPrice, int bedroom, EState state, string city, string neighborhood, EPropertyType propertyType, EPropertySituation propertySituation) { ProspectId = prospectId; Rent = rent; LowestPrice = lowestPrice; MaximumPrice = maximumPrice; Bedroom = bedroom; State = state; City = city; Neighborhood = neighborhood; PropertyType = propertyType; PropertySituation = propertySituation; }