feat: v2.2 batch (calendar, self-service, sort, description, filename search, stats, collab, invoice) on pre-redesign base

This commit is contained in:
Leon Tonhäuser committed 2026-11-30 21:20:13 +01:00
1 parent 453bece72c
commit 7204dd6b60
108 files changed
+10400 -105

No files matched your search

+8 -3
View File
@@ -594,6 +594,7 @@ export type DownloadDialogUsage = {
export type EditorialDownloadOptions = {
priceCents: number;
collabEnabled: boolean;
priorUsagesByAsset: Record<string, DownloadDialogUsage[]>;
};
@@ -610,7 +611,10 @@ export function createEditorialDownloadOptionsLoader(
throw new UsageAccountingError("INVALID_INPUT");
}
const [editorial] = await database
.select({ currentPriceCents: editorialAccounts.currentPriceCents })
.select({
currentPriceCents: editorialAccounts.currentPriceCents,
collabEnabled: editorialAccounts.collabEnabled,
})
.from(editorialAccounts)
.where(
and(
@@ -623,8 +627,9 @@ export function createEditorialDownloadOptionsLoader(
if (!Number.isSafeInteger(priceCents) || (priceCents ?? 0) <= 0) {
throw new UsageAccountingError("INVALID_PRICE");
}
const collabEnabled = editorial?.collabEnabled === true;
if (normalizedAssets.length === 0) {
return { priceCents: priceCents!, priorUsagesByAsset: {} };
return { priceCents: priceCents!, collabEnabled, priorUsagesByAsset: {} };
}
const deliveredOriginal = database
@@ -657,7 +662,7 @@ export function createEditorialDownloadOptionsLoader(
createdAt: row.createdAt.toISOString(),
});
}
return { priceCents: priceCents!, priorUsagesByAsset };
return { priceCents: priceCents!, collabEnabled, priorUsagesByAsset };
};
}