Skip to content

Commit

Permalink
fix: add user command
Browse files Browse the repository at this point in the history
  • Loading branch information
SmartNetAR committed Mar 23, 2022
1 parent 35388aa commit a659eaa
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 29 deletions.
10 changes: 5 additions & 5 deletions dev.init.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env bash

yarn command addUserRole --role Admin --email user@node.com --firstName node --lastName node --password 12345678 --documentType DNI --documentNumber 12345678 --gender male --phone 541112345678 --country AR --address av.1234 --isSuperAdmin false --birthday 04/07/1990
yarn command addUserRole --role SuperAdmin --email superadmin@node.com --firstName super --lastName admin --documentType DNI --documentNumber 12345679 --gender male --phone 541112345678 --country AR --address av.1234 --password 12345678 --birthday 05/07/1990 --isSuperAdmin true
yarn command activeUser --email superadmin@node.com
yarn command activeUser --email user@node.com
yarn command addUser --email superadmin@node.com --firstName super --lastName admin --documentType DNI --documentNumber 12345679 --gender male --phone 541112345678 --country AR --address av.1234 --password 12345678 --birthday 05/07/1990 --isSuperAdmin true
yarn command addUserRole --role Admin --email user@node.com --firstName node --lastName node --password 12345678 --documentType DNI --documentNumber 12345678 --gender male --phone 541112345678 --country AR --address av.1234 --isSuperAdmin false --birthday 04/07/1990
yarn command activeUser --email superadmin@node.com
yarn command activeUser --email user@node.com
yarn command syncRolesPermission
yarn command createBucket --name experience --region us-east-1
yarn command createBucket --name experience --region us-east-1
23 changes: 12 additions & 11 deletions src/User/Presentation/Commands/AddUserCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ const AddUserCommand = new commander.Command('addUser');
AddUserCommand
.version('0.0.1')
.description('Add user to the system')
.option('-e, --email <email>', 'Email of user')
.option('-fn, --firstName <firstName>', 'First Name of the user')
.option('-ln, --lastName <lastName>', 'Last Name of the user')
.option('-dt, --documentType <documentType>', 'Document Type of the user')
.option('-dn, --documentNumber <documentNumer>', 'Document Number of the user')
.option('-g, --gender <gender>', 'Gender of the user')
.option('-ph, --phone <phone>', 'Phone of the user')
.option('-c, --country <country>', 'Country of the user')
.option('-a, --address <address>', 'Address of the user')
.option('-p, --password <password>', 'Password of the user')
.option('-isa, --isSuperAdmin <isSuperAdmin>', 'Set if User is Super Admin')
.option('-e, --email <email>', 'User`s email')
.option('-fn, --firstName <firstName>', 'User`s first name')
.option('-ln, --lastName <lastName>', 'User`s last name')
.option('-p, --password <password>', 'User`s password')
.option('-dt, --documentType <documentType>', 'User`s document type')
.option('-dn, --documentNumber <documentNumber>', 'User`s document Number')
.option('-g, --gender <gender>', 'User`s gender')
.option('-ph, --phone <phone>', 'User`s phone')
.option('-c, --country <country>', 'User`s country')
.option('-a, --address <address>', 'User`s address')
.option('-bir, --birthday <birthday>', 'User`s birthday')
.option('-isa, --isSuperAdmin <isSuperAdmin>', 'Set if user is super admin')
.action(async(env) =>
{
const saveUserUseCase = new SaveUserUseCase();
Expand Down
26 changes: 13 additions & 13 deletions src/User/Presentation/Commands/AddUserRoleCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ const AddUserRoleCommand = new commander.Command('addUserRole');
AddUserRoleCommand
.version('0.0.1')
.description('Add user, role and assign it')
.option('-r, --role <role>', 'Name of the role')
.option('-e, --email <email>', 'Email of user')
.option('-fn, --firstName <firstName>', 'First Name of the user')
.option('-ln, --lastName <lastName>', 'Last Name of the user')
.option('-p, --password <password>', 'Password of the user')
.option('-dt, --documentType <documentType>', 'Document Type of the user')
.option('-dn, --documentNumber <documentNumber>', 'Document Number of the user')
.option('-g, --gender <gender>', 'Gender of the user')
.option('-ph, --phone <phone>', 'Phone of the user')
.option('-c, --country <country>', 'Country of the user')
.option('-a, --address <address>', 'Address of the user')
.option('-bir, --birthday <birthday>', 'Birthday of the user')
.option('-isa, --isSuperAdmin <isSuperAdmin>', 'Set if User is Super Admin')
.option('-r, --role <role>', 'Role`s name of the role')
.option('-e, --email <email>', 'User`s email')
.option('-fn, --firstName <firstName>', 'User`s first name')
.option('-ln, --lastName <lastName>', 'User`s last name')
.option('-p, --password <password>', 'User`s password')
.option('-dt, --documentType <documentType>', 'User`s document type')
.option('-dn, --documentNumber <documentNumber>', 'User`s document Number')
.option('-g, --gender <gender>', 'User`s gender')
.option('-ph, --phone <phone>', 'User`s phone')
.option('-c, --country <country>', 'User`s country')
.option('-a, --address <address>', 'User`s address')
.option('-bir, --birthday <birthday>', 'User`s birthday')
.option('-isa, --isSuperAdmin <isSuperAdmin>', 'Set if user is super admin')
.action(async(env: any) =>
{
const saveUserUseCase = new SaveUserUseCase();
Expand Down

0 comments on commit a659eaa

Please sign in to comment.