Track HiveGrid Cloud planning reference
This commit is contained in:
1 parent
b3d5ea6764
commit
e341c5938a
5784 files changed
+1104929
-3
No files matched your search
@@ -0,0 +1,8 @@
|
||||
export type ApiKeyEntityPermissionDto = {
|
||||
id: string;
|
||||
name: string;
|
||||
create: boolean;
|
||||
read: boolean;
|
||||
update: boolean;
|
||||
delete: boolean;
|
||||
};
|
||||
@@ -0,0 +1,6 @@
|
||||
export enum ContactStatus {
|
||||
Lead = "Lead",
|
||||
Prospect = "Prospect",
|
||||
Customer = "Customer",
|
||||
Partner = "Partner",
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
export type ColumnDto = {
|
||||
name: string;
|
||||
title: string;
|
||||
visible: boolean;
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Colors } from "~/application/enums/shared/Colors";
|
||||
|
||||
export interface FilterablePropertyDto {
|
||||
name: string;
|
||||
title: string;
|
||||
manual?: boolean;
|
||||
condition?: string;
|
||||
value?: string | null;
|
||||
options?: { name: string; value: string; color?: Colors }[];
|
||||
isNumber?: boolean;
|
||||
isBoolean?: boolean;
|
||||
hideSearch?: boolean;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { FilterablePropertyDto } from "./FilterablePropertyDto";
|
||||
|
||||
export interface FiltersDto {
|
||||
properties: FilterablePropertyDto[];
|
||||
query?: string | null;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import { SortedByDto } from "./SortedByDto";
|
||||
|
||||
export interface PaginationDto {
|
||||
page: number;
|
||||
pageSize: number;
|
||||
totalItems: number;
|
||||
totalPages: number;
|
||||
sortedBy?: SortedByDto[];
|
||||
query?: string | undefined;
|
||||
}
|
||||
|
||||
export interface PaginationData<T> {
|
||||
items: T[];
|
||||
pagination: PaginationDto | undefined;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export interface PaginationResultDto {
|
||||
totalItems: number;
|
||||
totalPages: number;
|
||||
page: number;
|
||||
pageSize: number;
|
||||
sortedBy: any;
|
||||
query: any;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { Entity, Property } from "@toolctrl/db/prisma-browser";
|
||||
import { EntityRelationshipWithDetails } from "~/utils/db/entities/entityRelationships.db.server";
|
||||
|
||||
export interface RowFiltersDto {
|
||||
customRow: boolean;
|
||||
entity: Entity;
|
||||
query: string | null;
|
||||
properties: {
|
||||
property?: Property;
|
||||
name?: string;
|
||||
value: string | string[] | null;
|
||||
condition?: string;
|
||||
match?: "and" | "or";
|
||||
parentEntity?: EntityRelationshipWithDetails;
|
||||
}[];
|
||||
tags: string[];
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { ReactNode } from "react";
|
||||
|
||||
export interface RowHeaderActionDto<T> {
|
||||
title?: string | ReactNode;
|
||||
onClick?: (idx: number, item: T) => void;
|
||||
onClickRoute?: (idx: number, item: T) => string | undefined;
|
||||
onClickRouteTarget?: undefined | "_blank";
|
||||
disabled?: (item: T) => boolean | boolean;
|
||||
hidden?: (item: T) => boolean;
|
||||
destructive?: boolean;
|
||||
firstColumn?: boolean;
|
||||
renderTitle?: (item: T) => ReactNode;
|
||||
renderIsDestructive?: (item: T) => boolean;
|
||||
prefetch?: "intent" | "render" | "none";
|
||||
confirmation?: (item: T) => {
|
||||
title: string;
|
||||
description: string;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import { ReactNode } from "react";
|
||||
import { InputType } from "~/application/enums/shared/InputType";
|
||||
|
||||
export type RowHeaderDisplayDto<T> = {
|
||||
title: string;
|
||||
name?: string;
|
||||
type?: InputType;
|
||||
value: (item: T, idx: number) => any;
|
||||
href?: (item: T) => string | undefined;
|
||||
formattedValue?: (item: T, idx?: number) => string | ReactNode;
|
||||
options?: { name: string; value: number | string; disabled?: boolean }[];
|
||||
setValue?: (value: any, idx: number) => void;
|
||||
editable?: (item: T, idx?: number) => boolean;
|
||||
className?: string;
|
||||
sortable?: boolean;
|
||||
breakpoint?: "sm" | "md" | "lg" | "xl" | "2xl";
|
||||
inputNumberStep?: string;
|
||||
inputBorderless?: boolean;
|
||||
inputOptional?: boolean;
|
||||
sortBy?: string;
|
||||
align?: "left" | "center" | "right";
|
||||
hidden?: boolean;
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
import { Entity, Property } from "@toolctrl/db/prisma-browser";
|
||||
|
||||
export interface SortedByDto {
|
||||
name: string;
|
||||
direction: "asc" | "desc";
|
||||
property?: Property;
|
||||
entity?: Entity;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
export type EmailTemplate = {
|
||||
type: "standard" | "layout";
|
||||
name: string;
|
||||
alias: string;
|
||||
subject: string;
|
||||
htmlBody: string;
|
||||
active: boolean;
|
||||
associatedServerId: number;
|
||||
templateId: number;
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
export type MediaDto = {
|
||||
id?: string;
|
||||
title: string;
|
||||
name: string;
|
||||
file: string;
|
||||
type: string;
|
||||
publicUrl?: string | null;
|
||||
storageBucket?: string | null;
|
||||
storageProvider?: string | null;
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
import { Entity, Property, RowValue } from "@toolctrl/db/prisma-browser";
|
||||
|
||||
export interface RowDynamicValuesDto {
|
||||
form: Entity | undefined;
|
||||
name: string;
|
||||
total: number;
|
||||
headers: (RowValue & { property: Property })[];
|
||||
// details: RequestDetailDto[];
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
export type RowPermissionsDto = {
|
||||
canRead?: boolean;
|
||||
canComment: boolean;
|
||||
canUpdate: boolean;
|
||||
canDelete: boolean;
|
||||
isOwner: boolean;
|
||||
};
|
||||
@@ -0,0 +1,16 @@
|
||||
import { RowMedia, RowValueMultiple, RowValueRange } from "@toolctrl/db/prisma-browser";
|
||||
import { PropertyWithDetails } from "~/utils/db/entities/entities.db.server";
|
||||
|
||||
export type RowValueDto = {
|
||||
id?: string | null;
|
||||
property: PropertyWithDetails;
|
||||
propertyId: string;
|
||||
textValue?: string | undefined;
|
||||
numberValue?: number | undefined;
|
||||
dateValue?: Date | undefined;
|
||||
booleanValue?: boolean | undefined;
|
||||
selectedOption?: string | undefined;
|
||||
media?: RowMedia[];
|
||||
multiple?: RowValueMultiple[];
|
||||
range?: RowValueRange | undefined;
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
export type RowValueMultipleDto = {
|
||||
id?: string;
|
||||
order: number;
|
||||
value: string;
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
import { Decimal } from "decimal.js";
|
||||
|
||||
export type RowValueRangeDto = {
|
||||
numberMin: Decimal | number | null;
|
||||
numberMax: Decimal | number | null;
|
||||
dateMin: Date | null;
|
||||
dateMax: Date | null;
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
export type GridLayoutDto = {
|
||||
columns?: number;
|
||||
sm?: number;
|
||||
md?: number;
|
||||
lg?: number;
|
||||
xl?: number;
|
||||
xl2?: number;
|
||||
gap: "xs" | "sm" | "md" | "lg" | "xl";
|
||||
};
|
||||
@@ -0,0 +1,31 @@
|
||||
export interface AnalyticsInfoDto {
|
||||
ip?: string;
|
||||
userAgent?: {
|
||||
type: string | undefined;
|
||||
os: {
|
||||
family: string | undefined;
|
||||
version: string | undefined;
|
||||
};
|
||||
browser: {
|
||||
name: string | undefined;
|
||||
version: string | undefined;
|
||||
};
|
||||
};
|
||||
referrer?: {
|
||||
via?: string;
|
||||
http?: string;
|
||||
source?: string;
|
||||
utm_medium?: string;
|
||||
utm_campaign?: string;
|
||||
utm_content?: string;
|
||||
utm_term?: string;
|
||||
};
|
||||
region?: {
|
||||
country?: string;
|
||||
city?: string;
|
||||
};
|
||||
userId: string | null;
|
||||
portalId?: string | null;
|
||||
portalUserId?: string | null;
|
||||
userAnalyticsId?: string;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
type ServerRuntimeMetaDescriptor =
|
||||
| {
|
||||
charSet: "utf-8";
|
||||
}
|
||||
| {
|
||||
title: string;
|
||||
}
|
||||
| {
|
||||
name: string;
|
||||
content: string;
|
||||
}
|
||||
| {
|
||||
property: string;
|
||||
content: string;
|
||||
}
|
||||
| {
|
||||
httpEquiv: string;
|
||||
content: string;
|
||||
}
|
||||
| {
|
||||
"script:ld+json": LdJsonObject;
|
||||
}
|
||||
| {
|
||||
tagName: "meta" | "link";
|
||||
[name: string]: string;
|
||||
}
|
||||
| any;
|
||||
type LdJsonObject = {
|
||||
[Key in string]: LdJsonValue;
|
||||
} & {
|
||||
[Key in string]?: LdJsonValue | undefined;
|
||||
};
|
||||
type LdJsonArray = LdJsonValue[] | readonly LdJsonValue[];
|
||||
type LdJsonPrimitive = string | number | boolean | null;
|
||||
type LdJsonValue = LdJsonPrimitive | LdJsonObject | LdJsonArray;
|
||||
|
||||
export type MetaTagsDto = ServerRuntimeMetaDescriptor[];
|
||||
@@ -0,0 +1,6 @@
|
||||
import { UserWithoutPassword } from "~/utils/db/users.db.server";
|
||||
|
||||
export type ImpersonatingSessionDto = {
|
||||
fromUser: UserWithoutPassword;
|
||||
toUser: UserWithoutPassword;
|
||||
};
|
||||
@@ -0,0 +1,6 @@
|
||||
export type SetupItem = {
|
||||
title: string;
|
||||
description: string;
|
||||
completed: boolean;
|
||||
path: string | undefined;
|
||||
};
|
||||
@@ -0,0 +1,6 @@
|
||||
export type CreatedByDto = {
|
||||
byUserId?: string | null;
|
||||
byApiKeyId?: string | null;
|
||||
byEmailId?: string | null;
|
||||
byEventWebhookAttemptId?: string | null;
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
export class CustomError {
|
||||
public message: string;
|
||||
public details?: Record<string, any>;
|
||||
public constructor(message: string, details?: Record<string, any>) {
|
||||
this.message = message;
|
||||
this.details = details;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export enum DefaultAdminRoles {
|
||||
SuperAdmin = "SuperAdmin",
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export enum DefaultAppRoles {
|
||||
SuperUser = "SuperUser",
|
||||
Admin = "Admin",
|
||||
BillingAdmin = "Billing Admin",
|
||||
User = "User",
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export enum DefaultEntityTypes {
|
||||
All = "all",
|
||||
AppOnly = "app",
|
||||
AdminOnly = "admin",
|
||||
System = "system",
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
export enum DefaultFeatures {
|
||||
Users = "users",
|
||||
API = "api",
|
||||
RateLimitPerMinute = "rate-limit-per-minute",
|
||||
RateLimitPerSecond = "rate-limit-per-second",
|
||||
PrioritySupport = "priority-support",
|
||||
Credits = "ai-credits",
|
||||
PrivateGenerations = "private-generations",
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
export enum DefaultLogActions {
|
||||
Login = "Login",
|
||||
Created = "Created",
|
||||
Updated = "Updated",
|
||||
Deleted = "Deleted",
|
||||
Commented = "Commented",
|
||||
Replied = "Replied",
|
||||
Reacted = "Reacted",
|
||||
RemovedReaction = "Removed Reaction",
|
||||
Logout = "Logout",
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
export const DefaultPermissions = [
|
||||
"admin.dashboard.view",
|
||||
"admin.accounts.view",
|
||||
"admin.accounts.create",
|
||||
"admin.account.view",
|
||||
"admin.account.settings.update",
|
||||
"admin.account.users",
|
||||
"admin.account.subscription",
|
||||
"admin.account.delete",
|
||||
"admin.accountTypes.view",
|
||||
"admin.accountTypes.create",
|
||||
"admin.accountTypes.update",
|
||||
"admin.accountTypes.delete",
|
||||
"admin.users.view",
|
||||
"admin.users.impersonate",
|
||||
"admin.users.changePassword",
|
||||
"admin.users.delete",
|
||||
"admin.relationships.view",
|
||||
"admin.relationships.create",
|
||||
"admin.relationships.update",
|
||||
"admin.relationships.delete",
|
||||
"admin.blacklist.view",
|
||||
"admin.tenantIpAddress.view",
|
||||
"admin.blacklist.manage",
|
||||
"admin.roles.view",
|
||||
"admin.roles.create",
|
||||
"admin.roles.update",
|
||||
"admin.roles.delete",
|
||||
"admin.roles.set",
|
||||
"admin.analytics.view",
|
||||
"admin.analytics.delete",
|
||||
"admin.entities.view",
|
||||
"admin.entities.create",
|
||||
"admin.entities.update",
|
||||
"admin.entities.delete",
|
||||
// "admin.workflows.view",
|
||||
// "admin.workflows.create",
|
||||
// "admin.workflows.update",
|
||||
// "admin.workflows.delete",
|
||||
"admin.apiKeys.view",
|
||||
"admin.apiKeys.create",
|
||||
"admin.apiKeys.update",
|
||||
"admin.apiKeys.delete",
|
||||
"admin.auditTrails.view",
|
||||
"admin.events.view",
|
||||
"admin.pricing.view",
|
||||
"admin.pricing.create",
|
||||
"admin.pricing.update",
|
||||
"admin.pricing.delete",
|
||||
"admin.emails.view",
|
||||
"admin.emails.create",
|
||||
"admin.emails.update",
|
||||
"admin.emails.delete",
|
||||
"admin.onboarding.view",
|
||||
"admin.onboarding.create",
|
||||
"admin.onboarding.update",
|
||||
"admin.onboarding.delete",
|
||||
"admin.notifications.view",
|
||||
"admin.notifications.manage",
|
||||
"admin.featureFlags.view",
|
||||
"admin.featureFlags.manage",
|
||||
"admin.marketing.leads.view",
|
||||
"admin.marketing.leads.manage",
|
||||
"admin.marketing.integrations.view",
|
||||
"admin.marketing.integrations.manage",
|
||||
"admin.marketing.funnels.view",
|
||||
"admin.prompts.view",
|
||||
"admin.prompts.create",
|
||||
"admin.prompts.update",
|
||||
"admin.prompts.delete",
|
||||
"admin.formulas.view",
|
||||
"admin.formulas.create",
|
||||
"admin.formulas.update",
|
||||
"admin.formulas.delete",
|
||||
"admin.metrics.view",
|
||||
"admin.metrics.update",
|
||||
"admin.metrics.delete",
|
||||
"admin.kb.view",
|
||||
"admin.kb.create",
|
||||
"admin.kb.update",
|
||||
"admin.kb.delete",
|
||||
"admin.settings.cookies.view",
|
||||
"admin.settings.cookies.create",
|
||||
"admin.settings.cookies.update",
|
||||
"admin.settings.general.view",
|
||||
"admin.settings.general.update",
|
||||
"admin.settings.authentication.view",
|
||||
"admin.settings.authentication.update",
|
||||
"admin.settings.analytics.view",
|
||||
"admin.settings.analytics.update",
|
||||
"admin.settings.seo.update",
|
||||
"admin.settings.internationalization.view",
|
||||
"admin.settings.internationalization.update",
|
||||
"admin.settings.danger.reset",
|
||||
"app.dashboard.view",
|
||||
"app.settings.members.view",
|
||||
"app.settings.members.create",
|
||||
"app.settings.members.update",
|
||||
"app.settings.members.delete",
|
||||
"app.settings.members.impersonate",
|
||||
"app.settings.roles.view",
|
||||
"app.settings.roles.set",
|
||||
"app.settings.groups.full",
|
||||
"app.settings.subscription.view",
|
||||
"app.settings.subscription.update",
|
||||
"app.settings.subscription.delete",
|
||||
"app.settings.subscription.invoices.view",
|
||||
"app.settings.account.view",
|
||||
"app.settings.account.update",
|
||||
"app.settings.account.delete",
|
||||
"app.settings.accounts.view",
|
||||
"app.settings.accounts.create",
|
||||
"app.settings.accounts.update",
|
||||
"app.settings.accounts.delete",
|
||||
"app.settings.apiKeys.view",
|
||||
"app.settings.apiKeys.create",
|
||||
"app.settings.apiKeys.update",
|
||||
"app.settings.apiKeys.delete",
|
||||
"app.settings.auditTrails.view",
|
||||
"app.plugins.use",
|
||||
"app.plugins.manage",
|
||||
// P4 Files (AK-P4a) — see packages/db permissions-seed (same list).
|
||||
"files.read_own",
|
||||
"files.read_all",
|
||||
"files.write",
|
||||
"files.delete",
|
||||
"files.admin",
|
||||
// P4 Tasks (AK-P4b) — see packages/db permissions-seed (same list).
|
||||
"tasks.read_own",
|
||||
"tasks.read_all",
|
||||
"tasks.write",
|
||||
"tasks.delete",
|
||||
"tasks.admin",
|
||||
// "entity.{name}.view",
|
||||
// "entity.{name}.read",
|
||||
// "entity.{name}.create",
|
||||
// "entity.{name}.update",
|
||||
// "entity.{name}.delete",
|
||||
] as const;
|
||||
export type DefaultPermission = (typeof DefaultPermissions)[number];
|
||||
@@ -0,0 +1,5 @@
|
||||
export enum DefaultVisibility {
|
||||
Private = "private",
|
||||
Tenant = "tenant",
|
||||
Public = "public",
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
export interface FileBase64 {
|
||||
file: File;
|
||||
base64: any;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import { StatChange } from "./StatChange";
|
||||
|
||||
export type Stat = {
|
||||
name: string;
|
||||
hint: string;
|
||||
stat: string;
|
||||
previousStat?: string;
|
||||
change?: string;
|
||||
changeType?: StatChange;
|
||||
path?: string;
|
||||
entity?: {
|
||||
slug: string;
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
export enum StatChange {
|
||||
Decrease,
|
||||
Equal,
|
||||
Increase,
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import { SubscriptionBillingPeriod } from "~/application/enums/subscriptions/SubscriptionBillingPeriod";
|
||||
|
||||
export interface BillingPeriodDto {
|
||||
value: SubscriptionBillingPeriod;
|
||||
default?: boolean;
|
||||
disabled?: boolean;
|
||||
recurring: boolean;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
export interface CurrencyDto {
|
||||
name: string;
|
||||
value: string;
|
||||
symbol: string;
|
||||
default?: boolean;
|
||||
disabled?: boolean;
|
||||
parities?: { from: string; parity: number }[];
|
||||
symbolRight?: boolean;
|
||||
thousandSeparator?: string;
|
||||
decimalSeparator?: string;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export interface FlatPriceDto {
|
||||
currency: string;
|
||||
monthlyPrice?: number;
|
||||
yearlyPrice?: number;
|
||||
oneTimePrice?: number;
|
||||
quarterlyPrice?: number;
|
||||
semiAnnualPrice?: number;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { SubscriptionFeatureLimitType } from "~/application/enums/subscriptions/SubscriptionFeatureLimitType";
|
||||
|
||||
export interface PlanFeatureUsageDto {
|
||||
order: number;
|
||||
title: string;
|
||||
name: string;
|
||||
type: SubscriptionFeatureLimitType;
|
||||
value: number;
|
||||
used: number;
|
||||
remaining: number | "unlimited";
|
||||
enabled: boolean;
|
||||
message: string;
|
||||
entity?: { id: string; title: string; titlePlural: string; slug: string };
|
||||
period?: {
|
||||
firstDay: Date | null;
|
||||
lastDay: Date | null;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import { SubscriptionFeatureLimitType } from "~/application/enums/subscriptions/SubscriptionFeatureLimitType";
|
||||
|
||||
export interface SubscriptionFeatureDto {
|
||||
order: number;
|
||||
title: string;
|
||||
name: string;
|
||||
type: SubscriptionFeatureLimitType;
|
||||
value: number;
|
||||
href?: string | null;
|
||||
badge?: string | null;
|
||||
accumulate?: boolean;
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
import { SubscriptionFeatureLimitType } from "~/application/enums/subscriptions/SubscriptionFeatureLimitType";
|
||||
|
||||
export interface SubscriptionFeatureInPlansDto {
|
||||
id: string;
|
||||
order: number;
|
||||
name: string;
|
||||
href?: string | null;
|
||||
badge?: string | null;
|
||||
accumulate?: boolean;
|
||||
plans: {
|
||||
id: string;
|
||||
title: string;
|
||||
type: SubscriptionFeatureLimitType;
|
||||
value: number;
|
||||
}[];
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { SubscriptionProductDto } from "./SubscriptionProductDto";
|
||||
import { SubscriptionPriceType } from "~/application/enums/subscriptions/SubscriptionPriceType";
|
||||
import { SubscriptionBillingPeriod } from "~/application/enums/subscriptions/SubscriptionBillingPeriod";
|
||||
import { SubscriptionUsageBasedTier } from "@toolctrl/db/prisma-browser";
|
||||
import { Decimal } from "decimal.js";
|
||||
|
||||
export interface SubscriptionPriceDto {
|
||||
id?: string;
|
||||
stripeId: string;
|
||||
type: SubscriptionPriceType;
|
||||
billingPeriod: SubscriptionBillingPeriod;
|
||||
price: number | Decimal;
|
||||
currency: string;
|
||||
trialDays: number;
|
||||
active: boolean;
|
||||
priceBefore?: number;
|
||||
subscriptionProductId: string;
|
||||
subscriptionProduct?: SubscriptionProductDto;
|
||||
usageBasedPrices?: SubscriptionUsageBasedTier[];
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import { SubscriptionPriceDto } from "./SubscriptionPriceDto";
|
||||
import { SubscriptionFeatureDto } from "./SubscriptionFeatureDto";
|
||||
import { PricingModel } from "~/application/enums/subscriptions/PricingModel";
|
||||
import { SubscriptionUsageBasedPriceDto } from "./SubscriptionUsageBasedPriceDto";
|
||||
import { TenantSubscriptionProduct, TenantType } from "@toolctrl/db/prisma-browser";
|
||||
|
||||
export interface SubscriptionProductDto {
|
||||
id?: string;
|
||||
stripeId: string;
|
||||
order: number;
|
||||
title: string;
|
||||
description: string | null;
|
||||
groupTitle?: string | null;
|
||||
groupDescription?: string | null;
|
||||
badge: string | null;
|
||||
active: boolean;
|
||||
model: PricingModel;
|
||||
public: boolean;
|
||||
prices: SubscriptionPriceDto[];
|
||||
features: SubscriptionFeatureDto[];
|
||||
translatedTitle?: string;
|
||||
usageBasedPrices?: SubscriptionUsageBasedPriceDto[];
|
||||
tenantProducts?: TenantSubscriptionProduct[];
|
||||
assignsTenantTypes?: TenantType[];
|
||||
billingAddressCollection?: string | null;
|
||||
hasQuantity?: boolean;
|
||||
canBuyAgain?: boolean;
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
import { SubscriptionBillingPeriod } from "~/application/enums/subscriptions/SubscriptionBillingPeriod";
|
||||
import { SubscriptionUsageBasedTierDto } from "./SubscriptionUsageBasedTierDto";
|
||||
|
||||
export interface SubscriptionUsageBasedPriceDto {
|
||||
id: string;
|
||||
subscriptionProductId: string;
|
||||
stripeId: string;
|
||||
billingPeriod: SubscriptionBillingPeriod;
|
||||
currency: string;
|
||||
unit: string;
|
||||
unitTitle: string;
|
||||
unitTitlePlural: string;
|
||||
usageType: string;
|
||||
aggregateUsage: string;
|
||||
tiersMode: string;
|
||||
billingScheme: string;
|
||||
tiers: SubscriptionUsageBasedTierDto[];
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import { Decimal } from "decimal.js";
|
||||
|
||||
export interface SubscriptionUsageBasedTierDto {
|
||||
id: string;
|
||||
subscriptionUsageBasedPriceId: string;
|
||||
from: number;
|
||||
to?: number | null;
|
||||
perUnitPrice?: number | Decimal | null;
|
||||
flatFeePrice?: number | Decimal | null;
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
export type SubscriptionUsageBasedUnitDto = {
|
||||
unit: string;
|
||||
unitTitle: string;
|
||||
unitTitlePlural: string;
|
||||
usageType: string;
|
||||
aggregateUsage: string;
|
||||
tiersMode: string;
|
||||
billingScheme: string;
|
||||
tiers: { from: number; to?: number }[];
|
||||
prices: {
|
||||
currency: string;
|
||||
from: number;
|
||||
to: number | undefined;
|
||||
perUnitPrice?: number | undefined;
|
||||
flatFeePrice?: number | undefined;
|
||||
}[];
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
export interface UsageBasedPriceDto {
|
||||
from: number;
|
||||
to?: number | undefined;
|
||||
perUnitPrice?: number | undefined;
|
||||
flatFeePrice?: number | undefined;
|
||||
currency: string;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
export type UsageBasedUnitDto = {
|
||||
name: string;
|
||||
title: string;
|
||||
titlePlural: string;
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
export type TenantTypeDto = {
|
||||
id?: string;
|
||||
title: string;
|
||||
titlePlural: string;
|
||||
description: string | null;
|
||||
isDefault?: boolean;
|
||||
subscriptionProducts?: { id?: string; title: string }[];
|
||||
_count?: { tenants: number };
|
||||
};
|
||||
Reference in new issue
Block a user