You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

2. Business Requirements

2.0 Priority Level Definitions

PriorityDefinitionGo-Live ImpactStakeholder ApprovalExample
CRITICALCore system functionality, data integrity, legal compliance, securityBLOCKING - Cannot go live without thisAll stakeholders requiredAuthentication, GDPR, data isolation
HIGHPrimary business value, significant operational impactBLOCKING - Should not go live without thisProduct Owner + Technical ArchitectBatch processing, multi-vendor XML
MEDIUMImportant for operations, workarounds exist temporarilyNON-BLOCKING - Can go live with plan to completeProduct Owner approvalTemplate management UI, postal integration
LOWNice to have, minimal business impact, future optimizationNON-BLOCKING - Defer to Phase 2Product Owner decisionAdvanced filtering, custom dashboards

2.1 BR-001: Multi-Tenant Organization Support

Requirement: The system shall support multiple independent utility companies (organizations) with complete data isolation at the blob storage, processing, and user access levels.

Business Value:

  • Enables SaaS business model for Nordic utilities market
  • Reduces per-customer infrastructure costs by 60-70%
  • Accelerates new customer onboarding (weeks → days)
  • Increases addressable market across Sweden, Norway, Denmark, Finland

Priority: CRITICAL

Nordic Market Context: Swedish utilities market has ~150 electricity suppliers, ~290 district heating companies. Multi-tenancy is essential for market penetration.

Acceptance Criteria:

CriterionMeasurement MethodTest CaseTarget
System supports 50+ concurrent organizationsLoad test with 50 organizations uploading batches simultaneouslyTC-001All batches process successfully
Each organization has isolated blob storageVerify container naming: {org-id}-invoices-{year}TC-002No cross-org container access
Users cannot access other organizations' dataAttempt API calls to different org-id with valid tokenTC-003All return 403 Forbidden
Each organization configures own brandingUpload logo, colors; verify in rendered PDFTC-004Branding applied correctly
Each organization defines delivery channelsConfigure email priority; verify email sent firstTC-005Channel priority honored
Organization data never shared in logsReview Application Insights logs for data leakageTC-006No PII in logs

Dependencies:

  • Azure Blob Storage with container-per-organization strategy
  • PostgreSQL schema with user_organization_roles table
  • Middleware for organization context extraction and validation
  • Role-based access control implementation

Risks & Mitigation (Nordic Context):

RiskLikelihoodImpactMitigation StrategyOwner
Data leakage between organizationsLOWCRITICAL- Middleware enforces org boundaries
- Automated cross-org access testing
- Penetration testing by external auditor
- GDPR-compliant architecture review
Security Officer
Performance degradation with 50+ tenantsMEDIUMHIGH- Blob storage auto-scales
- PostgreSQL connection pooling
- Indexed queries on organization_id
- Load testing with 100 organizations
Technical Architect
Swedish data residency requirementsLOWHIGH- West Europe primary region
- Data residency enforced in org config
- No cross-border data transfer
Compliance


2.2 BR-002: Multi-Vendor XML Format Support

Requirement: The system shall process invoice batch files from multiple vendor billing systems (GASEL/Telinet, XELLENT/Karlskoga, ZYNERGY/EG Software) with automatic format detection and transformation to canonical JSON.

Business Value:

  • Eliminates integration barrier for new customers (any billing system supported)
  • Reduces onboarding time by 80% (no custom integration development)
  • Increases market addressability to all Nordic utilities regardless of billing system
  • Enables vendor-agnostic downstream processing

Priority: HIGH

Nordic Market Context: Top 3 billing systems in Swedish utilities market: Telinet (EDIEL format), Karlskoga/Xellent (OIOXML), EG Zynergy (proprietary). Supporting these covers ~70% of market.

Acceptance Criteria:

