refractor code,

This commit is contained in:
root
2026-05-21 12:35:49 -04:00
parent e74681e810
commit f009ca10c6
158 changed files with 215801 additions and 5884 deletions
@@ -0,0 +1,20 @@
import { describe, it, expect } from 'vitest'
import { serializeReservationForDashboard } from './reservation.presenter'
describe('serializeReservationForDashboard', () => {
it('rewrites customer license image URLs to the protected route', () => {
const result = serializeReservationForDashboard({
id: 'reservation-1',
status: 'CONFIRMED',
contractNumber: null,
invoiceNumber: null,
extras: {},
customer: {
id: 'customer-1',
licenseImageUrl: 'http://localhost:4000/storage/companies/company-1/customers/customer-1/license.jpg',
},
})
expect(result.customer?.licenseImageUrl).toBe('http://localhost:3001/dashboard/api/v1/customers/customer-1/license-image')
})
})