added relationships in model layer
security fix
views in purchase