CriterionMeasurement MethodTest CaseTarget
System auto-detects GASEL formatTest with 50 GASEL XML samplesTC-010100% accuracy
System auto-detects XELLENT formatTest with 50 XELLENT XML samplesTC-011100% accuracy
System auto-detects ZYNERGY formatTest with 50 ZYNERGY XML samplesTC-012100% accuracy
All formats transform to canonical JSONParse each format, verify JSON schemaTC-013All required fields present
XML validation against vendor XSDValidate sample files against schemasTC-014Schema validation passes
Clear error for unsupported formatsUpload unknown format XMLTC-015Returns 415 with vendor list
Detection within 1 secondPerformance test with 100MB filesTC-016< 1 second

Dependencies:

  • Schema registry with field mappings for each vendor
  • XML parsing library supporting complex namespaces
  • XSD schema files from vendors (Telinet, Karlskoga, EG)
  • Canonical JSON schema definition

Risks & Mitigation (Nordic Context):

RiskLikelihoodImpactMitigation StrategyOwner
Vendor XML schema changes without noticeMEDIUMHIGH- Version all schemas (v1.0, v1.1, etc.)
- Support multiple versions simultaneously
- 3-month deprecation notice in vendor contracts
- Automated schema change detection
- Direct vendor communication channels
Product Owner
EDIEL standard evolutionMEDIUMMEDIUM- Monitor Ediel.org for updates
- Participate in Nordic Ediel working groups
- Backward compatibility for 2 versions
- Phased schema migration
Technical Architect
Complex namespace handling (OIOXML)LOWMEDIUM- Use System.Xml.Linq for namespace support
- XmlNamespaceManager for prefixes
- Extensive unit testing per vendor
- Schema mapping documentation
Dev Team
Incomplete field mappingsMEDIUMMEDIUM- Comprehensive mapping validation
- Custom fields dictionary for unmapped data
- Vendor format validation during onboarding
- Optional field graceful degradation
Dev Team
Energiforsk format variationsLOWLOW- Document accepted variations
- Lenient parsing mode option
- Warning system for non-critical deviations
Product Owner


2.3 BR-003: Batch Invoice Processing

Requirement: The system shall process batch invoice files containing up to 100,000 invoices with parallel processing, retry logic, and granular status tracking.

Business Value:

  • Enables high-volume monthly invoice runs (typical Swedish utility: 50K-200K customers)
  • Reduces manual processing effort by 95%
  • Improves time-to-customer (days → hours)
  • Enables predictable SLA commitments to customers

Priority: HIGH

Nordic Market Context: Monthly invoice cycles concentrated in first/last week of month. Heating season (Oct-Mar) has 40% higher volumes. System must handle seasonal peaks.

Acceptance Criteria:

CriterionMeasurement MethodTest CaseTarget
Single batch supports 100,000 invoicesUpload 100K batch, verify all processedTC-020All invoices processed
Batches processed asynchronouslyAPI returns 202 immediately, processing continuesTC-021< 500ms API response
Real-time progress trackingPoll status API during processingTC-022Updates every 30 seconds
Failed items don't block batchIntroduce 10 errors in 1000-item batchTC-023990 succeed, 10 fail independently
Retry mechanism (3 attempts)Force temporary failure, verify retriesTC-0243 retries then poison queue
Processing completes within 2 hours (100K)Load test with 100K invoice batchTC-025<= 120 minutes
Supports XML, JSON, CSV formats (Phase 1: XML only)Upload each format typeTC-026XML fully supported

Dependencies:

  • Azure Storage Queues for message passing
  • Worker auto-scaling (Container Apps with KEDA)
  • Blob storage for batch source files and processed invoices
  • Batch metadata storage with real-time updates

Risks & Mitigation (Nordic Context):

RiskLikelihoodImpactMitigation StrategyOwner
Processing timeout during heating season peaks (Oct-Mar)MEDIUMHIGH- Pre-warm workers 1st/last week of month
- Priority queue for SLA customers
- Scheduled off-peak processing windows
- Customer communication about peak times
Operations Manager
Memory constraints with large XML files (>50MB)MEDIUMMEDIUM- Stream-based XML parsing (XmlReader)
- Chunk processing for large batches
- File size monitoring and alerts
- 100MB hard limit with split guidance
Technical Architect
Disk space exhaustion on workersLOWMEDIUM- Ephemeral storage cleanup after processing
- Blob storage only for persistence
- Worker instance monitoring
Operations Manager
Queue message 64KB limit exceededMEDIUMMEDIUM- Store invoice JSON in blob, queue has reference only
- Message payload validation
- Compression for large messages
Technical Architect


