@heliofi/common 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/dist/src/domain/model/paylink-tx/entities/BasePaylinkTx.d.ts +1 -0
  2. package/dist/src/domain/model/paylink-tx/entities/BasePaylinkTx.js.map +1 -1
  3. package/dist/src/domain/model/paylink-tx/entities/PaylinkTxWithShallowEnrichedPaylink.d.ts +3 -0
  4. package/dist/src/domain/model/paylink-tx/entities/PaylinkTxWithShallowEnrichedPaylink.js.map +1 -1
  5. package/dist/tsconfig.tsbuildinfo +1 -1
  6. package/package.json +2 -2
  7. package/src/__tests__/index.test.ts +5 -0
  8. package/src/domain/constants/index.ts +2 -0
  9. package/src/domain/index.ts +3 -0
  10. package/src/domain/model/apiKey/dtos/createApiKeyDto.ts +15 -0
  11. package/src/domain/model/apiKey/dtos/index.ts +2 -0
  12. package/src/domain/model/apiKey/dtos/updateApiKeyDto.ts +11 -0
  13. package/src/domain/model/apiKey/entities/ApiKey.ts +11 -0
  14. package/src/domain/model/apiKey/entities/index.ts +1 -0
  15. package/src/domain/model/apiKey/index.ts +2 -0
  16. package/src/domain/model/approve-transaction/dtos/approveTransactionDto.ts +62 -0
  17. package/src/domain/model/approve-transaction/dtos/index.ts +1 -0
  18. package/src/domain/model/approve-transaction/index.ts +1 -0
  19. package/src/domain/model/attachment/dtos/createAttachmentDto.ts +22 -0
  20. package/src/domain/model/attachment/dtos/index.ts +1 -0
  21. package/src/domain/model/attachment/entities/Attachment.ts +6 -0
  22. package/src/domain/model/attachment/entities/AttachmentType.enum.ts +3 -0
  23. package/src/domain/model/attachment/entities/BaseAttachment.ts +11 -0
  24. package/src/domain/model/attachment/entities/ShallowEnrichedAttachment.ts +6 -0
  25. package/src/domain/model/attachment/entities/index.ts +4 -0
  26. package/src/domain/model/attachment/index.ts +2 -0
  27. package/src/domain/model/auth/dtos/index.ts +1 -0
  28. package/src/domain/model/auth/dtos/signOnDto.ts +14 -0
  29. package/src/domain/model/auth/entities/AuthResponse.ts +9 -0
  30. package/src/domain/model/auth/entities/AuthUser.ts +13 -0
  31. package/src/domain/model/auth/entities/index.ts +2 -0
  32. package/src/domain/model/auth/index.ts +2 -0
  33. package/src/domain/model/blockchain/constants/Cluster.ts +5 -0
  34. package/src/domain/model/blockchain/constants/index.ts +1 -0
  35. package/src/domain/model/blockchain/dtos/blockchainDto.ts +11 -0
  36. package/src/domain/model/blockchain/dtos/index.ts +1 -0
  37. package/src/domain/model/blockchain/entities/Blockchain.ts +9 -0
  38. package/src/domain/model/blockchain/entities/index.ts +1 -0
  39. package/src/domain/model/blockchain/index.ts +3 -0
  40. package/src/domain/model/company/dtos/createCompanyDto.ts +29 -0
  41. package/src/domain/model/company/dtos/index.ts +2 -0
  42. package/src/domain/model/company/dtos/updateCompanyDto.ts +29 -0
  43. package/src/domain/model/company/entities/Company.ts +18 -0
  44. package/src/domain/model/company/entities/index.ts +1 -0
  45. package/src/domain/model/company/index.ts +2 -0
  46. package/src/domain/model/content/dtos/contentDto.ts +11 -0
  47. package/src/domain/model/content/dtos/index.ts +1 -0
  48. package/src/domain/model/content/entities/Content.ts +7 -0
  49. package/src/domain/model/content/entities/index.ts +1 -0
  50. package/src/domain/model/content/index.ts +2 -0
  51. package/src/domain/model/currency/dtos/createCurrency.ts +33 -0
  52. package/src/domain/model/currency/dtos/index.ts +2 -0
  53. package/src/domain/model/currency/dtos/updateCurrency.ts +39 -0
  54. package/src/domain/model/currency/entities/BaseCurrency.ts +17 -0
  55. package/src/domain/model/currency/entities/Currency.ts +6 -0
  56. package/src/domain/model/currency/entities/index.ts +2 -0
  57. package/src/domain/model/currency/index.ts +2 -0
  58. package/src/domain/model/customer-details/dtos/CustomerDetailsDto.ts +32 -0
  59. package/src/domain/model/customer-details/dtos/index.ts +1 -0
  60. package/src/domain/model/customer-details/entities/CustomerDetails.ts +17 -0
  61. package/src/domain/model/customer-details/entities/index.ts +1 -0
  62. package/src/domain/model/customer-details/index.ts +2 -0
  63. package/src/domain/model/discordDetails/dtos/createDiscordDetails.ts +21 -0
  64. package/src/domain/model/discordDetails/dtos/index.ts +2 -0
  65. package/src/domain/model/discordDetails/dtos/updateDiscordDetails.ts +19 -0
  66. package/src/domain/model/discordDetails/entities/BaseDiscordDetails.ts +11 -0
  67. package/src/domain/model/discordDetails/entities/DiscordDetails.ts +6 -0
  68. package/src/domain/model/discordDetails/entities/index.ts +2 -0
  69. package/src/domain/model/discordDetails/index.ts +2 -0
  70. package/src/domain/model/email/dtos/emailDto.ts +46 -0
  71. package/src/domain/model/email/dtos/index.ts +1 -0
  72. package/src/domain/model/email/index.ts +1 -0
  73. package/src/domain/model/entity/Entity.ts +15 -0
  74. package/src/domain/model/entity/index.ts +1 -0
  75. package/src/domain/model/index.ts +21 -0
  76. package/src/domain/model/link-features/dtos/index.ts +1 -0
  77. package/src/domain/model/link-features/dtos/linkFeaturesDto.ts +39 -0
  78. package/src/domain/model/link-features/entities/LinkFeatures.ts +7 -0
  79. package/src/domain/model/link-features/entities/index.ts +1 -0
  80. package/src/domain/model/link-features/index.ts +2 -0
  81. package/src/domain/model/paylink/dtos/createPaylinkDto.ts +81 -0
  82. package/src/domain/model/paylink/dtos/index.ts +2 -0
  83. package/src/domain/model/paylink/dtos/updatePaylinkDto.ts +80 -0
  84. package/src/domain/model/paylink/entities/BasePaylink.ts +9 -0
  85. package/src/domain/model/paylink/entities/OnlyContentPaylink.ts +6 -0
  86. package/src/domain/model/paylink/entities/Paylink.ts +9 -0
  87. package/src/domain/model/paylink/entities/ShallowEnrichedPaylink.ts +9 -0
  88. package/src/domain/model/paylink/entities/index.ts +4 -0
  89. package/src/domain/model/paylink/index.ts +2 -0
  90. package/src/domain/model/paylink-tx/dtos/createPaylinkTxDto.ts +24 -0
  91. package/src/domain/model/paylink-tx/dtos/index.ts +2 -0
  92. package/src/domain/model/paylink-tx/dtos/updatePaylinkTxDto.ts +7 -0
  93. package/src/domain/model/paylink-tx/entities/BasePaylinkTx.ts +9 -0
  94. package/src/domain/model/paylink-tx/entities/PaylinkTx.ts +9 -0
  95. package/src/domain/model/paylink-tx/entities/PaylinkTxWithShallowEnrichedPaylink.ts +15 -0
  96. package/src/domain/model/paylink-tx/entities/ShallowEnrichedPaylinkTx.ts +9 -0
  97. package/src/domain/model/paylink-tx/entities/index.ts +4 -0
  98. package/src/domain/model/paylink-tx/index.ts +2 -0
  99. package/src/domain/model/payment-request/entities/BasePaymentRequest.ts +21 -0
  100. package/src/domain/model/payment-request/entities/PaymentRequest.ts +15 -0
  101. package/src/domain/model/payment-request/entities/ShallowEnrichedPaymentRequest.ts +15 -0
  102. package/src/domain/model/payment-request/entities/index.ts +3 -0
  103. package/src/domain/model/payment-request/index.ts +1 -0
  104. package/src/domain/model/payment-request-features/entities/PaymentRequestFeatures.ts +17 -0
  105. package/src/domain/model/payment-request-features/entities/index.ts +1 -0
  106. package/src/domain/model/payment-request-features/index.ts +1 -0
  107. package/src/domain/model/role/dtos/createRoleDto.ts +20 -0
  108. package/src/domain/model/role/dtos/index.ts +2 -0
  109. package/src/domain/model/role/dtos/updateRoleDto.ts +10 -0
  110. package/src/domain/model/role/entities/BaseRole.ts +8 -0
  111. package/src/domain/model/role/entities/Role.ts +9 -0
  112. package/src/domain/model/role/entities/RoleType.ts +5 -0
  113. package/src/domain/model/role/entities/ShallowEnrichedRole.ts +9 -0
  114. package/src/domain/model/role/entities/index.ts +4 -0
  115. package/src/domain/model/role/index.ts +2 -0
  116. package/src/domain/model/slug/dtos/index.ts +1 -0
  117. package/src/domain/model/slug/dtos/slug.ts +20 -0
  118. package/src/domain/model/slug/entities/Slug.ts +15 -0
  119. package/src/domain/model/slug/entities/SlugObjectType.ts +5 -0
  120. package/src/domain/model/slug/entities/index.ts +2 -0
  121. package/src/domain/model/slug/index.ts +2 -0
  122. package/src/domain/model/transaction-meta/dtos/CreateTransactionMetaDto.ts +34 -0
  123. package/src/domain/model/transaction-meta/dtos/index.ts +1 -0
  124. package/src/domain/model/transaction-meta/entities/BaseTransactionMeta.ts +16 -0
  125. package/src/domain/model/transaction-meta/entities/ShallowEnrichedTransactionMeta.ts +6 -0
  126. package/src/domain/model/transaction-meta/entities/TransactionMeta.ts +6 -0
  127. package/src/domain/model/transaction-meta/entities/index.ts +3 -0
  128. package/src/domain/model/transaction-meta/index.ts +2 -0
  129. package/src/domain/model/user/dtos/CreateUserDto.ts +19 -0
  130. package/src/domain/model/user/dtos/UpdateUserDto.ts +24 -0
  131. package/src/domain/model/user/dtos/index.ts +2 -0
  132. package/src/domain/model/user/entities/BaseUser.ts +13 -0
  133. package/src/domain/model/user/entities/ShallowEnrichedUser.ts +9 -0
  134. package/src/domain/model/user/entities/User.ts +9 -0
  135. package/src/domain/model/user/entities/index.ts +3 -0
  136. package/src/domain/model/user/index.ts +2 -0
  137. package/src/domain/model/wallet/dtos/UpdateWalletDto.ts +8 -0
  138. package/src/domain/model/wallet/dtos/index.ts +1 -0
  139. package/src/domain/model/wallet/entities/BaseWallet.ts +7 -0
  140. package/src/domain/model/wallet/entities/Wallet.ts +6 -0
  141. package/src/domain/model/wallet/entities/index.ts +2 -0
  142. package/src/domain/model/wallet/index.ts +2 -0
  143. package/src/domain/services/EmailService.ts +6 -0
  144. package/src/domain/services/index.ts +1 -0
  145. package/src/index.ts +1 -0
