39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
import { Result } from '@/lib/contracts/Result';
|
|
import type { DomainError, Service } from '@/lib/contracts/services/Service';
|
|
import type { GetLiveriesOutputDTO } from '@/lib/types/tbd/GetLiveriesOutputDTO';
|
|
|
|
/**
|
|
* Livery Service
|
|
*
|
|
* Provides livery management functionality.
|
|
*/
|
|
export class LiveryService implements Service {
|
|
async getLiveries(_: string): Promise<Result<GetLiveriesOutputDTO, DomainError>> {
|
|
// Mock data for now
|
|
const mockLiveries: GetLiveriesOutputDTO = {
|
|
liveries: [
|
|
{
|
|
id: 'livery-1',
|
|
name: 'Default Livery',
|
|
imageUrl: '/mock-livery-1.png',
|
|
createdAt: new Date().toISOString(),
|
|
isActive: true,
|
|
},
|
|
{
|
|
id: 'livery-2',
|
|
name: 'Custom Livery',
|
|
imageUrl: '/mock-livery-2.png',
|
|
createdAt: new Date(Date.now() - 86400000).toISOString(),
|
|
isActive: false,
|
|
},
|
|
],
|
|
};
|
|
return Result.ok(mockLiveries);
|
|
}
|
|
|
|
async uploadLivery(__: string, ___: File): Promise<Result<{ liveryId: string }, DomainError>> {
|
|
// Mock implementation
|
|
return Result.ok({ liveryId: 'new-livery-id' });
|
|
}
|
|
}
|