2.4 BR-004: Template-Based Invoice Rendering

Requirement: The system shall generate PDF and HTML invoices using organization-specific Handlebars templates with dynamic data binding and brand customization.

Business Value:

  • Enables brand consistency across all customer communications
  • Supports regulatory requirements (Swedish Energy Markets Inspectorate guidelines)
  • Allows per-organization customization without code changes
  • Future-proofs for multi-language support (Swedish, Norwegian, Danish, Finnish)

Priority: HIGH

Nordic Market Context: Swedish regulations require specific invoice information (consumption details, tax breakdown, grid owner, metering point). Templates must support regulatory compliance.

Acceptance Criteria:

CriterionMeasurement MethodTest CaseTarget
Organizations upload custom Handlebars templatesUpload HTML template via API (future) or blobTC-030Template stored successfully
Templates support dynamic data bindingRender with test invoice dataTC-031All fields populated
PDF generation from HTML with complianceGenerate PDF, verify format and contentTC-032A4, readable, complete
Template versioning supportedCreate v2.0.0, verify old batches use v1.0.0TC-033Version isolation working
Templates updateable without affecting in-flight batchesUpdate template while batch processesTC-034In-flight uses old version
Template validation before activationUpload template with missing variableTC-035Validation error returned
Organization branding appliedLogo, colors, fonts in rendered PDFTC-036Branding visible
Swedish regulatory fields requiredVerify mätpunkt, grid owner, consumption presentTC-037All required fields shown

Dependencies:

  • Handlebars.Net template engine library
  • PDF generation library (Playwright with headless Chromium or IronPDF)
  • Blob storage for template files
  • Template metadata storage with version tracking

Risks & Mitigation (Nordic Context):

RiskLikelihoodImpactMitigation StrategyOwner
Template rendering performance bottleneckHIGHHIGH- Compiled template caching (24-hour TTL)
- Parallel rendering within 32-item batches
- POC testing: render 10K invoices in < 5 min
- Horizontal scaling of BatchItemWorkers
Technical Architect
PDF generation quality issues (Swedish characters)MEDIUMMEDIUM- UTF-8 encoding throughout
- Font embedding for åäö characters
- Visual regression testing
- Sample PDF review with Swedish content
QA Team
Swedish Energy Markets Inspectorate complianceLOWCRITICAL- Legal review of template requirements
- Required fields checklist in template validation
- Compliance testing with regulatory samples
- Annual regulatory update review
Legal/Compliance
Template injection attacksLOWCRITICAL- Sandboxed Handlebars execution
- No {{eval}} or {{exec}} helpers
- Template sanitization
- Security code review
Security Officer


2.5 BR-005: Multi-Channel Delivery with Nordic Integration

Requirement: The system shall deliver invoices through multiple channels (email, postal, future: Kivra, e-Faktura, SMS) with configurable priority, automatic fallback, and integration with Nordic delivery partners.

Business Value:

  • Increases delivery success rate to >98% (vs ~92% email-only)
  • Reduces returned mail costs (postal fallback)
  • Meets customer preferences (digital-first, postal backup)
  • Enables compliance with Swedish "rätt till pappersfaktura" (right to paper invoice)
  • Future-proofs for digital mailbox mandate discussions

Priority: HIGH

Nordic Market Context: Swedish law requires postal option for all customers. Kivra has 4.2M users in Sweden (40% population). E-faktura standard for B2B. Multi-channel is regulatory and competitive necessity.

Acceptance Criteria:

