Why not do a forum search or browse the code for example clues close to what you seek?
The idea is to benefit and learn from other q&a posts - these may help
Filter Child table base on parent field
Filter Child Table Based on Child Field using Query
How to Filter child table
Custom apps for cloud users [extend ERPNext with microservices] - #6 by revant_one
Then followup here what snags you overcame, for you and the rest of us to refer to and learn.