App-Office-Contacts-Donations

 view release on metacpan or  search on metacpan

lib/App/Office/Contacts/Donations/Util/Validator.pm  view on Meta::CPAN

package App::Office::Contacts::Donations::Util::Validator;

use Moose;

extends 'App::Office::Contacts::Util::Validator';

use namespace::autoclean;

our $VERSION = '1.10';

# --------------------------------------------------

sub donations
{
	my($self) = @_;

	$self -> log(debug => 'Entered donations');

	my($verifier) = Data::Verifier -> new
	(
		filters => [qw(trim)],
		profile =>
		{
			amount_input =>
			{
				required => 1,
				type     => 'Num',
			},
			currency_id_1 =>
			{
				required => 1,
				type     => 'Int',
			},
			donation_motive_id =>
			{
				required => 1,
				type     => 'Int',
			},
			donation_project_id =>
			{
				required => 1,
				type     => 'Int',
			},
			motive_text =>
			{
				required => 0,
				type     => 'Str',
			},
			project_text =>
			{
				required => 0,
				type     => 'Str',
			},
			sid =>
			{
				required => 1,
				type     => 'Str',
			},
			target_id =>
			{
				required => 1,
				type     => 'Int',
			},
		},
	);
	my($result) = $verifier -> verify({$self -> query -> Vars});



( run in 2.296 seconds using v1.01-cache-2.11-cpan-99c4e6809bf )