From: erickson Date: Wed, 31 Mar 2010 17:26:09 +0000 (+0000) Subject: added API docs for open-ils.actor.user.stage.create. Added support for passing in... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e783e7a9f1c69a59f7f6ee974a613af3c768d451;p=evergreen%2Fpines.git added API docs for open-ils.actor.user.stage.create. Added support for passing in staged statcats git-svn-id: svn://svn.open-ils.org/ILS/trunk@16070 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Actor/Stage.pm b/Open-ILS/src/perlmods/OpenILS/Application/Actor/Stage.pm index 2aebb119e0..c50097c1f7 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Actor/Stage.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Actor/Stage.pm @@ -11,10 +11,27 @@ my $U = "OpenILS::Application::AppUtils"; __PACKAGE__->register_method ( method => 'create_user_stage', api_name => 'open-ils.actor.user.stage.create', + signature => { + desc => q/ + Creates a new pending user account including addresses and statcats. + Users are added to staging tables pending staff review. + /, + params => [ + {desc => 'user', type => 'object', class => 'stgu'}, + {desc => 'Mailing address. Optional', type => 'object', class => 'stgma'}, + {desc => 'Billing address. Optional', type => 'object', class => 'stgba'}, + {desc => 'Statcats. Optional. This is an array of "stgsc" objects', type => 'array'}, + ], + return => { + desc => 'username on success, Event on error', + type => '' + } + + } ); sub create_user_stage { - my($self, $conn, $user, $mail_addr, $bill_addr) = @_; # more? + my($self, $conn, $user, $mail_addr, $bill_addr, $statcats) = @_; # more? return 0 unless $U->ou_ancestor_setting_value('opac.allow_pending_user'); return OpenILS::Event->new('BAD_PARAMS') unless $user; @@ -36,6 +53,13 @@ sub create_user_stage { $e->create_staging_billing_address_stage($bill_addr) or return $e->die_event; } + if($statcats) { + foreach (@$statcats) { + $_->usrname($uname); + $e->create_staging_statcat_stage($_) or return $e->die_event; + } + } + $e->commit; $conn->respond_complete($uname); @@ -148,8 +172,5 @@ sub delete_user_stage { } - 1; - -