Text this: Effective theory approach to new physics with flavour: general framework and a leptoquark example