Convert AdSku collateral over to Moose.
This commit is contained in:
parent
9832f38a93
commit
b9051fa8a4
2 changed files with 45 additions and 50 deletions
|
|
@ -328,7 +328,7 @@ sub onCompletePurchase {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
WebGUI::AssetCollateral::Sku::Ad::Ad->create($session, {
|
WebGUI::AssetCollateral::Sku::Ad::Ad->new($session, {
|
||||||
userId => $userId,
|
userId => $userId,
|
||||||
transactionItemId => $item->getId,
|
transactionItemId => $item->getId,
|
||||||
adId => $ad->getId,
|
adId => $ad->getId,
|
||||||
|
|
|
||||||
|
|
@ -25,14 +25,7 @@ Package to manipulate collateral for WebGUI::Asset::Sku::Ad.
|
||||||
This packages is a subclass of L<WebGUI::Crud>. Please refer to that module
|
This packages is a subclass of L<WebGUI::Crud>. Please refer to that module
|
||||||
for a list of base methods that are available.
|
for a list of base methods that are available.
|
||||||
|
|
||||||
=cut
|
=head1 properties
|
||||||
|
|
||||||
use strict;
|
|
||||||
use base 'WebGUI::Crud';
|
|
||||||
|
|
||||||
#------------------------------------------------
|
|
||||||
|
|
||||||
=head1 crud_definition ($session)
|
|
||||||
|
|
||||||
Defines the fields this CRUD will contain.
|
Defines the fields this CRUD will contain.
|
||||||
|
|
||||||
|
|
@ -47,46 +40,48 @@ isDeleted = boolean that indicates whether the ad has been deleted from the syst
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub crud_definition {
|
use strict;
|
||||||
my ($class, $session) = @_;
|
use Moose;
|
||||||
my $definition = $class->SUPER::crud_definition($session);
|
use WebGUI::Definition::Crud;
|
||||||
$definition->{tableName} = 'adSkuPurchase';
|
extends 'WebGUI::Crud';
|
||||||
$definition->{tableKey} = 'adSkuPurchaseId';
|
define tableName => 'adSkuPurchase';
|
||||||
$definition->{properties} = {
|
define tableKey => 'adSkuPurchaseId';
|
||||||
userId => {
|
has adSkuPurchaseId => (
|
||||||
fieldType => 'user',
|
required => 1,
|
||||||
defaultValue => undef,
|
is => 'ro',
|
||||||
},
|
);
|
||||||
transactionItemId => {
|
property userId => (
|
||||||
fieldType => 'guid',
|
label => 'userId',
|
||||||
defaultValue => undef,
|
fieldType => 'user',
|
||||||
},
|
);
|
||||||
adId => {
|
property transactionItemId => (
|
||||||
fieldType => 'guid',
|
label => 'transactionItemId',
|
||||||
defaultValue => undef,
|
fieldType => 'guid',
|
||||||
},
|
);
|
||||||
clicksPurchased => {
|
property adId => (
|
||||||
fieldType => 'integer',
|
label => 'adId',
|
||||||
defaultValue => undef,
|
fieldType => 'guid',
|
||||||
},
|
);
|
||||||
impressionsPurchased => {
|
property clicksPurchased => (
|
||||||
fieldType => 'integer',
|
label => 'clicksPurchased',
|
||||||
defaultValue => undef,
|
fieldType => 'integer',
|
||||||
},
|
);
|
||||||
dateOfPurchase => {
|
property impressionsPurchased => (
|
||||||
fieldType => 'date',
|
label => 'impressionsPurchased',
|
||||||
defaultValue => undef,
|
fieldType => 'integer',
|
||||||
},
|
);
|
||||||
storedImage => {
|
property dateOfPurchase => (
|
||||||
fieldType => 'guid',
|
label => 'dateOfPurchase',
|
||||||
defaultValue => undef,
|
fieldType => 'date',
|
||||||
},
|
);
|
||||||
isDeleted => {
|
property storedImage => (
|
||||||
fieldType => 'yesNo',
|
label => 'storedImage',
|
||||||
defaultValue => 0,
|
fieldType => 'guid',
|
||||||
},
|
);
|
||||||
};
|
property isDeleted => (
|
||||||
return $definition;
|
label => 'isDeleted',
|
||||||
}
|
fieldType => 'yesNo',
|
||||||
|
default => 0,
|
||||||
|
);
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue