update account creation fileds
This commit is contained in:
@@ -4,8 +4,10 @@ type DbClient = Pick<typeof prisma, 'company' | 'brandSettings' | 'contractSetti
|
||||
|
||||
type CompanySignupInput = {
|
||||
companyName: string
|
||||
legalName: string
|
||||
slug: string
|
||||
email: string
|
||||
ownerEmail: string
|
||||
companyEmail: string
|
||||
companyPhone: string
|
||||
streetAddress: string
|
||||
city: string
|
||||
@@ -13,8 +15,21 @@ type CompanySignupInput = {
|
||||
zipCode: string
|
||||
legalForm: string
|
||||
managerName: string
|
||||
iceNumber: string
|
||||
taxId: string
|
||||
operatingLicenseNumber: string
|
||||
operatingLicenseIssuedAt: string
|
||||
operatingLicenseIssuedBy: string
|
||||
fax?: string
|
||||
yearsActive: string
|
||||
representativeName?: string
|
||||
representativeTitle?: string
|
||||
responsibleName: string
|
||||
responsibleRole: string
|
||||
responsibleIdentityNumber: string
|
||||
responsibleQualification?: string
|
||||
responsiblePhone: string
|
||||
responsibleEmail: string
|
||||
currency: 'MAD'
|
||||
registrationNumber: string
|
||||
plan: 'STARTER' | 'GROWTH' | 'PRO'
|
||||
@@ -44,17 +59,31 @@ export async function createCompanySignup(db: DbClient, input: CompanySignupInpu
|
||||
data: {
|
||||
name: input.companyName,
|
||||
slug: input.slug,
|
||||
email: input.email,
|
||||
email: input.companyEmail,
|
||||
phone: input.companyPhone,
|
||||
address: {
|
||||
streetAddress: input.streetAddress,
|
||||
city: input.city,
|
||||
country: input.country,
|
||||
zipCode: input.zipCode,
|
||||
legalName: input.legalName,
|
||||
legalForm: input.legalForm,
|
||||
companyEmail: input.companyEmail,
|
||||
managerName: input.managerName,
|
||||
iceNumber: input.iceNumber,
|
||||
operatingLicenseNumber: input.operatingLicenseNumber,
|
||||
operatingLicenseIssuedAt: input.operatingLicenseIssuedAt,
|
||||
operatingLicenseIssuedBy: input.operatingLicenseIssuedBy,
|
||||
fax: input.fax || null,
|
||||
yearsActive: input.yearsActive,
|
||||
representativeName: input.representativeName || null,
|
||||
representativeTitle: input.representativeTitle || null,
|
||||
responsibleName: input.responsibleName,
|
||||
responsibleRole: input.responsibleRole,
|
||||
responsibleIdentityNumber: input.responsibleIdentityNumber,
|
||||
responsibleQualification: input.responsibleQualification || null,
|
||||
responsiblePhone: input.responsiblePhone,
|
||||
responsibleEmail: input.responsibleEmail,
|
||||
},
|
||||
status: 'TRIALING',
|
||||
},
|
||||
@@ -65,7 +94,7 @@ export async function createCompanySignup(db: DbClient, input: CompanySignupInpu
|
||||
companyId: company.id,
|
||||
displayName: input.companyName,
|
||||
subdomain: input.slug,
|
||||
publicEmail: input.email,
|
||||
publicEmail: input.companyEmail,
|
||||
publicPhone: input.companyPhone,
|
||||
publicAddress: input.streetAddress,
|
||||
publicCity: input.city,
|
||||
@@ -78,8 +107,9 @@ export async function createCompanySignup(db: DbClient, input: CompanySignupInpu
|
||||
await db.contractSettings.create({
|
||||
data: {
|
||||
companyId: company.id,
|
||||
legalName: input.companyName,
|
||||
legalName: input.legalName,
|
||||
registrationNumber: input.registrationNumber,
|
||||
taxId: input.taxId,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -103,7 +133,7 @@ export async function createCompanySignup(db: DbClient, input: CompanySignupInpu
|
||||
clerkUserId: `local_owner_${company.id}`,
|
||||
firstName: input.firstName,
|
||||
lastName: input.lastName,
|
||||
email: input.email,
|
||||
email: input.ownerEmail,
|
||||
phone: input.companyPhone,
|
||||
passwordHash: input.passwordHash,
|
||||
role: 'OWNER',
|
||||
|
||||
Reference in New Issue
Block a user