import { injectable } from 'tsyringe' ; import { ArianeeTokenId } from '../../../../models/ArianeeTokenId' ; import { ContractService } from '../contractService/contractsService' ; @ injectable ( ) export class LostAndStolenService { constructor ( private contractService ) { } param { ArianeeTokenId } arianeeId returns { < void public setMissingStatus = ( arianeeId ) => this . contractService . lostContract . methods . setMissingStatus ( arianeeId . toString ( ) ) . send ( ) ; param { ArianeeTokenId } arianeeId returns { < void public unsetMissingStatus = ( arianeeId ) : Promise < any > => this . contractService . lostContract . methods . unsetMissingStatus ( arianeeId . toString ( ) ) . send ( ) ; param { ArianeeTokenId } arianeeId returns { < void public setStolenStatus = ( arianeeId ) : Promise < any > => this . contractService . lostContract . methods . setStolenStatus ( arianeeId . toString ( ) ) . send ( ) ; param { ArianeeTokenId } arianeeId returns { < void public unsetStolenStatus = ( arianeeId ) : Promise < any > => this . contractService . lostContract . methods . unsetStolenStatus ( arianeeId . toString ( ) ) . send ( ) ; param arianeeId public getMissingOrStolenStatus = async ( arianeeId ) : Promise < { isStolen : boolean ; isMissing : boolean ; } > => { const [ isStolen , isMissing ] = await Promise . all ( [ this . isMissing ( arianeeId ) , this . isStolen ( arianeeId ) ] ) ; return { isStolen , isMissing } ; } ; param { ArianeeTokenId } arianeeId returns { Promise < boolean > } public isMissing = ( arianeeId ) : Promise < boolean > => this . contractService . lostContract . methods . isMissing ( arianeeId . toString ( ) ) . call ( ) ; param { ArianeeTokenId } arianeeId returns { Promise < boolean > } public isStolen = ( arianeeId ) : Promise < boolean > => this . contractService . lostContract . methods . isStolen ( arianeeId . toString ( ) ) . call ( ) ; }