('/payouts/distribution/cancel', {
+ // api: 'labrinth',
+ // version: 'internal',
+ // method: 'POST',
+ // })
+ }
+}
+
+function getMockHistory(): Labrinth.Payouts.Internal.HistoryItem[] {
+ if (!mockDistribution) {
+ return mockHistory
+ }
+
+ const activeDistribution = mockDistribution
+ return mockHistory.map((payout) =>
+ payout.payouts_date === activeDistribution.payouts_date
+ ? {
+ ...payout,
+ started_at: activeDistribution.started_at,
+ started_by: activeDistribution.started_by,
+ detailed_external_adjustments: activeDistribution.adjustments.map((adjustment) => ({
+ description: adjustment.description,
+ amount_usd: adjustment.amount,
+ })),
+ }
+ : payout,
+ )
+}
diff --git a/packages/api-client/src/modules/labrinth/types.ts b/packages/api-client/src/modules/labrinth/types.ts
index 91a2702091..7bc530c292 100644
--- a/packages/api-client/src/modules/labrinth/types.ts
+++ b/packages/api-client/src/modules/labrinth/types.ts
@@ -1690,6 +1690,61 @@ export namespace Labrinth {
}
export namespace Payouts {
+ export namespace Internal {
+ export type YearMonth = string
+
+ export type PayoutStatus = 'open' | 'pending' | 'review' | 'paid'
+
+ export type RevenueDay = {
+ estimated_revenue_usd: number | null
+ }
+
+ export type DetailedExternalAdjustment = {
+ description: string
+ amount_usd: number
+ }
+
+ export type HistoryItem = {
+ payouts_date: YearMonth
+ days: RevenueDay[]
+ status: PayoutStatus
+ fees_deducted_usd: number
+ variance_adjustment_usd: number
+ net_estimated_revenue_usd: number
+ creator_net_estimated_revenue_usd: number
+ modrinth_net_estimated_revenue_usd: number
+ actual_revenue_usd?: number
+ total_external_adjustment_usd?: number
+ net_actual_revenue_usd?: number
+ creator_net_actual_revenue_usd?: number
+ modrinth_net_actual_revenue_usd?: number
+ started_at: string | null
+ started_by: string | null
+ detailed_external_adjustments: DetailedExternalAdjustment[] | null
+ }
+
+ export type DistributionAdjustment = {
+ description: string
+ amount: number
+ }
+
+ export type StartDistributionRequest = {
+ payouts_date: YearMonth
+ totp_code: string
+ amount_received: number
+ adjustments: DistributionAdjustment[]
+ }
+
+ export type DistributionRun = {
+ payouts_date: YearMonth
+ amount_received: number
+ adjustments: DistributionAdjustment[]
+ started_at: string
+ started_by: string
+ distributes_at: string
+ }
+ }
+
export namespace v3 {
export type RevenueData = {
time: number
diff --git a/packages/ui/src/components/base/Table.vue b/packages/ui/src/components/base/Table.vue
index ebe779e841..e1d5069c8f 100644
--- a/packages/ui/src/components/base/Table.vue
+++ b/packages/ui/src/components/base/Table.vue
@@ -85,6 +85,7 @@
|
string)
/**
* Sets a minimum width for the table content, allowing horizontal overflow below that width.
*/
@@ -323,6 +332,14 @@ function getRowClass(rowIndex: number): string {
return rowIndex % 2 === 0 ? 'bg-surface-2' : 'bg-surface-1.5'
}
+function getBodyCellClass(row: T, rowIndex: number): string {
+ if (typeof props.bodyCellClass === 'function') {
+ return props.bodyCellClass(row, rowIndex)
+ }
+
+ return props.bodyCellClass ?? 'h-14'
+}
+
function isSelected(row: T): boolean {
return selectedIdSet.value.has(getSelectionId(row))
}
|