bcgov/entity

PID - mandatory and optional

Closed this issue ยท 0 comments

๐Ÿ“– User Story

As a team lead,
I want the Property Identification Number (PID) field to behave according to the selected ownership type on the Property Details page,
So that we can ensure that the correct information is captured for property ownership and the STR Registry, and that validation is handled when users try to navigate through the application.

Context:

In the current workflow, the Property Identification Number (PID) field must be treated differently depending on the ownership type selected by the user. For users who select "Own" or "Co-Own", the PID field will be required to ensure accurate property information is collected. For users who select "Rent", the PID field will be optional, allowing flexibility where property identification may not be necessary.

Validations are performed for the entire page and will be triggered only when users attempt to click "Next" or navigate to another section using the stepper. If required information is missing or incorrect, an error message will appear underneath the field and a red X will show on the stepper.

Additionally, both the host and examiner will have access to view the PID in the appropriate sections of the application details and review pages.

note: Future iteration we will use an api to validate the PID.

๐ŸŽจ UX/UI Link:

[Insert UX/UI link showing the PID field behavior based on ownership type]

๐Ÿ“ Business Rules:

  • When users select "Own" or "Co-Own" as the ownership type on the Property Details page, the PID field will be required to enter.
  • When users select "Rent" as the ownership type, the PID field will be optional.
  • No validation is required for the PID number format.
  • Error Handling: If the ownership type is "Own" or "Co-Own" but the PID is not provided:
    • When users click "Next", navigate using the stepper, or try to submit the form, an error message will appear underneath the PID field.
    • A red X will also be displayed on the stepper to indicate that required information is missing from that step.
  • Hosts will be able to see the PID field on Step 4 of the review page and in the application details page.
  • Examiners will be able to see the PID number (if provided) on the application details page.

Story Scenarios:

Scenario 1: PID field required for ownership type "Own" or "Co-Own"

  • Given I am a host filling out the Property Details page,
  • When I select either "Own" or "Co-Own" as my ownership type,
  • Then the PID field should be marked as required, and I must enter a value before proceeding to the next step or submitting the application.

Scenario 2: PID field optional for ownership type "Rent"

  • Given I am a host filling out the Property Details page,
  • When I select "Rent" as my ownership type,
  • Then the PID field should be optional, and I may leave it blank without receiving an error.

Scenario 3: Error message for missing PID when required and trying to move forward

  • Given I have selected "Own" or "Co-Own" as my ownership type,
  • When I attempt to click "Next" or navigate to another page using the stepper without providing a PID,
  • Then I should see an error message below the PID field,
  • And a red X should appear on the stepper to indicate the missing required information.

Scenario 4: Host visibility of PID in review and application details

  • Given I am a host reviewing my application,
  • When I navigate to Step 4 of the review page,
  • Then I should be able to see the PID that I entered, or know that it was left blank if optional.
  • And I should also see the PID field in the application details page after submission.

Scenario 5: Examiner visibility of PID in application details

  • Given I am an examiner reviewing an application,
  • When I open the application details page,
  • Then I should be able to see the PID, if provided by the host.