Open Mike-Heneghan opened 4 years ago
To implement one way could be:
start date
and end date
to the Service
model which would default to None
and would be a DateTimeField
.filter_by_last_edited
.filter_queryset
method of search. start date
and end date
fields to the Service form. None
but make it clear if a service has not 'started' yet i.e. start date
is in the future. The initial plan was to not add the end date to the elastic search index although this complicated matters. The current methods of filtering and ordering could be impacted and it might be easier to remain consistent with the current approach.
After issues filtering with Elasticsearch instead added the exclusion as a filter of the Service objects in the search View.
start_date
and end_date
to the index.or
for end_date = None
and end_date <= currentDate
.An issue with standard form validation expecting the date to be inputted in American format i.e. month before day. Need to set the DateTime field input format to allow UK date format to be validated.
Fixed the saving and validation of dates.
Need to improve the form to hide the short term service content behind a question.
Adding a checkbox for short term service which then renders the inputs.
May need to split the start and end dates as is the start date is left blank it will default to the current date.
Added further test coverage to ensure the form can be submitted with a start
and end
date on creation and update of a service. Also tested that validation stops users from adding services with an end which is less than three days after the start date.
Still to complete:
start_date
and end_date
information to services as they appear in results and on the detail page. end_date
it has expired and will not be shown to users. Service Availability
section of the service create and update form i.e. if an end_date
is supplied without a start_date
when the form is subsequently submitted the blank start_date
input field would default to the current date. generate_user_report.js
and generate_location-report.js
files to add short term service-based information reflecting the number of 'upcoming', 'active' and 'expired' services based on the start_date
and end_date
fields.start_date
and end_date
fields.
Some users who add services to ALISS have given feedback that their services have predetermined end dates. This can be due to the availability of funding, staff or seasonal changes. For these users, they might find it challenging to go back and remove the service after it has been added.
Additionally, some services may come to an end but will start up again in the future and users don't want to have to delete and then later re-upload information regarding the service.
A potential solution to these related challenges could be to add a new column in the Service model which would store the end date. After this date, the services would be removed from the ElasticSearch index and would therefore not be searchable. Although preferably the data wouldn't be deleted.
If a user wants to reinstate or permanently add their service they could mark it as indefinite.
Need to consider how this can be implemented without adding unnecessary complexity.
Need to consider: