Committer: vtroitsky
LJSUP-13467: Selfpromo/CommPromo refactoring required for Journal PromoU trunk/cgi-bin/LJ/Pay/SelfPromo.pm
Modified: trunk/cgi-bin/LJ/Pay/SelfPromo.pm =================================================================== --- trunk/cgi-bin/LJ/Pay/SelfPromo.pm 2012-08-29 15:35:37 UTC (rev 12583) +++ trunk/cgi-bin/LJ/Pay/SelfPromo.pm 2012-08-29 16:12:25 UTC (rev 12584) @@ -1,25 +1,22 @@ package LJ::Pay::SelfPromo; use strict; -use warnings; +use LJ::Promo::Processor; +use base qw( LJ::Promo::Processor ); -use base qw(LJ::Promo::Processor); - +use warnings; use LJ::Pay::Wallet; use LJ::Pay::Wallet::Error qw(:codes); use LJ::Pay::PromotionSlot qw(:classes); use LJ::Pay::PromotedObject qw(:types); use LJ::Pay::Promotion; use LJ::Pay::SelfPromo::History; + use LJ::Event::PromoBuyout; - -#use LJ::Pay::SelfPromo::Lock; -#use LJ::Pay::SelfPromo::Error; - use Sys::Hostname qw(); use Exporter; -our @ISA = qw(Exporter); +our @ISA = qw(Exporter LJ::Promo::Processor); my $errors; @@ -57,13 +54,14 @@ } return $slot->config->{'min_cost'}; # return minimal price } - + =item _is_object_eligible Specific checks for that available for current processor Ensure that object is not promoting at the moment in all promos!!!! =cut sub _is_object_eligible { my ($class, $slot, $promoted_object, $promoter, $reason_ref) = @_; + my $type = $promoted_object->type; if ($type eq PROMO_OBJECT_TYPE_ENTRY()) { @@ -78,7 +76,6 @@ } } return 1; - } =item buyout Function to make a bid: core logic is implemented here