universo-platform-3d

Форк
0
47 строк · 1.3 Кб
1
import { ApiProperty } from '@nestjs/swagger'
2
import { IsNotEmpty, IsNumber, IsString, IsOptional } from 'class-validator'
3
export class SubscriptionDto {
4
  @IsNotEmpty()
5
  @IsNumber()
6
  @ApiProperty()
7
  amount: number
8

9
  @IsNotEmpty()
10
  @IsString()
11
  @ApiProperty()
12
  currency: string
13

14
  @IsNotEmpty()
15
  @IsString()
16
  @ApiProperty()
17
  productId: string
18

19
  // Important: If the product and price were manually created using the Stripe dashboard,
20
  // you'll need the specific 'priceId' to properly create new subscriptions.
21
  // Example: When a user purchases assets, we dynamically create the Stripe product and price during the asset creation process. However, for platform subscriptions, since there's no specific endpoint available, we manually create the product and prices directly from the Stripe dashboard.
22

23
  @IsOptional()
24
  @IsString()
25
  @ApiProperty({
26
    description:
27
      "If the product and price were manually created using the Stripe CLI,you'll need the specific 'priceId' to properly create new subscriptions."
28
  })
29
  priceId: string
30

31
  @IsOptional()
32
  @IsString()
33
  @ApiProperty()
34
  destination: string
35
}
36

37
export class ProductDto {
38
  @IsNotEmpty()
39
  @IsString()
40
  @ApiProperty()
41
  name: string
42

43
  @IsNotEmpty()
44
  @IsString()
45
  @ApiProperty()
46
  description: string
47
}
48

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.