Skip to content

Commit

Permalink
Merge pull request #1029 from multiversx/SERVICES-1849-add-fixed-pric…
Browse files Browse the repository at this point in the history
…e-filter

Add FixedPrice auction type
  • Loading branch information
danielailie authored Sep 21, 2023
2 parents 44bad2f + f73a306 commit 5425f61
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions schema.gql
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ enum AuctionStatusEnum {
}

enum AuctionTypeEnum {
FixedPrice
Nft
NftBid
None
Expand Down
10 changes: 9 additions & 1 deletion src/modules/auctions/auctions-setter.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Injectable, Logger } from '@nestjs/common';
import { Auction, AuctionAbi, AuctionStatusEnum, ExternalAuctionAbi } from './models';
import { Auction, AuctionAbi, AuctionStatusEnum, AuctionTypeEnum, ExternalAuctionAbi } from './models';
import '../../utils/extensions';
import { AuctionEntity } from 'src/db/auctions';
import { NftMarketplaceAbiService } from './nft-marketplace.abi.service';
Expand Down Expand Up @@ -56,6 +56,14 @@ export class AuctionsSetterService {
);
}

if (
auctionEntity.maxBidDenominated === auctionEntity.minBidDenominated &&
auctionEntity.type !== AuctionTypeEnum.SftAll &&
auctionEntity.type !== AuctionTypeEnum.SftOnePerPayment
) {
auctionEntity.type = AuctionTypeEnum.FixedPrice;
}

const savedAuction = await this.persistenceService.insertAuction(auctionEntity);

if (asset?.tags) {
Expand Down
1 change: 1 addition & 0 deletions src/modules/auctions/models/AuctionType.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export enum AuctionTypeEnum {
None = 'None',
Nft = 'Nft',
NftBid = 'NftBid',
FixedPrice = 'FixedPrice',
SftAll = 'SftAll',
SftOnePerPayment = 'SftOnePerPayment',
}
Expand Down

0 comments on commit 5425f61

Please sign in to comment.