How to group records under certain conditons in mysql
Schematically:

SELECT user.id
       CASE 
       -- if all docs are approved by bank then the status must 'verified'
            WHEN SUM(document.status = 'approved') = COUNT(document.id)
                THEN 'verified'
       -- If at least one document is 'verified', the overall status is 'verified'
            WHEN SUM(document.status = 'verified')
                THEN 'verified'
       -- If no document is 'verified' but at least one is 'in progress', the overall status is 'in progress'.
            WHEN SUM(document.status = 'in progress')
                THEN 'in progress'
       -- If no document is 'verified' and 'in progress', but at least one is 'expired', the overall status is 'expired'.
            WHEN SUM(document.status = 'expired')
                THEN 'expired'
       -- If no document is 'verified', 'in progress' and 'expired', but at least one is 'rejected', the overall status is 'rejected'.
            WHEN SUM(document.status = 'rejected')
                THEN 'rejected'
       -- If no document is uploaded at all, the status is 'no xyz uploaded' 
                ELSE 'no docs uploaded'
       END AS `overall_status`
FROM user 
JOIN document ON (joining conditions)
GROUP BY user.id



  (for documents without expiration date the status is 'expired')


I don't understand the place of this condition.