From 695895e26618cbfaa89183848cbeadd7ab9a0d5b Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 23 Jun 2018 19:59:49 -0400 Subject: initial implementation --- lib/WWW/YNAB/Transaction.pm | 95 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 lib/WWW/YNAB/Transaction.pm (limited to 'lib/WWW/YNAB/Transaction.pm') diff --git a/lib/WWW/YNAB/Transaction.pm b/lib/WWW/YNAB/Transaction.pm new file mode 100644 index 0000000..ab98642 --- /dev/null +++ b/lib/WWW/YNAB/Transaction.pm @@ -0,0 +1,95 @@ +package WWW::YNAB::Transaction; +use Moose; + +use Moose::Util::TypeConstraints qw(enum maybe_type); + +has id => ( + is => 'ro', + isa => 'Str', + required => 1, +); + +has date => ( + is => 'ro', + isa => 'Str', +); + +has amount => ( + is => 'ro', + isa => 'Int', +); + +has memo => ( + is => 'ro', + isa => 'Maybe[Str]', +); + +has cleared => ( + is => 'ro', + isa => enum([qw(cleared uncleared reconciled)]), +); + +has approved => ( + is => 'ro', + isa => 'Bool', +); + +has flag_color => ( + is => 'ro', + isa => maybe_type(enum([qw(red orange yellow green blue purple)])), +); + +has account_id => ( + is => 'ro', + isa => 'Str', +); + +has payee_id => ( + is => 'ro', + isa => 'Maybe[Str]', +); + +has category_id => ( + is => 'ro', + isa => 'Maybe[Str]', +); + +has transfer_account_id => ( + is => 'ro', + isa => 'Maybe[Str]', +); + +has import_id => ( + is => 'ro', + isa => 'Maybe[Str]', +); + +has deleted => ( + is => 'ro', + isa => 'Bool', +); + +has account_name => ( + is => 'ro', + isa => 'Str', +); + +has payee_name => ( + is => 'ro', + isa => 'Maybe[Str]', +); + +has category_name => ( + is => 'ro', + isa => 'Maybe[Str]', +); + +has subtransactions => ( + is => 'ro', + isa => 'ArrayRef[WWW::YNAB::SubTransaction]', +); + +__PACKAGE__->meta->make_immutable; +no Moose; + +1; -- cgit v1.2.3-54-g00ecf