Rebuild as InnungsApp project: replace stadtwerke analysis with full documentation
- PRD: vollständige Produktspezifikation (5 Module, Scope, Akzeptanzkriterien) - ARCHITECTURE: Tech Stack, Ordnerstruktur, Multi-Tenancy, Push, Kosten - DATABASE_SCHEMA: Vollständiges SQL-Schema mit RLS Policies und Views - USER_STORIES: 40+ Stories nach Rolle (Admin, Mitglied, Azubi, Obermeister) - PERSONAS: 5 detaillierte Nutzerprofile mit Alltag, Zitaten und Erwartungen - BUSINESS_MODEL: Preistabellen, Unit Economics, Revenue-Projektionen, Distribution - ROADMAP: 6 Phasen, Sprint-Planung, Meilensteine und KPIs - COMPETITIVE_ANALYSIS: Wettbewerbsmatrix, USPs, Preispositionierung - API_DESIGN: Supabase Query Patterns, Edge Functions, Realtime Subscriptions - ONBOARDING_FLOWS: 7 User Flows von Setup bis Fehlerfall - GTM_STRATEGY: 3-Phasen-Vertrieb, Outreach-Sequenz, Einwandbehandlung - AZUBI_MODULE: Video-Feed, 1-Click-Apply, Chat, Berichtsheft, Quiz - DSGVO_KONZEPT: Rechtsgrundlagen, TOMs, AVV, Minderjährige, Incident Response - FEATURES_BACKLOG: 72 Features nach MoSCoW + Technische Schulden Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
21
innungsapp/apps/mobile/hooks/useAuth.ts
Normal file
21
innungsapp/apps/mobile/hooks/useAuth.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { useAuthStore } from '@/store/auth.store'
|
||||
import { useRouter } from 'expo-router'
|
||||
|
||||
export function useAuth() {
|
||||
const { session, orgId, role, signOut } = useAuthStore()
|
||||
const router = useRouter()
|
||||
|
||||
async function handleSignOut() {
|
||||
await signOut()
|
||||
router.replace('/(auth)/login')
|
||||
}
|
||||
|
||||
return {
|
||||
session,
|
||||
orgId,
|
||||
role,
|
||||
isAuthenticated: !!session,
|
||||
isAdmin: role === 'admin',
|
||||
signOut: handleSignOut,
|
||||
}
|
||||
}
|
||||
19
innungsapp/apps/mobile/hooks/useMembers.ts
Normal file
19
innungsapp/apps/mobile/hooks/useMembers.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { trpc } from '@/lib/trpc'
|
||||
import { useMembersFilterStore } from '@/store/members.store'
|
||||
|
||||
export function useMembersList() {
|
||||
const search = useMembersFilterStore((s) => s.search)
|
||||
const nurAusbildungsbetriebe = useMembersFilterStore(
|
||||
(s) => s.nurAusbildungsbetriebe
|
||||
)
|
||||
|
||||
return trpc.members.list.useQuery({
|
||||
search: search || undefined,
|
||||
ausbildungsbetrieb: nurAusbildungsbetriebe || undefined,
|
||||
status: 'aktiv',
|
||||
})
|
||||
}
|
||||
|
||||
export function useMemberDetail(id: string) {
|
||||
return trpc.members.byId.useQuery({ id })
|
||||
}
|
||||
22
innungsapp/apps/mobile/hooks/useNews.ts
Normal file
22
innungsapp/apps/mobile/hooks/useNews.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { trpc } from '@/lib/trpc'
|
||||
import { useNewsReadStore } from '@/store/news.store'
|
||||
|
||||
export function useNewsList(kategorie?: string) {
|
||||
return trpc.news.list.useQuery({
|
||||
kategorie: kategorie as never,
|
||||
})
|
||||
}
|
||||
|
||||
export function useNewsDetail(id: string) {
|
||||
const markRead = useNewsReadStore((s) => s.markRead)
|
||||
const markReadMutation = trpc.news.markRead.useMutation()
|
||||
|
||||
const query = trpc.news.byId.useQuery({ id })
|
||||
|
||||
function onOpen() {
|
||||
markRead(id)
|
||||
markReadMutation.mutate({ newsId: id })
|
||||
}
|
||||
|
||||
return { ...query, onOpen }
|
||||
}
|
||||
12
innungsapp/apps/mobile/hooks/useStellen.ts
Normal file
12
innungsapp/apps/mobile/hooks/useStellen.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { trpc } from '@/lib/trpc'
|
||||
|
||||
export function useStellenListe(opts?: { sparte?: string; lehrjahr?: string }) {
|
||||
return trpc.stellen.listPublic.useQuery({
|
||||
sparte: opts?.sparte,
|
||||
lehrjahr: opts?.lehrjahr,
|
||||
})
|
||||
}
|
||||
|
||||
export function useStelleDetail(id: string) {
|
||||
return trpc.stellen.byId.useQuery({ id })
|
||||
}
|
||||
19
innungsapp/apps/mobile/hooks/useTermine.ts
Normal file
19
innungsapp/apps/mobile/hooks/useTermine.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { trpc } from '@/lib/trpc'
|
||||
|
||||
export function useTermineListe(upcoming = true) {
|
||||
return trpc.termine.list.useQuery({ upcoming })
|
||||
}
|
||||
|
||||
export function useTerminDetail(id: string) {
|
||||
return trpc.termine.byId.useQuery({ id })
|
||||
}
|
||||
|
||||
export function useToggleAnmeldung() {
|
||||
const utils = trpc.useUtils()
|
||||
return trpc.termine.toggleAnmeldung.useMutation({
|
||||
onSuccess: () => {
|
||||
utils.termine.list.invalidate()
|
||||
utils.termine.byId.invalidate()
|
||||
},
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user