Add Mellat e-payment, videos/instructions CMS, and legacy domain lookup.
Store gateway credentials per business, initiate/verify Mellat at checkout, and resolve old CMS ids from domains in the migrate modal. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
513673a7da
commit
d5e502cf77
@@ -18,6 +18,7 @@ import { UpdateBusinessDto } from './dto/update-business.dto';
|
||||
import { ListBusinessesDto } from './dto/list-businesses.dto';
|
||||
import { SearchBusinessesDto } from './dto/search-businesses.dto';
|
||||
import { MigrateFromOldDto } from './dto/migrate-from-old.dto';
|
||||
import { LegacyMigrateLookupDto } from './dto/legacy-migrate-lookup.dto';
|
||||
import { PurgeBusinessDataDto } from './dto/purge-business-data.dto';
|
||||
import { LegacyMigrateService } from './legacy-migrate.service';
|
||||
import { LegacyPurgeService } from './legacy-purge.service';
|
||||
@@ -676,6 +677,50 @@ export class BusinessAdminService {
|
||||
return { message: 'Business removed' };
|
||||
}
|
||||
|
||||
async lookupLegacyMigrate(
|
||||
businessIdRaw: string,
|
||||
query: LegacyMigrateLookupDto,
|
||||
actor: AuthUser,
|
||||
) {
|
||||
await this.assertSuperAdmin(actor);
|
||||
|
||||
const businessId = BigInt(businessIdRaw);
|
||||
const business = await this.prisma.business.findUnique({
|
||||
where: { id: businessId },
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
domains: {
|
||||
select: { host: true, isPrimary: true },
|
||||
orderBy: [{ isPrimary: 'desc' }, { createdAt: 'asc' }],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (!business) {
|
||||
throw new NotFoundException('Business not found');
|
||||
}
|
||||
|
||||
const meshkeeHosts = business.domains.map((d) => d.host);
|
||||
const lookup = await this.legacyMigrate.lookupLegacyBusiness({
|
||||
meshkeeHosts,
|
||||
oldBusinessId: query.oldBusinessId,
|
||||
});
|
||||
|
||||
return {
|
||||
meshkeeHosts,
|
||||
meshkeeBusinessName: business.name,
|
||||
oldBusinessId:
|
||||
lookup.oldBusinessId != null ? String(lookup.oldBusinessId) : null,
|
||||
domains: lookup.domains,
|
||||
brandEn: lookup.brandEn,
|
||||
brandFa: lookup.brandFa,
|
||||
slug: lookup.slug,
|
||||
matchedHost: lookup.matchedHost,
|
||||
source: lookup.source,
|
||||
};
|
||||
}
|
||||
|
||||
async migrateFromOld(businessIdRaw: string, dto: MigrateFromOldDto, actor: AuthUser) {
|
||||
await this.assertSuperAdmin(actor);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user