Ash FrameworkAF
Ash Framework3y ago
7 replies
Blibs

Load data from id for a policy check during a create action

I have a create action that will create a new Offer, that offer needs to be related to a Property, so one of the fields I accept as input is a property_id.

In my policies, I need to check some of this property fields, meaning that I need to load that property and make it accessible to that action policies somehow.

How can I do such a thing with Ash?

Also, can I make the whole process inside a transaction? Meaning that I have strong guarantees that what I'm checking in the policy is actually what is in the database at that time (avoiding race conditions).
Was this page helpful?