feat(boc): Complete Business Operations Center v1.0

- Go backend API with full CRUD for all modules (CRM, Sales, Finance, HR, Legal, Marketing, Support, Purchase, Inventory, Projects, Automation, Analytics)
- Rust analytics service with parallel report generation
- C runtime with POSIX shared memory IPC
- PostgreSQL schema with 30+ tables, full migrations
- Redis cache, sessions, pub/sub
- Kafka event streaming with Zookeeper
- WebSocket hub for real-time updates
- Automation engine with cron jobs, workflows, event triggers
- JWT authentication, multi-tenant from start
- Docker Compose with all services
- Nginx reverse proxy with rate limiting
- Integration tests passing
- Feature gap analysis against Fortnox/Odoo/Visma

Refs: BOC-001
This commit is contained in:
Bernt
2026-07-12 12:41:35 +00:00
parent 4789a7fb48
commit 58ca4e68db
26666 changed files with 575891 additions and 2074516 deletions
@@ -0,0 +1 @@
import{u as N,aP as w,r as c,j as e,x,y as h,I as b,v as p,L as C,w as v,z as f}from"./index-oAPVDf-r.js";import{Q as k}from"./qr-code-BIBWO21n.js";import{C as y}from"./circle-check-D3hjqUcb.js";import{C as _}from"./circle-alert-C1Hs9zwh.js";function D(){var i,u;N();const[g]=w(),[a,l]=c.useState(g.get("code")??""),[n,o]=c.useState(!1),[r,t]=c.useState(null),d=async()=>{if(!a.trim()){v.error("Ange kupongkod");return}o(!0),t(null);try{const{data:s,error:j}=await f.from("vouchers").select("id, title, orderer_brand, user_id, status, expires_at").eq("code",a.trim().toLowerCase()).single();if(j||!s){t({success:!1,error:"Kupong hittades inte"});return}if(s.status==="redeemed"){t({success:!1,error:"Kupongen är redan inlöst"});return}if(s.status==="expired"||new Date(s.expires_at)<new Date){t({success:!1,error:"Kupongen har gått ut"});return}const{error:m}=await f.from("vouchers").update({status:"redeemed",redeemed_at:new Date().toISOString()}).eq("id",s.id);if(m)throw m;t({success:!0,voucher:{title:s.title,brand:s.orderer_brand??"",user_id:s.user_id}})}catch(s){t({success:!1,error:s.message})}finally{o(!1)}};return e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:e.jsxs("div",{className:"w-full max-w-sm space-y-4",children:[e.jsxs("div",{className:"text-center",children:[e.jsx(k,{className:"w-12 h-12 text-primary mx-auto mb-2"}),e.jsx("h1",{className:"text-2xl font-bold",children:"Lös in kupong"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Ange kupongkoden eller scanna QR"})]}),!r&&e.jsx(x,{children:e.jsxs(h,{className:"pt-6 space-y-4",children:[e.jsx(b,{value:a,onChange:s=>l(s.target.value),placeholder:"Kupongkod (t.ex. a3f2b9c1d4e5)",className:"font-mono",onKeyDown:s=>s.key==="Enter"&&d()}),e.jsxs(p,{onClick:d,disabled:n,className:"w-full",children:[n?e.jsx(C,{className:"w-4 h-4 mr-2 animate-spin"}):null,n?"Verifierar...":"Lös in"]})]})}),r&&e.jsx(x,{className:r.success?"border-green-500/50 bg-green-500/10":"border-red-500/50 bg-red-500/10",children:e.jsxs(h,{className:"pt-6 text-center space-y-3",children:[r.success?e.jsx(y,{className:"w-16 h-16 text-green-500 mx-auto"}):e.jsx(_,{className:"w-12 h-12 text-red-500 mx-auto"}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-semibold text-lg",children:r.success?"Inlöst!":"Fel"}),r.success?e.jsxs("p",{className:"text-sm text-muted-foreground",children:[(i=r.voucher)==null?void 0:i.title," — ",(u=r.voucher)==null?void 0:u.brand]}):e.jsx("p",{className:"text-sm text-red-600",children:r.error})]}),e.jsx(p,{onClick:()=>{t(null),l("")},variant:"outline",className:"w-full",children:r.success?"Nästa kupong":"Försök igen"})]})})]})})}export{D as default};