feat(tip): add selectable coffee gift tiers
This commit is contained in:
@@ -5,11 +5,6 @@ import { UserStorage } from "@/data/storage/user/user_storage";
|
||||
import type { PendingChatPromotionType } from "@/data/storage/navigation";
|
||||
import type { LoginStatus } from "@/data/dto/auth";
|
||||
import { ROUTES } from "@/router/routes";
|
||||
import {
|
||||
buildTipCoffeePath,
|
||||
DEFAULT_TIP_COFFEE_TYPE,
|
||||
resolveTipCoffeeType,
|
||||
} from "@/lib/tip/tip_coffee";
|
||||
|
||||
export type ExternalEntryTarget =
|
||||
| typeof ROUTES.chat
|
||||
@@ -27,10 +22,6 @@ export interface ExternalEntryTargetInput {
|
||||
target?: string | null;
|
||||
}
|
||||
|
||||
export interface ExternalEntryDestinationInput extends ExternalEntryTargetInput {
|
||||
coffeeType?: string | null;
|
||||
}
|
||||
|
||||
export interface ExternalEntryPromotionInput {
|
||||
mode?: string | null;
|
||||
promotionType?: string | null;
|
||||
@@ -88,14 +79,8 @@ export function resolveExternalEntryTarget({
|
||||
|
||||
export function resolveExternalEntryDestination({
|
||||
target,
|
||||
coffeeType,
|
||||
}: ExternalEntryDestinationInput): string {
|
||||
const resolvedTarget = resolveExternalEntryTarget({ target });
|
||||
if (resolvedTarget !== ROUTES.tip) return resolvedTarget;
|
||||
|
||||
return buildTipCoffeePath(
|
||||
resolveTipCoffeeType(coffeeType) ?? DEFAULT_TIP_COFFEE_TYPE,
|
||||
);
|
||||
}: ExternalEntryTargetInput): string {
|
||||
return resolveExternalEntryTarget({ target });
|
||||
}
|
||||
|
||||
export async function persistExternalEntryPayload({
|
||||
|
||||
Reference in New Issue
Block a user