summaryrefslogtreecommitdiffstats
path: root/lib/WWW/YNAB/Transaction.pm
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2018-06-23 19:59:49 -0400
committerJesse Luehrs <doy@tozt.net>2018-06-23 19:59:49 -0400
commit695895e26618cbfaa89183848cbeadd7ab9a0d5b (patch)
treed6ea2d037365c212b61581ff3734673f9e6a488f /lib/WWW/YNAB/Transaction.pm
parent84b1fc5ec0a38eef8c82e7e403da2378b37095a6 (diff)
downloadwww-ynab-695895e26618cbfaa89183848cbeadd7ab9a0d5b.tar.gz
www-ynab-695895e26618cbfaa89183848cbeadd7ab9a0d5b.zip
initial implementation
Diffstat (limited to 'lib/WWW/YNAB/Transaction.pm')
-rw-r--r--lib/WWW/YNAB/Transaction.pm95
1 files changed, 95 insertions, 0 deletions
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;