mumuki / mumuki-domain

💡 Mumuki's domain model
GNU Affero General Public License v3.0
1 stars 0 forks source link

Chore certificate programs dates #199

Closed luchotc closed 3 years ago

luchotc commented 3 years ago

:memo: Details

There are several little changes in this one.

First of all I'm introducing optional start_date and end_date for CertificatePrograms and I renamed start_date and end_date of Certificates to started_at and ended_at because I think it is more semantic this way and to avoid attribute name repetition and make it clearer. For a Certificate, started_at and ended_at represent the dates in which the certified student actually completed the program. For a CertificateProgram, start_date and end_date are optional and they only represent the start and end date of the whole program. A program without start_date means that it is ongoing since the moment it was created and without end_date means that it could be ongoing forever. Ideally each program should have a clear start and end, but I'm considering those cases just in case.

I've created a method in application_record for easily creating a scope which filters between two optional dates and allow it to receive a param to specify if the filter should be actually applied or not.

So CertificateProgram.active(false) won't actually filter anything, which may be useful in the future :smile:.

I've also added the ability for an organization to know if there is any ongoing_certificate_programs? there. My idea is to show My certificates section only if there are ongoing_certificate_programs or the user was certified in that organization in the past. My intuition is that adding a section for something that you can't obtain, like a certificate it's not ideal. To discuss with @aguspina @lauramangifesta and @felipecalvo

:warning: Dependencies

None

:back: Backwards compatibility

100%

flbulgarelli commented 3 years ago

First of all I'm introducing optional start_date and end_date for CertificatePrograms and I renamed start_date and end_date of Certificates to started_at and ended_at because I think it is more semantic this way and to avoid attribute name repetition and make it clearer.

I understand the need of having two different pair of dates, and I am ok with that. However I don't understand how those names are more intention revealing. For me started_at and start_date mean exactly the same. Is there a convention I am not getting? Could you explain please? Thanks!

luchotc commented 3 years ago

@flbulgarelli Approved this one verbally