This commit is contained in:
2026-07-12 19:08:30 +03:30
parent 9202d1b2ca
commit 4048e3424a
14 changed files with 352 additions and 2 deletions
+16
View File
@@ -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',