Skip to content
  • aguestuser's avatar
    [215] cleanup: refactor shared db destroy logic in recycle/destroy · d1fed156
    aguestuser authored
    * the `common.destroy` function is odd
      * accepts a nullable channel (instead of just not being called)
      * has a funny return signature
      * the fact that it is a method on a channel rather than a function
        call that accepts a channel (or phone number) forces some tightly
        coupled testing patterns (that could be cleaner with pure functions
        on the db) without saving any db queries by doing so
    * replace it with `channelRepository.destroy` and also create
      `phoneNumberRepository.destroy`: leaves cleaner test seams and less
      convoluted branching logcis
    * clean up tests for destroy that (1) break b/c of this, (2) were
      tightly coupled and a bit hard to follow/change anyway
    d1fed156