-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: tick entity for interval to consume, add intervals to schema
- Loading branch information
Showing
16 changed files
with
203 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
metadata: | ||
kind: command-interval | ||
name: test-interval-cmd | ||
data: | ||
defaultCommand: | ||
noun: time | ||
verb: get | ||
frequency: | ||
zeit: 30 seconds |
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
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,51 @@ | ||
import { GraphQLObjectType, GraphQLString } from 'graphql'; | ||
import { Column, CreateDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'; | ||
|
||
import { BaseEntity } from './base/BaseEntity'; | ||
|
||
export const TABLE_TICK = 'tick'; | ||
|
||
@Entity(TABLE_TICK) | ||
export class Tick extends BaseEntity { | ||
@CreateDateColumn() | ||
public createdAt: number; | ||
|
||
@PrimaryGeneratedColumn('uuid') | ||
public id: string; | ||
|
||
@Column() | ||
public intervalId: string; | ||
|
||
@Column() | ||
public status: number; | ||
|
||
@UpdateDateColumn() | ||
public updatedAt: number; | ||
|
||
public toJSON(): object { | ||
return { | ||
createdAt: this.createdAt, | ||
id: this.id, | ||
intervalId: this.intervalId, | ||
updatedAt: this.updatedAt, | ||
}; | ||
} | ||
} | ||
|
||
export const GRAPH_OUTPUT_TICK = new GraphQLObjectType({ | ||
fields: { | ||
createdAt: { | ||
type: GraphQLString, | ||
}, | ||
id: { | ||
type: GraphQLString, | ||
}, | ||
intervalId: { | ||
type: GraphQLString, | ||
}, | ||
updatedAt: { | ||
type: GraphQLString, | ||
}, | ||
}, | ||
name: 'Tick', | ||
}); |
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
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { MigrationInterface, QueryRunner, Table } from 'typeorm'; | ||
|
||
import { TABLE_TICK } from 'src/entity/Tick'; | ||
|
||
export class CreateTick0001546063195 implements MigrationInterface { | ||
public async up(query: QueryRunner): Promise<any> { | ||
await query.createTable(new Table({ | ||
columns: [{ | ||
isPrimary: true, | ||
name: 'id', | ||
type: 'varchar', | ||
}, { | ||
name: 'createdAt', | ||
type: 'int', | ||
}, { | ||
name: 'intervalId', | ||
type: 'varchar', | ||
}, { | ||
name: 'status', | ||
type: 'int', | ||
}, { | ||
name: 'updatedAt', | ||
type: 'int', | ||
}], | ||
name: TABLE_TICK, | ||
})); | ||
} | ||
|
||
public async down(query: QueryRunner): Promise<any> { | ||
await query.dropTable(TABLE_TICK); | ||
} | ||
} |
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.