diff --git a/src/entity/log_pull.ts b/src/entity/log_pull.ts new file mode 100644 index 0000000..797ae41 --- /dev/null +++ b/src/entity/log_pull.ts @@ -0,0 +1,46 @@ +import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, OneToOne, JoinColumn } from 'typeorm'; + +import { LogPullType, StatusLogPull } from '../types/pull'; + +@Entity('log_pulls') +export class LogPull { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ + nullable: false, + length: 32 + }) + type: LogPullType; + + @Column({ + nullable: true, + length: 256 + }) + filename: string; + + @Column({ + nullable: false, + default: false + }) + is_file_deleted: boolean; + + @Column({ + nullable: false, + length: 64 + }) + status: StatusLogPull; + + @Column() + @CreateDateColumn() + created_at: Date; + + @Column({ + nullable: true + }) + finished_at: Date; + + @Column({ nullable: true }) + @DeleteDateColumn() + deleted_at: Date; +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 08b50a7..756ceb3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -21,6 +21,8 @@ import { District } from "./entity/district"; import { IncomeTier } from "./entity/income_tier"; import { Munisipo } from "./entity/munisipo"; import { Suco } from "./entity/suco"; +import { LogPull } from "./entity/log_pull"; +import { LogPullType, StatusLogPull } from "./types/pull"; export { User, @@ -46,5 +48,8 @@ export { District, IncomeTier, Munisipo, - Suco + Suco, + LogPull, + LogPullType, + StatusLogPull }; \ No newline at end of file diff --git a/src/types/pull.ts b/src/types/pull.ts new file mode 100644 index 0000000..2daec3c --- /dev/null +++ b/src/types/pull.ts @@ -0,0 +1,15 @@ +export enum LogPullType { + "LNKOLEK" = "LNKOLEK", + "CIF_BEREKENING" = "CIF_BEREKENING", + "TRIAL_BALANCE_BRANCH" = "TRIAL_BALANCE_BRANCH", + "TRIAL_BALANCE_KONSOLIDASI" = "TRIAL_BALANCE_KONSOLIDASI", + "TRANSAKSI_CS" = "TRANSAKSI_CS" +}; + + +export enum StatusLogPull { + "Waiting Schedule" = "W", + "Failed Pull Data" = "N", + "Retry Pull Data" = "R", + "Success Pull Data" = "Y" +}; \ No newline at end of file