Closed Natim closed 9 years ago
I have the following model:
{ "definition": { "title": "Mobile Originated Numbers", "description": "Associate a country code to a number", "fields": [ { "name": "mcc", "label": "Mobile Country Code", "type": "regex", "regex": "^[0-9]{3}$", "required": true }, { "name": "mnc", "label": "Mobile Network Code", "type": "regex", "regex": "^[0-9]{2,3}$" }, { "name": "moVerifier", "label": "MO Verifier Number", "type": "string", "required": true } ] } }
I wish to define the id as the concatenation of MCC and MNC with MNC blank if not present. Also it could just be an id fields that would be validated with a regexp.
I don't think we want to support such complicated use cases: since you have the regexps, I guess you should just use them and define a new field.
I did it differently finally: https://github.com/mozilla-services/msisdn-gateway/blob/1035666-msisdn-redis-map/msisdn-gateway/sms/infos/redis.js#L31L48
I have the following model:
I wish to define the id as the concatenation of MCC and MNC with MNC blank if not present. Also it could just be an id fields that would be validated with a regexp.