File Coverage

lib/Finance/Alpaca/Struct/TradeActivity.pm
Criterion Covered Total %
statement 33 33 100.0
branch n/a
condition n/a
subroutine 11 11 100.0
pod n/a
total 44 44 100.0


line stmt bran cond sub pod time code
1             package Finance::Alpaca::Struct::TradeActivity 0.9902 {
2 1     1   8 use strictures 2;
  1         7  
  1         39  
3 1     1   182 use feature 'signatures';
  1         3  
  1         60  
4 1     1   6 no warnings 'experimental::signatures';
  1         3  
  1         42  
5             #
6 1     1   5 use Type::Library 0.008 -base, -declare => qw[TradeActivity];
  1         17  
  1         6  
7 1     1   766 use Type::Utils;
  1         3  
  1         6  
8 1     1   1557 use Types::Standard qw[Enum Num Ref Str];
  1         3  
  1         6  
9 1     1   1102 use Types::TypeTiny 0.004 StringLike => { -as => "Stringable" };
  1         17  
  1         6  
10             class_type TradeActivity, { class => __PACKAGE__ };
11             coerce( TradeActivity, from Ref() => __PACKAGE__ . q[->new($_)] );
12             #
13 1     1   345 use Moo;
  1         2  
  1         6  
14 1     1   314 use Types::UUID;
  1         1  
  1         7  
15 1     1   388 use lib './lib';
  1         3  
  1         6  
16 1     1   165 use Finance::Alpaca::Types;
  1         3  
  1         7  
17             has activity_type => ( is => 'ro', isa => Str, required => 1 ); # FILL
18              
19             has order_id => ( is => 'ro', isa => Uuid, required => 1 );
20             has side => ( is => 'ro', isa => Enum [qw[buy sell sell_short]], required => 1 );
21             has transaction_time => ( is => 'ro', isa => Timestamp, required => 1, coerce => 1 );
22              
23             has [qw[symbol id]] => ( is => 'ro', isa => Str, required => 1 );
24             has [qw[qty cum_qty leaves_qty price ]] => ( is => 'ro', isa => Num, required => 1 );
25             has type => ( is => 'ro', isa => Enum [qw[fill partial_fill]], required => 1 );
26             }
27             1;
28             __END__