Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Timestamps for Task #12

Open
dennypradipta opened this issue Oct 8, 2019 · 4 comments
Open

Add Timestamps for Task #12

dennypradipta opened this issue Oct 8, 2019 · 4 comments

Comments

@dennypradipta
Copy link
Owner

Now that we have a fully functional task system that connects to the REST API, there is some minor changes to the data stored in MongoDB.

So I need fields in the Model that stores timestamps for saved task, such as created_at and modified_at.

But I am hesitating to decide whether to add one field called done_at or not. I mean sure, modified_at will store timestamps when there is modifications to the task such as edit and marked as done. But, what is the best practice? Should you separate done_at with modified_at or combine them in modified_at?

The possibility is that when you have done_at fields, you can gather data of "Task cleared before 31st October". If you only have modified_at, you can only gather data of "Task modified before 31st October".

In conclusion: Add created_at and modified_at field in Todo Model, and decide whether to add one field called done_at or not.

What are your thoughts? Comment down below and maybe try some PR.

Thank you very much

@MihaiDruta
Copy link

I think that created_at and updated_at should be enough. You could add a field smthng like finished of boolean type, and checking it whenever displaying some info (ex. if finished is true print "Task finished at (the value of updated_at)", or if finished is false display "Task updated at ...").

And I think these values (created_at and updated_at) should change automatically using some sort of lifecycle callbacks.

@dennypradipta
Copy link
Owner Author

Currently there is a field called done, which is a Boolean. It defines if the task is done or not. I see your point right there.

Do you want to take this issue?

@MihaiDruta
Copy link

Yeah, I think I could take it. I'm in :)

@dennypradipta
Copy link
Owner Author

OK I assigned you to this issue. Please bear in mind that register page is not working right now, so you have to register through Postman or cURL #4

Also, don't forget to check the Todo API and make sure you update the API with timestamps.

Good luck!

@MihaiDruta MihaiDruta removed their assignment Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants