pos-be/src/modules/configuration/otp-verification/domain/entities/otp-verification.entity.ts

41 lines
868 B
TypeScript

import { BaseEntity } from 'src/core/modules/domain/entities//base.entity';
export enum OTP_ACTION_TYPE {
CREATE_DISCOUNT = 'CREATE_DISCOUNT',
CANCEL_TRANSACTION = 'CANCEL_TRANSACTION',
REJECT_RECONCILIATION = 'REJECT_RECONCILIATION',
}
export enum OTP_SOURCE {
POS = 'POS',
WEB = 'WEB',
}
export interface OtpVerificationEntity extends BaseEntity {
otp_code: string;
action_type: OTP_ACTION_TYPE;
target_id: string;
reference: string;
source: OTP_SOURCE;
is_used: boolean;
is_replaced: boolean;
expired_at: number;
verified_at: number;
}
export interface OtpRequestEntity {
action_type: OTP_ACTION_TYPE;
source: OTP_SOURCE;
target_id: string;
reference: string;
}
export interface OtpVerifyEntity extends OtpRequestEntity {
otp_code: string;
}
export interface OtpVerifierEntity {
name: string;
phone_number: string;
}