CriterionMeasurement MethodTest CaseTarget
Email delivery via SendGridSend 1000 test invoicesTC-040>95% delivered
Postal delivery via 21G bulk SFTPCreate zip, upload to 21G SFTPTC-041File accepted by 21G
Channel priority configurable per orgSet priority [email, postal], verify orderTC-042Email attempted first
Automatic fallback on failureForce email failure, verify postal attemptedTC-043Postal triggered automatically
Delivery status tracked per invoiceCheck invoice metadata after deliveryTC-044Status and timestamps recorded
Retry logic for transient failuresSimulate SendGrid 429 rate limitTC-045Retries with backoff
Delivery confirmation loggedVerify audit log entriesTC-046All deliveries logged
21G bulk processing at scheduled timesVerify postal queue processed 12:00 and 20:00TC-047Batches sent on schedule

Dependencies:

  • SendGrid account with Nordic sender reputation
  • 21G SFTP server access and credentials
  • Azure Key Vault for credential storage
  • Postal queue processing service (scheduled workers)
  • ZIP file generation for 21G format

Risks & Mitigation (Nordic Context):

RiskLikelihoodImpactMitigation StrategyOwner
SendGrid Nordic deliverability issuesMEDIUMHIGH- Dedicated IP for Nordic sending
- SPF/DKIM/DMARC configuration
- Sender reputation monitoring
- Backup: Azure Communication Services
- Gradual ramp-up for new organizations
Operations Manager
21G SFTP connectivity issuesLOWHIGH- Retry logic with exponential backoff
- Dual SFTP credentials (primary/backup)
- Alert on connection failure
- 21G SLA monitoring
- Manual upload procedure documented
Operations Manager
Postal delivery delays (Swedish postal challenges)MEDIUMMEDIUM- Set customer expectations (5-7 business days)
- Track 21G processing confirmations
- Escalation process for delays>10 days
- Alternative print partner identified
Product Owner
Email spam filtering (Swedish ISPs)MEDIUMMEDIUM- Warm up sending IP gradually
- Monitor bounce rates by ISP
- Whitelist requests to major ISPs (Telia, Tele2, Telenor)
- Plain text + HTML multi-part emails
Operations Manager
Kivra API rate limits (future)MEDIUMMEDIUM- Queue-based sending
- Respect Kivra rate limits (documented in API)
- Fallback to email if Kivra unavailable
Technical Architect


2.6 BR-006: Real-Time Batch Status Visibility

Requirement: Users shall view batch processing status, progress statistics, and individual invoice statuses in real-time through the API with granular breakdown by processing stage and delivery channel.

Business Value:

  • Reduces support inquiries by 60% (self-service status checking)
  • Enables proactive issue resolution before customer complaints
  • Improves operational transparency and trust
  • Provides audit trail for service level agreement (SLA) tracking

Priority: MEDIUM

Nordic Market Context: Utility operations teams work standard hours (08:00-17:00). Real-time visibility enables remote monitoring and reduces after-hours escalations.

Acceptance Criteria:

CriterionMeasurement MethodTest CaseTarget
Batch status via API (queued/processing/completed/failed)GET /batches/{id} during processingTC-050Status reflects reality
Progress percentage accurateCompare reported % to actual processed countTC-051Within 1% accuracy
Individual invoice status queryableGET /batches/{id}/items with status filterTC-052Returns correct filtered list
Statistics include success/failure countsVerify statistics.successfulItems matches realityTC-053Exact match
Estimated completion time providedCheck estimatedCompletionAt during processingTC-054Within 20% of actual
Failed invoices listed with error detailsQuery items with status=failedTC-055Error messages present
Status updates within 30 secondsProcess batch, poll status APITC-056Updates every ≤30 seconds
Delivery channel breakdown shownVerify deliveryChannelBreakdown matches actualTC-057Accurate breakdown

Dependencies:

  • Batch metadata updates from all workers
  • Real-time statistics calculation (incremental updates)
  • Blob storage access for metadata reads
  • API caching strategy for frequently-polled batches

Risks & Mitigation:

RiskLikelihoodImpactMitigation StrategyOwner
Performance impact of frequent metadata updatesMEDIUMMEDIUM- ETag-based optimistic concurrency
- Batch statistics updates (not per-invoice)
- Caching layer for status API
- Throttle updates to max 1/minute
Technical Architect
Stale status data (eventual consistency)MEDIUMLOW- Document 30-second update SLA
- Timestamp on status response
- Retry-After header for frequent polls
- WebSocket push for Phase 2
Product Owner


