# Cross Boundary Dependencies & Backend Architecture Specification (Phase A) ## Overview This specification details the database models and backend controller endpoints required to support all 10 cross-boundary feature domains across the Canina Pharma platform. ## 10 Feature Domains 1. **SEO Settings**: Global & category-level search engine metadata management (`/api/settings/seo`). 2. **Banners**: Dynamic promotion banners and hero sliders (`/api/banners`). 3. **Smart Advisor**: Rule-based veterinary product recommendation engine (`/api/smart-advisor/rules`). 4. **Testimonials**: Verified customer and veterinary doctor testimonials (`/api/testimonials`). 5. **Ingredients**: Scientific active ingredient glossary and properties (`/api/ingredients`). 6. **Product Dosage**: Dynamic weight-based dosage configuration for medical products (`/api/products/:id/dosage-config`). 7. **Financial Settings**: Platform tax rates, shipping rates, and charity contribution percentages (`/api/settings/financial`). 8. **System Settings**: System operational flags, maintenance modes, and feature toggles (`/api/settings/system`). 9. **Prescriptions**: Veterinary prescription upload, verification, and approval workflow (`/api/prescriptions`). 10. **B2B Logic**: Wholesale partner registration, credit limits, and bulk inquiries (`/api/b2b`). ## Schema Additions - **`Setting`**: Stores category-based (`seo`, `financial`, `system`) key-value dynamic configurations. - **`Banner`**: Hero and section promotion banners with custom display ordering. - **`SmartAdvisorRule`**: Condition and pet type matching rules linking to recommended products. - **`Testimonial`**: Customer & vet testimonials with rating and ordering. - **`Ingredient`**: Farsi/English ingredient details, scientific names, and benefits list. - **`Prescription`**: User & pet prescription attachments with verification status. - **`B2BInquiry`**: Commercial partner inquiries with business metadata. - **`PartnerAccount`**: Credit limits and wholesale tiers for approved B2B clients. - **`Product.dosageConfig`**: JSON field holding dynamic calculation parameters per product.