feat: integrate Grafana dashboards into BOC DashboardPage
- Add Infrastructure Health section with CPU/Memory/Disk panels - Add Service Status section with PM2/Docker panels - Create GrafanaPanel component for iframe embedding - Build passes successfully
This commit is contained in:
@@ -0,0 +1,392 @@
|
||||
package legal
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// ContractTemplateType definierar standardavtalstyper
|
||||
type ContractTemplateType string
|
||||
|
||||
const (
|
||||
// AAMOS-produktavtal
|
||||
ContractAAMOSLicense ContractTemplateType = "aamos_license" // Licensavtal för AAMOS-plattformen
|
||||
ContractAAMOSSaaS ContractTemplateType = "aamos_saas" // SaaS-prenumeration
|
||||
ContractAAMOSAPI ContractTemplateType = "aamos_api" // API-åtkomstavtal
|
||||
ContractAAMOSPilot ContractTemplateType = "aamos_pilot" // Pilotprojektavtal
|
||||
|
||||
// Modulspecifika avtal
|
||||
ContractVisionModule ContractTemplateType = "vision_module" // AAMOS Vision
|
||||
ContractIdentityModule ContractTemplateType = "identity_module" // AAMOS Identity
|
||||
ContractFraudModule ContractTemplateType = "fraud_module" // AAMOS Fraud
|
||||
ContractInfrastructureModule ContractTemplateType = "infrastructure_module" // AAMOS Infrastructure
|
||||
ContractSafetyModule ContractTemplateType = "safety_module" // AAMOS Safety
|
||||
|
||||
// quiXzoom-avtal
|
||||
ContractAuthCore ContractTemplateType = "quixzoom_auth_core" // quiXzoom Auth Core
|
||||
ContractFrilansPayout ContractTemplateType = "quixzoom_frilans" // quiXzoom Frilans Payout
|
||||
ContractQZToken ContractTemplateType = "quixzoom_token" // QZ Token-licens
|
||||
|
||||
// Integrationsavtal
|
||||
ContractIntegrationPartner ContractTemplateType = "integration_partner" // Teknisk integrationspartner
|
||||
ContractDataProcessor ContractTemplateType = "data_processor" // GDPR DPA
|
||||
ContractSubcontractor ContractTemplateType = "subcontractor" // Underleverantör
|
||||
|
||||
// Verksamhetsavtal
|
||||
ContractEmployment ContractTemplateType = "employment" // Anställningsavtal
|
||||
ContractConsultant ContractTemplateType = "consultant" // Konsultavtal
|
||||
ContractNDA ContractTemplateType = "nda" // Sekretessavtal
|
||||
ContractMSA ContractTemplateType = "msa" // Master Service Agreement
|
||||
)
|
||||
|
||||
// ContractTemplate representerar ett standardavtal
|
||||
type ContractTemplate struct {
|
||||
ID string `json:"id"`
|
||||
Type ContractTemplateType `json:"type"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Category string `json:"category"` // aamos, quixzoom, legal, hr
|
||||
ProductModule string `json:"product_module,omitempty"` // Vilken produkt det gäller
|
||||
Version string `json:"version"`
|
||||
Status string `json:"status"` // active, draft, deprecated
|
||||
Language string `json:"language"` // sv, en
|
||||
Jurisdiction string `json:"jurisdiction"` // Sweden, EU, US
|
||||
|
||||
// Avtalsstruktur
|
||||
Sections []ContractSection `json:"sections"`
|
||||
Clauses []ContractClause `json:"clauses"`
|
||||
|
||||
// Standardvillkor
|
||||
DefaultTerms ContractTerms `json:"default_terms"`
|
||||
|
||||
// Metadata
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
CreatedBy string `json:"created_by"`
|
||||
}
|
||||
|
||||
// ContractSection representerar en avtalssektion
|
||||
type ContractSection struct {
|
||||
ID string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Order int `json:"order"`
|
||||
Required bool `json:"required"`
|
||||
Content string `json:"content"` // Standardtext
|
||||
Variables []string `json:"variables"` // Platshållare som ska fyllas i
|
||||
}
|
||||
|
||||
// ContractClause representerar ett specifikt klausul
|
||||
type ContractClause struct {
|
||||
ID string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Type string `json:"type"` // payment, liability, termination, ip, gdpr, sla
|
||||
Required bool `json:"required"`
|
||||
StandardText string `json:"standard_text"`
|
||||
Variables []string `json:"variables"`
|
||||
Conditions []string `json:"conditions,omitempty"` // När klausulen ska inkluderas
|
||||
}
|
||||
|
||||
// ContractTerms innehåller standardvillkor
|
||||
type ContractTerms struct {
|
||||
PaymentTerms string `json:"payment_terms"` // 30 dagar netto
|
||||
PaymentMethod string `json:"payment_method"` // Faktura, autogiro
|
||||
Currency string `json:"currency"` // SEK, USD, EUR
|
||||
VatRate float64 `json:"vat_rate"` // 25%
|
||||
|
||||
ContractPeriod string `json:"contract_period"` // 12 månader
|
||||
NoticePeriod string `json:"notice_period"` // 3 månader
|
||||
AutoRenewal bool `json:"auto_renewal"` // true/false
|
||||
|
||||
LiabilityCap float64 `json:"liability_cap"` // Max ersättning
|
||||
LiabilityCapCurrency string `json:"liability_cap_currency"`
|
||||
|
||||
SLAEnabled bool `json:"sla_enabled"`
|
||||
SLAUptime float64 `json:"sla_uptime"` // 99.9%
|
||||
SLAPenalty float64 `json:"sla_penalty"` // 10% av månadsavgift
|
||||
|
||||
DataProcessing bool `json:"data_processing"` // GDPR/DPA krävs
|
||||
DataLocation string `json:"data_location"` // EU-only
|
||||
|
||||
SupportLevel string `json:"support_level"` // standard, premium, enterprise
|
||||
SupportHours string `json:"support_hours"` // 08:00-17:00 CET
|
||||
|
||||
AuditRights bool `json:"audit_rights"` // Kund kan granska
|
||||
AuditFrequency string `json:"audit_frequency"` // Årligen
|
||||
}
|
||||
|
||||
// ProductContractLink kopplar produkter till avtalstyper
|
||||
type ProductContractLink struct {
|
||||
ProductID string `json:"product_id"`
|
||||
ProductName string `json:"product_name"`
|
||||
ProductType string `json:"product_type"` // vision, identity, fraud, etc.
|
||||
RequiredContracts []ContractTemplateType `json:"required_contracts"`
|
||||
OptionalContracts []ContractTemplateType `json:"optional_contracts"`
|
||||
DefaultTerms ContractTerms `json:"default_terms"`
|
||||
}
|
||||
|
||||
// Standard templates för Landvex/AAMOS
|
||||
func GetStandardTemplates() []ContractTemplate {
|
||||
return []ContractTemplate{
|
||||
{
|
||||
ID: "tmpl-aamos-license-001",
|
||||
Type: ContractAAMOSLicense,
|
||||
Name: "AAMOS Platform License",
|
||||
Description: "Standardlicensavtal för AAMOS-plattformen",
|
||||
Category: "aamos",
|
||||
ProductModule: "platform",
|
||||
Version: "1.0",
|
||||
Status: "active",
|
||||
Language: "sv",
|
||||
Jurisdiction: "Sweden",
|
||||
Sections: []ContractSection{
|
||||
{ID: "sec-1", Title: "Parter", Order: 1, Required: true, Content: "Detta avtal ingås mellan {{licensor}} ('Licensor') och {{licensee}} ('Licenstagare')."},
|
||||
{ID: "sec-2", Title: "Licensomfattning", Order: 2, Required: true, Content: "Licensor beviljar Licenstagare en icke-exklusiv, icke-överlåtbar licens att använda AAMOS-plattformen."},
|
||||
{ID: "sec-3", Title: "Aktiverade moduler", Order: 3, Required: true, Content: "Följande moduler ingår i licensen: {{modules}}", Variables: []string{"modules"}},
|
||||
{ID: "sec-4", Title: "API-åtkomst", Order: 4, Required: true, Content: "Licenstagare får API-åtkomst med följande begränsningar: {{api_limits}}", Variables: []string{"api_limits"}},
|
||||
{ID: "sec-5", Title: "Avgifter och betalning", Order: 5, Required: true, Content: "Licensavgift: {{license_fee}} {{currency}} per {{period}}."},
|
||||
{ID: "sec-6", Title: "Avtalstid och uppsägning", Order: 6, Required: true, Content: "Avtalet gäller tills vidare med {{notice_period}} uppsägningstid."},
|
||||
{ID: "sec-7", Title: "GDPR och dataskydd", Order: 7, Required: true, Content: "Parterna ska följa tillämplig dataskyddslagstiftning. Personuppgiftsbiträdesavtal (DPA) ingår som bilaga."},
|
||||
{ID: "sec-8", Title: "Service Level Agreement", Order: 8, Required: true, Content: "Tillgänglighet: {{sla_uptime}}%. Vid avvikelse utgår vite om {{sla_penalty}}% av månadsavgiften."},
|
||||
{ID: "sec-9", Title: "Immateriella rättigheter", Order: 9, Required: true, Content: "Alla rättigheter till AAMOS-plattformen tillhör Licensor."},
|
||||
{ID: "sec-10", Title: "Begränsningar", Order: 10, Required: true, Content: "Licenstagare får inte: (a) reverse engineering, (b) sublicensiera, (c) använda för olagliga ändamål."},
|
||||
},
|
||||
DefaultTerms: ContractTerms{
|
||||
PaymentTerms: "30 dagar netto",
|
||||
Currency: "SEK",
|
||||
VatRate: 25.0,
|
||||
ContractPeriod: "12 månader",
|
||||
NoticePeriod: "3 månader",
|
||||
AutoRenewal: true,
|
||||
SLAEnabled: true,
|
||||
SLAUptime: 99.9,
|
||||
SLAPenalty: 10.0,
|
||||
DataProcessing: true,
|
||||
DataLocation: "EU",
|
||||
SupportLevel: "standard",
|
||||
SupportHours: "08:00-17:00 CET",
|
||||
AuditRights: true,
|
||||
AuditFrequency: "Årligen",
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: "tmpl-aamos-saas-001",
|
||||
Type: ContractAAMOSSaaS,
|
||||
Name: "AAMOS SaaS-prenumeration",
|
||||
Description: "Prenumerationsavtal för AAMOS SaaS",
|
||||
Category: "aamos",
|
||||
ProductModule: "saas",
|
||||
Version: "1.0",
|
||||
Status: "active",
|
||||
Language: "sv",
|
||||
Jurisdiction: "Sweden",
|
||||
Sections: []ContractSection{
|
||||
{ID: "sec-1", Title: "Tjänstebeskrivning", Order: 1, Required: true, Content: "AAMOS SaaS är en molnbaserad AI-plattform för {{use_case}}.", Variables: []string{"use_case"}},
|
||||
{ID: "sec-2", Title: "Prenumerationsnivå", Order: 2, Required: true, Content: "Vald nivå: {{tier}}. Inkluderar: {{features}}.", Variables: []string{"tier", "features"}},
|
||||
{ID: "sec-3", Title: "Användarlicenser", Order: 3, Required: true, Content: "Antal användare: {{user_count}}. Ytterligare användare: {{extra_user_price}}/användare/månad.", Variables: []string{"user_count", "extra_user_price"}},
|
||||
{ID: "sec-4", Title: "Datavolym", Order: 4, Required: true, Content: "Inkluderad datavolym: {{data_volume}}/månad. Överskridelse: {{overage_price}}/GB.", Variables: []string{"data_volume", "overage_price"}},
|
||||
},
|
||||
DefaultTerms: ContractTerms{
|
||||
PaymentTerms: "Månadsvis i förskott",
|
||||
Currency: "SEK",
|
||||
VatRate: 25.0,
|
||||
ContractPeriod: "1 månad",
|
||||
NoticePeriod: "1 månad",
|
||||
AutoRenewal: true,
|
||||
SLAEnabled: true,
|
||||
SLAUptime: 99.5,
|
||||
SLAPenalty: 5.0,
|
||||
DataProcessing: true,
|
||||
DataLocation: "EU",
|
||||
SupportLevel: "standard",
|
||||
SupportHours: "08:00-17:00 CET",
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: "tmpl-vision-001",
|
||||
Type: ContractVisionModule,
|
||||
Name: "AAMOS Vision - Modulavtal",
|
||||
Description: "Tilläggsavtal för AAMOS Vision-modulen",
|
||||
Category: "aamos",
|
||||
ProductModule: "vision",
|
||||
Version: "1.0",
|
||||
Status: "active",
|
||||
Language: "sv",
|
||||
Jurisdiction: "Sweden",
|
||||
Sections: []ContractSection{
|
||||
{ID: "sec-1", Title: "Modulbeskrivning", Order: 1, Required: true, Content: "AAMOS Vision tillhandahåller objektigenkänning, anomalidetektion och skadebedömning via bild- och videoanalys."},
|
||||
{ID: "sec-2", Title: "Användningsområden", Order: 2, Required: true, Content: "Godkända användningsområden: {{use_cases}}.", Variables: []string{"use_cases"}},
|
||||
{ID: "sec-3", Title: "Bildkvalitetskrav", Order: 3, Required: true, Content: "Minimikrav: {{min_resolution}}, {{min_fps}} FPS."},
|
||||
{ID: "sec-4", Title: "Träningsdata", Order: 4, Required: true, Content: "Kunden ansvarar för att tillhandahålla annoterad träningsdata vid behov."},
|
||||
},
|
||||
DefaultTerms: ContractTerms{
|
||||
PaymentTerms: "30 dagar netto",
|
||||
Currency: "SEK",
|
||||
VatRate: 25.0,
|
||||
ContractPeriod: "12 månader",
|
||||
NoticePeriod: "3 månader",
|
||||
SLAEnabled: true,
|
||||
SLAUptime: 99.9,
|
||||
DataProcessing: true,
|
||||
DataLocation: "EU",
|
||||
SupportLevel: "premium",
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: "tmpl-quixzoom-auth-001",
|
||||
Type: ContractAuthCore,
|
||||
Name: "quiXzoom Auth Core - Licensavtal",
|
||||
Description: "Licensavtal för quiXzoom Auth Core autentiseringsplattform",
|
||||
Category: "quixzoom",
|
||||
ProductModule: "auth",
|
||||
Version: "1.0",
|
||||
Status: "active",
|
||||
Language: "sv",
|
||||
Jurisdiction: "Sweden",
|
||||
Sections: []ContractSection{
|
||||
{ID: "sec-1", Title: "Tjänstebeskrivning", Order: 1, Required: true, Content: "quiXzoom Auth Core tillhandahåller autentisering via e-post, Google, telefon och lösenord."},
|
||||
{ID: "sec-2", Title: "KYZ Engine", Order: 2, Required: true, Content: "Inkluderar Know Your Zoomer (KYZ) för identitetsverifiering."},
|
||||
{ID: "sec-3", Title: "Company Registry", Order: 3, Required: true, Content: "Stöd för enskild firma och registrerat företag."},
|
||||
{ID: "sec-4", Title: "Payout Engine", Order: 4, Required: true, Content: "Integration med Stripe Connect, Frilans Finans och banköverföring."},
|
||||
{ID: "sec-5", Title: "SDK-licens", Order: 5, Required: true, Content: "@quixzoom/auth-core SDK licens för {{platform}}.", Variables: []string{"platform"}},
|
||||
},
|
||||
DefaultTerms: ContractTerms{
|
||||
PaymentTerms: "30 dagar netto",
|
||||
Currency: "USD",
|
||||
VatRate: 0.0,
|
||||
ContractPeriod: "12 månader",
|
||||
NoticePeriod: "3 månader",
|
||||
AutoRenewal: true,
|
||||
SLAEnabled: true,
|
||||
SLAUptime: 99.99,
|
||||
DataProcessing: true,
|
||||
DataLocation: "EU",
|
||||
SupportLevel: "enterprise",
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: "tmpl-quixzoom-frilans-001",
|
||||
Type: ContractFrilansPayout,
|
||||
Name: "quiXzoom Frilans Payout - Avtal",
|
||||
Description: "Utbetalningsavtal för frilansare utan företag",
|
||||
Category: "quixzoom",
|
||||
ProductModule: "payout",
|
||||
Version: "1.0",
|
||||
Status: "active",
|
||||
Language: "sv",
|
||||
Jurisdiction: "Sweden",
|
||||
Sections: []ContractSection{
|
||||
{ID: "sec-1", Title: "Tjänstebeskrivning", Order: 1, Required: true, Content: "quiXzoom Frilans Payout hanterar utbetalningar, skatter och avgifter för frilansare."},
|
||||
{ID: "sec-2", Title: "Marknader", Order: 2, Required: true, Content: "Giltiga marknader: {{markets}}.", Variables: []string{"markets"}},
|
||||
{ID: "sec-3", Title: "Avgiftsstruktur", Order: 3, Required: true, Content: "Plattformsavgift: {{platform_fee}}%. Processing: {{processing_fee}}%.", Variables: []string{"platform_fee", "processing_fee"}},
|
||||
{ID: "sec-4", Title: "Skattehantering", Order: 4, Required: true, Content: "Automatisk källskatt enligt respektive lands lagstiftning."},
|
||||
{ID: "sec-5", Title: "Utbetalningsperiod", Order: 5, Required: true, Content: "Veckovis/månadsvis utbetalning enligt {{payout_schedule}}.", Variables: []string{"payout_schedule"}},
|
||||
},
|
||||
DefaultTerms: ContractTerms{
|
||||
PaymentTerms: "Veckovis/månadsvis",
|
||||
Currency: "USD",
|
||||
VatRate: 0.0,
|
||||
ContractPeriod: "Löpande",
|
||||
NoticePeriod: "1 månad",
|
||||
AutoRenewal: true,
|
||||
SLAEnabled: true,
|
||||
SLAUptime: 99.95,
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: "tmpl-dpa-001",
|
||||
Type: ContractDataProcessor,
|
||||
Name: "Personuppgiftsbiträdesavtal (DPA)",
|
||||
Description: "GDPR-kompatibelt personuppgiftsbiträdesavtal",
|
||||
Category: "legal",
|
||||
ProductModule: "gdpr",
|
||||
Version: "1.0",
|
||||
Status: "active",
|
||||
Language: "sv",
|
||||
Jurisdiction: "EU",
|
||||
Sections: []ContractSection{
|
||||
{ID: "sec-1", Title: "Parter och roller", Order: 1, Required: true, Content: "{{controller}} är personuppgiftsansvarig. {{processor}} är personuppgiftsbiträde."},
|
||||
{ID: "sec-2", Title: "Behandlingsaktiviteter", Order: 2, Required: true, Content: "Behandling: {{processing_activities}}. Ändamål: {{purpose}}.", Variables: []string{"processing_activities", "purpose"}},
|
||||
{ID: "sec-3", Title: "Personuppgiftskategorier", Order: 3, Required: true, Content: "Kategorier: {{data_categories}}. Registrerade: {{data_subjects}}.", Variables: []string{"data_categories", "data_subjects"}},
|
||||
{ID: "sec-4", Title: "Säkerhetsåtgärder", Order: 4, Required: true, Content: "Biträdet ska implementera lämpliga tekniska och organisatoriska säkerhetsåtgärder."},
|
||||
{ID: "sec-5", Title: "Underbiträden", Order: 5, Required: true, Content: "Godkända underbiträden: {{subprocessors}}.", Variables: []string{"subprocessors"}},
|
||||
{ID: "sec-6", Title: "Dataplacering", Order: 6, Required: true, Content: "Personuppgifter behandlas inom {{data_location}}.", Variables: []string{"data_location"}},
|
||||
{ID: "sec-7", Title: "Radering och återlämning", Order: 7, Required: true, Content: "Vid avtalets upphörande ska personuppgifter raderas eller återlämnas."},
|
||||
},
|
||||
DefaultTerms: ContractTerms{
|
||||
DataProcessing: true,
|
||||
DataLocation: "EU",
|
||||
AuditRights: true,
|
||||
AuditFrequency: "Årligen",
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// GetProductContractLinks returnerar standard kopplingar mellan produkter och avtal
|
||||
func GetProductContractLinks() []ProductContractLink {
|
||||
return []ProductContractLink{
|
||||
{
|
||||
ProductID: "prod-aamos-platform",
|
||||
ProductName: "AAMOS Platform",
|
||||
ProductType: "platform",
|
||||
RequiredContracts: []ContractTemplateType{
|
||||
ContractAAMOSLicense,
|
||||
ContractDataProcessor,
|
||||
},
|
||||
OptionalContracts: []ContractTemplateType{
|
||||
ContractAAMOSAPI,
|
||||
ContractMSA,
|
||||
},
|
||||
},
|
||||
{
|
||||
ProductID: "prod-aamos-vision",
|
||||
ProductName: "AAMOS Vision",
|
||||
ProductType: "vision",
|
||||
RequiredContracts: []ContractTemplateType{
|
||||
ContractAAMOSLicense,
|
||||
ContractVisionModule,
|
||||
ContractDataProcessor,
|
||||
},
|
||||
OptionalContracts: []ContractTemplateType{
|
||||
ContractAAMOSAPI,
|
||||
},
|
||||
},
|
||||
{
|
||||
ProductID: "prod-aamos-identity",
|
||||
ProductName: "AAMOS Identity",
|
||||
ProductType: "identity",
|
||||
RequiredContracts: []ContractTemplateType{
|
||||
ContractAAMOSLicense,
|
||||
ContractIdentityModule,
|
||||
ContractDataProcessor,
|
||||
},
|
||||
OptionalContracts: []ContractTemplateType{
|
||||
ContractAAMOSAPI,
|
||||
},
|
||||
},
|
||||
{
|
||||
ProductID: "prod-quixzoom-auth",
|
||||
ProductName: "quiXzoom Auth Core",
|
||||
ProductType: "auth",
|
||||
RequiredContracts: []ContractTemplateType{
|
||||
ContractAuthCore,
|
||||
ContractDataProcessor,
|
||||
},
|
||||
OptionalContracts: []ContractTemplateType{
|
||||
ContractQZToken,
|
||||
ContractIntegrationPartner,
|
||||
},
|
||||
},
|
||||
{
|
||||
ProductID: "prod-quixzoom-payout",
|
||||
ProductName: "quiXzoom Frilans Payout",
|
||||
ProductType: "payout",
|
||||
RequiredContracts: []ContractTemplateType{
|
||||
ContractFrilansPayout,
|
||||
ContractDataProcessor,
|
||||
},
|
||||
OptionalContracts: []ContractTemplateType{
|
||||
ContractQZToken,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user