2.7 BR-007: Security & Access Control

Requirement: The system shall implement OAuth 2.0 authentication with Microsoft Entra ID, role-based access control with 6 distinct roles, organization-level data isolation, and comprehensive audit logging compliant with Swedish and EU security standards.

Business Value:

  • Ensures GDPR Article 32 compliance (security of processing)
  • Prevents unauthorized data access and potential €20M GDPR fines
  • Enables customer trust and enterprise sales (security requirements in tenders)
  • Supports SOC 2 Type II compliance for future certification

Priority: CRITICAL

Nordic Market Context: Swedish utilities handle sensitive customer data (personnummer, consumption patterns). GDPR fines can reach 4% of annual turnover. Enterprise security is non-negotiable.

Acceptance Criteria:

CriterionMeasurement MethodTest CaseTarget
OAuth 2.0 with Entra ID authenticationAttempt API access with/without tokenTC-060401 without token, 200 with valid token
6 roles implementedVerify all roles in PostgreSQLTC-061All 6 roles present
Users access only their organization dataUser from Org A attempts Org B accessTC-062403 Forbidden
All data access logged to audit trailReview audit_logs table after operationsTC-063All actions logged
API authentication required (all endpoints except /health)Call endpoints without tokenTC-064401 on all except /health
MFA enforced for admin rolesAdmin login without MFATC-065MFA challenge presented
API key rotation every 90 daysCheck key age in Key VaultTC-066Alerts at 80 days
Failed login lockout (5 attempts = 15 min)Attempt 6 failed loginsTC-067Account locked

Dependencies:

  • Microsoft Entra ID tenant configuration
  • PostgreSQL schema for users, roles, user_organization_roles
  • Azure Key Vault for secrets management
  • Audit logging infrastructure
  • MFA provider integration

Risks & Mitigation (Nordic/EU Context):

RiskLikelihoodImpactMitigation StrategyOwner
GDPR non-compliance penaltyLOWCRITICAL- Annual GDPR compliance audit
- Privacy Impact Assessment (PIA) completed
- Data Protection Officer (DPO) review
- Datainspektionen (Swedish DPA) guidelines followed
- EU Standard Contractual Clauses for vendors
Legal/Compliance
Unauthorized personnummer accessLOWCRITICAL- Personnummer encrypted at rest
- Access logging for all PII fields
- Role-based field-level access control
- Swedish Personal Data Act compliance
Security Officer
Authentication complexity delays onboardingMEDIUMMEDIUM- Entra ID B2B invitation flow
- Self-service org admin provisioning
- Clear onboarding documentation
- SSO with customer Entra ID tenants
Product Owner
Audit log storage costs (7-year retention)MEDIUMLOW- PostgreSQL for hot logs (1 year)
- Archive to blob after 1 year
- Compressed JSON format
- Query optimization
Technical Architect


2.8 BR-008: GDPR & Swedish Data Protection Compliance

Requirement: The system shall comply with GDPR and Swedish Data Protection Law including all data subject rights, lawful processing basis, 7-year retention for invoices, data minimization, and Nordic data residency.

Business Value:

  • Avoids GDPR fines (up to €20M or 4% of annual turnover)
  • Enables enterprise sales (GDPR compliance is tender requirement)
  • Builds customer trust and brand reputation
  • Supports Swedish utility regulatory requirements (Energimarknadsinspektionen)

Priority: CRITICAL

Nordic Market Context: Swedish Datainspektionen actively enforces GDPR. Recent fines in telecom/energy sector for inadequate security. Data residency within EU required for many public utility contracts.

Acceptance Criteria:

