feat(api): yacht detail, patch, archive, transfer, history, autocomplete
This commit is contained in:
@@ -318,6 +318,17 @@ export async function listYachtsForOwner(
|
||||
});
|
||||
}
|
||||
|
||||
// ─── Ownership history ────────────────────────────────────────────────────────
|
||||
|
||||
export async function listOwnershipHistory(yachtId: string, portId: string) {
|
||||
// First scope-check the yacht (throws NotFoundError if cross-tenant)
|
||||
await getYachtById(yachtId, portId);
|
||||
return await db.query.yachtOwnershipHistory.findMany({
|
||||
where: eq(yachtOwnershipHistory.yachtId, yachtId),
|
||||
orderBy: (t, { desc }) => [desc(t.startDate)],
|
||||
});
|
||||
}
|
||||
|
||||
// ─── Autocomplete ─────────────────────────────────────────────────────────────
|
||||
|
||||
export async function autocomplete(portId: string, q: string) {
|
||||
|
||||
Reference in New Issue
Block a user