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
+250
View File
@@ -0,0 +1,250 @@
<!DOCTYPE html>
<html lang="sv">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Betalning — quiXzoom Field Gear</title>
<script src="https://js.stripe.com/v3/"></script>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: #0A0A1B;
color: #fff;
min-height: 100vh;
}
.header {
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
padding: 1rem;
border-bottom: 1px solid rgba(255,255,255,0.1);
}
.header a {
color: #6366f1;
text-decoration: none;
}
.container {
max-width: 500px;
margin: 0 auto;
padding: 1rem;
}
.order-summary {
background: rgba(255,255,255,0.03);
border: 1px solid rgba(255,255,255,0.08);
border-radius: 12px;
padding: 1rem;
margin-bottom: 1.5rem;
}
.order-summary h2 {
font-size: 1.1rem;
margin-bottom: 1rem;
}
.order-item {
display: flex;
justify-content: space-between;
padding: 0.5rem 0;
border-bottom: 1px solid rgba(255,255,255,0.05);
}
.order-total {
display: flex;
justify-content: space-between;
padding-top: 1rem;
font-size: 1.2rem;
font-weight: 700;
color: #6366f1;
}
.payment-form {
background: rgba(255,255,255,0.03);
border: 1px solid rgba(255,255,255,0.08);
border-radius: 12px;
padding: 1rem;
}
.payment-form h2 {
font-size: 1.1rem;
margin-bottom: 1rem;
}
#card-element {
background: rgba(255,255,255,0.05);
border: 1px solid rgba(255,255,255,0.1);
border-radius: 8px;
padding: 1rem;
margin-bottom: 1rem;
}
#card-errors {
color: #ef4444;
font-size: 0.85rem;
margin-bottom: 1rem;
min-height: 1.5rem;
}
.pay-btn {
width: 100%;
background: #6366f1;
color: #fff;
border: none;
padding: 1rem;
border-radius: 8px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: background 0.2s;
}
.pay-btn:hover {
background: #4f46e5;
}
.pay-btn:disabled {
background: rgba(255,255,255,0.1);
cursor: not-allowed;
}
.spinner {
display: inline-block;
width: 20px;
height: 20px;
border: 2px solid rgba(255,255,255,0.3);
border-radius: 50%;
border-top-color: #fff;
animation: spin 1s ease-in-out infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
.success {
text-align: center;
padding: 2rem;
}
.success-icon {
font-size: 4rem;
margin-bottom: 1rem;
}
.success h2 {
font-size: 1.5rem;
margin-bottom: 0.5rem;
}
.success p {
color: rgba(255,255,255,0.6);
}
</style>
</head>
<body>
<div class="header">
<a href="/">← Tillbaka till shoppen</a>
</div>
<div class="container">
<div id="checkout-content">
<div class="order-summary">
<h2>Din order</h2>
<div id="order-items"></div>
<div class="order-total">
<span>Totalt</span>
<span id="order-total">0 kr</span>
</div>
</div>
<div class="payment-form">
<h2>Betalningsuppgifter</h2>
<div id="card-element"></div>
<div id="card-errors"></div>
<button class="pay-btn" id="pay-btn" onclick="submitPayment()">
Betala nu
</button>
</div>
</div>
<div id="success-message" class="success" style="display: none;">
<div class="success-icon"></div>
<h2>Betalning genomförd!</h2>
<p>Tack för din beställning. Du får en bekräftelse via e-post.</p>
</div>
</div>
<script>
const urlParams = new URLSearchParams(window.location.search);
const orderId = urlParams.get('order_id');
let stripe, card, clientSecret;
async function init() {
const token = localStorage.getItem('quixzoom_token');
if (!token) {
alert('Logga in först');
window.location.href = '/';
return;
}
// Hämta orderdetaljer
const orderRes = await fetch(`/api/orders/${orderId}`, {
headers: { 'Authorization': `Bearer ${token}` }
});
if (!orderRes.ok) {
alert('Order hittades inte');
window.location.href = '/';
return;
}
const order = await orderRes.json();
// Visa order
const itemsDiv = document.getElementById('order-items');
order.items.forEach(item => {
itemsDiv.innerHTML += `
<div class="order-item">
<span>${item.name} x${item.quantity}</span>
<span>${(item.total/100).toFixed(0)} kr</span>
</div>
`;
});
document.getElementById('order-total').textContent = `${(order.total_amount/100).toFixed(0)} kr`;
// Skapa PaymentIntent
const intentRes = await fetch('/api/payment/create-intent', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ order_id: parseInt(orderId) })
});
const intentData = await intentRes.json();
// Initiera Stripe
stripe = Stripe(intentData.publishable_key);
const elements = stripe.elements();
card = elements.create('card', {
style: {
base: {
color: '#fff',
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
fontSize: '16px',
'::placeholder': { color: 'rgba(255,255,255,0.4)' }
}
}
});
card.mount('#card-element');
card.on('change', (event) => {
document.getElementById('card-errors').textContent = event.error ? event.error.message : '';
});
clientSecret = intentData.client_secret;
}
async function submitPayment() {
const btn = document.getElementById('pay-btn');
btn.disabled = true;
btn.innerHTML = '<span class="spinner"></span> Bearbetar...';
const { error, paymentIntent } = await stripe.confirmCardPayment(clientSecret, {
payment_method: { card: card }
});
if (error) {
document.getElementById('card-errors').textContent = error.message;
btn.disabled = false;
btn.textContent = 'Betala nu';
} else if (paymentIntent.status === 'succeeded') {
document.getElementById('checkout-content').style.display = 'none';
document.getElementById('success-message').style.display = 'block';
}
}
init();
</script>
</body>
</html>
+192
View File
@@ -0,0 +1,192 @@
<!DOCTYPE html>
<html lang="sv">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ product.name }} — quiXzoom Field Gear</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: #0A0A1B;
color: #fff;
min-height: 100vh;
}
.header {
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
padding: 1rem;
border-bottom: 1px solid rgba(255,255,255,0.1);
}
.header a {
color: #6366f1;
text-decoration: none;
}
.container {
max-width: 800px;
margin: 0 auto;
padding: 1rem;
}
.product-detail {
background: rgba(255,255,255,0.03);
border: 1px solid rgba(255,255,255,0.08);
border-radius: 16px;
overflow: hidden;
}
.product-image {
width: 100%;
height: 300px;
background: linear-gradient(135deg, #1a1a2e, #16213e);
display: flex;
align-items: center;
justify-content: center;
font-size: 6rem;
}
.product-info {
padding: 1.5rem;
}
.product-name {
font-size: 1.5rem;
font-weight: 700;
margin-bottom: 0.5rem;
}
.product-desc {
color: rgba(255,255,255,0.6);
margin-bottom: 1rem;
line-height: 1.5;
}
.product-price {
font-size: 2rem;
font-weight: 700;
color: #6366f1;
margin-bottom: 1rem;
}
.options {
margin-bottom: 1.5rem;
}
.option-label {
font-weight: 600;
margin-bottom: 0.5rem;
display: block;
}
.option-buttons {
display: flex;
gap: 0.5rem;
flex-wrap: wrap;
}
.option-btn {
background: rgba(255,255,255,0.05);
border: 1px solid rgba(255,255,255,0.2);
color: #fff;
padding: 0.5rem 1rem;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s;
}
.option-btn:hover, .option-btn.selected {
background: #6366f1;
border-color: #6366f1;
}
.add-to-cart {
width: 100%;
background: #6366f1;
color: #fff;
border: none;
padding: 1rem;
border-radius: 12px;
font-size: 1.1rem;
font-weight: 600;
cursor: pointer;
transition: background 0.2s;
}
.add-to-cart:hover {
background: #4f46e5;
}
.add-to-cart:disabled {
background: rgba(255,255,255,0.1);
cursor: not-allowed;
}
.stock-info {
margin-top: 0.5rem;
font-size: 0.85rem;
color: rgba(255,255,255,0.5);
}
</style>
</head>
<body>
<div class="header">
<a href="/">← Tillbaka till shoppen</a>
</div>
<div class="container">
<div class="product-detail">
<div class="product-image">🎯</div>
<div class="product-info">
<h1 class="product-name">{{ product.name }}</h1>
<p class="product-desc">{{ product.description }}</p>
<div class="product-price">{{ "%.0f"|format(product.price_sek/100) }} kr</div>
{% if product.sizes and product.sizes|length > 0 %}
<div class="options">
<label class="option-label">Storlek</label>
<div class="option-buttons" id="size-options">
{% for size in product.sizes %}
<button class="option-btn" onclick="selectSize('{{ size }}')">{{ size }}</button>
{% endfor %}
</div>
</div>
{% endif %}
{% if product.colors and product.colors|length > 0 %}
<div class="options">
<label class="option-label">Färg</label>
<div class="option-buttons" id="color-options">
{% for color in product.colors %}
<button class="option-btn" onclick="selectColor('{{ color }}')">{{ color }}</button>
{% endfor %}
</div>
</div>
{% endif %}
<button class="add-to-cart" id="add-btn" onclick="addToCart()">
Lägg i kundvagn
</button>
<div class="stock-info">
{% if product.stock_quantity > 0 %}
{{ product.stock_quantity }} i lager
{% else %}
Slut i lager
{% endif %}
</div>
</div>
</div>
</div>
<script>
let selectedSize = null;
let selectedColor = null;
function selectSize(size) {
selectedSize = size;
document.querySelectorAll('#size-options .option-btn').forEach(btn => {
btn.classList.toggle('selected', btn.textContent === size);
});
}
function selectColor(color) {
selectedColor = color;
document.querySelectorAll('#color-options .option-btn').forEach(btn => {
btn.classList.toggle('selected', btn.textContent === color);
});
}
function addToCart() {
const token = localStorage.getItem('quixzoom_token');
if (!token) {
alert('Logga in först');
return;
}
alert('Tillagd i kundvagnen!');
}
</script>
</body>
</html>
+458
View File
@@ -0,0 +1,458 @@
<!DOCTYPE html>
<html lang="sv">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>quiXzoom Field Gear Collection</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: #0A0A1B;
color: #fff;
min-height: 100vh;
}
.header {
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
padding: 2rem 1rem;
text-align: center;
border-bottom: 1px solid rgba(255,255,255,0.1);
}
.header h1 {
font-size: 1.8rem;
margin-bottom: 0.5rem;
background: linear-gradient(135deg, #6366f1, #8b5cf6);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.header p {
color: rgba(255,255,255,0.6);
font-size: 0.9rem;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 1rem;
}
.eligibility-banner {
background: rgba(99, 102, 241, 0.1);
border: 1px solid rgba(99, 102, 241, 0.3);
border-radius: 12px;
padding: 1rem;
margin: 1rem 0;
text-align: center;
}
.eligibility-banner.locked {
background: rgba(239, 68, 68, 0.1);
border-color: rgba(239, 68, 68, 0.3);
}
.eligibility-banner.unlocked {
background: rgba(34, 197, 94, 0.1);
border-color: rgba(34, 197, 94, 0.3);
}
.category-filter {
display: flex;
gap: 0.5rem;
overflow-x: auto;
padding: 1rem 0;
margin-bottom: 1rem;
}
.category-btn {
background: rgba(255,255,255,0.05);
border: 1px solid rgba(255,255,255,0.1);
color: #fff;
padding: 0.5rem 1rem;
border-radius: 20px;
cursor: pointer;
white-space: nowrap;
transition: all 0.2s;
}
.category-btn:hover, .category-btn.active {
background: #6366f1;
border-color: #6366f1;
}
.products-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: 1.5rem;
}
.product-card {
background: rgba(255,255,255,0.03);
border: 1px solid rgba(255,255,255,0.08);
border-radius: 16px;
overflow: hidden;
transition: transform 0.2s, box-shadow 0.2s;
}
.product-card:hover {
transform: translateY(-4px);
box-shadow: 0 8px 32px rgba(99, 102, 241, 0.15);
}
.product-image {
width: 100%;
height: 200px;
background: linear-gradient(135deg, #1a1a2e, #16213e);
display: flex;
align-items: center;
justify-content: center;
font-size: 4rem;
}
.product-info {
padding: 1rem;
}
.product-name {
font-size: 1.1rem;
font-weight: 600;
margin-bottom: 0.25rem;
}
.product-desc {
color: rgba(255,255,255,0.5);
font-size: 0.85rem;
margin-bottom: 0.75rem;
}
.product-meta {
display: flex;
justify-content: space-between;
align-items: center;
}
.product-price {
font-size: 1.25rem;
font-weight: 700;
color: #6366f1;
}
.product-btn {
background: #6366f1;
color: #fff;
border: none;
padding: 0.5rem 1rem;
border-radius: 8px;
cursor: pointer;
font-weight: 500;
transition: background 0.2s;
}
.product-btn:hover {
background: #4f46e5;
}
.product-btn:disabled {
background: rgba(255,255,255,0.1);
cursor: not-allowed;
}
.stock-low {
color: #f59e0b;
font-size: 0.75rem;
}
.stock-out {
color: #ef4444;
font-size: 0.75rem;
}
.cart-icon {
position: absolute;
top: 1rem;
right: 1rem;
font-size: 1.5rem;
cursor: pointer;
background: rgba(255,255,255,0.1);
padding: 0.5rem 1rem;
border-radius: 8px;
}
.tier-badge {
margin-top: 0.5rem;
padding: 0.25rem 0.75rem;
border-radius: 20px;
font-size: 0.8rem;
font-weight: 600;
display: inline-block;
}
.tier-contributor {
background: rgba(255,255,255,0.1);
color: rgba(255,255,255,0.6);
}
.tier-field {
background: rgba(99, 102, 241, 0.2);
color: #6366f1;
}
.tier-verified {
background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
color: #8b5cf6;
border: 1px solid rgba(139, 92, 246, 0.3);
}
.cart-modal {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0,0,0,0.8);
z-index: 100;
justify-content: center;
align-items: center;
}
.cart-content {
background: #1a1a2e;
border-radius: 16px;
padding: 1.5rem;
max-width: 400px;
width: 90%;
max-height: 80vh;
overflow-y: auto;
}
.cart-item {
display: flex;
justify-content: space-between;
padding: 0.75rem 0;
border-bottom: 1px solid rgba(255,255,255,0.1);
}
.checkout-btn {
width: 100%;
background: #6366f1;
color: #fff;
border: none;
padding: 1rem;
border-radius: 8px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
margin-top: 1rem;
}
@media (max-width: 640px) {
.products-grid {
grid-template-columns: repeat(2, 1fr);
gap: 1rem;
}
.header h1 { font-size: 1.4rem; }
}
</style>
</head>
<body>
<div class="header">
<h1>quiXzoom Field Gear</h1>
<p>Professionell utrustning för professionella Zoomers</p>
<div class="cart-icon" onclick="showCart()">
🛒 <span id="cart-count">0</span>
</div>
<div class="tier-badge" id="tier-badge"></div>
</div>
<div class="container">
<div id="eligibility-banner" class="eligibility-banner">
<span id="eligibility-text">Kontrollerar din Zoomer-status...</span>
</div>
<div class="category-filter">
<button class="category-btn active" onclick="filterCategory('all')">Alla</button>
{% for cat in categories %}
<button class="category-btn" onclick="filterCategory('{{ cat }}')">{{ cat|capitalize }}</button>
{% endfor %}
</div>
<div class="products-grid" id="products-grid">
{% for product in products %}
<div class="product-card" data-category="{{ product.category }}">
<div class="product-image">🎯</div>
<div class="product-info">
<div class="product-name">{{ product.name }}</div>
<div class="product-desc">{{ product.description }}</div>
<div class="product-meta">
<span class="product-price">{{ "%.0f"|format(product.price_sek/100) }} kr</span>
{% if product.stock_quantity > 0 %}
<button class="product-btn" onclick="addToCart({{ product.id }})" data-product="{{ product.id }}">
Lägg till
</button>
{% else %}
<span class="stock-out">Slut i lager</span>
{% endif %}
</div>
{% if product.stock_quantity > 0 and product.stock_quantity < 10 %}
<div class="stock-low">Endast {{ product.stock_quantity }} kvar</div>
{% endif %}
</div>
</div>
{% endfor %}
</div>
</div>
<div class="cart-modal" id="cart-modal" onclick="hideCart(event)">
<div class="cart-content" onclick="event.stopPropagation()">
<h2>Kundvagn</h2>
<div id="cart-items"></div>
<div id="cart-total" style="text-align: right; font-size: 1.2rem; font-weight: 700; margin-top: 1rem;"></div>
<button class="checkout-btn" onclick="checkout()">Gå till kassan</button>
</div>
</div>
<script>
let userEligible = false;
let cart = JSON.parse(localStorage.getItem('cart') || '[]');
async function checkEligibility() {
const token = localStorage.getItem('quixzoom_token');
if (!token) {
showLocked('Logga in för att se shoppen');
return;
}
try {
const res = await fetch('/api/tier', {
headers: { 'Authorization': `Bearer ${token}` }
});
const data = await res.json();
userEligible = data.completed_missions >= 10;
// Update tier badge
const badge = document.getElementById('tier-badge');
if (data.tier === 'verified_field_contributor') {
badge.textContent = '⭐ Verified Field Contributor';
badge.className = 'tier-badge tier-verified';
showUnlocked(`✅ Verified Field Contributor — ${data.completed_missions} uppdrag @ ${(data.approval_rate*100).toFixed(0)}% godkänt`);
} else if (data.tier === 'field_contributor') {
badge.textContent = '🎯 Field Contributor';
badge.className = 'tier-badge tier-field';
showUnlocked(`✅ Field Contributor — ${data.completed_missions} uppdrag`);
} else {
badge.textContent = '👤 Contributor';
badge.className = 'tier-badge tier-contributor';
showLocked(`🔒 ${10 - data.completed_missions} uppdrag kvar till Field Contributor`);
}
} catch (e) {
showLocked('Kunde inte verifiera din status');
}
}
function showLocked(msg) {
const banner = document.getElementById('eligibility-banner');
banner.className = 'eligibility-banner locked';
document.getElementById('eligibility-text').textContent = msg;
document.querySelectorAll('.product-btn').forEach(btn => btn.disabled = true);
}
function showUnlocked(msg) {
const banner = document.getElementById('eligibility-banner');
banner.className = 'eligibility-banner unlocked';
document.getElementById('eligibility-text').textContent = msg;
document.querySelectorAll('.product-btn').forEach(btn => btn.disabled = false);
}
function filterCategory(cat) {
document.querySelectorAll('.category-btn').forEach(btn => btn.classList.remove('active'));
event.target.classList.add('active');
document.querySelectorAll('.product-card').forEach(card => {
if (cat === 'all' || card.dataset.category === cat) {
card.style.display = 'block';
} else {
card.style.display = 'none';
}
});
}
function addToCart(productId) {
if (!userEligible) return;
const product = products.find(p => p.id === productId);
if (!product) return;
const existing = cart.find(item => item.product_id === productId);
if (existing) {
existing.quantity += 1;
} else {
cart.push({
product_id: productId,
name: product.name,
price: product.price_sek,
quantity: 1
});
}
localStorage.setItem('cart', JSON.stringify(cart));
updateCartCount();
alert('Tillagd i kundvagnen!');
}
function updateCartCount() {
document.getElementById('cart-count').textContent = cart.reduce((sum, item) => sum + item.quantity, 0);
}
function showCart() {
const modal = document.getElementById('cart-modal');
const itemsDiv = document.getElementById('cart-items');
itemsDiv.innerHTML = '';
if (cart.length === 0) {
itemsDiv.innerHTML = '<p style="text-align: center; color: rgba(255,255,255,0.5);">Kundvagnen är tom</p>';
} else {
cart.forEach((item, idx) => {
itemsDiv.innerHTML += `
<div class="cart-item">
<span>${item.name} x${item.quantity}</span>
<span>${(item.price * item.quantity / 100).toFixed(0)} kr</span>
</div>
`;
});
}
const total = cart.reduce((sum, item) => sum + (item.price * item.quantity), 0);
document.getElementById('cart-total').textContent = `Totalt: ${(total/100).toFixed(0)} kr`;
modal.style.display = 'flex';
}
function hideCart(event) {
if (event.target.id === 'cart-modal') {
document.getElementById('cart-modal').style.display = 'none';
}
}
async function checkout() {
if (cart.length === 0) return;
const token = localStorage.getItem('quixzoom_token');
if (!token) {
alert('Logga in först');
return;
}
// Skapa order
const res = await fetch('/api/orders', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
items: cart.map(item => ({
product_id: item.product_id,
quantity: item.quantity
})),
shipping_address: {
name: 'Test',
street: 'Testgatan 1',
city: 'Stockholm',
postal_code: '11122'
}
})
});
if (res.ok) {
const order = await res.json();
cart = [];
localStorage.removeItem('cart');
updateCartCount();
window.location.href = `/checkout?order_id=${order.id}`;
} else {
const err = await res.json();
alert(err.detail || 'Kunde inte skapa order');
}
}
let products = [];
async function loadProducts() {
const res = await fetch('/api/products');
products = await res.json();
}
loadProducts();
checkEligibility();
updateCartCount();
</script>
</body>
</html>
+334
View File
@@ -0,0 +1,334 @@
<!DOCTYPE html>
<html lang="sv">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Verifiera Field Contributor — quiXzoom</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: #0A0A1B;
color: #fff;
min-height: 100vh;
line-height: 1.6;
}
.container {
max-width: 600px;
margin: 0 auto;
padding: 2rem 1rem;
}
.header {
text-align: center;
margin-bottom: 2rem;
}
.logo {
font-size: 2rem;
font-weight: 800;
background: linear-gradient(135deg, #6366f1, #8b5cf6);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
margin-bottom: 0.5rem;
}
.subtitle {
color: rgba(255,255,255,0.5);
font-size: 0.9rem;
}
/* Status-kort */
.status-card {
background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
border: 1px solid rgba(139, 92, 246, 0.3);
border-radius: 16px;
padding: 2rem;
text-align: center;
margin-bottom: 2rem;
}
.status-card.valid {
border-color: rgba(34, 197, 94, 0.5);
background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
}
.status-card.invalid {
border-color: rgba(239, 68, 68, 0.5);
background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
}
.status-icon {
font-size: 4rem;
margin-bottom: 1rem;
}
.status-title {
font-size: 1.5rem;
font-weight: 700;
margin-bottom: 0.5rem;
}
.status-desc {
color: rgba(255,255,255,0.7);
}
/* Contributor-kort */
.contributor-card {
background: rgba(255,255,255,0.03);
border: 1px solid rgba(255,255,255,0.08);
border-radius: 16px;
padding: 1.5rem;
margin-bottom: 1.5rem;
}
.contributor-header {
display: flex;
align-items: center;
gap: 1rem;
margin-bottom: 1.5rem;
padding-bottom: 1rem;
border-bottom: 1px solid rgba(255,255,255,0.08);
}
.avatar {
width: 64px;
height: 64px;
border-radius: 50%;
background: linear-gradient(135deg, #6366f1, #8b5cf6);
display: flex;
align-items: center;
justify-content: center;
font-size: 1.5rem;
font-weight: 700;
}
.contributor-info h2 {
font-size: 1.25rem;
margin-bottom: 0.25rem;
}
.contributor-tier {
display: inline-flex;
align-items: center;
gap: 0.25rem;
padding: 0.25rem 0.75rem;
border-radius: 20px;
font-size: 0.8rem;
font-weight: 600;
}
.tier-verified {
background: rgba(139, 92, 246, 0.2);
color: #8b5cf6;
}
.tier-field {
background: rgba(99, 102, 241, 0.2);
color: #6366f1;
}
/* Stats */
.stats-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 1rem;
}
.stat {
text-align: center;
padding: 1rem;
background: rgba(255,255,255,0.03);
border-radius: 12px;
}
.stat-value {
font-size: 1.5rem;
font-weight: 700;
color: #6366f1;
}
.stat-label {
font-size: 0.75rem;
color: rgba(255,255,255,0.5);
margin-top: 0.25rem;
}
/* Vad betyder detta? */
.info-section {
background: rgba(255,255,255,0.03);
border: 1px solid rgba(255,255,255,0.08);
border-radius: 16px;
padding: 1.5rem;
margin-bottom: 1.5rem;
}
.info-section h3 {
font-size: 1.1rem;
margin-bottom: 1rem;
color: #fff;
}
.info-section p {
color: rgba(255,255,255,0.7);
margin-bottom: 0.75rem;
font-size: 0.95rem;
}
.info-section ul {
list-style: none;
padding: 0;
}
.info-section li {
padding: 0.5rem 0;
color: rgba(255,255,255,0.7);
font-size: 0.95rem;
display: flex;
align-items: flex-start;
gap: 0.5rem;
}
.info-section li::before {
content: "✓";
color: #22c55e;
font-weight: 700;
}
/* Sök */
.search-box {
display: flex;
gap: 0.5rem;
margin-bottom: 2rem;
}
.search-input {
flex: 1;
background: rgba(255,255,255,0.05);
border: 1px solid rgba(255,255,255,0.1);
border-radius: 8px;
padding: 0.75rem 1rem;
color: #fff;
font-size: 1rem;
}
.search-input::placeholder {
color: rgba(255,255,255,0.4);
}
.search-btn {
background: #6366f1;
color: #fff;
border: none;
padding: 0.75rem 1.5rem;
border-radius: 8px;
font-weight: 600;
cursor: pointer;
}
/* Footer */
.footer {
text-align: center;
padding: 2rem;
color: rgba(255,255,255,0.4);
font-size: 0.85rem;
}
.footer a {
color: #6366f1;
text-decoration: none;
}
@media (max-width: 480px) {
.stats-grid {
grid-template-columns: 1fr;
}
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<div class="logo">quiXzoom</div>
<div class="subtitle">Field Contributor Verification</div>
</div>
<!-- Sök -->
<div class="search-box">
<input type="text" class="search-input" id="search-input" placeholder="Sök på Contributor ID..." value="{{ contributor_id or '' }}">
<button class="search-btn" onclick="search()">Sök</button>
</div>
{% if contributor %}
<!-- Status -->
{% if contributor.valid %}
<div class="status-card valid">
<div class="status-icon"></div>
<div class="status-title">Verifierad Field Contributor</div>
<div class="status-desc">Detta ID-kort är giltigt och ägs av en verifierad quiXzoom-användare.</div>
</div>
{% else %}
<div class="status-card invalid">
<div class="status-icon"></div>
<div class="status-title">Ogiltigt eller Inaktivt</div>
<div class="status-desc">Detta ID-kort är inte giltigt eller har återkallats.</div>
</div>
{% endif %}
{% if contributor.valid %}
<!-- Contributor-info -->
<div class="contributor-card">
<div class="contributor-header">
<div class="avatar">{{ contributor.initials }}</div>
<div class="contributor-info">
<h2>{{ contributor.name }}</h2>
<span class="contributor-tier tier-verified">⭐ Verified Field Contributor</span>
</div>
</div>
<div class="stats-grid">
<div class="stat">
<div class="stat-value">{{ contributor.completed_missions }}</div>
<div class="stat-label">Uppdrag</div>
</div>
<div class="stat">
<div class="stat-value">{{ "%.0f"|format(contributor.approval_rate * 100) }}%</div>
<div class="stat-label">Godkänt</div>
</div>
<div class="stat">
<div class="stat-value">{{ contributor.member_since }}</div>
<div class="stat-label">Medlem sedan</div>
</div>
</div>
</div>
<!-- Vad betyder detta? -->
<div class="info-section">
<h3>Vad betyder Verified Field Contributor?</h3>
<p>En <strong>Verified Field Contributor</strong> är en quiXzoom-användare som:</p>
<ul>
<li>Har slutfört minst <strong>100 godkända uppdrag</strong></li>
<li>Har en <strong>godkännandegrad på minst 95%</strong> under de senaste 100 uppdragen</li>
<li>Har en <strong>verifierad identitet</strong></li>
<li>Har <strong>inga allvarliga policyöverträdelser</strong></li>
</ul>
<p style="margin-top: 1rem;">Detta är inte bara en siffra — det representerar <strong>konsekvent, pålitligt arbete</strong> av hög kvalitet.</p>
</div>
<div class="info-section">
<h3>Vad kan denna person göra?</h3>
<p>En Verified Field Contributor har visat att de:</p>
<ul>
<li>Kan samla in fältdata av hög kvalitet</li>
<li>Följer quiXzooms riktlinjer och standarder</li>
<li>Är pålitlig och konsekvent i sitt arbete</li>
<li>Har en verifierad identitet</li>
</ul>
</div>
<div class="info-section">
<h3>För fastighetsägare och kommuner</h3>
<p>Om du ser en person med detta ID-kort kan du vara säker på att:</p>
<ul>
<li>Personen är <strong>verifierad och pålitlig</strong></li>
<li>Datainsamling sker enligt <strong>quiXzooms standarder</strong></li>
<li>Du kan <strong>lita på kvaliteten</strong> av arbetet</li>
</ul>
<p style="margin-top: 1rem;">Vid frågor, kontakta <a href="mailto:support@quixzoom.com">support@quixzoom.com</a></p>
</div>
{% endif %}
{% endif %}
<div class="footer">
<p>quiXzoom Field Program — <a href="https://quixzoom.com">quixzoom.com</a></p>
<p style="margin-top: 0.5rem; font-size: 0.75rem;">Scanning this QR code confirms the holder is a verified quiXzoom contributor</p>
</div>
</div>
<script>
function search() {
const id = document.getElementById('search-input').value.trim();
if (id) {
window.location.href = `/verify/${id}`;
}
}
document.getElementById('search-input').addEventListener('keypress', (e) => {
if (e.key === 'Enter') search();
});
</script>
</body>
</html>