Add dark-mode business logo, payment order steps, and Arvan DNS diagnostics.
Store logo_dark_media_id on businesses, expose logoDarkUrl on tenant/website APIs, prepend awaiting-payment steps to order workflows, and surface clearer Arvan API network errors. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
e942348b1d
commit
6ce6f959ac
@@ -68,6 +68,7 @@ export class BusinessProfileService {
|
||||
categoryAssignments: true,
|
||||
addresses: { orderBy: { createdAt: 'asc' } },
|
||||
logoMedia: true,
|
||||
logoDarkMedia: true,
|
||||
faviconMedia: true,
|
||||
},
|
||||
});
|
||||
@@ -99,6 +100,7 @@ export class BusinessProfileService {
|
||||
categoryAssignments: true,
|
||||
addresses: { orderBy: { createdAt: 'asc' } },
|
||||
logoMedia: true,
|
||||
logoDarkMedia: true,
|
||||
faviconMedia: true,
|
||||
},
|
||||
});
|
||||
@@ -140,6 +142,7 @@ export class BusinessProfileService {
|
||||
categoryAssignments: true,
|
||||
addresses: true,
|
||||
logoMedia: true,
|
||||
logoDarkMedia: true,
|
||||
faviconMedia: true,
|
||||
},
|
||||
});
|
||||
@@ -156,6 +159,10 @@ export class BusinessProfileService {
|
||||
await this.assertLogoMedia(businessId, BigInt(dto.logoMediaId));
|
||||
}
|
||||
|
||||
if (dto.logoDarkMediaId !== undefined && dto.logoDarkMediaId !== null) {
|
||||
await this.assertLogoMedia(businessId, BigInt(dto.logoDarkMediaId));
|
||||
}
|
||||
|
||||
const previousFaviconMediaId = business.faviconMediaId;
|
||||
const logoChanged =
|
||||
dto.logoMediaId !== undefined &&
|
||||
@@ -196,6 +203,13 @@ export class BusinessProfileService {
|
||||
}
|
||||
}
|
||||
|
||||
if (dto.logoDarkMediaId !== undefined) {
|
||||
data.logoDarkMedia =
|
||||
dto.logoDarkMediaId === null
|
||||
? { disconnect: true }
|
||||
: { connect: { id: BigInt(dto.logoDarkMediaId) } };
|
||||
}
|
||||
|
||||
if (Object.keys(data).length > 0) {
|
||||
await tx.business.update({
|
||||
where: { id: businessId },
|
||||
@@ -376,6 +390,8 @@ export class BusinessProfileService {
|
||||
socialMedia: unknown;
|
||||
logoMediaId: bigint | null;
|
||||
logoMedia: { publicUrl: string } | null;
|
||||
logoDarkMediaId: bigint | null;
|
||||
logoDarkMedia: { publicUrl: string } | null;
|
||||
faviconMediaId: bigint | null;
|
||||
faviconMedia: { publicUrl: string } | null;
|
||||
categoryAssignments: { categoryId: bigint }[];
|
||||
@@ -390,6 +406,8 @@ export class BusinessProfileService {
|
||||
socialMedia: normalizeSocialMedia(business.socialMedia),
|
||||
logoMediaId: business.logoMediaId?.toString() ?? null,
|
||||
logoUrl: business.logoMedia?.publicUrl ?? null,
|
||||
logoDarkMediaId: business.logoDarkMediaId?.toString() ?? null,
|
||||
logoDarkUrl: business.logoDarkMedia?.publicUrl ?? null,
|
||||
faviconMediaId: business.faviconMediaId?.toString() ?? null,
|
||||
faviconUrl:
|
||||
business.faviconMedia?.publicUrl ??
|
||||
|
||||
@@ -33,6 +33,8 @@ export type BusinessProfile = {
|
||||
socialMedia: BusinessSocialMedia;
|
||||
logoMediaId: string | null;
|
||||
logoUrl: string | null;
|
||||
logoDarkMediaId: string | null;
|
||||
logoDarkUrl: string | null;
|
||||
faviconMediaId: string | null;
|
||||
faviconUrl: string | null;
|
||||
categoryIds: string[];
|
||||
|
||||
@@ -110,6 +110,11 @@ export class UpdateBusinessProfileDto {
|
||||
@IsInt()
|
||||
logoMediaId?: number | null;
|
||||
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsInt()
|
||||
logoDarkMediaId?: number | null;
|
||||
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@Type(() => Number)
|
||||
|
||||
Reference in New Issue
Block a user