website refactor
This commit is contained in:
@@ -1,17 +1,38 @@
|
||||
import { Result } from '@/lib/contracts/Result';
|
||||
import type { Service } from '@/lib/contracts/services/Service';
|
||||
import type { GetLiveriesOutputDTO } from '@/lib/types/tbd/GetLiveriesOutputDTO';
|
||||
|
||||
/**
|
||||
* Livery Service
|
||||
*
|
||||
* Currently not implemented - returns NotImplemented errors for all endpoints.
|
||||
*
|
||||
* Provides livery management functionality.
|
||||
*/
|
||||
export class LiveryService implements Service {
|
||||
async getLiveries(): Promise<Result<void, 'NOT_IMPLEMENTED'>> {
|
||||
return Result.err('NOT_IMPLEMENTED');
|
||||
async getLiveries(driverId: string): Promise<Result<GetLiveriesOutputDTO, string>> {
|
||||
// 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(): Promise<Result<void, 'NOT_IMPLEMENTED'>> {
|
||||
return Result.err('NOT_IMPLEMENTED');
|
||||
async uploadLivery(driverId: string, file: File): Promise<Result<{ liveryId: string }, string>> {
|
||||
// Mock implementation
|
||||
return Result.ok({ liveryId: 'new-livery-id' });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user