amended api for recurring transaction list
This commit is contained in:
parent
37ffd53054
commit
bd36405fa8
1 changed files with 14 additions and 1 deletions
|
@ -45,12 +45,13 @@ sub post_transaction_list_purchases {
|
||||||
|
|
||||||
my @recurring_transaction_list = (
|
my @recurring_transaction_list = (
|
||||||
map {{
|
map {{
|
||||||
|
id => $_->id,
|
||||||
seller => $_->seller->name,
|
seller => $_->seller->name,
|
||||||
value => $_->value / 100000,
|
value => $_->value / 100000,
|
||||||
start_time => $c->format_iso_datetime($_->start_time),
|
start_time => $c->format_iso_datetime($_->start_time),
|
||||||
last_updated => $c->format_iso_datetime($_->last_updated),
|
last_updated => $c->format_iso_datetime($_->last_updated),
|
||||||
essential => $_->essential,
|
essential => $_->essential,
|
||||||
category => $_->category->category->name,
|
category => ( defined $_->category ? $_->category->name : 'Uncategorised' ),
|
||||||
recurring_period => $_->recurring_period,
|
recurring_period => $_->recurring_period,
|
||||||
}} $recurring_transactions->all
|
}} $recurring_transactions->all
|
||||||
);
|
);
|
||||||
|
@ -63,4 +64,16 @@ sub post_transaction_list_purchases {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub update_recurring {
|
||||||
|
my $c = shift;
|
||||||
|
|
||||||
|
my $user = $c->stash->{api_user};
|
||||||
|
|
||||||
|
my $validation = $c->validation;
|
||||||
|
|
||||||
|
$validation->input( $c->stash->{api_json} );
|
||||||
|
#TODO check that user matches seller on database before updating for that id
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
Reference in a new issue