-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1039 from multiversx/SERVICES-1882-upgrade-market…
…place-key-type Update marketplace key and add contraints
- Loading branch information
Showing
6 changed files
with
29 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/db/migrations/1696854100026-UpdateMarketplaceKeyLength.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
||
export class UpdateMarketplaceKeyLength1696854100026 implements MigrationInterface { | ||
name = 'UpdateMarketplaceKeyLength1696854100026'; | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE \`marketplaces\` MODIFY COLUMN \`key\` varchar(62) NOT NULL`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE \`marketplaces\` MODIFY COLUMN \`key\` varchar(20) NOT NULL`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
import { Field, InputType } from '@nestjs/graphql'; | ||
import { IsOptional, Matches, MaxLength } from 'class-validator'; | ||
import { ADDRESS_RGX, ADDRESS_ERROR } from 'src/utils/constants'; | ||
|
||
@InputType() | ||
export class WhitelistMarketplaceArgs { | ||
@Field({ description: 'This field will be shown on external apps like xSpothlight, xPortal!' }) | ||
marketplaceName: string; | ||
|
||
@MaxLength(62) | ||
@Field({ description: 'This should de a unique key, so choose wisely!' }) | ||
marketplaceKey: string; | ||
|
||
@Field({ description: 'This will be used to redirect from external apps!' }) | ||
marketplaceUrl: string; | ||
|
||
@Field({ description: 'Smart Contract Address, if not sent the default one will be used', nullable: true }) | ||
@IsOptional() | ||
@Matches(RegExp(ADDRESS_RGX), { message: ADDRESS_ERROR }) | ||
marketplaceScAddress: string; | ||
} |