tech debt: rename `phoneNumber` table/model to `accountPhoneNumber`
motiviation:
- it is very easy to confuse a
phoneNumber
record (which has aphoneNumber
field along with astatus
and atwilioSid
with thephoneNumber
field itself - this confusion is compounded by the fact that
phoneNumber
andchannelPhoneNumber
are fields on 4 or 5 different models, making the namephoneNumber
one of the most overdetermined symbols in the semiotics of this codebase. in general: it has become a more and more confusing word to read, with more and more external context needed to understand what it means. but names should be simple and obvious and require no added context to understand! - not only is this bug prone, it misses something in the domain about what this entity is: it is a phone number paired with a connection to twilio. in the context of a channel, the same phone number is something else. if we name it a
accountPhoneNumber
, or simply anaccount
we both clarify the intent of storing the phone number in this particular bag of data and reduce the possibility for bugs and mixing up fields
Edited by aguestuser