(id: string, update: Partial<FleetUnit>)
| 305 | } |
| 306 | |
| 307 | updateUnit(id: string, update: Partial<FleetUnit>): FleetUnit | undefined { |
| 308 | const index = this.fleet.findIndex((u) => u.id === id); |
| 309 | if (index !== -1) { |
| 310 | this.fleet[index] = { ...this.fleet[index], ...update }; |
| 311 | return this.fleet[index]; |
| 312 | } |
| 313 | return undefined; |
| 314 | } |
| 315 | } |
| 316 | |
| 317 | export const fleetDb = new FleetDatabaseService(); |