Refactorizacion para permitir la inyeccion de dependencias en el
servicio de HTTP
This commit is contained in:
96
packages/sim-shared/domain/operationsRepository.port.ts
Normal file
96
packages/sim-shared/domain/operationsRepository.port.ts
Normal file
@@ -0,0 +1,96 @@
|
||||
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;
|
||||
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;
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user