109 lines
2.2 KiB
TypeScript
109 lines
2.2 KiB
TypeScript
/**
|
|
* SIM Domain - Contract
|
|
*/
|
|
|
|
// SIM Status
|
|
export const SIM_STATUS = {
|
|
ACTIVE: "active",
|
|
SUSPENDED: "suspended",
|
|
CANCELLED: "cancelled",
|
|
PENDING: "pending",
|
|
} as const;
|
|
|
|
export type SimStatus = (typeof SIM_STATUS)[keyof typeof SIM_STATUS];
|
|
|
|
// SIM Type
|
|
export const SIM_TYPE = {
|
|
STANDARD: "standard",
|
|
NANO: "nano",
|
|
MICRO: "micro",
|
|
ESIM: "esim",
|
|
} as const;
|
|
|
|
export type SimType = (typeof SIM_TYPE)[keyof typeof SIM_TYPE];
|
|
|
|
// SIM Details
|
|
export interface SimDetails {
|
|
account: string;
|
|
status: SimStatus;
|
|
planCode: string;
|
|
planName: string;
|
|
simType: SimType;
|
|
iccid: string;
|
|
eid: string;
|
|
msisdn: string;
|
|
imsi: string;
|
|
remainingQuotaMb: number;
|
|
remainingQuotaKb: number;
|
|
voiceMailEnabled: boolean;
|
|
callWaitingEnabled: boolean;
|
|
internationalRoamingEnabled: boolean;
|
|
networkType: string;
|
|
activatedAt?: string;
|
|
expiresAt?: string;
|
|
}
|
|
|
|
// SIM Usage
|
|
export interface RecentDayUsage {
|
|
date: string;
|
|
usageKb: number;
|
|
usageMb: number;
|
|
}
|
|
|
|
export interface SimUsage {
|
|
account: string;
|
|
todayUsageMb: number;
|
|
todayUsageKb: number;
|
|
monthlyUsageMb?: number;
|
|
monthlyUsageKb?: number;
|
|
recentDaysUsage: RecentDayUsage[];
|
|
isBlacklisted: boolean;
|
|
lastUpdated?: string;
|
|
}
|
|
|
|
// SIM Top-Up History
|
|
export interface SimTopUpHistoryEntry {
|
|
quotaKb: number;
|
|
quotaMb: number;
|
|
addedDate: string;
|
|
expiryDate: string;
|
|
campaignCode: string;
|
|
}
|
|
|
|
export interface SimTopUpHistory {
|
|
account: string;
|
|
totalAdditions: number;
|
|
additionCount: number;
|
|
history: SimTopUpHistoryEntry[];
|
|
}
|
|
|
|
// ============================================================================
|
|
// SIM Management Requests
|
|
// ============================================================================
|
|
|
|
export interface SimTopUpRequest {
|
|
quotaMb: number;
|
|
}
|
|
|
|
export interface SimPlanChangeRequest {
|
|
newPlanCode: string;
|
|
assignGlobalIp?: boolean;
|
|
scheduledAt?: string;
|
|
}
|
|
|
|
export interface SimCancelRequest {
|
|
scheduledAt?: string; // YYYYMMDD - optional, immediate if omitted
|
|
}
|
|
|
|
export interface SimTopUpHistoryRequest {
|
|
fromDate: string; // YYYYMMDD
|
|
toDate: string; // YYYYMMDD
|
|
}
|
|
|
|
export interface SimFeaturesUpdateRequest {
|
|
voiceMailEnabled?: boolean;
|
|
callWaitingEnabled?: boolean;
|
|
internationalRoamingEnabled?: boolean;
|
|
networkType?: "4G" | "5G";
|
|
}
|