added API docs for open-ils.actor.user.stage.create. Added support for passing in...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 31 Mar 2010 17:26:09 +0000 (17:26 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 31 Mar 2010 17:26:09 +0000 (17:26 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16070 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Actor/Stage.pm

index 2aebb11..c50097c 100644 (file)
@@ -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;
 
-
-