add table log pulls

This commit is contained in:
2024-12-11 15:41:48 +07:00
parent c98868defa
commit 14b7d85568
3 changed files with 67 additions and 1 deletions

46
src/entity/log_pull.ts Normal file
View File

@ -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;
}

View File

@ -21,6 +21,8 @@ import { District } from "./entity/district";
import { IncomeTier } from "./entity/income_tier"; import { IncomeTier } from "./entity/income_tier";
import { Munisipo } from "./entity/munisipo"; import { Munisipo } from "./entity/munisipo";
import { Suco } from "./entity/suco"; import { Suco } from "./entity/suco";
import { LogPull } from "./entity/log_pull";
import { LogPullType, StatusLogPull } from "./types/pull";
export { export {
User, User,
@ -46,5 +48,8 @@ export {
District, District,
IncomeTier, IncomeTier,
Munisipo, Munisipo,
Suco Suco,
LogPull,
LogPullType,
StatusLogPull
}; };

15
src/types/pull.ts Normal file
View File

@ -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"
};