trial
This commit is contained in:
@@ -304,10 +304,26 @@ export class AuthService {
|
||||
ownerId: user.id,
|
||||
});
|
||||
|
||||
await this.grantFreeTrial(salon.id, user.id);
|
||||
|
||||
const tokens = await this.issueTokens(user);
|
||||
return { ...tokens, salon };
|
||||
}
|
||||
|
||||
private async grantFreeTrial(
|
||||
salonId: string,
|
||||
ownerId: string,
|
||||
): Promise<void> {
|
||||
try {
|
||||
await this.salonSubscriptionsService.startFreeTrial(salonId, ownerId);
|
||||
} catch (error) {
|
||||
this.logger.error(
|
||||
`Failed to grant free trial for salon ${salonId}`,
|
||||
error instanceof Error ? error.stack : undefined,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private validateSalonSignupFields(dto: VerifySalonOtpDto): void {
|
||||
const requiredFields: Array<keyof VerifySalonOtpDto> = [
|
||||
'firstName',
|
||||
|
||||
Reference in New Issue
Block a user