CriterionMeasurement MethodTest CaseTarget
Right to access: Data export APIRequest customer data exportTC-070JSON export with all customer invoices
Right to erasure: AnonymizationRequest customer deletion, verify PII removedTC-071Personnummer, name, email redacted
7-year invoice retentionCheck lifecycle policy configTC-072Invoices retained 7 years
Audit logging for all data accessQuery audit_logs for customer data accessTC-073All accesses logged
Data residency (Nordic countries only)Verify blob storage regionsTC-074West/North Europe only
Consent management for digital deliveryTrack customer delivery channel consentTC-075Consent recorded
Privacy policy complianceLegal reviewTC-076Approved by legal
Lawful basis documentedReview data processing inventoryTC-077Contract basis for invoice data

Dependencies:

  • Legal review of GDPR compliance approach
  • Data anonymization procedures and testing
  • Azure Blob lifecycle policies for retention
  • Data Processing Agreement (DPA) with Azure
  • Privacy Impact Assessment (PIA) completion

Risks & Mitigation (Swedish/EU Context):

RiskLikelihoodImpactMitigation StrategyOwner
Datainspektionen (Swedish DPA) auditLOWCRITICAL- Annual self-assessment against GDPR
- Document all processing activities (ROPA)
- DPO appointed and consulted
- Privacy by design in architecture
- Regular employee training
Legal/Compliance
Cross-border data transfer violationsLOWCRITICAL- All data stays in EU (Azure West/North Europe)
- No backup to non-EU regions
- Vendor contracts include EU Standard Clauses
- Azure compliance certifications verified
Legal/Compliance
Personnummer handling violationsMEDIUMCRITICAL- Personnummer only in encrypted fields
- Access logging for all reads
- Minimal retention (7 years, then deletion)
- Swedish Personal Data Act guidelines
- No personnummer in URLs or logs
Security Officer
Right to erasure vs 7-year retention conflictMEDIUMHIGH- Anonymization instead of deletion (legal basis: accounting law)
- Legal opinion obtained
- Balance data subject rights with legal obligations
- Documented in privacy policy
Legal/Compliance
Third-party processor compliance (SendGrid, 21G)MEDIUMHIGH- Data Processing Agreements (DPA) signed
- Sub-processor list maintained
- Regular compliance audits
- EU-based data centers only
Legal/Compliance


2.9 BR-009: Operational Monitoring & Observability

Requirement: The system shall provide comprehensive monitoring through Application Insights, structured logging with Serilog, real-time dashboards, and automated alerting to enable 24/7 operational visibility and proactive issue resolution.

Business Value:

  • Reduces mean time to detection (MTTD) from hours to minutes
  • Enables proactive issue resolution before customer impact
  • Supports SLA compliance and reporting
  • Reduces on-call burden through automated diagnostics

Priority: HIGH

Nordic Market Context: Swedish customers expect high service quality. Many utilities have SLA commitments (99.9% uptime). Winter heating season requires 24/7 monitoring.

Acceptance Criteria:

CriterionMeasurement MethodTest CaseTarget
Application Insights integrated (all services)Verify telemetry in Azure portalTC-080All services sending data
Structured logging with correlation IDsTrace request across servicesTC-081Same correlation ID
Custom metrics trackedVerify metrics in dashboardTC-082Batch, delivery, queue metrics present
Dashboards refresh every 5 minutesCheck dashboard timestampTC-083≤ 5 minutes old
Dashboards accessible to authorized usersLogin as different rolesTC-084Access granted appropriately
Critical alerts trigger within 5 minutesSimulate high error rateTC-085Alert received within 5 min
Alert escalation after 15 min unacknowledgedDon't acknowledge alertTC-086Escalation triggered
PII masked in logsSearch logs for personnummerTC-087No personnummer found

Required Dashboards:

  1. Operations Dashboard: Active batches, queue depths, worker counts, error rate, health status
  2. Performance Dashboard: API latency, processing times, PDF generation, delivery latency
  3. Business Dashboard: Invoices processed, delivery breakdown, top organizations
  4. Vendor Dashboard: Batches by format, parsing success rates

Dependencies:

  • Application Insights workspace
  • Alert action groups (email, SMS)
  • Dashboard configuration and permissions
  • On-call rotation schedule

Risks & Mitigation (Nordic Context):

