Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions docs/docs/licenses/cancel-many.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ sidebar_position: 12

# Cancel many Licenses

This method will cancel many ad hoc Licenses
This method will cancel many ad hoc Licenses.
:::danger

Deprecated. Use [cancel subscription](../subscriptions/cancel.md).

:::

## Code Sample

Expand All @@ -26,4 +31,4 @@ _Type:_ `string[]`

## Return Type

For more information about this request see our API documentation on [cancel many Licenses](https://docs.salable.app/api/v2#tag/Licenses/operation/cancelLicenses)
For more information about this request, see our API documentation on [cancel many Licenses](https://docs.salable.app/api/v2#tag/Licenses/operation/cancelLicenses)
8 changes: 7 additions & 1 deletion docs/docs/licenses/cancel.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ sidebar_position: 11

This method will cancel an ad hoc License

:::danger

Deprecated. Use [cancel subscription](../subscriptions/cancel.md).

:::

## Code Sample

```typescript
Expand All @@ -26,4 +32,4 @@ _Type:_ `string`

## Return Type

For more information about this request see our API documentation on [cancel License](https://docs.salable.app/api/v2#tag/Licenses/operation/cancelLicense)
For more information about this request, see our API documentation on [cancel License](https://docs.salable.app/api/v2#tag/Licenses/operation/cancelLicense)
8 changes: 7 additions & 1 deletion docs/docs/licenses/create-many.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ sidebar_position: 2

# Create Many Licenses

This method creates many ad hoc licenses
This method creates many ad hoc licenses.

:::danger

Deprecated. Use [create subscription](../subscriptions/create.md). To create seats on a per seat subscription use [add seats](../subscriptions/add-seats.md).

:::

## Code Sample

Expand Down
8 changes: 7 additions & 1 deletion docs/docs/licenses/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ sidebar_position: 1

# Create License

This method creates an ad hoc license
This method creates an ad hoc license.

:::danger

Deprecated. Use [create subscription](../subscriptions/create.md).

:::

## Code Sample

Expand Down
8 changes: 7 additions & 1 deletion docs/docs/licenses/get-all.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ sidebar_position: 3

# Get All Licenses

Returns a list of all the licenses created by your Salable organization
Returns a list of all the licenses created by your Salable organization.

:::danger

Deprecated. Use [get subscriptions](../subscriptions/get-all.md).

:::

## Code Sample

Expand Down
6 changes: 6 additions & 0 deletions docs/docs/licenses/get-count.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ sidebar_position: 5

This method returns aggregate count number of Licenses.

:::danger

Deprecated. Use [subscription count](../subscriptions/get-count.md).

:::

## Code Sample

```typescript
Expand Down
8 changes: 7 additions & 1 deletion docs/docs/licenses/get-one.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ sidebar_position: 4

# Get One License

Returns a single license
Returns a single license.

:::danger

Deprecated. Use [get subscription](../subscriptions/get-one.md).

:::

## Code Sample

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/licenses/update-many.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 9

# Update Many Licenses

This method updates many Licenses with the values passed into the body of the request.
Deprecated. Use [manage seats](../subscriptions/manage-seats.md).

## Code Sample

Expand Down
6 changes: 6 additions & 0 deletions docs/docs/licenses/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ sidebar_position: 8

This method updates specific Licenses with the values passed into the body of the request.

:::danger

Deprecated. Use [update subscription](../subscriptions/update.md). To assign a grantee use [manage seats](../subscriptions/manage-seats.md).

:::

## Code Sample

```typescript
Expand Down
89 changes: 49 additions & 40 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ generator client {

model Product {
uuid String @id @default(uuid())
name String
description String? @db.Text
logoUrl String? @db.Text
displayName String
Expand All @@ -22,33 +21,32 @@ model Product {
organisationPaymentIntegration OrganisationPaymentIntegration? @relation(fields: [organisationPaymentIntegrationUuid], references: [uuid], onUpdate: NoAction)
organisationPaymentIntegrationUuid String @default("free")
paymentIntegrationProductId String?
appType String @default("custom")
updatedAt DateTime @default(now()) @updatedAt
isTest Boolean @default(false)
archivedAt DateTime?
plans Plan[]
capabilities Capability[]
features Feature[]
pricingTables PricingTable[]
licenses License[]
subscriptions Subscription[]
currencies CurrenciesOnProduct[]
updatedAt DateTime @default(now()) @updatedAt
archivedAt DateTime?
isTest Boolean @default(false)
coupons Coupon[]

name String /// @deprecated
appType String @default("custom") /// @deprecated
capabilities Capability[] /// @deprecated

@@index([organisation])
@@index([organisationPaymentIntegrationUuid])
}

model Plan {
uuid String @id @default(uuid())
name String
description String? @db.Text
displayName String
slug String @default("")
status String
isTest Boolean @default(false)
trialDays Int?
evaluation Boolean @default(false)
evalDays Int @default(0)
organisation String
visibility String
Expand All @@ -57,30 +55,35 @@ model Plan {
maxSeatAmount Int @default(-1)
interval String
length Int
active Boolean
planType String
pricingType String @default("free")
environment String
paddlePlanId Int?
archivedAt DateTime?
updatedAt DateTime @default(now()) @updatedAt
hasAcceptedTransaction Boolean @default(false)
product Product @relation(fields: [productUuid], references: [uuid], onUpdate: NoAction, onDelete: Cascade)
productUuid String
featuredOnPricingTable PricingTable?
currencies CurrenciesOnPlans[]
features FeaturesOnPlans[]
usage LicensesUsageOnPlans[]
pricingTables PlansOnPricingTables[]
capabilities CapabilitiesOnPlans[]
licenses License[]
subscription Subscription[]
salablePlan Boolean @default(false)
updatedAt DateTime @default(now()) @updatedAt
flags FlagsOnPlans[]
hasAcceptedTransaction Boolean @default(false)
coupons CouponsOnPlans[]
licensesUsage LicensesUsage[]
archivedAt DateTime?

planType String /// @deprecated
name String /// @deprecated
trialDays Int? /// @deprecated use `evalDays` instead
evaluation Boolean @default(false) /// @deprecated
active Boolean /// @deprecated use `status` instead
environment String /// @deprecated
paddlePlanId Int? /// @deprecated
salablePlan Boolean @default(false) /// @deprecated
usage LicensesUsageOnPlans[] /// @deprecated
capabilities CapabilitiesOnPlans[] /// @deprecated
flags FlagsOnPlans[] /// @deprecated
}

/// @deprecated
model Capability {
uuid String @id @default(uuid())
name String
Expand All @@ -96,7 +99,6 @@ model Capability {

model Feature {
uuid String @id @default(uuid())
name String
description String? @db.Text
displayName String
variableName String? @default("")
Expand All @@ -105,14 +107,16 @@ model Feature {
valueType String @default("numerical")
defaultValue String @default("0")
showUnlimited Boolean @default(false)
updatedAt DateTime @default(now()) @updatedAt
sortOrder Int @default(0)
product Product? @relation(fields: [productUuid], references: [uuid], onUpdate: NoAction, onDelete: Cascade)
productUuid String?
plans FeaturesOnPlans[]
featureEnumOptions FeatureEnumOption[]
pricingTables FeaturesOnPricingTables[]
updatedAt DateTime @default(now()) @updatedAt
licenses FeaturesOnLicenses[]
sortOrder Int @default(0)

name String /// @deprecated
licenses FeaturesOnLicenses[] /// @deprecated

@@index([productUuid])
}
Expand All @@ -137,12 +141,13 @@ model FeaturesOnPlans {
enumValue FeatureEnumOption? @relation(fields: [enumValueUuid], references: [uuid], onUpdate: NoAction, onDelete: Cascade)
enumValueUuid String?
isUnlimited Boolean @default(false)
isUsage Boolean @default(false)
pricePerUnit Float?
minUsage Int?
maxUsage Int?
updatedAt DateTime @default(now()) @updatedAt

isUsage Boolean @default(false) /// @deprecated
pricePerUnit Float? /// @deprecated
minUsage Int? /// @deprecated
maxUsage Int? /// @deprecated

@@id([planUuid, featureUuid])
@@index([planUuid])
@@index([featureUuid])
Expand All @@ -164,21 +169,22 @@ model FeaturesOnPricingTables {

model PricingTable {
uuid String @id @default(uuid())
name String
status String @default("ACTIVE")
title String?
text String? @db.Text
theme String @default("light")
featureOrder String @default("default")
product Product @relation(fields: [productUuid], references: [uuid], onUpdate: NoAction, onDelete: Cascade)
productUuid String
plans PlansOnPricingTables[]
features FeaturesOnPricingTables[]
customTheme Json?
featuredPlan Plan? @relation(fields: [featuredPlanUuid], references: [uuid], onUpdate: NoAction, onDelete: Cascade)
featuredPlanUuid String? @unique
updatedAt DateTime @default(now()) @updatedAt

name String /// @deprecated
title String? /// @deprecated
text String? @db.Text /// @deprecated
theme String @default("light") /// @deprecated
customTheme Json? /// @deprecated

@@index([productUuid])
}

Expand Down Expand Up @@ -237,8 +243,6 @@ model Session {

model License {
uuid String @id @default(uuid())
name String?
email String?
subscription Subscription? @relation(fields: [subscriptionUuid], references: [uuid], onUpdate: NoAction, onDelete: Cascade)
subscriptionUuid String?
status String
Expand All @@ -250,16 +254,19 @@ model License {
productUuid String
plan Plan @relation(fields: [planUuid], references: [uuid], onUpdate: NoAction, onDelete: Cascade)
planUuid String
capabilities Json
metadata Json?
startTime DateTime @default(now())
endTime DateTime
updatedAt DateTime @default(now()) @updatedAt
features FeaturesOnLicenses[] /// @deprecated Use `usage` instead.
usage LicensesUsageOnPlans[]
usageRecords LicensesUsage[]
isTest Boolean @default(false)
cancelAtPeriodEnd Boolean @default(false)

name String? /// @deprecated
email String? /// @deprecated Use subscription `email` instead
cancelAtPeriodEnd Boolean @default(false) /// @deprecated Use subscription `cancelAtPeriodEnd` instead.
features FeaturesOnLicenses[] /// @deprecated Use `usage` instead.
capabilities Json /// @deprecated
metadata Json? /// @deprecated

@@index([status, paymentService])
@@index([productUuid])
Expand Down Expand Up @@ -369,13 +376,14 @@ model OrganisationPaymentIntegration {
products Product[]
webhooks Webhook[]
accountName String
accountData Json
status PaymentIntegrationStatus?
accountId String?
updatedAt DateTime @default(now()) @updatedAt
isTest Boolean @default(false)
newPaymentEnabled Boolean @default(false)

accountData Json /// @deprecated

@@index([accountId])
}

Expand Down Expand Up @@ -434,6 +442,7 @@ model LicensesUsageOnPlans {
@@index([planUuid])
}

/// @deprecated
model FeaturesOnLicenses {
license License @relation(fields: [licenseUuid], references: [uuid], onUpdate: NoAction, onDelete: Cascade)
licenseUuid String
Expand Down
Loading