-
Notifications
You must be signed in to change notification settings - Fork 1
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 #5 from taraldefi/feat/property-selection
feat(marketplace): property selection
- Loading branch information
Showing
11 changed files
with
220 additions
and
43 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
15 changes: 15 additions & 0 deletions
15
chainhook-subscriber/src/common/decorators/track-changes.decorator.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,15 @@ | ||
import "reflect-metadata"; | ||
|
||
export const METADATA_KEY = Symbol('TrackChanges'); | ||
|
||
export function TrackChanges(): PropertyDecorator { | ||
return function (target: Object, propertyKey: string | symbol): void { | ||
let existingProperties: Array<string | symbol> = Reflect.getMetadata(METADATA_KEY, target.constructor); | ||
if (existingProperties) { | ||
existingProperties.push(propertyKey); | ||
} else { | ||
existingProperties = [propertyKey]; | ||
Reflect.defineMetadata(METADATA_KEY, existingProperties, target.constructor); | ||
} | ||
}; | ||
} |
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
20 changes: 20 additions & 0 deletions
20
chainhook-subscriber/src/database/migrations/1690548214447-Hash.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,20 @@ | ||
import {MigrationInterface, QueryRunner} from "typeorm"; | ||
|
||
export class Hash1690548214447 implements MigrationInterface { | ||
name = 'Hash1690548214447' | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "Auctions" ADD "hash" character(64) NOT NULL`); | ||
await queryRunner.query(`ALTER TABLE "Bids" ADD "hash" character(64) NOT NULL`); | ||
await queryRunner.query(`ALTER TABLE "auction_bids_history" ADD "hash" character(64) NOT NULL`); | ||
await queryRunner.query(`ALTER TABLE "auctions_history" ADD "hash" character(64) NOT NULL`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "auctions_history" DROP COLUMN "hash"`); | ||
await queryRunner.query(`ALTER TABLE "auction_bids_history" DROP COLUMN "hash"`); | ||
await queryRunner.query(`ALTER TABLE "Bids" DROP COLUMN "hash"`); | ||
await queryRunner.query(`ALTER TABLE "Auctions" DROP COLUMN "hash"`); | ||
} | ||
|
||
} |
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
Oops, something went wrong.