This commit is contained in:
2025-12-10 00:38:59 +01:00
parent a4a732ddc5
commit 0f7fe67d3c
25 changed files with 1914 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
/**
* Application Port: ILiveryCompositor
*
* Defines interface for livery image composition.
* Infrastructure will provide image processing implementation.
*/
import type { LiveryDecal } from '../../domain/value-objects/LiveryDecal';
export interface CompositionResult {
success: boolean;
composedImageUrl?: string;
error?: string;
timestamp: Date;
}
export interface ILiveryCompositor {
/**
* Composite a livery by layering decals on base image
*/
composeLivery(
baseImageUrl: string,
decals: LiveryDecal[]
): Promise<CompositionResult>;
/**
* Generate a livery pack (.zip) for all drivers in a season
*/
generateLiveryPack(
seasonId: string,
liveryData: Array<{
driverId: string;
driverName: string;
carId: string;
composedImageUrl: string;
}>
): Promise<Buffer>;
/**
* Validate livery image (check for logos/text)
*/
validateLiveryImage(imageUrl: string): Promise<{
isValid: boolean;
violations?: string[];
}>;
}

View File

@@ -0,0 +1,39 @@
/**
* Application Port: ILiveryStorage
*
* Defines interface for livery image storage.
* Infrastructure will provide cloud storage adapter.
*/
export interface UploadResult {
success: boolean;
imageUrl?: string;
error?: string;
timestamp: Date;
}
export interface ILiveryStorage {
/**
* Upload a livery image
*/
upload(
imageData: Buffer | string,
fileName: string,
metadata?: Record<string, unknown>
): Promise<UploadResult>;
/**
* Download a livery image
*/
download(imageUrl: string): Promise<Buffer>;
/**
* Delete a livery image
*/
delete(imageUrl: string): Promise<void>;
/**
* Generate a signed URL for temporary access
*/
generateSignedUrl(imageUrl: string, expiresInSeconds: number): Promise<string>;
}

View File

@@ -0,0 +1,48 @@
/**
* Application Port: IPaymentGateway
*
* Defines interface for payment processing.
* Infrastructure will provide mock or real implementation.
*/
import type { Money } from '../../domain/value-objects/Money';
export interface PaymentResult {
success: boolean;
transactionId?: string;
error?: string;
timestamp: Date;
}
export interface RefundResult {
success: boolean;
refundId?: string;
error?: string;
timestamp: Date;
}
export interface IPaymentGateway {
/**
* Process a payment
*/
processPayment(
amount: Money,
payerId: string,
description: string,
metadata?: Record<string, unknown>
): Promise<PaymentResult>;
/**
* Refund a payment
*/
refund(
originalTransactionId: string,
amount: Money,
reason: string
): Promise<RefundResult>;
/**
* Verify payment status
*/
verifyPayment(transactionId: string): Promise<PaymentResult>;
}