document-exchange
Complete guide to building document exchange pages. A document exchange page lets users upload, download, and manage documents organized into collapsible request groups. Use when building, modifying, or debugging any document exchange page, document upload/download feature, or dokumente page in the finstreet context.
What this skill does
# Document Exchange — Complete Guide
A document exchange page lets users manage documents organized into collapsible request groups. Each group contains document request cards that support upload, download, and delete. The feature is split by portal (FSP vs PM), but shares common actions, a sorting hook, a zustand store, and backend models.
## Architecture
```
Page (server) → Header (client) + PageContent (client)
↓
RequestGroup (client) × N
↓
RequestDisplay (client) × N per group
↓
DocumentRequest (from @finstreet/ui)
```
## Directory Structure
Shared files live in `common/` and at the feature root. Portal-specific components live in `fsp/` or `pm/`.
```
src/features/documentExchange/
├── store.ts ← zustand toggle for "hide completed"
├── useSortRequestsByRequestGroup.ts ← sorts requests into 4 groups
├── common/
│ ├── actions/
│ │ ├── documentExchangeUploadAction.ts
│ │ ├── documentExchangeDownloadDocumentAction.ts
│ │ ├── documentExchangeDeleteDocumentAction.ts
│ │ └── documentExchangeRefetchAction.ts
│ └── components/
│ └── DocumentExchangeLoading.tsx
└── {portal}/ ← fsp or pm
└── components/
├── DocumentExchangePageContent.tsx
├── DocumentExchangeRequestGroup.tsx
└── DocumentExchangeRequestDisplay.tsx
```
## File Creation Order
When creating a document exchange for a new product/portal:
1. **Backend** (schema + server) — if a new endpoint is needed
2. **Common actions** — adjust revalidation paths for the new product route
3. **Store** — already shared, no changes needed
4. **Sorting hook** — already shared, no changes needed unless request groups differ
5. **Components** — DocumentExchangeRequestDisplay → RequestGroup → PageContent
6. **Page** — the route page.tsx
7. **Loading** — the loading.tsx skeleton
## Portal Differences
| Feature | FSP | PM |
|---------|-----|-----|
| Message modal | Yes (DocumentRelatedMessageModal) | No |
| DocumentTags | Yes | No |
| sendMessage callback | Yes | No |
| Progress text color | `text.dark` | `text.light` |
| Header wraps | FspFinancingCaseOverviewSubPageHeader | PropertyManagementCaseDetailsPageSubHeader |
Both portals share: common actions, store, sorting hook, loading component, and backend.
## Step-by-Step Reference
- For the **3 core components** (PageContent, RequestGroup, RequestDisplay), see [components.md](components.md)
- For the **common actions** (upload, download, delete, refetch), see [actions.md](actions.md)
- For **shared utilities** (store, sorting hook, loading, backend), see [shared.md](shared.md)
## Rules
1. All 3 components are `"use client"` — they use hooks (state, translations, zustand store)
2. The `DocumentRequest` component from `@finstreet/ui` handles the actual upload/download UI
3. Actions are shared in `common/actions/` — only adjust `revalidatePath` routes for new products
4. The store, sorting hook, and loading component are fully shared — do not duplicate
5. The page is a server component that fetches data via `getRequestsWithDocuments`
6. Translation namespace is `documentExchange` for all components
7. Use `useTranslations` from `next-intl` (not `useExtracted`)
8. Use arrow function exports (`export const`) for components
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.