apps/recallassess/recallassess-api/src/api/client/account/account.controller.ts
api/client/account
CLAccountController
Client portal API — Account (Account). HTTP Endpoints for RecallAssess.
Methods |
|
| Async createAccountFromSignup | ||||||
createAccountFromSignup(dto: CreateAccountFromSignupDto)
|
||||||
Decorators :
@Public()
|
||||||
|
Create company account and admin user after signup/payment.
Called by frontend after successful payment. Public (no auth).
Persists optional
Parameters :
Returns :
Promise<AccountCreationResponseDto>
|
import { Public } from "@bish-nest/bnest-auth";
import { Body, Controller, Post } from "@nestjs/common";
import { ApiBody, ApiOperation, ApiResponse, ApiTags } from "@nestjs/swagger";
import { CLAccountService } from "./account.service";
import { AccountCreationResponseDto, CreateAccountFromSignupDto } from "./dto/account.dto";
/**
* CLAccountController
*
* Client portal API — Account (Account). HTTP Endpoints for RecallAssess.
*/
@ApiTags("Client - Account")
@Controller("api/client/account")
export class CLAccountController {
constructor(private accountService: CLAccountService) {}
/**
* Create company account and admin user after signup/payment.
* Called by frontend after successful payment. Public (no auth).
* Persists optional `team_size` onto `company.team_size`.
*/
@Public()
@Post("create-from-signup")
@ApiOperation({
summary: "Create company + admin from signup",
description:
"Creates the company tenant and admin participant after Stripe payment or trial setup. Optional team_size is stored on company.",
})
@ApiBody({ type: CreateAccountFromSignupDto })
@ApiResponse({ status: 201, description: "Account created", type: AccountCreationResponseDto })
async createAccountFromSignup(@Body() dto: CreateAccountFromSignupDto): Promise<AccountCreationResponseDto> {
return this.accountService.createAccountFromSignup(dto);
}
}