refactor: rename share URL path from location to bills-due

- Renamed directory: app/[locale]/share/location -> app/[locale]/share/bills-due
- Updated all URL references in web-app (billActions, locationActions, ViewBillCard)
- Updated all URL references in email-worker templates (4 email templates)
- Updated documentation in sprints/email-worker.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Knee Cola
2025-12-31 11:27:50 +01:00
parent d7abd99448
commit 1e83172491
11 changed files with 16 additions and 15 deletions

View File

@@ -0,0 +1,47 @@
import { ViewLocationCard } from '@/app/ui/ViewLocationCard';
import { fetchLocationById, setSeenByTenantAt, validateShareAccess } from '@/app/lib/actions/locationActions';
import { getUserSettingsByUserId } from '@/app/lib/actions/userSettingsActions';
import { notFound } from 'next/navigation';
import { myAuth } from '@/app/lib/auth';
export default async function LocationViewPage({ shareId }: { shareId: string }) {
// Validate share access (checks checksum + TTL, extracts locationId)
const accessValidation = await validateShareAccess(shareId);
if (!accessValidation.valid || !accessValidation.locationId) {
return (
<div className="alert alert-error">
<p>{accessValidation.error || 'This content is no longer shared'}</p>
</div>
);
}
const locationId = accessValidation.locationId;
// Fetch location
const location = await fetchLocationById(locationId);
if (!location) {
return notFound();
}
// Fetch user settings for the location owner
const userSettings = await getUserSettingsByUserId(location.userId);
// Check if the page was accessed by an authenticated user who is the owner
const session = await myAuth();
const isOwner = session?.user?.id === location.userId;
// If the page is not visited by the owner, mark it as seen by tenant
if (!isOwner) {
await setSeenByTenantAt(locationId);
}
return (
<ViewLocationCard
location={location}
userSettings={userSettings}
shareId={shareId}
/>
);
}

View File

@@ -0,0 +1,14 @@
import { Suspense } from 'react';
import LocationViewPage from './LocationViewPage';
import { Main } from '@/app/ui/Main';
import { LocationEditFormSkeleton } from '@/app/ui/LocationEditForm';
export default async function Page({ params: { id } }: { params: { id: string } }) {
return (
<Main>
<Suspense fallback={<LocationEditFormSkeleton />}>
<LocationViewPage shareId={id} />
</Suspense>
</Main>
);
}