refactor(data): merge DTO models into schemas
This commit is contained in:
@@ -2,7 +2,7 @@ import { act } from "react";
|
||||
import { createRoot, type Root } from "react-dom/client";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
import { PaymentPlan } from "@/data/dto/payment";
|
||||
import { PaymentPlan } from "@/data/schemas/payment";
|
||||
import { behaviorAnalytics } from "@/lib/analytics";
|
||||
|
||||
import { usePaymentPlanAnalytics } from "../use-payment-plan-analytics";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { useEffect, useRef } from "react";
|
||||
|
||||
import type { PaymentPlan } from "@/data/dto/payment";
|
||||
import type { PaymentPlan } from "@/data/schemas/payment";
|
||||
import {
|
||||
behaviorAnalytics,
|
||||
type PaymentAnalyticsContext,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { type Dispatch, useEffect, useRef } from "react";
|
||||
|
||||
import type { PayChannel } from "@/data/dto/payment";
|
||||
import type { PayChannel } from "@/data/schemas/payment";
|
||||
import type { PendingPaymentSubscriptionType } from "@/lib/payment/pending_payment_order";
|
||||
import {
|
||||
usePaymentDispatch,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import type { UiMessage } from "@/data/dto/chat";
|
||||
import type { UiMessage } from "@/stores/chat/ui-message";
|
||||
|
||||
import {
|
||||
buildChatRenderItems,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { UiMessage } from "@/data/dto/chat";
|
||||
import type { UiMessage } from "@/stores/chat/ui-message";
|
||||
|
||||
export type ChatMessageKeyResolver = (message: UiMessage) => string;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import type { LoginStatus } from "@/data/dto/auth";
|
||||
import type { LoginStatus } from "@/data/schemas/auth";
|
||||
import type { ChatUpgradeReason } from "@/stores/chat/chat-state";
|
||||
import { AppEnvUtil } from "@/utils/app-env";
|
||||
import { BrowserDetector } from "@/utils/browser-detect";
|
||||
|
||||
@@ -2,7 +2,7 @@ import { act } from "react";
|
||||
import { createRoot, type Root } from "react-dom/client";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
import type { UiMessage } from "@/data/dto/chat";
|
||||
import type { UiMessage } from "@/stores/chat/ui-message";
|
||||
|
||||
import { ChatArea } from "../chat-area";
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
} from "react";
|
||||
import { LoaderCircle } from "lucide-react";
|
||||
|
||||
import type { UiMessage } from "@/data/dto/chat";
|
||||
import type { UiMessage } from "@/stores/chat/ui-message";
|
||||
import { DEFAULT_CHARACTER_ID } from "@/data/constants/character";
|
||||
import { usePullToRefresh } from "@/hooks/use-pull-to-refresh";
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { shallowEqual } from "@xstate/react";
|
||||
|
||||
import type { LoginStatus } from "@/data/dto/auth";
|
||||
import type { LoginStatus } from "@/data/schemas/auth";
|
||||
import { useAppNavigator } from "@/router/use-app-navigator";
|
||||
import {
|
||||
usePaymentDispatch,
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
import { useEffect, useRef } from "react";
|
||||
|
||||
import type { LoginStatus } from "@/data/dto/auth";
|
||||
import type { UiMessage } from "@/data/dto/chat";
|
||||
import type { LoginStatus } from "@/data/schemas/auth";
|
||||
import type { UiMessage } from "@/stores/chat/ui-message";
|
||||
import { resolveSplashLatestMessageCacheIdentity } from "@/lib/chat/splash_latest_message";
|
||||
import { getLatestSplashMessagePreview } from "@/lib/chat/splash_latest_message_preview";
|
||||
import { useSplashLatestMessageCache } from "@/providers/splash-latest-message-provider";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import packageInfo from "../../../package.json";
|
||||
|
||||
import type { FeedbackContext } from "@/data/dto/feedback";
|
||||
import type { FeedbackContext } from "@/data/schemas/feedback";
|
||||
import { BrowserDetector } from "@/utils/browser-detect";
|
||||
import { PlatformDetector } from "@/utils/platform-detect";
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
|
||||
import { BackButton } from "@/app/_components";
|
||||
import { MobileShell } from "@/app/_components/core";
|
||||
import type { FeedbackCategory } from "@/data/dto/feedback";
|
||||
import type { FeedbackCategory } from "@/data/schemas/feedback";
|
||||
import { ROUTES } from "@/router/routes";
|
||||
import { useAppNavigator } from "@/router/use-app-navigator";
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { type FormEvent, useEffect, useRef, useState } from "react";
|
||||
|
||||
import type { FeedbackCategory } from "@/data/dto/feedback";
|
||||
import type { FeedbackCategory } from "@/data/schemas/feedback";
|
||||
import { submitFeedback } from "@/lib/feedback";
|
||||
|
||||
import { createFeedbackContext } from "./feedback-context";
|
||||
|
||||
@@ -2,7 +2,7 @@ import { act, type Dispatch } from "react";
|
||||
import { createRoot, type Root } from "react-dom/client";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
import type { LoginStatus } from "@/data/dto/auth";
|
||||
import type { LoginStatus } from "@/data/schemas/auth";
|
||||
import { ROUTES } from "@/router/routes";
|
||||
import type { PrivateRoomEvent } from "@/stores/private-room";
|
||||
import type { PrivateRoomUnlockPaywallRequest } from "@/stores/private-room/private-room-state";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { renderToStaticMarkup } from "react-dom/server";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { PrivateAlbum } from "@/data/dto/private-room";
|
||||
import { PrivateAlbum } from "@/data/schemas/private-room";
|
||||
|
||||
import { PrivateAlbumCard } from "../private-album-card";
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import Image from "next/image";
|
||||
import { ImageIcon, LockKeyhole } from "lucide-react";
|
||||
|
||||
import { CharacterAvatar } from "@/app/_components";
|
||||
import type { PrivateAlbum } from "@/data/dto/private-room";
|
||||
import type { PrivateAlbum } from "@/data/schemas/private-room";
|
||||
import { isPrivateAlbumLocked } from "@/lib/private-room/private_album";
|
||||
|
||||
import styles from "../private-room-screen.module.css";
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useEffect, useRef } from "react";
|
||||
import Image from "next/image";
|
||||
import { ChevronLeft, ChevronRight, X } from "lucide-react";
|
||||
|
||||
import type { PrivateAlbum } from "@/data/dto/private-room";
|
||||
import type { PrivateAlbum } from "@/data/schemas/private-room";
|
||||
|
||||
import styles from "../private-room-screen.module.css";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { PrivateAlbum } from "@/data/dto/private-room";
|
||||
import type { PrivateAlbum } from "@/data/schemas/private-room";
|
||||
|
||||
import styles from "../private-room-screen.module.css";
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { type Dispatch, useEffect, useRef } from "react";
|
||||
|
||||
import type { LoginStatus } from "@/data/dto/auth";
|
||||
import type { LoginStatus } from "@/data/schemas/auth";
|
||||
import { useGuestLoginBootstrap } from "@/hooks/use-guest-login-bootstrap";
|
||||
import { behaviorAnalytics } from "@/lib/analytics";
|
||||
import { ROUTES } from "@/router/routes";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import type { UserView } from "@/data/dto/user";
|
||||
import type { UserView } from "@/stores/user/user-view";
|
||||
|
||||
import {
|
||||
getSidebarViewModel,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { LoginStatus } from "@/data/dto/auth";
|
||||
import type { UserView } from "@/data/dto/user";
|
||||
import type { LoginStatus } from "@/data/schemas/auth";
|
||||
import type { UserView } from "@/stores/user/user-view";
|
||||
|
||||
export type SidebarUserState = "guest" | "member" | "vip";
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { type Dispatch, useEffect } from "react";
|
||||
|
||||
import type { LoginStatus } from "@/data/dto/auth";
|
||||
import type { LoginStatus } from "@/data/schemas/auth";
|
||||
|
||||
interface SidebarAuthBootstrapState {
|
||||
hasInitialized: boolean;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
import type { LoginStatus } from "@/data/dto/auth";
|
||||
import type { LoginStatus } from "@/data/schemas/auth";
|
||||
import { useHasHydrated } from "@/hooks/use-has-hydrated";
|
||||
import { loadSplashLatestMessagePreview } from "@/lib/chat/splash_latest_message";
|
||||
import { useSplashLatestMessageCache } from "@/providers/splash-latest-message-provider";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
import { PaymentPlan } from "@/data/dto/payment";
|
||||
import { PaymentPlan } from "@/data/schemas/payment";
|
||||
|
||||
import {
|
||||
canChooseSubscriptionPayChannel,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import Image from "next/image";
|
||||
|
||||
import type { PayChannel } from "@/data/dto/payment";
|
||||
import type { PayChannel } from "@/data/schemas/payment";
|
||||
|
||||
const PAYMENT_METHODS: {
|
||||
channel: PayChannel;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { PayChannel, PaymentPlan } from "@/data/dto/payment";
|
||||
import type { PayChannel, PaymentPlan } from "@/data/schemas/payment";
|
||||
import { getDefaultPayChannelForCountryCode } from "@/lib/payment/default_pay_channel";
|
||||
import { AppEnvUtil } from "@/utils/app-env";
|
||||
export { getDefaultPayChannelForCountryCode } from "@/lib/payment/default_pay_channel";
|
||||
|
||||
@@ -5,7 +5,7 @@ import { BackButton } from "@/app/_components";
|
||||
import { Checkbox, MobileShell } from "@/app/_components/core";
|
||||
import { usePaymentPlanAnalytics } from "@/app/_hooks/use-payment-plan-analytics";
|
||||
import { AppConstants } from "@/core/app_constants";
|
||||
import type { PayChannel } from "@/data/dto/payment";
|
||||
import type { PayChannel } from "@/data/schemas/payment";
|
||||
import type { SubscriptionReturnTo } from "@/lib/navigation/subscription_exit";
|
||||
import {
|
||||
behaviorAnalytics,
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useEffect, useRef, useState } from "react";
|
||||
|
||||
import { usePaymentRouteFlow } from "@/app/_hooks/use-payment-route-flow";
|
||||
import { useAppNavigator } from "@/router/use-app-navigator";
|
||||
import type { PayChannel } from "@/data/dto/payment";
|
||||
import type { PayChannel } from "@/data/schemas/payment";
|
||||
import type { SubscriptionReturnTo } from "@/lib/navigation/subscription_exit";
|
||||
|
||||
import type { SubscriptionType } from "./subscription-screen.helpers";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { PaymentPlan } from "@/data/dto/payment";
|
||||
import { PaymentPlan } from "@/data/schemas/payment";
|
||||
import type { PaymentPlanInput } from "@/data/schemas/payment/payment_plan";
|
||||
|
||||
import {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { LoginStatus } from "@/data/dto/auth";
|
||||
import type { PaymentPlan } from "@/data/dto/payment";
|
||||
import type { LoginStatus } from "@/data/schemas/auth";
|
||||
import type { PaymentPlan } from "@/data/schemas/payment";
|
||||
import {
|
||||
getTipCoffeeOption,
|
||||
type TipCoffeeType,
|
||||
|
||||
@@ -8,7 +8,7 @@ import { CharacterAvatar } from "@/app/_components";
|
||||
import { MobileShell } from "@/app/_components/core";
|
||||
import { usePaymentPlanAnalytics } from "@/app/_hooks/use-payment-plan-analytics";
|
||||
import { usePaymentRouteFlow } from "@/app/_hooks/use-payment-route-flow";
|
||||
import type { PayChannel } from "@/data/dto/payment";
|
||||
import type { PayChannel } from "@/data/schemas/payment";
|
||||
import {
|
||||
behaviorAnalytics,
|
||||
type PaymentAnalyticsContext,
|
||||
|
||||
Reference in New Issue
Block a user