Fetching contributors…
Cannot retrieve contributors at this time
48 lines (33 sloc) 745 Bytes
package MetaCPAN::Document::Favorite;
use strict;
use warnings;
use Moose;
use ElasticSearchX::Model::Document;
use DateTime;
use MetaCPAN::Types qw(:all);
use MetaCPAN::Util;
has id => (
is => 'ro',
id => [qw(user distribution)],
);
has [qw(author release user distribution)] => (
is => 'ro',
required => 1,
);
=head2 date
L<DateTime> when the item was created.
=cut
has date => (
is => 'ro',
required => 1,
isa => 'DateTime',
default => sub { DateTime->now },
);
=head2 timestamp
Sets the C<_timestamp> field to the value of L</date>.
=cut
has timestamp => (
is => 'ro',
timestamp => {}, # { path => 'date', store => 1 },
);
__PACKAGE__->meta->make_immutable;