Update hivegrid-cloud reference to latest main
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e98d38e716
commit
7b21524c86
3781 files changed
+373484
-225607
No files matched your search
+13
-13
@@ -1,4 +1,4 @@
|
||||
import type { PortalSubscriptionFeature, PortalSubscriptionPrice, PortalSubscriptionProduct } from "@toolctrl/db/prisma-browser";
|
||||
import type { PortalSubscriptionFeature, PortalSubscriptionPrice, PortalSubscriptionProduct } from "@hivegrid/db/prisma-browser";
|
||||
import { SubscriptionProductDto } from "~/application/dtos/subscriptions/SubscriptionProductDto";
|
||||
import { PricingModel } from "~/application/enums/subscriptions/PricingModel";
|
||||
import { SubscriptionBillingPeriod } from "~/application/enums/subscriptions/SubscriptionBillingPeriod";
|
||||
@@ -140,11 +140,11 @@ export async function getPortalSubscriptionProduct(portalId: string, id: string)
|
||||
});
|
||||
}
|
||||
|
||||
export async function getPortalSubscriptionProductByStripeId(portalId: string, stripeId: string) {
|
||||
export async function getPortalSubscriptionProductByBillingProviderId(portalId: string, billingProviderId: string) {
|
||||
return await db.portalSubscriptionProduct.findFirst({
|
||||
where: {
|
||||
portalId,
|
||||
stripeId,
|
||||
billingProviderId,
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -187,10 +187,10 @@ export async function getPortalSubscriptionPrice(portalId: string, id: string):
|
||||
});
|
||||
}
|
||||
|
||||
export async function getPortalSubscriptionPriceByStripeId(portalId: string, stripeId: string): Promise<PortalSubscriptionPriceWithProduct | null> {
|
||||
export async function getPortalSubscriptionPriceByBillingProviderId(portalId: string, billingProviderId: string): Promise<PortalSubscriptionPriceWithProduct | null> {
|
||||
return await db.portalSubscriptionPrice
|
||||
.findFirst({
|
||||
where: { portalId, stripeId },
|
||||
where: { portalId, billingProviderId },
|
||||
include: {
|
||||
subscriptionProduct: true,
|
||||
},
|
||||
@@ -202,7 +202,7 @@ export async function getPortalSubscriptionPriceByStripeId(portalId: string, str
|
||||
|
||||
export async function createPortalSubscriptionProduct(data: {
|
||||
portalId: string;
|
||||
stripeId: string;
|
||||
billingProviderId: string;
|
||||
order: number;
|
||||
title: string;
|
||||
model: PricingModel;
|
||||
@@ -219,7 +219,7 @@ export async function createPortalSubscriptionProduct(data: {
|
||||
return await db.portalSubscriptionProduct.create({
|
||||
data: {
|
||||
portalId: data.portalId,
|
||||
stripeId: data.stripeId,
|
||||
billingProviderId: data.billingProviderId,
|
||||
order: data.order,
|
||||
title: data.title,
|
||||
model: data.model,
|
||||
@@ -240,7 +240,7 @@ export async function updatePortalSubscriptionProduct(
|
||||
portalId: string,
|
||||
id: string,
|
||||
data: {
|
||||
stripeId?: string;
|
||||
billingProviderId?: string;
|
||||
order?: number;
|
||||
title?: string;
|
||||
model?: PricingModel;
|
||||
@@ -260,7 +260,7 @@ export async function updatePortalSubscriptionProduct(
|
||||
portalId,
|
||||
},
|
||||
data: {
|
||||
stripeId: data.stripeId,
|
||||
billingProviderId: data.billingProviderId,
|
||||
order: data.order,
|
||||
title: data.title,
|
||||
model: data.model,
|
||||
@@ -285,7 +285,7 @@ export async function updatePortalSubscriptionProduct(
|
||||
return item;
|
||||
}
|
||||
|
||||
export async function updatePortalSubscriptionProductStripeId(portalId: string, id: string, data: { stripeId: string }) {
|
||||
export async function updatePortalSubscriptionProductBillingProviderId(portalId: string, id: string, data: { billingProviderId: string }) {
|
||||
return await db.portalSubscriptionProduct.update({
|
||||
where: {
|
||||
portalId,
|
||||
@@ -295,7 +295,7 @@ export async function updatePortalSubscriptionProductStripeId(portalId: string,
|
||||
});
|
||||
}
|
||||
|
||||
export async function updatePortalSubscriptionPriceStripeId(portalId: string, id: string, data: { stripeId: string }) {
|
||||
export async function updatePortalSubscriptionPriceBillingProviderId(portalId: string, id: string, data: { billingProviderId: string }) {
|
||||
return await db.portalSubscriptionPrice.update({
|
||||
where: {
|
||||
portalId,
|
||||
@@ -308,7 +308,7 @@ export async function updatePortalSubscriptionPriceStripeId(portalId: string, id
|
||||
export async function createPortalSubscriptionPrice(data: {
|
||||
portalId: string;
|
||||
subscriptionProductId: string;
|
||||
stripeId: string;
|
||||
billingProviderId: string;
|
||||
type: SubscriptionPriceType;
|
||||
billingPeriod: SubscriptionBillingPeriod;
|
||||
price: number;
|
||||
@@ -320,7 +320,7 @@ export async function createPortalSubscriptionPrice(data: {
|
||||
data: {
|
||||
portalId: data.portalId,
|
||||
subscriptionProductId: data.subscriptionProductId,
|
||||
stripeId: data.stripeId,
|
||||
billingProviderId: data.billingProviderId,
|
||||
type: data.type,
|
||||
billingPeriod: data.billingPeriod,
|
||||
price: data.price,
|
||||
|
||||
+6
-6
@@ -6,7 +6,7 @@ import {
|
||||
PortalUserSubscription,
|
||||
PortalUserSubscriptionProduct,
|
||||
PortalUserSubscriptionProductPrice,
|
||||
} from "@toolctrl/db/prisma-browser";
|
||||
} from "@hivegrid/db/prisma-browser";
|
||||
import { FiltersDto } from "~/application/dtos/data/FiltersDto";
|
||||
import { PaginationDto } from "~/application/dtos/data/PaginationDto";
|
||||
import { db } from "~/utils/db.server";
|
||||
@@ -154,14 +154,14 @@ export async function getPortalUserSubscriptionProductById(portalId: string, id:
|
||||
});
|
||||
}
|
||||
|
||||
export async function getPortalUserSubscriptionProductByStripeSubscriptionId(
|
||||
export async function getPortalUserSubscriptionProductByBillingProviderSubscriptionId(
|
||||
portalId: string,
|
||||
stripeSubscriptionId: string
|
||||
billingProviderSubscriptionId: string
|
||||
): Promise<PortalUserSubscriptionProductWithTenant | null> {
|
||||
return await db.portalUserSubscriptionProduct.findFirst({
|
||||
where: {
|
||||
portalId,
|
||||
stripeSubscriptionId,
|
||||
billingProviderSubscriptionId,
|
||||
},
|
||||
include: {
|
||||
portalUserSubscription: {
|
||||
@@ -176,7 +176,7 @@ export async function addPortalUserSubscriptionProduct(data: {
|
||||
portalId: string;
|
||||
portalUserSubscriptionId: string;
|
||||
subscriptionProductId: string;
|
||||
stripeSubscriptionId?: string;
|
||||
billingProviderSubscriptionId?: string;
|
||||
quantity?: number;
|
||||
fromCheckoutSessionId?: string | null;
|
||||
prices: {
|
||||
@@ -189,7 +189,7 @@ export async function addPortalUserSubscriptionProduct(data: {
|
||||
portalId: data.portalId,
|
||||
portalUserSubscriptionId: data.portalUserSubscriptionId,
|
||||
subscriptionProductId: data.subscriptionProductId,
|
||||
stripeSubscriptionId: data.stripeSubscriptionId,
|
||||
billingProviderSubscriptionId: data.billingProviderSubscriptionId,
|
||||
quantity: data.quantity,
|
||||
fromCheckoutSessionId: data.fromCheckoutSessionId,
|
||||
endsAt: null,
|
||||
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
import { PortalUserSubscription } from "@toolctrl/db/prisma-browser";
|
||||
import { PortalUserSubscription } from "@hivegrid/db/prisma-browser";
|
||||
import { clearCacheKey } from "~/utils/cache.server";
|
||||
import { PortalUserSubscriptionProductWithDetails } from "./portalUserSubscriptionProducts.db.server";
|
||||
import { db } from "~/utils/db.server";
|
||||
@@ -72,13 +72,13 @@ export async function getPortalUserSubscriptions(portalId: string): Promise<Port
|
||||
});
|
||||
}
|
||||
|
||||
export async function createPortalUserSubscription(portalId: string, portalUserId: string, stripeCustomerId: string) {
|
||||
export async function createPortalUserSubscription(portalId: string, portalUserId: string, billingProviderCustomerId: string) {
|
||||
return await db.portalUserSubscription
|
||||
.create({
|
||||
data: {
|
||||
portalId,
|
||||
portalUserId,
|
||||
stripeCustomerId,
|
||||
billingProviderCustomerId,
|
||||
},
|
||||
include: {
|
||||
products: {
|
||||
@@ -100,7 +100,7 @@ export async function createPortalUserSubscription(portalId: string, portalUserI
|
||||
});
|
||||
}
|
||||
|
||||
export async function updatePortalUserSubscriptionCustomerId(portalId: string, portalUserId: string, data: { stripeCustomerId: string }) {
|
||||
export async function updatePortalUserSubscriptionCustomerId(portalId: string, portalUserId: string, data: { billingProviderCustomerId: string }) {
|
||||
return await db.portalUserSubscription
|
||||
.update({
|
||||
where: {
|
||||
|
||||
+6
-6
@@ -1,10 +1,10 @@
|
||||
import { Prisma, Portal } from "@toolctrl/db/prisma-browser";
|
||||
import { Prisma, Portal } from "@hivegrid/db/prisma-browser";
|
||||
import { FilterablePropertyDto } from "~/application/dtos/data/FilterablePropertyDto";
|
||||
import { FiltersDto } from "~/application/dtos/data/FiltersDto";
|
||||
import { PaginationDto } from "~/application/dtos/data/PaginationDto";
|
||||
import { JsonPropertiesValuesDto } from "~/modules/jsonProperties/dtos/JsonPropertiesValuesDto";
|
||||
import { cachified, clearCacheKey } from "~/utils/cache.server";
|
||||
import { loadWebConfig } from "@toolctrl/config";
|
||||
import { loadWebConfig } from "@hivegrid/config";
|
||||
import { db, dbRead } from "~/utils/db.server";
|
||||
import { TenantSimple } from "~/utils/db/tenants.db.server";
|
||||
import TenantModelHelper from "~/utils/helpers/models/TenantModelHelper";
|
||||
@@ -171,7 +171,7 @@ export async function createPortal(data: {
|
||||
domain: string | null;
|
||||
title: string;
|
||||
isPublished: boolean;
|
||||
stripeAccountId: string | null;
|
||||
paymentProviderAccountId: string | null;
|
||||
metadata: JsonPropertiesValuesDto;
|
||||
themeColor: string | null;
|
||||
themeScheme: string | null;
|
||||
@@ -203,7 +203,7 @@ export async function createPortal(data: {
|
||||
domain: data.domain,
|
||||
title: data.title,
|
||||
isPublished: data.isPublished,
|
||||
stripeAccountId: data.stripeAccountId,
|
||||
paymentProviderAccountId: data.paymentProviderAccountId,
|
||||
metadata: data.metadata,
|
||||
themeColor: data.themeColor,
|
||||
themeScheme: data.themeScheme,
|
||||
@@ -241,7 +241,7 @@ export async function updatePortal(
|
||||
domain?: string | null;
|
||||
title?: string;
|
||||
isPublished?: boolean;
|
||||
stripeAccountId?: string | null;
|
||||
paymentProviderAccountId?: string | null;
|
||||
metadata?: JsonPropertiesValuesDto;
|
||||
themeColor?: string | null;
|
||||
themeScheme?: string | null;
|
||||
@@ -272,7 +272,7 @@ export async function updatePortal(
|
||||
domain: data.domain,
|
||||
title: data.title,
|
||||
isPublished: data.isPublished,
|
||||
stripeAccountId: data.stripeAccountId,
|
||||
paymentProviderAccountId: data.paymentProviderAccountId,
|
||||
metadata: data.metadata,
|
||||
themeColor: data.themeColor,
|
||||
themeScheme: data.themeScheme,
|
||||
|
||||
Reference in new issue
Block a user