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,