-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to setup dependent properties? #35
Comments
Hey @hexsprite just wondering what's your specific use case? You should define your factories as being correct to begin with, i.e with all arguments required to build a valid document already present. If you need to test with different |
I would like to be able to provide a start and duration and if the end is not actually provided I want it to be calculated from those provided parameters. This would be a welcome shorthand for my tests as it means I don't have to do tedious calculations to present a correct |
current:
desired:
|
In your app does |
needs to be in the DB |
though that is a good point since one of them should be computed ;) Not ready to make that sort of change in the app yet though |
It definitely shouldn't be the role of the factory to calculate the A pattern I've done in the past is run the generated factory document through a |
In fact I have a fork of the package that allows you to provide this very function as part of the factory definition ;) |
not sure if there's a way to do this or not, looking at the code so far I think not...
but I want to be able to say something like:
That would allow me to optionally provide start and duration. I notice that
this
object contains the statically defined properties, but not what the user provides as arguments toFactory.create
Any tips on how to implement that?
The text was updated successfully, but these errors were encountered: