From 9e47d861a2341253995d1270feb6244e93249d98 Mon Sep 17 00:00:00 2001 From: Mayank Mishra Date: Fri, 28 Nov 2025 11:41:35 +0530 Subject: [PATCH] made the stepper updation in submit company details api --- prisma/schema.prisma | 4 ++-- src/modules/host/services/host.service.ts | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 99c8fad..54ccbad 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -235,7 +235,7 @@ model Countries { model Currencies { id Int @id @default(autoincrement()) countryXid Int @map("country_xid") - country Countries @relation(fields: [countryXid], references: [id], onDelete: Restrict) + country Countries @relation(fields: [countryXid], references: [id], onDelete: Cascade) currencyName String @unique @map("currency_name") @db.VarChar(20) currencySymbol String @unique @map("currency_symbol") @db.VarChar(10) isActive Boolean @default(true) @map("is_active") @@ -312,7 +312,7 @@ model Taxes { model Banks { id Int @id @default(autoincrement()) countryXid Int @map("country_xid") - country Countries @relation(fields: [countryXid], references: [id], onDelete: Restrict) + country Countries @relation(fields: [countryXid], references: [id], onDelete: Cascade) bankName String @unique @map("bank_name") @db.VarChar(100) isActive Boolean @default(true) @map("is_active") createdAt DateTime @default(now()) @map("created_at") diff --git a/src/modules/host/services/host.service.ts b/src/modules/host/services/host.service.ts index 01c7103..b5c636b 100644 --- a/src/modules/host/services/host.service.ts +++ b/src/modules/host/services/host.service.ts @@ -351,6 +351,10 @@ export class HostService { const minglarStatusDisplay = isDraft ? MINGLAR_STATUS_DISPLAY.DRAFT : MINGLAR_STATUS_DISPLAY.NEW; + + const stepper = isDraft + ? STEPPER.NOT_SUBMITTED + : STEPPER.UNDER_REVIEW; // CREATE if (!existingHostCompany) { @@ -391,7 +395,7 @@ export class HostService { facebookUrl: companyData.facebookUrl || null, linkedinUrl: companyData.linkedinUrl || null, twitterUrl: companyData.twitterUrl || null, - stepper: STEPPER.UNDER_REVIEW, + stepper: stepper, hostStatusInternal: hostStatusInternal, hostStatusDisplay: hostStatusDisplay, adminStatusInternal: minglarStatusInternal, @@ -474,7 +478,7 @@ export class HostService { facebookUrl: companyData.facebookUrl || null, linkedinUrl: companyData.linkedinUrl || null, twitterUrl: companyData.twitterUrl || null, - stepper: STEPPER.UNDER_REVIEW, + stepper: stepper, hostStatusInternal: hostStatusInternal, hostStatusDisplay: hostStatusDisplay, adminStatusInternal: minglarStatusInternal,