Open evereq opened 4 years ago
@evereq I've started work on this feature & have a few questions
On tenants (though it'll come much later but just want to be sure) :
Will this client be created within the same tenant or will it be a new tenant altogether?
If the client will be a new tenant, then when we start showing things only for a tenant, will the client organization be visible in the 'organizations' tab (technically it shouldn't be if the client is a new tenant)?
General
What do we do if the email address already exists in the system as a user? (Maybe for the same tenant or maybe for different tenant etc.. ). I think for now we can just not allow them to add an email that already exists in the system.
When an invite is sent, should we create a client in the db with state 'invited' & null clientOrganizationId or instead only create a separate table like _invitedclients. I would prefer the first one because the client might take time to register & we shouldn't wait for them signing up for an organization to create simple client one in our db.
@rmagon see my answers below:
On tenants
That means we also probably should have a field clientTenantId where we will store TenantId of the client, I missed this in the description above!
The more complex scenario would be if a user with same email has multiple organizations and so we don't know which one to connect. I think in this case, we will need to show something for the client in our UI (when he click on the invite link) so he can select which Org he wants to "connect" (we can't show such selection/list of Organization to user who sends invite because it's security issue! We can only as client to select from his Orgs)
General
See answer above :) If email is used in our current tenant (not in some other tenant like described above), we will need later to generate an error saying that you want to invite a user which already registered in account :)
Yes, let's create a client record in our tenant DB in any case with state invited and only if client actually register we set that clientOrganizationId to relevant value and change status
Let me know if you have more questions!
@rmagon also to give you idea how complex it will be after client logins (in his own tenant), please read https://github.com/ever-co/gauzy/issues/514 ;)
Basically in some sense, you were right when you asked about the visibility of organizations (and the data) between company and client organizations. There will be some more "connected" things there, but for now, for the invite feature, it's most important to just store such "connection" info so later we can use it to decide what we can show to both org and client org.
@evereq Are we good to close this issue or keep it open till we cover the scenarios where invited client pre-exists in the system as part of one or more tenants.
@MuizNadeem I would prefer to keep it open before we cover all cases
Sure 😃
We have a few Epics related to organization clients: 1) ability for clients to login into Gauzy and see some information or make some actions (e.g. our company has some clients who want to get access to projects, employees, bonuses info, and many other) - https://github.com/ever-co/gauzy/issues/514 2) ability to invite clients to join Gauzy - this Epic
So, below is a description of 2)
On the Organization management Clients tab, we have a button "Add" which allows creating new Client for given Organization manually. However, it will be very useful to be able to "invite" clients into Gauzy, so they can register their own account, next to be able to login to Gauzy, communicate with a partner organization(s), see reports, statistics, employees tracking time and so on.
So we need to add the following:
1) button "Invite" on that Tab, to the right from the button "Add" which will open a popup to invite the client into Gauzy. Such an invite should have an input field for the client's email address. If the client invited, he should get an email with a link to join the Gauzy platform by registering an account. Such a link also should include the organization Id of the user who invited the client. After registration of client tenant and organization is done, the invite system should create a link between both organizations, where one is identified as "Client" for another. The most simple way to do it is to add a new field into
organization_clients
table called "clientOrganizationId" (default null) and add there client organization id after it (new organization for the client) gets created during invite process.2) In the Card of each of the existed clients (who do not yet have registered account, i.e. not have
clientOrganizationId != null
), we should have a button "Invite", which will open a popup to invite that already existed client into Gauzy. It will only send an email with an invite link to the relevant client. Note: if no email entered for the client, invite button should show popup to enter client email with the button "Invite" (and of course we should update client record with such email address).3) We should make client card clickable (unrelated to Invite feature we describe here) and it should redirect to separate Client page, where we will have different features available to work with a specific client, including the ability to view his profile page at Gauzy, to communicate with Client and so on.