__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;
$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);
}
-
1;
-
-