| 1 | #!/usr/bin/perl | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | use WWW::Shopify; | ||
| 7 | |||
| 8 | package WWW::Shopify::Model::Payout::Transaction; | ||
| 9 | use parent "WWW::Shopify::Model::Item"; | ||
| 10 | |||
| 11 | my $fields; sub fields { return $fields; } | ||
| 12 | BEGIN { $fields = { | ||
| 13 | "id" => new WWW::Shopify::Field::Identifier(), | ||
| 14 | "amount" => new WWW::Shopify::Field::Money(), | ||
| 15 | "currency" => new WWW::Shopify::Field::Currency(), | ||
| 16 | "type" => new WWW::Shopify::Field::String::Enum([qw(charge refund dispute reserve adjustment credit debit payout payout_failure payout_cancellation)]), | ||
| 17 | "test" => new WWW::Shopify::Field::Boolean(), | ||
| 18 | "payout_id" => new WWW::Shopify::Field::Relation::Parent('WWW::Shopify::Model::Payout'), | ||
| 19 | "payout_status" => new WWW::Shopify::Field::String(), | ||
| 20 | "fee" => new WWW::Shopify::Field::Money(), | ||
| 21 | "net" => new WWW::Shopify::Field::Money(), | ||
| 22 | "source_id" => new WWW::Shopify::Field::BigInt(), | ||
| 23 | "source_type" => new WWW::Shopify::Field::String::Enum([qw(charge refund dispute reserve adjustment payout)]), | ||
| 24 | "source_order_transaction_id" => new WWW::Shopify::Field::Relation::ReferenceOne('WWW::Shopify::Model::Transaction'), | ||
| 25 | "source_order_id" => new WWW::Shopify::Field::Relation::ReferenceOne('WWW::Shopify::Model::Order'), | ||
| 26 | "processed_at" => new WWW::Shopify::Field::Date() | ||
| 27 | }; } | ||
| 28 | my $queries; sub queries { return $queries; } | ||
| 29 | BEGIN { $queries = { | ||
| 30 | since_id => new WWW::Shopify::Query::LowerBound('id'), | ||
| 31 | last_id => new WWW::Shopify::Query::UpperBound('id'), | ||
| 32 | test => new WWW::Shopify::Query::Match('test'), | ||
| 33 | payout_id => new WWW::Shopify::Query::Match('payout_id'), | ||
| 34 | payout_status => new WWW::Shopify::Query::Enum('payout_status', [qw(scheduled in_transit paid failed cancelled)]) | ||
| 35 | }; } | ||
| 36 | |||
| 37 | sub updatable { undef }; | ||
| 38 | sub creatable { undef }; | ||
| 39 | |||
| 40 | sub read_scope { return "read_orders"; } | ||
| 41 | |||
| 42 | eval(__PACKAGE__->generate_accessors); die $@ if $@; | ||
| 43 | |||
| 44 | 1 |