UNPKG

hmrc-vat-checker

Version:
30 lines (24 loc) 994 B
import GbVatNumber from '../gbVatNumber.js' class HmrcVatCheckerV2ResponseAddress { constructor(data) { this.line1 = data.line1 ? data.line1 : null this.line2 = data.line2 ? data.line2 : null this.postcode = data.postcode ? data.postcode : null this.countryCode = data.countryCode ? data.countryCode : null } } class HmrcVatCheckerV2Response { constructor(data) { this.exists = data.exists this.name = data.target ? data.target.name : null this.vatNumber = data.target ? new GbVatNumber(data.target.vatNumber) : null this.address = data.target ? new HmrcVatCheckerV2ResponseAddress(data.target.address) : null this.requesterVatNumber = data.requester ? new GbVatNumber(data.requester) : null this.consultationNumber = data.consultationNumber ? data.consultationNumber : null this.processingDate = data.processingDate ? new Date(data.processingDate) : null } } export { HmrcVatCheckerV2Response, HmrcVatCheckerV2ResponseAddress }