jpreecedev / Landlords

0 stars 1 forks source link

Start new tenancy wizard #48

Closed jpreecedev closed 7 years ago

jpreecedev commented 7 years ago

Need to be able to create a new tenancy.

The tenancies manager would capture the following information, in a sequence of steps;

  1. The property the tenancy applies to
  2. Type of tenancy (Agricultural, Assured, AST, Common Law, Licence, Regulated)
  3. Start date
  4. End date (perhaps from a list, 3 months, 6 months etc)
  5. Rent payment amount
  6. Rent payment frequency (Per week, 2 weekly, 4 weekly, monthly, 3 monthly, 6 monthly, annually)
  7. The tenants payment reference
  8. Capture the tenants details (All tenants)
  9. Capture the dates when rent payments are due
jpreecedev commented 7 years ago

This is best suited to a wizard

jpreecedev commented 7 years ago

The wizard should look like this;

jpreecedev commented 7 years ago

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.

jpreecedev commented 7 years ago

Once all the data has been collected and validated, the tenancy should be created.

The creation process would look like this;

jpreecedev commented 7 years ago

Regarding each tenant, we need to also capture the following information;

jpreecedev commented 7 years ago

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.

jpreecedev commented 7 years ago

Might be able to steal code for custom validation attributes from here. https://foolproof.codeplex.com/SourceControl/latest#Foolproof/RequiredIf.cs

jpreecedev commented 7 years ago

Ignore the last comment don't think that is going to work

jpreecedev commented 7 years ago

Potentially good solution; https://stackoverflow.com/questions/3400542/how-do-i-use-ivalidatableobject#answer-42519662

jpreecedev commented 7 years ago

https://gist.github.com/jpreecedev/62d90e210e572b5643b0f729553264a3