wip
This commit is contained in:
46
packages/racing/application/ports/ILiveryCompositor.ts
Normal file
46
packages/racing/application/ports/ILiveryCompositor.ts
Normal 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[];
|
||||
}>;
|
||||
}
|
||||
39
packages/racing/application/ports/ILiveryStorage.ts
Normal file
39
packages/racing/application/ports/ILiveryStorage.ts
Normal 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>;
|
||||
}
|
||||
48
packages/racing/application/ports/IPaymentGateway.ts
Normal file
48
packages/racing/application/ports/IPaymentGateway.ts
Normal 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>;
|
||||
}
|
||||
Reference in New Issue
Block a user