This commit is contained in:
2025-12-16 21:38:16 +07:00
parent 66c239f047
commit 9b0d8a9d64
5 changed files with 97 additions and 2 deletions

View File

@ -0,0 +1,70 @@
import { Column, CreateDateColumn, DeleteDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
import { TrxSmsStatus, TrxSmsType } from "../types/trx";
@Entity("trx_sms_logs", { schema: "trx" })
export class TrxSmsLog {
@PrimaryGeneratedColumn("uuid")
id: string;
@Column({
nullable: false,
length: 4096,
})
type: TrxSmsType;
@Column({
nullable: false,
length: 4096,
})
phone: string;
@Column({
nullable: false,
type: "text",
})
content: string;
@Column({
nullable: false,
})
request_at: Date;
@Column({
nullable: true,
type: "text",
})
response: string;
@Column({
nullable: true,
})
response_at: Date;
@Column({
nullable: false,
length: 64,
default: TrxSmsStatus.process,
})
status: TrxSmsStatus;
@Column()
@CreateDateColumn()
created_at: Date;
@Column({ nullable: true, length: 256 })
created_by: string;
@Column({ nullable: true })
@UpdateDateColumn()
updated_at: Date;
@Column({ nullable: true, length: 256 })
updated_by: string;
@Column({ nullable: true })
@DeleteDateColumn()
deleted_at: Date;
@Column({ nullable: true, length: 256 })
deleted_by: string;
}

View File

@ -41,6 +41,7 @@ export * from "../types/paging";
export * from "../types/role"; export * from "../types/role";
export * from "../types/status"; export * from "../types/status";
export * from "../types/email"; export * from "../types/email";
export * from "../types/sms";
export * from "../types/pull"; export * from "../types/pull";
export * from "../types/category_source"; export * from "../types/category_source";
export * from "../types/category"; export * from "../types/category";

View File

@ -22,6 +22,7 @@ export * from "../entity/trx_transaction_slas";
export * from "../entity/trx_transaction_amls"; export * from "../entity/trx_transaction_amls";
export * from "../entity/trx_transaction_signatures"; export * from "../entity/trx_transaction_signatures";
export * from "../entity/trx_email_logs"; export * from "../entity/trx_email_logs";
export * from "../entity/trx_sms_logs";
export * from "../entity/trx_maintenances"; export * from "../entity/trx_maintenances";
export * from "../entity/trx_maintenance_details"; export * from "../entity/trx_maintenance_details";
export * from "../entity/trx_maintenance_slas"; export * from "../entity/trx_maintenance_slas";

13
src/types/sms.ts Normal file
View File

@ -0,0 +1,13 @@
export class SmsBody {
application: string;
to: string;
message: string;
}
export enum SmsTrxFrom {
"non_reply" = "non_reply",
"registration" = "registration",
"verification" = "verification",
"transaction" = "transaction",
"info" = "info",
}

View File

@ -104,6 +104,18 @@ export enum TrxTransactionRemark {
"cancel" = "Cancel", "cancel" = "Cancel",
} }
export enum TrxSmsType {
"verification" = "verification",
"registration" = "registration",
"transaction" = "transaction",
}
export enum TrxSmsStatus {
"process" = "process",
"success" = "success",
"fail" = "fail",
}
export enum TrxEmailType { export enum TrxEmailType {
"verification" = "verification", "verification" = "verification",
"registration" = "registration", "registration" = "registration",
@ -149,5 +161,3 @@ export enum TrxMaintenanceActionType {
"update" = "update", "update" = "update",
"delete" = "delete", "delete" = "delete",
} }
////