Closed jpreecedev closed 7 years ago
This is best suited to a wizard
The wizard should look like this;
The data is a bit all over the page at the minute. When the StartTenancy
view is instantiated, a request should be made to the server to fetch the view data. View data should consist of all the default values for a select lists etc. View data should also consist of a tenancy
object that will be used later to persist the tenancy created by this wizard.
Once the view data is retrieved, it should be passed to the Store
, and not managed by the StartTenancy
view. Each field should trigger a store update so that state is managed centrally.
Once all the data has been collected and validated, the tenancy should be created.
The creation process would look like this;
StartTenancyViewModel
should be returned to the server. This will consist of the Tenancy
entity, a list of Tenant
entities, each Tenant
should have at least one address TenantAddress
.TenancyTenant
to create a relationship between Tenancy
and Tenant
Regarding each tenant, we need to also capture the following information;
Outstanding issue is related to server side validation. We have validation attributes on the TenantViewModel
and Tenant
classes. The problem with this is that if the "occupier" is a child then a lot of the fields don't apply.
Might be able to steal code for custom validation attributes from here. https://foolproof.codeplex.com/SourceControl/latest#Foolproof/RequiredIf.cs
Ignore the last comment don't think that is going to work
Potentially good solution; https://stackoverflow.com/questions/3400542/how-do-i-use-ivalidatableobject#answer-42519662
Need to be able to create a new tenancy.
The tenancies manager would capture the following information, in a sequence of steps;