unique loan constraint and idempotent transformer