RiskLikelihoodImpactMitigation StrategyOwner
Alert fatigue from false positivesHIGHMEDIUM- Tuned thresholds based on baseline
- 2-week monitoring before alerts live
- Weekly alert review meetings
- Alert suppression during maintenance
Operations Manager
Insufficient monitoring during off-hoursMEDIUMHIGH- 24/7 on-call rotation
- Automated incident creation in Jira
- Runbook for common issues
- PagerDuty integration for escalation
Operations Manager
Log storage costs exceeding budgetLOWMEDIUM- 90-day log retention
- Sampling for high-volume logs
- Cost alerts at 80% budget
- Archive old logs to blob
Technical Architect
Missing critical metricsMEDIUMMEDIUM- Monthly metrics review
- Stakeholder feedback on dashboard usefulness
- Iterate dashboard based on incidents
Operations Manager


2.10 BR-010: Test Data Strategy (GDPR Compliance)

Requirement: The system shall use only synthetic, non-sensitive test data in all non-production environments, with zero copying of production data to staging, to ensure GDPR compliance and prevent data breaches.

Business Value:

  • Ensures GDPR Article 5(1)(b) compliance (purpose limitation)
  • Prevents catastrophic data breach from non-production environments
  • Reduces storage and transfer costs (no production data duplication)
  • Enables offshore development team participation (India)

Priority: CRITICAL

Nordic Market Context: Swedish Datainspektionen prohibits production data in test environments. Indian development team cannot access personnummer data. European team must lead production debugging.

Acceptance Criteria:

CriterionMeasurement MethodTest CaseTarget
Zero production data in stagingAudit staging blob storageTC-090No real personnummer found
Synthetic data generator creates realistic batchesGenerate 10K synthetic invoicesTC-091Valid structure, fake PII
European team handles production issuesProduction bug workflow documentedTC-092No PII sent to offshore team
Reproduction scenarios use synthetic dataCreate synthetic scenario from production bugTC-093Issue reproducible
Staging data clearly marked as testVisual indicators in UI, filename patternsTC-094Test data obvious
Production access restricted (European team only)Attempt production access from India VPNTC-095Access denied (geo-fenced)
Synthetic data follows Swedish patternsReview generated personnummer, addressesTC-096Realistic but invalid

Dependencies:

  • Synthetic data generation tool (Swedish personnummer, addresses, etc.)
  • Staging environment completely isolated from production
  • Network policies restricting production access
  • Documentation of production issue workflow

Risks & Mitigation (EU/India Context):

RiskLikelihoodImpactMitigation StrategyOwner
Accidental production data leak to stagingLOWCRITICAL- Automated scanning for real personnummer patterns
- No database copying tools
- Production data access audit logs
- Annual security training
Security Officer
Offshore team delays due to data restrictionsMEDIUMMEDIUM- European team creates reproduction scenarios
- Comprehensive synthetic data sets
- Well-documented issue reports
- Pair programming for production issues
Product Owner
Synthetic data unrealistic (testing gaps)MEDIUMMEDIUM- Generate from real data distributions (anonymized)
- Edge cases library (long names, special chars)
- Swedish address/personnummer validation
- Regular synthetic data quality review
QA Team
Production debugging bottleneck (European team only)MEDIUMMEDIUM- European team on-call 24/7
- Comprehensive monitoring reduces debugging needs
- Runbooks for common issues
- Knowledge transfer to European team
Operations Manager


2.11 BR-011: Invoice Download API

Requirement: Users shall be able to download generated invoices (PDF and HTML) through authenticated API endpoints with access control and audit logging.

Business Value:

  • Enables customer service to retrieve invoices for disputes
  • Supports reprint requests without reprocessing
  • Facilitates regulatory compliance (invoice provision upon request)
  • Enables future customer portal integration

Priority: HIGH

Acceptance Criteria:

