Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

reconciled new blue

Steven Teya475c14f68e3
diff --git a/apps/web/app/api/cron/payouts/route.ts b/apps/web/app/api/cron/payouts/route.ts
index a100260d5d..42f31c8a78 100644
--- a/apps/web/app/api/cron/payouts/route.ts
+++ b/apps/web/app/api/cron/payouts/route.ts
@@ -1,7 +1,7 @@
import { handleAndReturnErrorResponse } from "@/lib/api/errors";
-import { processMonthlyPartnerPayouts } from "@/lib/api/sales/payout";
import { verifyVercelSignature } from "@/lib/cron/verify-vercel";
import { NextResponse } from "next/server";
+import { processMonthlyPartnerPayouts } from "./utils";
export const dynamic = "force-dynamic";
diff --git a/apps/web/lib/api/sales/payout.ts b/apps/web/app/api/cron/payouts/utils.ts
similarity index 89%
rename from apps/web/lib/api/sales/payout.ts
rename to apps/web/app/api/cron/payouts/utils.ts
index 3cc5d3d3ed..f9878a93ae 100644
--- a/apps/web/lib/api/sales/payout.ts
+++ b/apps/web/app/api/cron/payouts/utils.ts
@@ -1,6 +1,5 @@
+import { createId } from "@/lib/api/utils";
import { prisma } from "@/lib/prisma";
-import { subDays } from "date-fns";
-import { createId } from "../utils";
// Payout are calcuated at the end of the month
export const processMonthlyPartnerPayouts = async () => {
@@ -39,9 +38,9 @@ export const createPartnerPayouts = async ({
partnerId,
payoutId: null,
status: "pending", // We only want to pay out sales that are pending (not refunded / fraud / duplicate)
- createdAt: {
- lte: subDays(new Date(), 30), // Referral commissions are held for 30 days before becoming available.
- },
+ // createdAt: {
+ // lte: subDays(new Date(), 30), // Referral commissions are held for 30 days before becoming available.
+ // },
},
select: {
id: true,
@@ -76,7 +75,7 @@ export const createPartnerPayouts = async ({
// Create the payout
const payout = await tx.payout.create({
data: {
- id: createId({ prefix: "" }),
+ id: createId({ prefix: "po_" }),
programId,
partnerId,
amount,
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/programs/[programId]/sales/sale-table.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/programs/[programId]/sales/sale-table.tsx
index ace0f67835..40af8fe86e 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/programs/[programId]/sales/sale-table.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/programs/[programId]/sales/sale-table.tsx
@@ -50,8 +50,8 @@ export const SaleStatusBadges = {
},
reconciled: {
label: "Reconciled",
- variant: "neutral",
- className: "text-neutral-600 bg-neutral-100",
+ variant: "new",
+ className: "text-blue-600 bg-blue-100",
icon: CircleHalfDottedClock,
},
paid: {
diff --git a/packages/ui/src/status-badge.tsx b/packages/ui/src/status-badge.tsx
index b05e2be15c..e17c9bfa8e 100644
--- a/packages/ui/src/status-badge.tsx
+++ b/packages/ui/src/status-badge.tsx
@@ -15,7 +15,7 @@ const statusBadgeVariants = cva(
variants: {
variant: {
neutral: "bg-gray-500/[.15] text-gray-600",
- new: "bg-gray-500/[.15] text-gray-600",
+ new: "bg-blue-500/[.15] text-blue-600",
success: "bg-green-500/[.15] text-green-600",
pending: "bg-orange-500/[.15] text-orange-600",
warning: "bg-yellow-500/[.15] text-yellow-600",