58 lines
1.0 KiB
TypeScript
58 lines
1.0 KiB
TypeScript
|
|
// Common types used across the application
|
||
|
|
|
||
|
|
export interface Paginated<T> {
|
||
|
|
items: T[];
|
||
|
|
nextCursor: string | null;
|
||
|
|
totalCount?: number;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface ApiResponse<T> {
|
||
|
|
success: boolean;
|
||
|
|
data?: T;
|
||
|
|
error?: {
|
||
|
|
code: string;
|
||
|
|
message: string;
|
||
|
|
details?: unknown;
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface IdempotencyKey {
|
||
|
|
key: string;
|
||
|
|
userId: string;
|
||
|
|
createdAt: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface UserMapping {
|
||
|
|
userId: string;
|
||
|
|
whmcsClientId: number;
|
||
|
|
sfContactId?: string;
|
||
|
|
sfAccountId?: string;
|
||
|
|
createdAt?: Date;
|
||
|
|
updatedAt?: Date;
|
||
|
|
}
|
||
|
|
|
||
|
|
// Extended mapping interfaces for V2 implementation
|
||
|
|
export interface UserIdMapping extends UserMapping {
|
||
|
|
createdAt?: Date;
|
||
|
|
updatedAt?: Date;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface CreateMappingRequest {
|
||
|
|
userId: string;
|
||
|
|
whmcsClientId: number;
|
||
|
|
sfAccountId?: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface UpdateMappingRequest {
|
||
|
|
whmcsClientId?: number;
|
||
|
|
sfAccountId?: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface MappingStats {
|
||
|
|
totalMappings: number;
|
||
|
|
whmcsMappings: number;
|
||
|
|
salesforceMappings: number;
|
||
|
|
completeMappings: number;
|
||
|
|
orphanedMappings: number;
|
||
|
|
}
|