Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Move

Manav Rathi6d2bd35a6642
diff --git a/web/apps/photos/src/components/pages/gallery/PlanSelector.tsx b/web/apps/photos/src/components/pages/gallery/PlanSelector.tsx
index a64a302e46..7c1da48a09 100644
--- a/web/apps/photos/src/components/pages/gallery/PlanSelector.tsx
+++ b/web/apps/photos/src/components/pages/gallery/PlanSelector.tsx
@@ -35,9 +35,13 @@ import Typography from "@mui/material/Typography";
import { t } from "i18next";
import { useContext, useEffect, useMemo, useState } from "react";
import { Trans } from "react-i18next";
-import billingService, { type PlansResponse } from "services/billingService";
+import billingService, {
+ Plan,
+ PLAN_PERIOD,
+ Subscription,
+ type PlansResponse,
+} from "services/billingService";
import { getFamilyPortalRedirectURL } from "services/userService";
-import { Plan, PLAN_PERIOD, Subscription } from "types/billing";
import { SetLoading } from "types/gallery";
import { BonusData, UserDetails } from "types/user";
import {
diff --git a/web/apps/photos/src/services/billingService.ts b/web/apps/photos/src/services/billingService.ts
index 18fef72f75..c56489ce6c 100644
--- a/web/apps/photos/src/services/billingService.ts
+++ b/web/apps/photos/src/services/billingService.ts
@@ -8,9 +8,38 @@ import {
} from "@ente/shared/storage/localStorage";
import { getToken } from "@ente/shared/storage/localStorage/helpers";
import isElectron from "is-electron";
-import { Plan, Subscription } from "types/billing";
import { getPaymentToken } from "./userService";
+export enum PLAN_PERIOD {
+ MONTH = "month",
+ YEAR = "year",
+}
+
+export interface Subscription {
+ id: number;
+ userID: number;
+ productID: string;
+ storage: number;
+ originalTransactionID: string;
+ expiryTime: number;
+ paymentProvider: string;
+ attributes: {
+ isCancelled: boolean;
+ };
+ price: string;
+ period: PLAN_PERIOD;
+}
+
+export interface Plan {
+ id: string;
+ androidID: string;
+ iosID: string;
+ storage: number;
+ price: string;
+ period: PLAN_PERIOD;
+ stripeID: string;
+}
+
enum PaymentActionType {
Buy = "buy",
Update = "update",
diff --git a/web/apps/photos/src/types/billing/index.ts b/web/apps/photos/src/types/billing/index.ts
deleted file mode 100644
index 3354a174ca..0000000000
--- a/web/apps/photos/src/types/billing/index.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-export enum PLAN_PERIOD {
- MONTH = "month",
- YEAR = "year",
-}
-
-export interface Subscription {
- id: number;
- userID: number;
- productID: string;
- storage: number;
- originalTransactionID: string;
- expiryTime: number;
- paymentProvider: string;
- attributes: {
- isCancelled: boolean;
- };
- price: string;
- period: PLAN_PERIOD;
-}
-
-export interface Plan {
- id: string;
- androidID: string;
- iosID: string;
- storage: number;
- price: string;
- period: PLAN_PERIOD;
- stripeID: string;
-}
diff --git a/web/apps/photos/src/types/user/index.ts b/web/apps/photos/src/types/user/index.ts
index bbdbd5d021..29be85169d 100644
--- a/web/apps/photos/src/types/user/index.ts
+++ b/web/apps/photos/src/types/user/index.ts
@@ -1,5 +1,5 @@
import type { FamilyData } from "@/new/photos/services/user";
-import { Subscription } from "types/billing";
+import { Subscription } from "services/billingService";
export interface Bonus {
storage: number;
diff --git a/web/apps/photos/src/utils/billing/index.ts b/web/apps/photos/src/utils/billing/index.ts
index 84d6b0c457..77429c820a 100644
--- a/web/apps/photos/src/utils/billing/index.ts
+++ b/web/apps/photos/src/utils/billing/index.ts
@@ -7,8 +7,7 @@ import { SetDialogBoxAttributes } from "@ente/shared/components/DialogBox/types"
import { LS_KEYS, getData } from "@ente/shared/storage/localStorage";
import { t } from "i18next";
import type { NextRouter } from "next/router";
-import billingService from "services/billingService";
-import { Plan, Subscription } from "types/billing";
+import billingService, { Plan, Subscription } from "services/billingService";
import { SetLoading } from "types/gallery";
import { BonusData, UserDetails } from "types/user";
import { getSubscriptionPurchaseSuccessMessage } from "utils/ui";
diff --git a/web/apps/photos/src/utils/ui/index.tsx b/web/apps/photos/src/utils/ui/index.tsx
index f29d6179e2..267d7cf62d 100644
--- a/web/apps/photos/src/utils/ui/index.tsx
+++ b/web/apps/photos/src/utils/ui/index.tsx
@@ -2,7 +2,7 @@ import { DialogBoxAttributes } from "@ente/shared/components/DialogBox/types";
import InfoOutlined from "@mui/icons-material/InfoRounded";
import { t } from "i18next";
import { Trans } from "react-i18next";
-import { Subscription } from "types/billing";
+import { Subscription } from "services/billingService";
export const getTrashFilesMessage = (
deleteFileHelper,