# Copyright (c) 2006 bivio Software, Inc. All Rights Reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: ECSubscription.bunit,v 2.1 2008/06/18 16:45:08 moeller Exp $ Request(); req()->set_realm_and_user(ShellUtil_SQL()->DEMO); my($_D) = __PACKAGE__->use('Type.Date'); my($_ECPM) = __PACKAGE__->use('Type.ECPaymentMethod'); my($_ECS) = __PACKAGE__->use('Type.ECService'); my($payment) = model('ECPayment')->create({ amount => 0, service => $_ECS->ANIMAL, method => $_ECPM->NO_PAYMENT, }); my($today) = $_D->local_today; [ [req()] => [ create => [ [{ ec_payment_id => $payment->get('ec_payment_id'), start_date => $_D->add_days($today, -10), end_date => $_D->add_days($today, 10), }] => not_die(), ], is_infinite => 0, is_active => 1, update => [ [{ start_date => $_D->add_days($today, -10), end_date => $_D->add_days($today, -1), }] => not_die(), ], is_active => 0, make_infinite => not_die(), is_infinite => 1, is_active => 1, update => [ [{ start_date => $_D->add_days($today, 1), end_date => $_D->add_days($today, 2), }] => not_die(), ], is_active => 0, update => [ [{ start_date => $_D->add_days($today, 0), }] => not_die(), ], is_active => 1, update => [ [{ end_date => $_D->add_days($today, 0), }] => not_die(), ], is_active => 1, ], ];