Merge branch 'main' of https://git.shiblysolution.id/BRITL/entity
This commit is contained in:
@ -1,63 +1,75 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinTable, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm';
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinTable, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
|
||||
import { BrilinkDiscountModule, BrilinkDiscountStatus, BrilinkDiscountType } from '../types/brilink';
|
||||
import { BrilinkMerchant } from './brilink_merchants';
|
||||
import { BrilinkDiscountModule, BrilinkDiscountStatus, BrilinkDiscountType } from "../types/brilink";
|
||||
import { BrilinkMerchant } from "./brilink_merchants";
|
||||
|
||||
@Entity('brilink_discounts', { schema: 'brilinks' })
|
||||
@Entity("brilink_discounts", { schema: "brilinks" })
|
||||
export class BrilinkDiscount {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => BrilinkMerchant, { onDelete: 'RESTRICT' })
|
||||
@JoinTable()
|
||||
merchant: BrilinkMerchant
|
||||
@ManyToOne(() => BrilinkMerchant, { onDelete: "RESTRICT" })
|
||||
@JoinTable()
|
||||
merchant: BrilinkMerchant;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
module: BrilinkDiscountModule;
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
module: BrilinkDiscountModule;
|
||||
|
||||
@Column({ type: "varchar", length: 255, unique: true })
|
||||
code: string;
|
||||
@Column({ type: "varchar", length: 255, unique: true })
|
||||
code: string;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
name: string;
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
name: string;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
type: BrilinkDiscountType;
|
||||
@Column({
|
||||
type: "float8",
|
||||
nullable: true,
|
||||
})
|
||||
min_trans_amount: number;
|
||||
|
||||
@Column({
|
||||
type: 'float8',
|
||||
nullable: false,
|
||||
default: 0
|
||||
})
|
||||
amount: number;
|
||||
@Column({
|
||||
type: "float8",
|
||||
nullable: true,
|
||||
})
|
||||
max_trans_amount: number;
|
||||
|
||||
@Column({ nullable: false })
|
||||
start_date: Date;
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
type: BrilinkDiscountType;
|
||||
|
||||
@Column({ nullable: false })
|
||||
end_date: Date;
|
||||
@Column({
|
||||
type: "float8",
|
||||
nullable: false,
|
||||
default: 0,
|
||||
})
|
||||
amount: number;
|
||||
|
||||
@Column({ type: "varchar", length: 10 })
|
||||
status: BrilinkDiscountStatus;
|
||||
@Column({ nullable: false })
|
||||
start_date: Date;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
@Column({ nullable: false })
|
||||
end_date: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
created_by: string;
|
||||
@Column({ type: "varchar", length: 10 })
|
||||
status: BrilinkDiscountStatus;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
updated_by: string;
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
created_by: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
deleted_by: string;
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
updated_by: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
deleted_by: string;
|
||||
}
|
||||
184
src/entity/gps_vehicles.ts
Normal file
184
src/entity/gps_vehicles.ts
Normal file
@ -0,0 +1,184 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinTable, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn, OneToOne, JoinColumn } from "typeorm";
|
||||
import { GpsDevice } from "./gps_devices";
|
||||
|
||||
export abstract class BaseEntityAudit {
|
||||
@CreateDateColumn({ name: "created_at" })
|
||||
created_at: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
created_by: string;
|
||||
|
||||
@UpdateDateColumn({ name: "updated_at", nullable: true })
|
||||
updated_at?: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
updated_by?: string;
|
||||
|
||||
@DeleteDateColumn({ name: "deleted_at", nullable: true })
|
||||
deleted_at?: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
deleted_by?: string;
|
||||
}
|
||||
|
||||
@Entity("gps_vehicles", { schema: "gps" })
|
||||
export class GpsVehicles extends BaseEntityAudit {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
vehicle_id: string;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
name?: string;
|
||||
|
||||
@OneToOne(() => GpsDevice, { nullable: true, onDelete: "SET NULL" })
|
||||
@JoinColumn({ name: "device_id", referencedColumnName: "id" })
|
||||
device_id?: GpsDevice;
|
||||
|
||||
@Column({ type: "json", nullable: true })
|
||||
vehicle_dt?: Record<string, any>;
|
||||
|
||||
// =============================
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
created_by: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
updated_by: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
deleted_by: string;
|
||||
}
|
||||
|
||||
@Entity("gps_vehicle_types", { schema: "gps" })
|
||||
export class GpsVehicleTypes extends BaseEntityAudit {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
vehicle_type_id: string;
|
||||
|
||||
@Column({ type: "json", nullable: true })
|
||||
vehicle_type_dt?: Record<string, any>;
|
||||
|
||||
// =============================
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
created_by: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
updated_by: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
deleted_by: string;
|
||||
}
|
||||
|
||||
@Entity("gps_vehicle_brands", { schema: "gps" })
|
||||
export class GpsVehicleBrands extends BaseEntityAudit {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
vehicle_brand_id: string;
|
||||
|
||||
@Column({ type: "json", nullable: true })
|
||||
vehicle_brand_dt?: Record<string, any>;
|
||||
|
||||
// =============================
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
created_by: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
updated_by: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
deleted_by: string;
|
||||
}
|
||||
|
||||
@Entity("gps_vehicle_cats", { schema: "gps" })
|
||||
export class GpsVehicleCats extends BaseEntityAudit {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
vehicle_cat_id: string;
|
||||
|
||||
@Column({ type: "json", nullable: true })
|
||||
vehicle_cat_dt?: Record<string, any>;
|
||||
|
||||
// =============================
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
created_by: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
updated_by: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
deleted_by: string;
|
||||
}
|
||||
|
||||
@Entity("gps_vehicle_models", { schema: "gps" })
|
||||
export class GpsVehicleModels extends BaseEntityAudit {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
vehicle_model_id: string;
|
||||
|
||||
@Column({ type: "json", nullable: true })
|
||||
vehicle_model_dt?: Record<string, any>;
|
||||
|
||||
// =============================
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
created_by: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
updated_by: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
deleted_by: string;
|
||||
}
|
||||
54
src/entity/telemor_logs.ts
Normal file
54
src/entity/telemor_logs.ts
Normal file
@ -0,0 +1,54 @@
|
||||
import { Column, CreateDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
|
||||
import { Application } from "./application";
|
||||
|
||||
@Entity("telemor_logs", { schema: "telemor" })
|
||||
export class TelemorLogs {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => Application, { onDelete: "NO ACTION" })
|
||||
@JoinColumn({ name: "application" })
|
||||
application: Application;
|
||||
|
||||
@Column({
|
||||
length: 256,
|
||||
})
|
||||
url: string;
|
||||
|
||||
@Column({
|
||||
type: "jsonb",
|
||||
})
|
||||
header: string;
|
||||
|
||||
@Column({
|
||||
type: "jsonb",
|
||||
})
|
||||
body: string;
|
||||
|
||||
@Column()
|
||||
request_at: Date;
|
||||
|
||||
@Column({
|
||||
length: 4096,
|
||||
})
|
||||
response: string;
|
||||
|
||||
@Column({
|
||||
length: 128,
|
||||
nullable: true,
|
||||
})
|
||||
supplier_reference_code: string;
|
||||
|
||||
@Column({
|
||||
length: 128,
|
||||
nullable: true,
|
||||
})
|
||||
supplier_transaction_code: string;
|
||||
|
||||
@Column()
|
||||
response_at: Date;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
}
|
||||
28
src/entity/telemor_mosan_remit_configs.ts
Normal file
28
src/entity/telemor_mosan_remit_configs.ts
Normal file
@ -0,0 +1,28 @@
|
||||
import { Column, CreateDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
|
||||
@Entity("telemor_mosan_remit_configs", { schema: "telemor" })
|
||||
export class TelemorMosanRemitConfig {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
length: 4096,
|
||||
})
|
||||
key: string;
|
||||
|
||||
@Column({
|
||||
length: 4096,
|
||||
})
|
||||
value: string;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
expired_at: Date;
|
||||
}
|
||||
@ -12,3 +12,4 @@ export * from "./schema/eform";
|
||||
export * from "./schema/compliance";
|
||||
export * from "./schema/trx";
|
||||
export * from "./schema/gps";
|
||||
export * from "./schema/telemor";
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
export * from "../types/gps";
|
||||
export * from "../entity/gps_devices";
|
||||
export * from "../entity/gps_device_log";
|
||||
export * from "../entity/gps_vehicles";
|
||||
|
||||
2
src/schema/telemor.ts
Normal file
2
src/schema/telemor.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export * from "../entity/telemor_mosan_remit_configs";
|
||||
export * from "../entity/telemor_logs";
|
||||
Reference in New Issue
Block a user