99 lines
3.1 KiB
TypeScript
99 lines
3.1 KiB
TypeScript
import { Result } from "sim-shared/domain/Result.js";
|
|
|
|
export type StatusEnum = 'error' | 'finished' | 'noRequestId' | 'running' | 'noMassID';
|
|
|
|
export interface IOperationsRepository {
|
|
createOperation(data: ObjeniousOperation): Promise<Result<string, ObjeniousOperation>>
|
|
updateOperation(data: ObjeniousOperationChange): Promise<Result<string, ObjeniousOperation>>
|
|
getPendingOperations(): Promise<Result<string, ObjeniousOperation[]>>
|
|
}
|
|
|
|
export type ObjeniousOperation = {
|
|
id?: number;
|
|
/** Uuid del mensaje asociado a la operacion */
|
|
correlation_id?: string;
|
|
operation: string;
|
|
retry_count?: number;
|
|
max_retry?: number;
|
|
max_date_retry?: string | null;
|
|
iccids: string; // Deberia ser string[] pero no parseo la lista de iccids
|
|
request_id?: string;
|
|
mass_action_id?: string;
|
|
end_date?: string | null;
|
|
error?: string | null;
|
|
status: StatusEnum;
|
|
objenious_status?: string;
|
|
last_change_date?: string;
|
|
}
|
|
|
|
export type ObjeniousOperationChange = {
|
|
id?: number;
|
|
operation_id: number;
|
|
info?: string | null;
|
|
error?: string | null;
|
|
new_status: StatusEnum;
|
|
previous_status?: StatusEnum;
|
|
new_objenious_status?: string;
|
|
previous_objenious_status?: string;
|
|
new_request_id?: string;
|
|
new_mass_action_id?: string;
|
|
}
|
|
|
|
export namespace Objenious {
|
|
export type Status = "En Cours" | "Terminé";
|
|
export type Identifier = "IMSI" | "MSISDN" | "REFERENCE" | "ICCID" | "IMEI"
|
|
export type ResponseGetRequestById = {
|
|
created: string,
|
|
status: "NEW" | "RUNNING" | "OK" | "KO" | "REPLAYED" | "CANCELLED" | "CLOSED" | "DISABLED",
|
|
statusDate: string,
|
|
actionType: "PREACTIVATION_AND_ACTIVATION" | string, // todo: añadir el resto
|
|
massActionIds: number[]
|
|
}
|
|
|
|
export type ActionType = "PREACTIVATION" | "PREACTIVATION_ACTIVATION" | "ACTIVATION" |
|
|
"STATUS_CHANGE" | "ICCID_CHANGE" | "EUICC_NOTIFICATION"
|
|
| "EUICC_AUDIT" | "MSISDN_CHANGE" | "ALARM_SETTING"
|
|
| "ALARM_UNSETTING" | "CUSTOM_FIELDS_UPDATE" | "SERVICE_CHANGE"
|
|
| "SEND_SMS" | "CHANGE_OFFER" | "PORT_IN"
|
|
| "PORT_OUT" | "CHANGE_CUSTOMER_ACCOUNT" | "SIMCARD_TRANSFER"
|
|
| "GEO_LOCATION" | "UPDATE_COMMITMENT" | "COACH_M2M"
|
|
| "PP_RECHARGE" | "TERMINATION_DFE" | "DO_ORDER_PAYMENT"
|
|
| "DO_TOP_UP" | "RADIUS_READ" | "RADIUS_UPDATE"
|
|
| "RADIUS_SYNCHRONIZE" | "NETWORK_RESET" | "UPDATE_YORK_COMMUNITY"
|
|
| "SUSPENSION" | "REACTIVATION" | "RESILIATION"
|
|
| "SORTIE_TEST" | "VALIDATION_RESILIATION" | "REFUS_RESILIATION";
|
|
|
|
export type ParametersGetMassAction = {
|
|
massActionId?: string,
|
|
unitActionId?: string,
|
|
createDateMin?: string,
|
|
createDateMax?: string,
|
|
dueDateMin?: string,
|
|
dueDateMax?: string,
|
|
endDateMin?: string,
|
|
endDateMax?: string,
|
|
"identifier.identifiers"?: string[],
|
|
"identifier.identifierType"?: Identifier,
|
|
actionTypes?: ActionType,
|
|
errorCodes?: string[],
|
|
pageNumber?: number,
|
|
pageSize?: number
|
|
}
|
|
|
|
export type ResponseGetMassAction = {
|
|
id: number,
|
|
loginCreator?: string,
|
|
longinCancellor?: string,
|
|
actionType: ActionType,
|
|
dueDate?: string,
|
|
targetActionNumber?: number,
|
|
created: string,
|
|
started?: string,
|
|
ended?: string,
|
|
status: string,
|
|
info?: string
|
|
}
|
|
}
|
|
|
|
|