CriterionMeasurement MethodTest CaseTarget
API endpoint to download PDF by invoice IDGET /invoices/{id}/pdfTC-100PDF file returned
API endpoint to download HTML by invoice IDGET /invoices/{id}/htmlTC-101HTML returned
Download links in batch item responseGET /batches/{id}/items/{itemId}TC-102pdfUrl and htmlUrl present
Access control: org users onlyUser from Org A downloads Org B invoiceTC-103403 Forbidden
Download generates audit log entryDownload invoice, check audit_logsTC-104Entry created
Content-Disposition header for PDFCheck HTTP response headersTC-105Filename in header
Rate limiting on downloadsDownload 1000 invoices rapidlyTC-106Rate limit applied

Dependencies:

  • Blob storage SAS token generation
  • Access control middleware
  • Audit logging service

Risks & Mitigation:

RiskLikelihoodImpactMitigation StrategyOwner
Unauthorized invoice accessLOWHIGH- Organization boundary checks
- Audit all downloads
- Rate limiting
- Anomaly detection
Security Officer
Bandwidth costs for large volumesMEDIUMLOW- CDN for frequently accessed invoices
- Compression
- Monitoring
Technical Architect


2.12 BR-012: Batch History & Search

Requirement: Users shall be able to search, filter, and list historical batches for their organization with support for date ranges, status filters, and vendor format filtering.

Business Value:

  • Enables troubleshooting and root cause analysis
  • Supports operational reporting and SLA tracking
  • Facilitates audit compliance
  • Improves user experience with search capabilities

Priority: MEDIUM

Acceptance Criteria:

CriterionMeasurement MethodTest CaseTarget
List batches with paginationGET /batches?page=1&pageSize=50TC-110Paginated list returned
Filter by date rangeGET /batches?from=2025-11-01&to=2025-11-30TC-111Only Nov batches returned
Filter by statusGET /batches?status=completedTC-112Only completed batches
Filter by vendor formatGET /batches?vendorCode=GASELTC-113Only GASEL batches
Search by batch nameGET /batches?search=NovemberTC-114Name contains "November"
Sort by upload/completion dateGET /batches?sortBy=uploadedAt&order=descTC-115Newest first
Returns last 90 days by defaultGET /batches (no filters)TC-116Last 90 days only
Access restricted to organizationUser queries batches from other orgTC-117Empty results

Dependencies:

  • Batch metadata indexing strategy
  • Query performance optimization
  • Blob storage metadata queries or search index

Risks & Mitigation:

RiskLikelihoodImpactMitigation StrategyOwner
Slow queries with large batch historyMEDIUMMEDIUM- Index on organization_id, date
- Pagination required
- Consider Azure Cognitive Search for Phase 2
Technical Architect


2.13 BR-013: Notification System

Requirement: The system shall send email notifications to designated organization contacts when batch processing completes successfully or fails, including summary statistics and error reports.

Business Value:

  • Reduces manual status checking effort by 80%
  • Enables proactive issue resolution
  • Improves customer satisfaction with timely updates
  • Supports SLA monitoring and reporting

Priority: MEDIUM

Acceptance Criteria:

CriterionMeasurement MethodTest CaseTarget
Email sent on batch completionComplete batch, verify email receivedTC-120Email received within 5 min
Email sent on batch failureForce batch failure, verify emailTC-121Email received within 5 min
Email includes summary statisticsReview email contentTC-122Total, success, failed counts present
Email includes error report for failuresReview failure emailTC-123Failed items listed with reasons
Recipients configurable per organizationUpdate org config, verify new recipientTC-124Email to correct recipients
Email template professional and brandedReview email designTC-125EG branding applied
Links to batch status in emailClick link in emailTC-126Opens to batch detail

Dependencies:

  • Email service (SendGrid or Azure Communication Services)
  • Email templates (HTML)
  • Organization configuration for recipients

Risks & Mitigation:

RiskLikelihoodImpactMitigation StrategyOwner
Email deliverability to org adminsMEDIUMMEDIUM- SPF/DKIM/DMARC for notification domain
- Fallback to SMS for critical alerts
Operations Manager
Notification fatigueMEDIUMLOW- Configurable notification thresholds
- Digest emails for multiple batches
- Opt-in for verbose notifications
Product Owner


  • No labels