Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Campaign Discrepancies

This is an https://github.com/heyjobs/ruby-task task solution

Ruby 2.5.0

Campaign discrepancy service

This is service for checking for syncronization issues for a Campaign model.

It retrieves remote ads data and compare it with local.

Usage

Add campaign_discrepancy lib into Ruby on Rails app services and use wherever you want just calling

CampaignDiscrepancy::Checker.run.state

CampaignDiscrepancy::Checker servise has attributes:

  • state - where all found discrepancies stored
  • errors - array with errors ocurred if any

To know if service performed succesfully run

checker = CampaignDiscrepancy::Checker.run
checker.success

Solution notes

Solution is assumed to be a part of Ruby on Rails appliation.

To test it localy Campaign model is stubbed with support class and object_double and Rails app Settings stubbed with Settings class.

Solution can be easily changed to check more attributes if needed with just adding new items to CampaignDiscrepancy::Analyzer METRICS constant.

Custom errors can be defined for the service. Errors::ExternalAdsFetchError error added to collect all fetch remote data issues.

About

https://github.com/heyjobs/ruby-task solution

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages