@sourceloop/ctrl-plane-tenant-management-service / Exports / OnboardingService
Class: OnboardingService¶
Helper service for onboarding tenants.
Table of contents¶
Constructors¶
Properties¶
Methods¶
Constructors¶
constructor¶
• new OnboardingService(leadRepository
, tenantRepository
, contactRepository
, addressRepository
, leadAuthenticator
, logger
)
Constructs a new instance of the OnboardingService.
Parameters¶
Name | Type | Description |
---|---|---|
leadRepository |
LeadRepository |
Repository for managing leads. |
tenantRepository |
TenantRepository |
Repository for managing tenants. |
contactRepository |
ContactRepository |
Repository for managing contacts. |
addressRepository |
AddressRepository |
Repository for managing addresses. |
leadAuthenticator |
LeadAuthenticator |
Service for authenticating leads. |
logger |
ILogger |
Logger service for logging messages. |
Defined in¶
services/tenant-management-service/src/services/onboarding.service.ts:32
Properties¶
addressRepository¶
• Private
addressRepository: AddressRepository
Repository for managing addresses.
Defined in¶
services/tenant-management-service/src/services/onboarding.service.ts:40
contactRepository¶
• Private
contactRepository: ContactRepository
Repository for managing contacts.
Defined in¶
services/tenant-management-service/src/services/onboarding.service.ts:38
leadAuthenticator¶
• Private
leadAuthenticator: LeadAuthenticator
Service for authenticating leads.
Defined in¶
services/tenant-management-service/src/services/onboarding.service.ts:42
leadRepository¶
• Private
leadRepository: LeadRepository
Repository for managing leads.
Defined in¶
services/tenant-management-service/src/services/onboarding.service.ts:34
logger¶
• Private
logger: ILogger
Logger service for logging messages.
Defined in¶
services/tenant-management-service/src/services/onboarding.service.ts:44
tenantRepository¶
• Private
tenantRepository: TenantRepository
Repository for managing tenants.
Defined in¶
services/tenant-management-service/src/services/onboarding.service.ts:36
Methods¶
addLead¶
▸ addLead(lead
): Promise
<{ id
: string
= newLead.id; key
: string
}>
The addLead function creates a new lead, triggers a validation email, and returns the new lead.
Parameters¶
Name | Type | Description |
---|---|---|
lead |
Omit <CreateLeadDTO , "id" | "addressId" | "isValidated" > |
The lead parameter is an object of type Lead with the id property omitted. |
Returns¶
Promise
<{ id
: string
= newLead.id; key
: string
}>
The addLead
function is returning the newly created lead object.
Defined in¶
services/tenant-management-service/src/services/onboarding.service.ts:53
onboard¶
▸ onboard(dto
, lead?
): Promise
<Tenant
>
The setupTenant
function creates a new tenant with the provided information and an optional lead,
and returns the created tenant.
Parameters¶
Name | Type | Description |
---|---|---|
dto |
TenantOnboardDTO |
The dto parameter is an object of type TenantOnboardDTO which contains the necessary information to onboard a new tenant. It includes properties such as key , country , address , city , state , zip , and name . |
lead? |
Lead |
The lead parameter is an optional parameter of type Lead . It represents the lead associated with the tenant being onboarded. If a lead is provided, their information will be used to create a contact for the tenant. If no lead is provided, the contact will not be created. |
Returns¶
Promise
<Tenant
>
a Promise that resolves to a Tenant object.
Defined in¶
services/tenant-management-service/src/services/onboarding.service.ts:143
onboardForLead¶
▸ onboardForLead(dto
, lead
): Promise
<Tenant
>
The startOnboarding function checks if a lead user exists and is validated, and if not, updates the lead user's validation status and triggers tenant creation.
Parameters¶
Name | Type | Description |
---|---|---|
dto |
Omit <TenantOnboardDTO , "contact" > |
- |
lead |
LeadUser |
The lead parameter is an object of type LeadUser . It represents a lead user who is going through the onboarding process. |
Returns¶
Promise
<Tenant
>
Defined in¶
services/tenant-management-service/src/services/onboarding.service.ts:97