Average use case of the app is a form being filled by a surveyor, I have to produce a unique id for every entry based on three drop down selections, shown in the image below:

I have to produce a unique Consumer-Id for every entry based on zone and ward selection, as an example, the surveyor selects zone 01, and ward 02, and enters the first entry, the consumer id should be 01-02-01 respectively, AND when change the selection of either the zone or ward, the entry number should start from 1, and if they switch back to the zone and ward where they had made some entries before, let's say in zone 01, ward 02 they made 25 entries, so the last consumer id was 01-02-25, when they switch back to this zone and ward the entry should continue from 26.
I am unable to devise a logic for the above requirement, is it possible to achieve in firestore or locally inside the app?