-
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 #181 from harmony-one/add_payment_log
Add logs and DAU metrics
- Loading branch information
Showing
11 changed files
with
1,077 additions
and
57 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,37 @@ | ||
import {Entity, Column, PrimaryGeneratedColumn, CreateDateColumn} from 'typeorm'; | ||
|
||
@Entity({ name: 'logs' }) | ||
export class BotLog { | ||
@PrimaryGeneratedColumn() | ||
id!: number; | ||
|
||
@Column({type: "bigint"}) | ||
tgUserId: number; | ||
|
||
@Column({type: "bigint"}) | ||
accountId: number; | ||
|
||
@Column({type: "bigint"}) | ||
groupId: number; | ||
|
||
@Column({ default: false }) | ||
isPrivate: boolean; | ||
|
||
@Column() | ||
command: string; | ||
|
||
@Column() | ||
message: string; | ||
|
||
@Column({ default: false }) | ||
isSupportedCommand: boolean; | ||
|
||
@Column({ type: 'decimal', precision: 10, scale: 8, default: 0 }) | ||
amountOne: number; | ||
|
||
@Column({ type: 'decimal', precision: 10, scale: 8, default: 0 }) | ||
amountCredits: number; | ||
|
||
@CreateDateColumn() | ||
createdAt: Date; | ||
} |
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,14 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm"; | ||
|
||
export class AddLogs1692905335026 implements MigrationInterface { | ||
name = 'AddLogs1692905335026' | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`CREATE TABLE "logs" ("id" SERIAL NOT NULL, "tgUserId" bigint NOT NULL, "accountId" bigint NOT NULL, "groupId" bigint NOT NULL, "isPrivate" boolean NOT NULL DEFAULT false, "command" character varying NOT NULL, "message" character varying NOT NULL, "isSupportedCommand" boolean NOT NULL DEFAULT false, "amountOne" numeric(10,8) NOT NULL DEFAULT '0', "amountCredits" numeric(10,8) NOT NULL DEFAULT '0', "createdAt" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "PK_fb1b805f2f7795de79fa69340ba" PRIMARY KEY ("id"))`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`DROP TABLE "logs"`); | ||
} | ||
|
||
} |
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.