35 lines
955 B
TypeScript
35 lines
955 B
TypeScript
import { Result } from "#shared/domain/Result";
|
|
|
|
export type StatusEnum = 'noRequestID' | 'noMassID' | 'running' | 'finished' | 'error' | 'other';
|
|
|
|
export interface IOperationsRepository {
|
|
createOperation(data: ObjeniousOperation): Promise<Result<string, ObjeniousOperation>>
|
|
updateOperation(data: ObjeniousOperationChange): Promise<Result<string, ObjeniousOperation>>
|
|
getPendingOerations(): Promise<Result<string, ObjeniousOperation>>
|
|
}
|
|
|
|
export type ObjeniousOperation = {
|
|
id?: number;
|
|
operation: string;
|
|
retry_count?: number;
|
|
max_retry?: number;
|
|
max_date_retry?: Date | null;
|
|
iccids: string[];
|
|
request_id?: string;
|
|
mass_action_id?: string;
|
|
end_date?: Date | null;
|
|
error?: string | null;
|
|
status: StatusEnum;
|
|
}
|
|
|
|
export type ObjeniousOperationChange = {
|
|
id?: number;
|
|
operation_id: number;
|
|
creation_date: Date;
|
|
error?: string | null;
|
|
new_status: StatusEnum;
|
|
new_request_id?: string;
|
|
new_mass_action_id?: string;
|
|
}
|
|
|