@@ -0,0 +1,19 @@
1
+ import { IsOptional, IsString, IsBoolean } from 'class-validator';
2
+ import { ApiProperty } from '@nestjs/swagger';
3
+
4
+ export class UpdateDiscordDetailsDto {
5
+ @ApiProperty()
6
+ @IsString()
7
+ @IsOptional()
8
+ serverId?: string;
9
+
10
+ @ApiProperty()
11
+ @IsString()
12
+ @IsOptional()
13
+ roleId?: string;
14
+
15
+ @ApiProperty()
16
+ @IsBoolean()
17
+ @IsOptional()
18
+ active?: boolean;
19
+ }
@@ -0,0 +1,11 @@
1
+ import { Entity } from '../../entity';
2
+
3
+ export class BaseDiscordDetails extends Entity {
4
+ id: string;
5
+
6
+ serverId: string;
7
+
8
+ roleId: string;
9
+
10
+ active?: boolean;
11
+ }
@@ -0,0 +1,6 @@
1
+ import type { Company } from '../../company';
2
+ import { BaseDiscordDetails } from './BaseDiscordDetails';
3
+
4
+ export class DiscordDetails extends BaseDiscordDetails {
5
+ company: Company;
6
+ }
@@ -0,0 +1,2 @@
1
+ export * from './DiscordDetails';
2
+ export * from './BaseDiscordDetails';
@@ -0,0 +1,2 @@
1
+ export * from './dtos';
2
+ export * from './entities';
@@ -0,0 +1,46 @@
1
+ import {
2
+ IsEmail,
3
+ IsNotEmpty,
4
+ IsNumber,
5
+ IsOptional,
6
+ IsString,
7
+ } from 'class-validator';
8
+ import { Cluster } from '@solana/web3.js';
9
+ import { ApiProperty } from '@nestjs/swagger';
10
+
11
+ export class EmailDto {
12
+ @ApiProperty()
13
+ @IsString()
14
+ @IsNotEmpty()
15
+ transactionSignature: string;
16
+
17
+ @ApiProperty()
18
+ @IsEmail()
19
+ @IsNotEmpty()
20
+ merchantEmail: string;
21
+
22
+ @ApiProperty()
23
+ @IsNumber()
24
+ @IsNotEmpty()
25
+ amount: number;
26
+
27
+ @ApiProperty()
28
+ @IsString()
29
+ @IsNotEmpty()
30
+ product: string;
31
+
32
+ @ApiProperty()
33
+ @IsString()
34
+ @IsNotEmpty()
35
+ currency: string;
36
+
37
+ @ApiProperty()
38
+ @IsString()
39
+ @IsNotEmpty()
40
+ time: string;
41
+
42
+ @ApiProperty()
43
+ @IsString()
44
+ @IsOptional()
45
+ cluster?: Cluster = 'devnet';
46
+ }
@@ -0,0 +1 @@
1
+ export * from './emailDto';
@@ -0,0 +1 @@
1
+ export * from './dtos';
@@ -0,0 +1,15 @@
1
+ import { plainToInstance } from 'class-transformer';
2
+
3
+ /**
4
+ * @example
5
+ * const value = User.fromObject(plain);
6
+ * */
7
+ export class Entity {
8
+ static fromObject<T extends Entity>(record: T): T {
9
+ return plainToInstance(this, record) as T;
10
+ }
11
+
12
+ static fromObjects<T extends Entity>(records: T[]): T[] {
13
+ return plainToInstance(this, records) as T[];
14
+ }
15
+ }
@@ -0,0 +1 @@
1
+ export { Entity } from './Entity';
@@ -0,0 +1,21 @@
1
+ export * from './user';
2
+ export * from './role';
3
+ export * from './slug';
4
+ export * from './wallet';
5
+ export * from './currency';
6
+ export * from './customer-details';
7
+ export * from './transaction-meta';
8
+ export * from './discordDetails';
9
+ export * from './company';
10
+ export * from './apiKey';
11
+ export * from './paylink-tx';
12
+ export * from './blockchain';
13
+ export * from './paylink';
14
+ export * from './content';
15
+ export * from './link-features';
16
+ export * from './payment-request';
17
+ export * from './payment-request-features';
18
+ export * from './attachment';
19
+ export * from './email';
20
+ export * from './auth';
21
+ export * from './approve-transaction';
@@ -0,0 +1 @@
1
+ export * from './linkFeaturesDto';
@@ -0,0 +1,39 @@
1
+ import { IsBoolean, IsOptional } from 'class-validator';
2
+
3
+ export class LinkFeaturesDto {
4
+ @IsBoolean()
5
+ @IsOptional()
6
+ requireEmail?: boolean;
7
+
8
+ @IsBoolean()
9
+ @IsOptional()
10
+ requireDiscordUsername?: boolean;
11
+
12
+ @IsBoolean()
13
+ @IsOptional()
14
+ requireFullName?: boolean;
15
+
16
+ @IsBoolean()
17
+ @IsOptional()
18
+ requireTwitterUsername?: boolean;
19
+
20
+ @IsBoolean()
21
+ @IsOptional()
22
+ requireCountry?: boolean;
23
+
24
+ @IsBoolean()
25
+ @IsOptional()
26
+ requireDeliveryAddress?: boolean;
27
+
28
+ @IsBoolean()
29
+ @IsOptional()
30
+ requirePhoneNumber?: boolean;
31
+
32
+ @IsBoolean()
33
+ @IsOptional()
34
+ canChangeQuantity?: boolean;
35
+
36
+ @IsBoolean()
37
+ @IsOptional()
38
+ canChangePrice?: boolean;
39
+ }
@@ -0,0 +1,7 @@
1
+ import { PaymentRequestFeatures } from '../../payment-request-features';
2
+
3
+ export class LinkFeatures extends PaymentRequestFeatures {
4
+ canChangePrice: boolean;
5
+
6
+ canChangeQuantity: boolean;
7
+ }
@@ -0,0 +1 @@
1
+ export * from './LinkFeatures';
@@ -0,0 +1,2 @@
1
+ export * from './dtos';
2
+ export * from './entities';
@@ -0,0 +1,81 @@
1
+ import {
2
+ IsBoolean,
3
+ IsNotEmpty,
4
+ IsOptional,
5
+ IsString,
6
+ ValidateNested,
7
+ } from 'class-validator';
8
+ import { Type } from 'class-transformer';
9
+ import { ApiProperty } from '@nestjs/swagger';
10
+ import { ContentDto } from '../../content';
11
+ import { LinkFeaturesDto } from '../../link-features';
12
+
13
+ export class CreatePaylinkDto {
14
+ @ApiProperty()
15
+ @IsString()
16
+ @IsNotEmpty()
17
+ company: string;
18
+
19
+ @ApiProperty()
20
+ @IsString()
21
+ @IsNotEmpty()
22
+ name: string;
23
+
24
+ @ApiProperty()
25
+ @IsString()
26
+ @IsOptional()
27
+ description?: string;
28
+
29
+ @ApiProperty()
30
+ @IsString()
31
+ @IsOptional()
32
+ imageUrl?: string;
33
+
34
+ @ApiProperty()
35
+ @IsOptional()
36
+ normalizedPrice?: bigint;
37
+
38
+ @ApiProperty()
39
+ @IsBoolean()
40
+ @IsOptional()
41
+ notifySenderByEmail?: boolean = false;
42
+
43
+ @ApiProperty()
44
+ @IsBoolean()
45
+ @IsOptional()
46
+ notifyReceiverByEmail?: boolean = false;
47
+
48
+ @ApiProperty()
49
+ @IsBoolean()
50
+ @IsOptional()
51
+ addDiscordRole?: boolean = false;
52
+
53
+ @ApiProperty()
54
+ @IsString()
55
+ @IsOptional()
56
+ currency?: string;
57
+
58
+ @ApiProperty()
59
+ @IsBoolean()
60
+ @IsOptional()
61
+ disabled?: boolean;
62
+
63
+ @ApiProperty()
64
+ @IsString()
65
+ @IsNotEmpty()
66
+ wallet: string;
67
+
68
+ @ApiProperty()
69
+ @IsString()
70
+ @IsOptional()
71
+ @Type(() => ContentDto)
72
+ @ValidateNested()
73
+ content?: ContentDto;
74
+
75
+ @ApiProperty()
76
+ @IsString()
77
+ @IsOptional()
78
+ @Type(() => LinkFeaturesDto)
79
+ @ValidateNested()
80
+ features?: LinkFeaturesDto;
81
+ }
@@ -0,0 +1,2 @@
1
+ export * from './createPaylinkDto';
2
+ export * from './updatePaylinkDto';
@@ -0,0 +1,80 @@
1
+ import {
2
+ IsBoolean,
3
+ IsOptional,
4
+ IsString,
5
+ ValidateNested,
6
+ } from 'class-validator';
7
+ import { Type } from 'class-transformer';
8
+ import { ApiProperty } from '@nestjs/swagger';
9
+ import { ContentDto } from '../../content';
10
+ import { LinkFeaturesDto } from '../../link-features';
11
+
12
+ export class UpdatePaylinkDto {
13
+ @ApiProperty()
14
+ @IsString()
15
+ @IsOptional()
16
+ company?: string;
17
+
18
+ @ApiProperty()
19
+ @IsOptional()
20
+ @IsString()
21
+ name?: string;
22
+
23
+ @ApiProperty()
24
+ @IsString()
25
+ @IsOptional()
26
+ description?: string;
27
+
28
+ @ApiProperty()
29
+ @IsString()
30
+ @IsOptional()
31
+ imageUrl?: string;
32
+
33
+ @ApiProperty()
34
+ @IsOptional()
35
+ normalizedPrice?: bigint;
36
+
37
+ @ApiProperty()
38
+ @IsBoolean()
39
+ @IsOptional()
40
+ notifySenderByEmail?: boolean;
41
+
42
+ @ApiProperty()
43
+ @IsBoolean()
44
+ @IsOptional()
45
+ notifyReceiverByEmail?: boolean;
46
+
47
+ @ApiProperty()
48
+ @IsBoolean()
49
+ @IsOptional()
50
+ addDiscordRole?: boolean;
51
+
52
+ @ApiProperty()
53
+ @IsString()
54
+ @IsOptional()
55
+ currency?: string;
56
+
57
+ @ApiProperty()
58
+ @IsBoolean()
59
+ @IsOptional()
60
+ disabled?: boolean;
61
+
62
+ @ApiProperty()
63
+ @IsString()
64
+ @IsOptional()
65
+ wallet?: string;
66
+
67
+ @ApiProperty()
68
+ @IsString()
69
+ @IsOptional()
70
+ @Type(() => ContentDto)
71
+ @ValidateNested()
72
+ content?: ContentDto;
73
+
74
+ @ApiProperty()
75
+ @IsString()
76
+ @IsOptional()
77
+ @Type(() => LinkFeaturesDto)
78
+ @ValidateNested()
79
+ features?: LinkFeaturesDto;
80
+ }
@@ -0,0 +1,9 @@
1
+ import type { Content } from '../../content';
2
+ import type { LinkFeatures } from '../../link-features';
3
+ import { BasePaymentRequest } from '../../payment-request';
4
+
5
+ export class BasePaylink extends BasePaymentRequest {
6
+ content: Content;
7
+
8
+ features: LinkFeatures;
9
+ }
@@ -0,0 +1,6 @@
1
+ import { Entity } from '../../entity';
2
+ import { Content } from '../../content';
3
+
4
+ export class OnlyContentPaylink extends Entity {
5
+ content: Content;
6
+ }
@@ -0,0 +1,9 @@
1
+ import { ContentDto } from '../../content';
2
+ import { LinkFeaturesDto } from '../../link-features';
3
+ import { PaymentRequest } from '../../payment-request';
4
+
5
+ export class Paylink extends PaymentRequest {
6
+ content: ContentDto;
7
+
8
+ features: LinkFeaturesDto;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { ShallowEnrichedPaymentRequest } from '../../payment-request';
2
+ import type { Content } from '../../content';
3
+ import type { LinkFeatures } from '../../link-features';
4
+
5
+ export class ShallowEnrichedPaylink extends ShallowEnrichedPaymentRequest {
6
+ content: Content;
7
+
8
+ features: LinkFeatures;
9
+ }
@@ -0,0 +1,4 @@
1
+ export * from './Paylink';
2
+ export * from './BasePaylink';
3
+ export * from './ShallowEnrichedPaylink';
4
+ export * from './OnlyContentPaylink';
@@ -0,0 +1,2 @@
1
+ export * from './dtos';
2
+ export * from './entities';
@@ -0,0 +1,24 @@
1
+ import { Type } from 'class-transformer';
2
+ import {
3
+ IsNotEmpty,
4
+ IsNumber,
5
+ IsString,
6
+ ValidateNested,
7
+ } from 'class-validator';
8
+ import { CreateTransactionMetaDto } from '../../transaction-meta';
9
+
10
+ export class CreatePaylinkTxDto {
11
+ @IsString()
12
+ @IsNotEmpty()
13
+ @Type(() => CreateTransactionMetaDto)
14
+ @ValidateNested()
15
+ meta: CreateTransactionMetaDto;
16
+
17
+ @IsString()
18
+ @IsNotEmpty()
19
+ paylink: string;
20
+
21
+ @IsNumber()
22
+ @IsNotEmpty()
23
+ quantity: number;
24
+ }
@@ -0,0 +1,2 @@
1
+ export * from './createPaylinkTxDto';
2
+ export * from './updatePaylinkTxDto';
@@ -0,0 +1,7 @@
1
+ import { IsNumber, IsOptional } from 'class-validator';
2
+
3
+ export class UpdatePaylinkTxDto {
4
+ @IsNumber()
5
+ @IsOptional()
6
+ quantity?: number;
7
+ }
@@ -0,0 +1,9 @@
1
+ import { Entity } from '../../entity';
2
+
3
+ export class BasePaylinkTx extends Entity {
4
+ id: string;
5
+
6
+ quantity: number;
7
+
8
+ createdAt: Date;
9
+ }
@@ -0,0 +1,9 @@
1
+ import type { TransactionMeta } from '../../transaction-meta';
2
+ import type { Paylink } from '../../paylink';
3
+ import { BasePaylinkTx } from './BasePaylinkTx';
4
+
5
+ export class PaylinkTx extends BasePaylinkTx {
6
+ meta: TransactionMeta;
7
+
8
+ paylink: Paylink;
9
+ }
@@ -0,0 +1,15 @@
1
+ import { BasePaylinkTx } from './BasePaylinkTx';
2
+ import type { BaseTransactionMeta } from '../../transaction-meta';
3
+ import { ShallowEnrichedPaylink } from '../../paylink';
4
+
5
+ export class PaylinkTxWithShallowEnrichedPaylink extends BasePaylinkTx {
6
+ meta: BaseTransactionMeta;
7
+
8
+ paylink: ShallowEnrichedPaylink;
9
+
10
+ paylinkCreatorId: string;
11
+
12
+ paylinkName: string;
13
+
14
+ paylinkImageUrl?: string;
15
+ }
@@ -0,0 +1,9 @@
1
+ import { BasePaylinkTx } from './BasePaylinkTx';
2
+ import type { BaseTransactionMeta } from '../../transaction-meta';
3
+ import type { BasePaylink } from '../../paylink';
4
+
5
+ export class ShallowEnrichedPaylinkTx extends BasePaylinkTx {
6
+ meta: BaseTransactionMeta;
7
+
8
+ paylink: BasePaylink;
9
+ }
@@ -0,0 +1,4 @@
1
+ export * from './PaylinkTx';
2
+ export * from './BasePaylinkTx';
3
+ export * from './ShallowEnrichedPaylinkTx';
4
+ export * from './PaylinkTxWithShallowEnrichedPaylink';
@@ -0,0 +1,2 @@
1
+ export * from './dtos';
2
+ export * from './entities';
@@ -0,0 +1,21 @@
1
+ import { Entity } from '../../entity';
2
+
3
+ export class BasePaymentRequest extends Entity {
4
+ id: string;
5
+
6
+ name: string;
7
+
8
+ description?: string;
9
+
10
+ imageUrl?: string;
11
+
12
+ normalizedPrice: bigint;
13
+
14
+ notifySenderByEmail: boolean;
15
+
16
+ notifyReceiverByEmail: boolean;
17
+
18
+ addDiscordRole: boolean;
19
+
20
+ disabled: boolean;
21
+ }
@@ -0,0 +1,15 @@
1
+ import type { Company } from '../../company';
2
+ import type { User } from '../../user';
3
+ import type { Currency } from '../../currency';
4
+ import type { Wallet } from '../../wallet';
5
+ import { BasePaymentRequest } from './BasePaymentRequest';
6
+
7
+ export class PaymentRequest extends BasePaymentRequest {
8
+ creator: User;
9
+
10
+ company: Company;
11
+
12
+ currency: Currency;
13
+
14
+ wallet: Wallet;
15
+ }
@@ -0,0 +1,15 @@
1
+ import type { Company } from '../../company';
2
+ import { BasePaymentRequest } from './BasePaymentRequest';
3
+ import type { BaseUser } from '../../user';
4
+ import type { BaseCurrency } from '../../currency';
5
+ import type { BaseWallet } from '../../wallet';
6
+
7
+ export class ShallowEnrichedPaymentRequest extends BasePaymentRequest {
8
+ creator: BaseUser;
9
+
10
+ company: Company;
11
+
12
+ currency: BaseCurrency;
13
+
14
+ wallet: BaseWallet;
15
+ }
@@ -0,0 +1,3 @@
1
+ export * from './PaymentRequest';
2
+ export * from './BasePaymentRequest';
3
+ export * from './ShallowEnrichedPaymentRequest';
@@ -0,0 +1 @@
1
+ export * from './entities';
@@ -0,0 +1,17 @@
1
+ import { Entity } from '../../entity';
2
+
3
+ export class PaymentRequestFeatures extends Entity {
4
+ requireEmail: boolean;
5
+
6
+ requireDiscordUsername: boolean;
7
+
8
+ requireFullName: boolean;
9
+
10
+ requireTwitterUsername: boolean;
11
+
12
+ requireCountry: boolean;
13
+
14
+ requireDeliveryAddress: boolean;
15
+
16
+ requirePhoneNumber: boolean;
17
+ }
@@ -0,0 +1 @@
1
+ export * from './PaymentRequestFeatures';
@@ -0,0 +1 @@
1
+ export * from './entities';
@@ -0,0 +1,20 @@
1
+ import { IsEnum, IsNotEmpty, IsString } from 'class-validator';
2
+ import { ApiProperty } from '@nestjs/swagger';
3
+ import { RoleType } from '../entities';
4
+
5
+ export class CreateRoleDto {
6
+ @ApiProperty()
7
+ @IsString()
8
+ @IsNotEmpty()
9
+ company: string;
10
+
11
+ @ApiProperty()
12
+ @IsEnum(RoleType)
13
+ @IsNotEmpty()
14
+ type: RoleType;
15
+
16
+ @ApiProperty()
17
+ @IsString()
18
+ @IsNotEmpty()
19
+ user: string;
20
+ }
@@ -0,0 +1,2 @@
1
+ export * from './createRoleDto';
2
+ export * from './updateRoleDto';
@@ -0,0 +1,10 @@
1
+ import { IsEnum, IsNotEmpty } from 'class-validator';
2
+ import { ApiProperty } from '@nestjs/swagger';
3
+ import { RoleType } from '../entities';
4
+
5
+ export class UpdateRoleDto {
6
+ @ApiProperty()
7
+ @IsEnum(RoleType)
8
+ @IsNotEmpty()
9
+ type: RoleType;
10
+ }
@@ -0,0 +1,8 @@
1
+ import { Entity } from '../../entity';
2
+ import { RoleType } from './RoleType';
3
+
4
+ export class BaseRole extends Entity {
5
+ id: string;
6
+
7
+ type: RoleType;
8
+ }
@@ -0,0 +1,9 @@
1
+ import type { User } from '../../user';
2
+ import type { Company } from '../../company';
3
+ import { BaseRole } from './BaseRole';
4
+
5
+ export class Role extends BaseRole {
6
+ company: Company;
7
+
8
+ user: User;
9
+ }
@@ -0,0 +1,5 @@
1
+ export enum RoleType {
2
+ ADMIN = 'ADMIN',
3
+ WRITE = 'WRITE',
4
+ READ = 'READ',
5
+ }