Checkbox father and son

hello to everyone
i can’t understad how to create a solution similar the posted image

i have a list (loaded from a single table) with id and id_father
in this example morning, afternoon and evening have id_father setted to Monday (working days have setted only id, nothing id_father)
furthermore, if I select a child element the parent must be selected automatically, and if i select father at least one children is mandatory
how can implement this solution?

It seems that days with day part options (like Monday with morning, afternoon, etc.) should not be checkboxes. They could just be text or something similar. However, it’s hard to suggest any UX pattern without knowing details like: does each day have day part options? are these part options supposed to be always visible or do they appear on a checkbox click?

days with day parts must also be selectable
days may or may not have day parts (I only indicated Monday to create the visual example)
the day parts options must always be visible

To me this sounds like a strange UX choice. The day-checkboxes are redundant information, while introducing complexity for validation. Why not leave out the checkboxes for the days, and only show checkboxes for the day parts (but include day name in the label)?

☐ Monday morning ☐ Monday afternoon ☐ Monday evening
☐ Tuesday morning ☐ Tuesday afternoon ☐ Tuesday evening

Now that sounds easier both for the development and the user experience.

Even if it’s simpler, I can’t apply the solution you suggest, I have to do as I showed in the post

I understand. Requirements do be like that sometimes.

Which part of it do you struggle with?

Maybe I found something similar to what I need at this link

at this time better solution is combining TreeGrid with TreeData