DEFRA/ivory-front-office

View on GitHub
server/modules/who-owns/who-owns-item.handlers.js

Summary

Maintainability
A
0 mins
Test Coverage
const { Registration } = require('ivory-data-mapping').cache

class WhoOwnsHandlers extends require('../common/option/single/single-option.handlers') {
  get Model () {
    return Registration
  }

  get fieldname () {
    return 'ownerType'
  }

  get selectError () {
    return 'Select if you own it or someone else owns it'
  }

  async isOwner (request) {
    const { ownerType } = await this.getData(request)
    return (ownerType === 'i-own-it')
  }
}

module.exports = WhoOwnsHandlers