Closed viriponce closed 5 months ago
This PR addresses issue #71
*backend/api/models.py Change the field type for time field in the TimeRecord model. time = models.DurationField()
time
TimeRecord
time = models.DurationField()
backend/api/migrations/0015_alter_timerecord_time.py This migration file was crated after running the makemigrations command.
backend/api/serializers/TimeRecordSerializer.py Change the validate_time method to validate that not negative value is allowed for time.
validate_time
I tried the Time Record endpoints and all of them are working as expected. When providing a negative value, the validation error is returned.
This PR addresses issue #71
Implementation
*backend/api/models.py Change the field type for
time
field in theTimeRecord
model.time = models.DurationField()
backend/api/migrations/0015_alter_timerecord_time.py This migration file was crated after running the makemigrations command.
backend/api/serializers/TimeRecordSerializer.py Change the
validate_time
method to validate that not negative value is allowed for time.Swagger
I tried the Time Record endpoints and all of them are working as expected. When providing a negative value, the validation error is returned.