tin-spa 20.14.113 → 20.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/index.d.ts +71 -10
- package/fesm2022/{tin-spa-accounting.module-Cg4vWaJE.mjs → tin-spa-accounting.module-BILkGXdD.mjs} +77 -89
- package/fesm2022/tin-spa-accounting.module-BILkGXdD.mjs.map +1 -0
- package/fesm2022/{tin-spa-agent-page.component-DJvMPjCQ.mjs → tin-spa-agent-page.component-Cp4bqg6t.mjs} +2 -2
- package/fesm2022/{tin-spa-agent-page.component-DJvMPjCQ.mjs.map → tin-spa-agent-page.component-Cp4bqg6t.mjs.map} +1 -1
- package/fesm2022/{tin-spa-agent.component-D0CGGnGZ.mjs → tin-spa-agent.component-B9lNOt77.mjs} +4 -4
- package/fesm2022/{tin-spa-agent.component-D0CGGnGZ.mjs.map → tin-spa-agent.component-B9lNOt77.mjs.map} +1 -1
- package/fesm2022/{tin-spa-assets.module-qIWNwJ2E.mjs → tin-spa-assets.module-DmJme9IP.mjs} +16 -11
- package/fesm2022/tin-spa-assets.module-DmJme9IP.mjs.map +1 -0
- package/fesm2022/tin-spa-core.mjs +380 -112
- package/fesm2022/tin-spa-core.mjs.map +1 -1
- package/fesm2022/{tin-spa-general-erp.module-CoYxceLj.mjs → tin-spa-general-erp.module-XyprAx0S.mjs} +2 -2
- package/fesm2022/{tin-spa-general-erp.module-CoYxceLj.mjs.map → tin-spa-general-erp.module-XyprAx0S.mjs.map} +1 -1
- package/fesm2022/{tin-spa-hr.module-CKPZ9ZOj.mjs → tin-spa-hr.module-nk3eBN8I.mjs} +2 -2
- package/fesm2022/{tin-spa-hr.module-CKPZ9ZOj.mjs.map → tin-spa-hr.module-nk3eBN8I.mjs.map} +1 -1
- package/fesm2022/tin-spa-http.mjs +32 -1
- package/fesm2022/tin-spa-http.mjs.map +1 -1
- package/fesm2022/{tin-spa-inventory.module-DRKAcNau.mjs → tin-spa-inventory.module-Dht0gTeq.mjs} +16 -11
- package/fesm2022/tin-spa-inventory.module-Dht0gTeq.mjs.map +1 -0
- package/fesm2022/{tin-spa-loans.module-BTDmgrWo.mjs → tin-spa-loans.module-CZrynkhJ.mjs} +2 -2
- package/fesm2022/{tin-spa-loans.module-BTDmgrWo.mjs.map → tin-spa-loans.module-CZrynkhJ.mjs.map} +1 -1
- package/fesm2022/{tin-spa-manufacturing.module-CHta6oV_.mjs → tin-spa-manufacturing.module-DN8362Ms.mjs} +2 -2
- package/fesm2022/{tin-spa-manufacturing.module-CHta6oV_.mjs.map → tin-spa-manufacturing.module-DN8362Ms.mjs.map} +1 -1
- package/fesm2022/{tin-spa-payroll.module-CZ_GO1jF.mjs → tin-spa-payroll.module-DLD8XGfX.mjs} +12 -9
- package/fesm2022/{tin-spa-payroll.module-CZ_GO1jF.mjs.map → tin-spa-payroll.module-DLD8XGfX.mjs.map} +1 -1
- package/fesm2022/{tin-spa-purchasing.module-NCdwquaF.mjs → tin-spa-purchasing.module-D4tSAY7P.mjs} +16 -11
- package/fesm2022/tin-spa-purchasing.module-D4tSAY7P.mjs.map +1 -0
- package/fesm2022/{tin-spa-sales.module-D0uEGJW7.mjs → tin-spa-sales.module-BoM6453x.mjs} +40 -17
- package/fesm2022/tin-spa-sales.module-BoM6453x.mjs.map +1 -0
- package/fesm2022/{tin-spa-tenancy-erp.module-GwIv8Wbc.mjs → tin-spa-tenancy-erp.module-BhlUtBMA.mjs} +2 -2
- package/fesm2022/{tin-spa-tenancy-erp.module-GwIv8Wbc.mjs.map → tin-spa-tenancy-erp.module-BhlUtBMA.mjs.map} +1 -1
- package/fesm2022/{tin-spa-tin-spa-Cqe5hYTr.mjs → tin-spa-tin-spa-Ca9PhXiH.mjs} +2410 -247
- package/fesm2022/tin-spa-tin-spa-Ca9PhXiH.mjs.map +1 -0
- package/fesm2022/tin-spa.mjs +1 -1
- package/http/index.d.ts +3 -1
- package/index.d.ts +386 -25
- package/package.json +1 -1
- package/src/tin-styles.css +27 -0
- package/fesm2022/tin-spa-accounting.module-Cg4vWaJE.mjs.map +0 -1
- package/fesm2022/tin-spa-assets.module-qIWNwJ2E.mjs.map +0 -1
- package/fesm2022/tin-spa-inventory.module-DRKAcNau.mjs.map +0 -1
- package/fesm2022/tin-spa-purchasing.module-NCdwquaF.mjs.map +0 -1
- package/fesm2022/tin-spa-sales.module-D0uEGJW7.mjs.map +0 -1
- package/fesm2022/tin-spa-tin-spa-Cqe5hYTr.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tin-spa-tenancy-erp.module-GwIv8Wbc.mjs","sources":["../../../projects/tin-spa/src/lib/pages/subscription/subscription.component.ts","../../../projects/tin-spa/src/lib/pages/billing/billing.component.ts","../../../projects/tin-spa/src/lib/modules/tenancy-erp/tenancy-erp.module.ts"],"sourcesContent":["// Subscription management page — current plan display, plan comparison, upgrade/downgrade\nimport { Component, OnInit } from '@angular/core';\nimport { HttpService } from 'tin-spa/core';\nimport { SubscriptionService } from 'tin-spa/core';\nimport { MatSnackBar } from '@angular/material/snack-bar';\nimport { ApiErrorService } from 'tin-spa/core'; // Added: two silent loads and one raw-text snackbar on the plan-change path (WS-6 Phase 4)\n\n@Component({\n selector: 'spa-subscription',\n template: `\n <div class=\"subscription-container\">\n <h4 class=\"page-title\"><mat-icon>card_membership</mat-icon> Subscription</h4>\n\n <!-- Current Plan Card -->\n <mat-card class=\"current-plan-card\" *ngIf=\"currentSubscription\">\n <mat-card-header>\n <mat-icon mat-card-avatar class=\"plan-avatar\">verified</mat-icon>\n <mat-card-title>{{ currentSubscription.planName || 'No Plan' }}</mat-card-title>\n <mat-card-subtitle>\n <span class=\"status-badge\" [ngClass]=\"'status-' + (currentSubscription.status || 0)\">\n {{ getStatusLabel(currentSubscription.status) }}\n </span>\n </mat-card-subtitle>\n </mat-card-header>\n <mat-card-content>\n <div class=\"plan-details\">\n <div class=\"detail-item\">\n <span class=\"detail-label\">Price</span>\n <span class=\"detail-value\">\\${{ currentSubscription.planPrice | number:'1.2-2' }}/{{ currentSubscription.planBillingCycle === 1 ? 'year' : 'month' }}</span>\n </div>\n <div class=\"detail-item\">\n <span class=\"detail-label\">Start Date</span>\n <span class=\"detail-value\">{{ currentSubscription.startDate | date:'mediumDate' }}</span>\n </div>\n <div class=\"detail-item\">\n <span class=\"detail-label\">End Date</span>\n <span class=\"detail-value\">{{ currentSubscription.endDate | date:'mediumDate' }}</span>\n </div>\n <div class=\"detail-item\" *ngIf=\"currentSubscription.trialEndDate\">\n <span class=\"detail-label\">Trial Ends</span>\n <span class=\"detail-value\">{{ currentSubscription.trialEndDate | date:'mediumDate' }}</span>\n </div>\n </div>\n </mat-card-content>\n </mat-card>\n\n <!-- No Subscription Message -->\n <mat-card class=\"current-plan-card\" *ngIf=\"!currentSubscription && !loading\">\n <mat-card-content>\n <p class=\"no-plan-message\"><mat-icon>info</mat-icon> No active subscription. Choose a plan below to get started.</p>\n </mat-card-content>\n </mat-card>\n\n <!-- Plan Comparison Grid -->\n <h5 class=\"section-title\">Available Plans</h5>\n <div class=\"plans-grid\">\n <mat-card *ngFor=\"let plan of availablePlans\" class=\"plan-card\" [ngClass]=\"{'current': plan.planID === currentSubscription?.planID}\">\n <mat-card-header>\n <mat-card-title>{{ plan.name }}</mat-card-title>\n <mat-card-subtitle>{{ plan.description }}</mat-card-subtitle>\n </mat-card-header>\n <mat-card-content>\n <div class=\"plan-price\">\n <span class=\"price-amount\">\\${{ plan.price | number:'1.2-2' }}</span>\n <span class=\"price-period\">/{{ plan.billingCycle === 1 ? 'year' : 'month' }}</span>\n </div>\n <div class=\"plan-limits\">\n <div class=\"limit-item\">\n <mat-icon>group</mat-icon>\n <span>{{ plan.maxUsers === 0 ? 'Unlimited' : plan.maxUsers }} users</span>\n </div>\n <div class=\"limit-item\" *ngIf=\"plan.trialDays > 0\">\n <mat-icon>schedule</mat-icon>\n <span>{{ plan.trialDays }}-day free trial</span>\n </div>\n </div>\n <mat-divider></mat-divider>\n <div class=\"feature-list\">\n <div *ngFor=\"let feature of plan.features\" class=\"feature-item\">\n <mat-icon class=\"feature-check\">check_circle</mat-icon>\n <span>{{ feature.name }}</span>\n <span class=\"feature-limit\" *ngIf=\"feature.limit > 0\">(limit: {{ feature.limit }})</span>\n </div>\n <div *ngIf=\"!plan.features || plan.features.length === 0\" class=\"no-features\">\n <mat-icon>info_outline</mat-icon> No features configured\n </div>\n </div>\n </mat-card-content>\n <mat-card-actions>\n <button mat-raised-button *ngIf=\"plan.planID === currentSubscription?.planID\" disabled color=\"primary\">\n <mat-icon>check</mat-icon> Current Plan\n </button>\n <button mat-raised-button *ngIf=\"plan.planID !== currentSubscription?.planID\" color=\"accent\" (click)=\"confirmChangePlan(plan)\">\n <mat-icon>{{ isPlanUpgrade(plan) ? 'upgrade' : 'arrow_downward' }}</mat-icon>\n {{ isPlanUpgrade(plan) ? 'Upgrade' : 'Switch' }}\n </button>\n </mat-card-actions>\n </mat-card>\n </div>\n\n <!-- Confirmation Dialog (inline) -->\n <div class=\"overlay\" *ngIf=\"showConfirmation\" (click)=\"cancelChange()\">\n <mat-card class=\"confirm-dialog\" (click)=\"$event.stopPropagation()\">\n <mat-card-header>\n <mat-card-title>Confirm Plan Change</mat-card-title>\n </mat-card-header>\n <mat-card-content>\n <p>Are you sure you want to {{ isPlanUpgrade(selectedPlan) ? 'upgrade' : 'switch' }} to the <strong>{{ selectedPlan?.name }}</strong> plan?</p>\n <p class=\"price-info\">Price: <strong>\\${{ selectedPlan?.price | number:'1.2-2' }}/{{ selectedPlan?.billingCycle === 1 ? 'year' : 'month' }}</strong></p>\n <p *ngIf=\"selectedPlan?.trialDays > 0\" class=\"trial-info\">\n <mat-icon>schedule</mat-icon> Includes {{ selectedPlan?.trialDays }}-day free trial\n </p>\n </mat-card-content>\n <mat-card-actions align=\"end\">\n <button mat-button (click)=\"cancelChange()\">Cancel</button>\n <button mat-raised-button color=\"primary\" (click)=\"executePlanChange()\" [disabled]=\"changingPlan\">\n <mat-icon *ngIf=\"changingPlan\">hourglass_empty</mat-icon>\n {{ changingPlan ? 'Processing...' : 'Confirm' }}\n </button>\n </mat-card-actions>\n </mat-card>\n </div>\n </div>\n `,\n styles: [`\n .subscription-container { padding: 16px; max-width: 1200px; }\n .page-title { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; color: #333; font-weight: 500; }\n .section-title { margin: 24px 0 16px; color: #555; }\n\n .current-plan-card { margin-bottom: 24px; }\n .plan-avatar { font-size: 40px; width: 40px; height: 40px; color: #1976d2; }\n .plan-details { display: flex; gap: 32px; flex-wrap: wrap; padding: 8px 0; }\n .detail-item { display: flex; flex-direction: column; }\n .detail-label { font-size: 12px; color: #888; text-transform: uppercase; }\n .detail-value { font-size: 16px; font-weight: 500; }\n\n .status-badge { padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; }\n .status-0 { background: #e3f2fd; color: #1565c0; } /* Trial */\n .status-1 { background: #e8f5e9; color: #2e7d32; } /* Active */\n .status-2 { background: #fff3e0; color: #e65100; } /* PastDue */\n .status-3 { background: #fce4ec; color: #c62828; } /* Cancelled */\n .status-4 { background: #f5f5f5; color: #616161; } /* Expired */\n\n .no-plan-message { display: flex; align-items: center; gap: 8px; color: #666; margin: 0; }\n\n .plans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }\n .plan-card { display: flex; flex-direction: column; }\n .plan-card.current { border: 2px solid #1976d2; }\n .plan-price { text-align: center; padding: 16px 0; }\n .price-amount { font-size: 32px; font-weight: 700; color: #1976d2; }\n .price-period { font-size: 14px; color: #888; }\n\n .plan-limits { display: flex; gap: 16px; justify-content: center; padding-bottom: 12px; }\n .limit-item { display: flex; align-items: center; gap: 4px; font-size: 13px; color: #666; }\n .limit-item mat-icon { font-size: 18px; width: 18px; height: 18px; }\n\n .feature-list { padding: 12px 0; }\n .feature-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; }\n .feature-check { color: #4caf50; font-size: 18px; width: 18px; height: 18px; }\n .feature-limit { font-size: 12px; color: #999; }\n .no-features { display: flex; align-items: center; gap: 4px; color: #999; font-size: 13px; }\n\n mat-card-actions { margin-top: auto; }\n mat-card-actions button { width: 100%; }\n\n .overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 1000; }\n .confirm-dialog { max-width: 440px; width: 90%; }\n .price-info { font-size: 16px; }\n .trial-info { display: flex; align-items: center; gap: 4px; color: #1976d2; font-size: 14px; }\n `],\n standalone: false\n})\nexport class SubscriptionPageComponent implements OnInit {\n\n currentSubscription: any = null;\n availablePlans: any[] = [];\n loading = true;\n showConfirmation = false;\n selectedPlan: any = null;\n changingPlan = false;\n\n constructor(\n private httpService: HttpService,\n private subscriptionService: SubscriptionService,\n private snackBar: MatSnackBar,\n private apiErrorService: ApiErrorService // Changed: injected so a failed load or plan change is classified rather than swallowed or echoed\n ) { }\n\n ngOnInit() {\n this.loadCurrentSubscription();\n this.loadAvailablePlans();\n }\n\n // Load the current tenant's active subscription\n loadCurrentSubscription() {\n this.httpService.Get('subscriptions/current').subscribe({\n next: (response: any) => {\n if (response?.success) {\n this.currentSubscription = response.data;\n } else {\n this.apiErrorService.presentAppFailure(response, 'load', 'subscriptions/current'); // Added: was silent — the \"your current plan\" panel stayed blank, and a user comparing plans could not tell which one they were already on\n }\n this.loading = false;\n },\n error: () => { this.loading = false; }\n });\n }\n\n // Load all available plans with their features\n loadAvailablePlans() {\n this.httpService.Get('subscriptions/plans').subscribe({\n next: (response: any) => {\n if (response?.success) {\n this.availablePlans = response.data || [];\n } else {\n this.apiErrorService.presentAppFailure(response, 'load', 'subscriptions/plans'); // Added: was silent. A plan-comparison page with no plans on it reads as \"there is nothing to upgrade to\", which is a commercially wrong thing to tell someone by accident\n }\n }\n });\n }\n\n // Get human-readable subscription status label\n getStatusLabel(status: number): string {\n const labels: Record<number, string> = { 0: 'Trial', 1: 'Active', 2: 'Past Due', 3: 'Cancelled', 4: 'Expired' };\n return labels[status] || 'Unknown';\n }\n\n // Check if the target plan is an upgrade (higher price)\n isPlanUpgrade(plan: any): boolean {\n if (!this.currentSubscription) return true;\n return (plan?.price || 0) > (this.currentSubscription?.planPrice || 0);\n }\n\n // Show confirmation dialog for plan change\n confirmChangePlan(plan: any) {\n this.selectedPlan = plan;\n this.showConfirmation = true;\n }\n\n // Cancel the plan change dialog\n cancelChange() {\n this.showConfirmation = false;\n this.selectedPlan = null;\n }\n\n // Execute the plan change via API\n executePlanChange() {\n if (!this.selectedPlan) return;\n this.changingPlan = true;\n\n this.httpService.Post('subscriptions/change', { planID: this.selectedPlan.planID }).subscribe({\n next: (response: any) => {\n this.changingPlan = false;\n this.showConfirmation = false;\n if (response?.success) {\n this.snackBar.open('Plan changed successfully', '', { duration: 3000 });\n this.loadCurrentSubscription(); // Refresh current subscription\n this.subscriptionService.loadFeatures(); // Refresh enabled features for UI gating\n } else {\n this.apiErrorService.presentAppFailure(response, 'action', 'subscriptions/change'); // Changed: was a bare MatSnackBar carrying response.message verbatim for 3 seconds. 'action' rather than 'submit' — this sits behind a confirmation panel with nothing typed into it, so the 'submit' wording about a still-populated form would not be true\n }\n },\n error: () => {\n this.changingPlan = false;\n this.snackBar.open('Failed to change plan', '', { duration: 3000 });\n }\n });\n }\n}\n","// Billing page — invoice history table, invoice detail dialog, and payment flow dialog\nimport { Component, OnInit } from '@angular/core';\nimport { HttpService } from 'tin-spa/core';\nimport { MatSnackBar } from '@angular/material/snack-bar';\nimport { ApiErrorService } from 'tin-spa/core'; // Added: this page had four unhandled `success` checks, two of them on a money path (WS-6 Phase 4)\nimport { redactSecrets } from 'tin-spa/core'; // Added (security 2026-08-31)\n\n@Component({\n selector: 'spa-billing',\n template: `\n <div class=\"billing-container\">\n <h4 class=\"page-title\"><mat-icon>receipt_long</mat-icon> Billing & Invoices</h4>\n\n <!-- Current Subscription Summary -->\n <mat-card class=\"summary-card\" *ngIf=\"currentSubscription\">\n <mat-card-content>\n <div class=\"summary-row\">\n <div class=\"summary-item\">\n <span class=\"summary-label\">Current Plan</span>\n <span class=\"summary-value\">{{ currentSubscription.planName || 'No Plan' }}</span>\n </div>\n <div class=\"summary-item\">\n <span class=\"summary-label\">Status</span>\n <span class=\"status-badge\" [ngClass]=\"'status-' + (currentSubscription.status || 0)\">\n {{ getStatusLabel(currentSubscription.status) }}\n </span>\n </div>\n <div class=\"summary-item\">\n <span class=\"summary-label\">Next Billing</span>\n <span class=\"summary-value\">{{ currentSubscription.endDate | date:'mediumDate' }}</span>\n </div>\n </div>\n </mat-card-content>\n </mat-card>\n\n <!-- Invoice History Table -->\n <mat-card class=\"invoices-card\">\n <mat-card-header>\n <mat-card-title>Invoice History</mat-card-title>\n </mat-card-header>\n <mat-card-content>\n <div class=\"table-container\" *ngIf=\"invoices.length > 0\">\n <table class=\"invoice-table\">\n <thead>\n <tr>\n <th>Date</th>\n <th>Description</th>\n <th>Amount</th>\n <th>Status</th>\n <th>Payment Method</th>\n <th>Actions</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let invoice of invoices\">\n <td>{{ invoice.invoiceDate | date:'mediumDate' }}</td>\n <td>{{ invoice.description || invoice.planName + ' Subscription' }}</td>\n <td>{{ invoice.currency }} {{ invoice.amount | number:'1.2-2' }}</td>\n <td>\n <span class=\"invoice-status\" [ngClass]=\"'inv-status-' + invoice.status\">\n {{ getInvoiceStatusLabel(invoice.status) }}\n </span>\n </td>\n <td>{{ invoice.paymentMethod || '-' }}</td>\n <td>\n <button mat-icon-button (click)=\"viewInvoiceDetail(invoice)\" matTooltip=\"View Details\">\n <mat-icon>launch</mat-icon><!-- Changed: 'visibility' (eye) -> 'launch'. This opens the invoice detail, so it is a view action and must carry the same icon as every other view in the estate -->\n </button>\n <button mat-icon-button *ngIf=\"invoice.status === 0\" (click)=\"initiatePayment(invoice)\" matTooltip=\"Pay Now\" color=\"primary\">\n <mat-icon>payment</mat-icon>\n </button>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <div class=\"empty-state\" *ngIf=\"invoices.length === 0 && !loading\">\n <mat-icon>receipt</mat-icon>\n <p>No invoices yet</p>\n </div>\n <div class=\"loading-state\" *ngIf=\"loading\">\n <mat-spinner diameter=\"32\"></mat-spinner>\n <p>Loading invoices...</p>\n </div>\n </mat-card-content>\n </mat-card>\n\n <!-- Invoice Detail Dialog (inline overlay) -->\n <div class=\"overlay\" *ngIf=\"showDetail\" (click)=\"closeDetail()\">\n <mat-card class=\"detail-dialog\" (click)=\"$event.stopPropagation()\">\n <mat-card-header>\n <mat-card-title>Invoice Detail</mat-card-title>\n <button mat-icon-button class=\"close-btn\" (click)=\"closeDetail()\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-card-header>\n <mat-card-content *ngIf=\"selectedInvoice\">\n <div class=\"detail-grid\">\n <div class=\"detail-field\">\n <span class=\"field-label\">Plan</span>\n <span class=\"field-value\">{{ selectedInvoice.planName }}</span>\n </div>\n <div class=\"detail-field\">\n <span class=\"field-label\">Amount</span>\n <span class=\"field-value\">{{ selectedInvoice.currency }} {{ selectedInvoice.amount | number:'1.2-2' }}</span>\n </div>\n <div class=\"detail-field\">\n <span class=\"field-label\">Status</span>\n <span class=\"invoice-status\" [ngClass]=\"'inv-status-' + selectedInvoice.status\">\n {{ getInvoiceStatusLabel(selectedInvoice.status) }}\n </span>\n </div>\n <div class=\"detail-field\">\n <span class=\"field-label\">Invoice Date</span>\n <span class=\"field-value\">{{ selectedInvoice.invoiceDate | date:'medium' }}</span>\n </div>\n <div class=\"detail-field\" *ngIf=\"selectedInvoice.paidDate\">\n <span class=\"field-label\">Paid Date</span>\n <span class=\"field-value\">{{ selectedInvoice.paidDate | date:'medium' }}</span>\n </div>\n <div class=\"detail-field\" *ngIf=\"selectedInvoice.paymentReference\">\n <span class=\"field-label\">Payment Reference</span>\n <span class=\"field-value\">{{ selectedInvoice.paymentReference }}</span>\n </div>\n <div class=\"detail-field\" *ngIf=\"selectedInvoice.paymentMethod\">\n <span class=\"field-label\">Payment Method</span>\n <span class=\"field-value\">{{ selectedInvoice.paymentMethod }}</span>\n </div>\n </div>\n\n <!-- Payment Transaction Audit Trail -->\n <div class=\"transactions-section\" *ngIf=\"selectedInvoice.transactions?.length > 0\">\n <h5>Payment Transactions</h5>\n <table class=\"transaction-table\">\n <thead>\n <tr>\n <th>Date</th>\n <th>Reference</th>\n <th>Amount</th>\n <th>Status</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let txn of selectedInvoice.transactions\">\n <td>{{ txn.createdDate | date:'medium' }}</td>\n <td>{{ txn.gatewayReference || '-' }}</td>\n <td>{{ txn.currency }} {{ txn.amount | number:'1.2-2' }}</td>\n <td>\n <span class=\"txn-status\" [ngClass]=\"'txn-status-' + txn.status\">\n {{ getPaymentStatusLabel(txn.status) }}\n </span>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <div class=\"transactions-section\" *ngIf=\"!selectedInvoice.transactions || selectedInvoice.transactions.length === 0\">\n <h5>Payment Transactions</h5>\n <p class=\"no-transactions\">No payment transactions recorded</p>\n </div>\n </mat-card-content>\n </mat-card>\n </div>\n\n <!-- Payment Flow Dialog (inline overlay) -->\n <div class=\"overlay\" *ngIf=\"showPayment\" (click)=\"closePayment()\">\n <mat-card class=\"payment-dialog\" (click)=\"$event.stopPropagation()\">\n <mat-card-header>\n <mat-card-title>Process Payment</mat-card-title>\n </mat-card-header>\n <mat-card-content *ngIf=\"paymentInvoice\">\n <div class=\"payment-summary\">\n <p>Plan: <strong>{{ paymentInvoice.planName }}</strong></p>\n <p>Amount: <strong>{{ paymentInvoice.currency }} {{ paymentInvoice.amount | number:'1.2-2' }}</strong></p>\n </div>\n\n <!-- Payment processing state -->\n <div class=\"payment-state\" *ngIf=\"paymentProcessing\">\n <mat-spinner diameter=\"40\"></mat-spinner>\n <p>Processing payment...</p>\n </div>\n\n <!-- Payment success state -->\n <div class=\"payment-state success\" *ngIf=\"paymentResult?.success\">\n <mat-icon class=\"result-icon success-icon\">check_circle</mat-icon>\n <p>Payment completed successfully!</p>\n <p class=\"payment-ref\" *ngIf=\"paymentResult.reference\">Reference: {{ paymentResult.reference }}</p>\n </div>\n\n <!-- Payment redirect state (live mode) -->\n <div class=\"payment-state redirect\" *ngIf=\"paymentResult && !paymentResult.success && paymentResult.redirectUrl\">\n <mat-icon class=\"result-icon redirect-icon\">open_in_new</mat-icon>\n <p>You will be redirected to complete payment</p>\n <a mat-raised-button color=\"primary\" [href]=\"paymentResult.redirectUrl\" target=\"_blank\">\n <mat-icon>payment</mat-icon> Complete Payment\n </a>\n </div>\n\n <!-- Payment failure state -->\n <div class=\"payment-state error\" *ngIf=\"paymentResult && !paymentResult.success && !paymentResult.redirectUrl\">\n <mat-icon class=\"result-icon error-icon\">error</mat-icon>\n <p>{{ paymentResult.message || 'Payment failed. Please try again.' }}</p>\n </div>\n </mat-card-content>\n <mat-card-actions align=\"end\">\n <button mat-button (click)=\"closePayment()\">{{ paymentResult?.success ? 'Done' : 'Cancel' }}</button>\n <button mat-raised-button color=\"primary\" *ngIf=\"!paymentProcessing && !paymentResult\" (click)=\"processPayment()\">\n <mat-icon>payment</mat-icon> Pay Now\n </button>\n </mat-card-actions>\n </mat-card>\n </div>\n </div>\n `,\n styles: [`\n .billing-container { padding: 16px; max-width: 1200px; }\n .page-title { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; color: #333; font-weight: 500; }\n\n .summary-card { margin-bottom: 24px; }\n .summary-row { display: flex; gap: 32px; flex-wrap: wrap; }\n .summary-item { display: flex; flex-direction: column; }\n .summary-label { font-size: 12px; color: #888; text-transform: uppercase; }\n .summary-value { font-size: 16px; font-weight: 500; }\n\n .status-badge { padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; }\n .status-0 { background: #e3f2fd; color: #1565c0; }\n .status-1 { background: #e8f5e9; color: #2e7d32; }\n .status-2 { background: #fff3e0; color: #e65100; }\n .status-3 { background: #fce4ec; color: #c62828; }\n .status-4 { background: #f5f5f5; color: #616161; }\n\n .invoices-card { margin-bottom: 24px; }\n .table-container { overflow-x: auto; }\n .invoice-table, .transaction-table { width: 100%; border-collapse: collapse; }\n .invoice-table th, .invoice-table td,\n .transaction-table th, .transaction-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #e0e0e0; font-size: 14px; }\n .invoice-table th, .transaction-table th { font-weight: 500; color: #666; font-size: 12px; text-transform: uppercase; }\n .invoice-table tbody tr:hover { background: #f5f5f5; }\n\n .invoice-status { padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 500; }\n .inv-status-0 { background: #fff3e0; color: #e65100; } /* Pending */\n .inv-status-1 { background: #e8f5e9; color: #2e7d32; } /* Paid */\n .inv-status-2 { background: #fce4ec; color: #c62828; } /* Failed */\n .inv-status-3 { background: #f3e5f5; color: #6a1b9a; } /* Refunded */\n\n .txn-status { padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 500; }\n .txn-status-0 { background: #e3f2fd; color: #1565c0; } /* Initiated */\n .txn-status-1 { background: #fff3e0; color: #e65100; } /* Pending */\n .txn-status-2 { background: #e8f5e9; color: #2e7d32; } /* Success */\n .txn-status-3 { background: #fce4ec; color: #c62828; } /* Failed */\n .txn-status-4 { background: #f5f5f5; color: #616161; } /* Cancelled */\n\n .empty-state, .loading-state { display: flex; flex-direction: column; align-items: center; padding: 32px; color: #999; }\n .empty-state mat-icon { font-size: 48px; width: 48px; height: 48px; margin-bottom: 8px; }\n\n .overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 1000; }\n .detail-dialog { max-width: 640px; width: 90%; max-height: 80vh; overflow-y: auto; }\n .payment-dialog { max-width: 440px; width: 90%; }\n\n .close-btn { position: absolute; top: 8px; right: 8px; }\n\n .detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }\n .detail-field { display: flex; flex-direction: column; }\n .field-label { font-size: 12px; color: #888; text-transform: uppercase; }\n .field-value { font-size: 14px; font-weight: 500; }\n\n .transactions-section { margin-top: 16px; }\n .transactions-section h5 { margin: 0 0 8px; color: #555; }\n .no-transactions { color: #999; font-size: 13px; }\n\n .payment-summary { margin-bottom: 16px; }\n .payment-summary p { margin: 4px 0; font-size: 15px; }\n\n .payment-state { display: flex; flex-direction: column; align-items: center; padding: 24px; text-align: center; }\n .result-icon { font-size: 48px; width: 48px; height: 48px; margin-bottom: 8px; }\n .success-icon { color: #4caf50; }\n .redirect-icon { color: #1976d2; }\n .error-icon { color: #f44336; }\n .payment-ref { font-size: 12px; color: #888; }\n `],\n standalone: false\n})\nexport class BillingPageComponent implements OnInit {\n\n currentSubscription: any = null;\n invoices: any[] = [];\n loading = true;\n\n // Invoice detail dialog state\n showDetail = false;\n selectedInvoice: any = null;\n\n // Payment dialog state\n showPayment = false;\n paymentInvoice: any = null;\n paymentProcessing = false;\n paymentResult: any = null;\n\n constructor(\n private httpService: HttpService,\n private snackBar: MatSnackBar,\n private apiErrorService: ApiErrorService // Changed: injected so failures on this page are classified, not swallowed or echoed\n ) { }\n\n ngOnInit() {\n this.loadCurrentSubscription();\n this.loadInvoices();\n }\n\n // Load current subscription summary\n loadCurrentSubscription() {\n this.httpService.Get('subscriptions/current').subscribe({\n next: (response: any) => {\n if (response?.success) {\n this.currentSubscription = response.data;\n } else {\n this.apiErrorService.presentAppFailure(response, 'load', 'subscriptions/current'); // Added: was silent — the subscription summary card simply did not render, so a tenant could not tell a broken read from having no plan\n }\n }\n });\n }\n\n // Load invoice history for the current tenant\n loadInvoices() {\n this.httpService.Get('tenantinvoices/all/x').subscribe({\n next: (response: any) => {\n if (response?.success) {\n this.invoices = response.data || [];\n } else {\n this.apiErrorService.presentAppFailure(response, 'load', 'tenantinvoices/all/x'); // Added: was silent. An empty invoice list is a perfectly normal state for a new tenant, which is precisely why a FAILED one must not look the same — \"you have no invoices\" is a different fact from \"we could not fetch them\"\n }\n this.loading = false;\n },\n error: () => { this.loading = false; }\n });\n }\n\n // Subscription status label mapping\n getStatusLabel(status: number): string {\n const labels: Record<number, string> = { 0: 'Trial', 1: 'Active', 2: 'Past Due', 3: 'Cancelled', 4: 'Expired' };\n return labels[status] || 'Unknown';\n }\n\n // Invoice status label mapping (TenantInvoiceStatus enum)\n getInvoiceStatusLabel(status: number): string {\n const labels: Record<number, string> = { 0: 'Pending', 1: 'Paid', 2: 'Failed', 3: 'Refunded' };\n return labels[status] || 'Unknown';\n }\n\n // Payment transaction status label mapping (GatewayPaymentStatus enum)\n getPaymentStatusLabel(status: number): string {\n const labels: Record<number, string> = { 0: 'Initiated', 1: 'Pending', 2: 'Success', 3: 'Failed', 4: 'Cancelled' };\n return labels[status] || 'Unknown';\n }\n\n // View invoice detail with payment transaction audit trail\n viewInvoiceDetail(invoice: any) {\n this.httpService.Get('tenantinvoices/detail/' + invoice.tenantInvoiceID).subscribe({\n next: (response: any) => {\n if (response?.success) {\n this.selectedInvoice = response.data;\n this.showDetail = true;\n } else {\n this.apiErrorService.presentAppFailure(response, 'action', 'tenantinvoices/detail/' + invoice.tenantInvoiceID); // Changed: was a bare MatSnackBar carrying response.message — raw server text for 3 seconds, ApiErrorService bypassed entirely, the same shape Phase 3 removed from groups.component.ts\n }\n },\n error: () => {\n this.snackBar.open('Failed to load invoice detail', '', { duration: 3000 });\n }\n });\n }\n\n // Close the invoice detail dialog\n closeDetail() {\n this.showDetail = false;\n this.selectedInvoice = null;\n }\n\n // Open payment dialog for a pending invoice\n initiatePayment(invoice: any) {\n this.paymentInvoice = invoice;\n this.paymentProcessing = false;\n this.paymentResult = null;\n this.showPayment = true;\n }\n\n // Process payment via payments API\n processPayment() {\n if (!this.paymentInvoice) return;\n this.paymentProcessing = true;\n\n this.httpService.Post('payments/process/' + this.paymentInvoice.tenantInvoiceID, {}).subscribe({\n next: (response: any) => {\n this.paymentProcessing = false;\n if (response?.success) {\n // Dev mode: payment auto-completed\n this.paymentResult = { success: true, reference: response.data?.reference };\n this.loadInvoices(); // Refresh invoice list\n } else if (response?.data?.redirectUrl) {\n // Live mode: redirect to Paynow\n this.paymentResult = { success: false, redirectUrl: response.data.redirectUrl };\n } else {\n this.paymentResult = { success: false, message: this.paymentFailureText(response, 'payments/process/' + this.paymentInvoice.tenantInvoiceID) }; // Changed: was `response?.message || 'Payment failed'` rendered verbatim at the template's failure state\n }\n },\n error: () => {\n this.paymentProcessing = false;\n this.paymentResult = { success: false, message: 'Payment request failed. Please try again.' };\n }\n });\n }\n\n // Added: the payment dialog is the one place in this sweep where a MODAL is the WRONG answer. It already\n // owns a dedicated failure state — error icon, red panel, inside the dialog the user is staring at — so\n // stacking presentAppFailure's dialog on top of it would talk over a surface that is already doing the job,\n // and would leave the panel underneath still showing the raw sentence anyway.\n //\n // What was actually wrong was the TEXT, not the surface. So the classifier is reused directly: a message a\n // backend author wrote for a human (\"Insufficient funds\", \"Card declined\") is exactly what someone paying an\n // invoice needs and is shown unchanged, while an implementation leak is replaced. The reference, when the\n // catch-all minted one, is kept — a failed payment is the single most likely thing a tenant phones about.\n private paymentFailureText(response: any, url: string): string {\n const raw = response?.message;\n console.error('[tin-spa] payment failure', { url: redactSecrets(url), message: redactSecrets(raw) }); // Changed (security 2026-08-31): dropped `response` — this is the PAYMENT path, and the raw response object is the last place in the library that should be printed to a console. URL and message, redacted, are the technical detail that matters.\n\n if (this.apiErrorService.classifyMessage(raw) === 'business') return raw;\n\n const reference = this.apiErrorService.extractReference(raw);\n return `We couldn't complete that payment because of a technical problem — not anything you did wrong. Nothing was charged.` +\n (reference ? ` Please try again shortly, and quote reference ${reference} if you contact your administrator.` : ` Please try again shortly.`);\n }\n\n // Close the payment dialog\n closePayment() {\n this.showPayment = false;\n this.paymentInvoice = null;\n this.paymentResult = null;\n if (this.paymentResult?.success) {\n this.loadInvoices(); // Refresh if payment was successful\n }\n }\n}\n","// Added (S10-part-1): the two Tier-3 leaves that used to sit inside the CORE TenancyModule — subscription and\n// billing (per [C-AMD-3] / AMB-1). Same shape as GeneralErpModule. URLs unchanged: home/tenancy/subscription\n// and home/tenancy/billing.\nimport { NgModule } from '@angular/core';\nimport { RouterModule, Routes } from '@angular/router';\nimport { CommonModule } from '@angular/common';\nimport { SpaAdminModule } from '../spa-admin.module';\nimport { SubscriptionPageComponent } from '../../pages/subscription/subscription.component';\nimport { BillingPageComponent } from '../../pages/billing/billing.component';\n\nexport const TENANCY_ERP_ROUTES: Routes = [\n { path: \"subscription\", component: SubscriptionPageComponent },\n { path: \"billing\", component: BillingPageComponent }\n];\n\n@NgModule({\n declarations: [SubscriptionPageComponent, BillingPageComponent],\n imports: [CommonModule, SpaAdminModule, RouterModule.forChild(TENANCY_ERP_ROUTES)]\n})\nexport class TenancyErpModule { }\n"],"names":["i3","i4","i5","i7","i8","i1"],"mappings":";;;;;;;;;;;;;;;;;AAAA;MA4Ka,yBAAyB,CAAA;IASpC,WAAA,CACU,WAAwB,EACxB,mBAAwC,EACxC,QAAqB,EACrB,eAAgC;;QAHhC,IAAA,CAAA,WAAW,GAAX,WAAW;QACX,IAAA,CAAA,mBAAmB,GAAnB,mBAAmB;QACnB,IAAA,CAAA,QAAQ,GAAR,QAAQ;QACR,IAAA,CAAA,eAAe,GAAf,eAAe;QAXzB,IAAA,CAAA,mBAAmB,GAAQ,IAAI;QAC/B,IAAA,CAAA,cAAc,GAAU,EAAE;QAC1B,IAAA,CAAA,OAAO,GAAG,IAAI;QACd,IAAA,CAAA,gBAAgB,GAAG,KAAK;QACxB,IAAA,CAAA,YAAY,GAAQ,IAAI;QACxB,IAAA,CAAA,YAAY,GAAG,KAAK;IAOhB;IAEJ,QAAQ,GAAA;QACN,IAAI,CAAC,uBAAuB,EAAE;QAC9B,IAAI,CAAC,kBAAkB,EAAE;IAC3B;;IAGA,uBAAuB,GAAA;QACrB,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC,SAAS,CAAC;AACtD,YAAA,IAAI,EAAE,CAAC,QAAa,KAAI;AACtB,gBAAA,IAAI,QAAQ,EAAE,OAA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A,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,iBAHZ,yBAAyB,EAAE,oBAAoB,CAAA,EAAA,OAAA,EAAA,CACpD,YAAY,EAAE,cAAc,EAAAK,IAAA,CAAA,YAAA,CAAA,EAAA,CAAA,CAAA;gHAE3B,gBAAgB,EAAA,OAAA,EAAA,CAFjB,YAAY,EAAE,cAAc,EAAE,YAAY,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAA,EAAA,CAAA,CAAA;;4FAEtE,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,CAAC,yBAAyB,EAAE,oBAAoB,CAAC;AAC/D,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,YAAY,CAAC,QAAQ,CAAC,kBAAkB,CAAC;AAClF,iBAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"tin-spa-tenancy-erp.module-BhlUtBMA.mjs","sources":["../../../projects/tin-spa/src/lib/pages/subscription/subscription.component.ts","../../../projects/tin-spa/src/lib/pages/billing/billing.component.ts","../../../projects/tin-spa/src/lib/modules/tenancy-erp/tenancy-erp.module.ts"],"sourcesContent":["// Subscription management page — current plan display, plan comparison, upgrade/downgrade\nimport { Component, OnInit } from '@angular/core';\nimport { HttpService } from 'tin-spa/core';\nimport { SubscriptionService } from 'tin-spa/core';\nimport { MatSnackBar } from '@angular/material/snack-bar';\nimport { ApiErrorService } from 'tin-spa/core'; // Added: two silent loads and one raw-text snackbar on the plan-change path (WS-6 Phase 4)\n\n@Component({\n selector: 'spa-subscription',\n template: `\n <div class=\"subscription-container\">\n <h4 class=\"page-title\"><mat-icon>card_membership</mat-icon> Subscription</h4>\n\n <!-- Current Plan Card -->\n <mat-card class=\"current-plan-card\" *ngIf=\"currentSubscription\">\n <mat-card-header>\n <mat-icon mat-card-avatar class=\"plan-avatar\">verified</mat-icon>\n <mat-card-title>{{ currentSubscription.planName || 'No Plan' }}</mat-card-title>\n <mat-card-subtitle>\n <span class=\"status-badge\" [ngClass]=\"'status-' + (currentSubscription.status || 0)\">\n {{ getStatusLabel(currentSubscription.status) }}\n </span>\n </mat-card-subtitle>\n </mat-card-header>\n <mat-card-content>\n <div class=\"plan-details\">\n <div class=\"detail-item\">\n <span class=\"detail-label\">Price</span>\n <span class=\"detail-value\">\\${{ currentSubscription.planPrice | number:'1.2-2' }}/{{ currentSubscription.planBillingCycle === 1 ? 'year' : 'month' }}</span>\n </div>\n <div class=\"detail-item\">\n <span class=\"detail-label\">Start Date</span>\n <span class=\"detail-value\">{{ currentSubscription.startDate | date:'mediumDate' }}</span>\n </div>\n <div class=\"detail-item\">\n <span class=\"detail-label\">End Date</span>\n <span class=\"detail-value\">{{ currentSubscription.endDate | date:'mediumDate' }}</span>\n </div>\n <div class=\"detail-item\" *ngIf=\"currentSubscription.trialEndDate\">\n <span class=\"detail-label\">Trial Ends</span>\n <span class=\"detail-value\">{{ currentSubscription.trialEndDate | date:'mediumDate' }}</span>\n </div>\n </div>\n </mat-card-content>\n </mat-card>\n\n <!-- No Subscription Message -->\n <mat-card class=\"current-plan-card\" *ngIf=\"!currentSubscription && !loading\">\n <mat-card-content>\n <p class=\"no-plan-message\"><mat-icon>info</mat-icon> No active subscription. Choose a plan below to get started.</p>\n </mat-card-content>\n </mat-card>\n\n <!-- Plan Comparison Grid -->\n <h5 class=\"section-title\">Available Plans</h5>\n <div class=\"plans-grid\">\n <mat-card *ngFor=\"let plan of availablePlans\" class=\"plan-card\" [ngClass]=\"{'current': plan.planID === currentSubscription?.planID}\">\n <mat-card-header>\n <mat-card-title>{{ plan.name }}</mat-card-title>\n <mat-card-subtitle>{{ plan.description }}</mat-card-subtitle>\n </mat-card-header>\n <mat-card-content>\n <div class=\"plan-price\">\n <span class=\"price-amount\">\\${{ plan.price | number:'1.2-2' }}</span>\n <span class=\"price-period\">/{{ plan.billingCycle === 1 ? 'year' : 'month' }}</span>\n </div>\n <div class=\"plan-limits\">\n <div class=\"limit-item\">\n <mat-icon>group</mat-icon>\n <span>{{ plan.maxUsers === 0 ? 'Unlimited' : plan.maxUsers }} users</span>\n </div>\n <div class=\"limit-item\" *ngIf=\"plan.trialDays > 0\">\n <mat-icon>schedule</mat-icon>\n <span>{{ plan.trialDays }}-day free trial</span>\n </div>\n </div>\n <mat-divider></mat-divider>\n <div class=\"feature-list\">\n <div *ngFor=\"let feature of plan.features\" class=\"feature-item\">\n <mat-icon class=\"feature-check\">check_circle</mat-icon>\n <span>{{ feature.name }}</span>\n <span class=\"feature-limit\" *ngIf=\"feature.limit > 0\">(limit: {{ feature.limit }})</span>\n </div>\n <div *ngIf=\"!plan.features || plan.features.length === 0\" class=\"no-features\">\n <mat-icon>info_outline</mat-icon> No features configured\n </div>\n </div>\n </mat-card-content>\n <mat-card-actions>\n <button mat-raised-button *ngIf=\"plan.planID === currentSubscription?.planID\" disabled color=\"primary\">\n <mat-icon>check</mat-icon> Current Plan\n </button>\n <button mat-raised-button *ngIf=\"plan.planID !== currentSubscription?.planID\" color=\"accent\" (click)=\"confirmChangePlan(plan)\">\n <mat-icon>{{ isPlanUpgrade(plan) ? 'upgrade' : 'arrow_downward' }}</mat-icon>\n {{ isPlanUpgrade(plan) ? 'Upgrade' : 'Switch' }}\n </button>\n </mat-card-actions>\n </mat-card>\n </div>\n\n <!-- Confirmation Dialog (inline) -->\n <div class=\"overlay\" *ngIf=\"showConfirmation\" (click)=\"cancelChange()\">\n <mat-card class=\"confirm-dialog\" (click)=\"$event.stopPropagation()\">\n <mat-card-header>\n <mat-card-title>Confirm Plan Change</mat-card-title>\n </mat-card-header>\n <mat-card-content>\n <p>Are you sure you want to {{ isPlanUpgrade(selectedPlan) ? 'upgrade' : 'switch' }} to the <strong>{{ selectedPlan?.name }}</strong> plan?</p>\n <p class=\"price-info\">Price: <strong>\\${{ selectedPlan?.price | number:'1.2-2' }}/{{ selectedPlan?.billingCycle === 1 ? 'year' : 'month' }}</strong></p>\n <p *ngIf=\"selectedPlan?.trialDays > 0\" class=\"trial-info\">\n <mat-icon>schedule</mat-icon> Includes {{ selectedPlan?.trialDays }}-day free trial\n </p>\n </mat-card-content>\n <mat-card-actions align=\"end\">\n <button mat-button (click)=\"cancelChange()\">Cancel</button>\n <button mat-raised-button color=\"primary\" (click)=\"executePlanChange()\" [disabled]=\"changingPlan\">\n <mat-icon *ngIf=\"changingPlan\">hourglass_empty</mat-icon>\n {{ changingPlan ? 'Processing...' : 'Confirm' }}\n </button>\n </mat-card-actions>\n </mat-card>\n </div>\n </div>\n `,\n styles: [`\n .subscription-container { padding: 16px; max-width: 1200px; }\n .page-title { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; color: #333; font-weight: 500; }\n .section-title { margin: 24px 0 16px; color: #555; }\n\n .current-plan-card { margin-bottom: 24px; }\n .plan-avatar { font-size: 40px; width: 40px; height: 40px; color: #1976d2; }\n .plan-details { display: flex; gap: 32px; flex-wrap: wrap; padding: 8px 0; }\n .detail-item { display: flex; flex-direction: column; }\n .detail-label { font-size: 12px; color: #888; text-transform: uppercase; }\n .detail-value { font-size: 16px; font-weight: 500; }\n\n .status-badge { padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; }\n .status-0 { background: #e3f2fd; color: #1565c0; } /* Trial */\n .status-1 { background: #e8f5e9; color: #2e7d32; } /* Active */\n .status-2 { background: #fff3e0; color: #e65100; } /* PastDue */\n .status-3 { background: #fce4ec; color: #c62828; } /* Cancelled */\n .status-4 { background: #f5f5f5; color: #616161; } /* Expired */\n\n .no-plan-message { display: flex; align-items: center; gap: 8px; color: #666; margin: 0; }\n\n .plans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }\n .plan-card { display: flex; flex-direction: column; }\n .plan-card.current { border: 2px solid #1976d2; }\n .plan-price { text-align: center; padding: 16px 0; }\n .price-amount { font-size: 32px; font-weight: 700; color: #1976d2; }\n .price-period { font-size: 14px; color: #888; }\n\n .plan-limits { display: flex; gap: 16px; justify-content: center; padding-bottom: 12px; }\n .limit-item { display: flex; align-items: center; gap: 4px; font-size: 13px; color: #666; }\n .limit-item mat-icon { font-size: 18px; width: 18px; height: 18px; }\n\n .feature-list { padding: 12px 0; }\n .feature-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; }\n .feature-check { color: #4caf50; font-size: 18px; width: 18px; height: 18px; }\n .feature-limit { font-size: 12px; color: #999; }\n .no-features { display: flex; align-items: center; gap: 4px; color: #999; font-size: 13px; }\n\n mat-card-actions { margin-top: auto; }\n mat-card-actions button { width: 100%; }\n\n .overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 1000; }\n .confirm-dialog { max-width: 440px; width: 90%; }\n .price-info { font-size: 16px; }\n .trial-info { display: flex; align-items: center; gap: 4px; color: #1976d2; font-size: 14px; }\n `],\n standalone: false\n})\nexport class SubscriptionPageComponent implements OnInit {\n\n currentSubscription: any = null;\n availablePlans: any[] = [];\n loading = true;\n showConfirmation = false;\n selectedPlan: any = null;\n changingPlan = false;\n\n constructor(\n private httpService: HttpService,\n private subscriptionService: SubscriptionService,\n private snackBar: MatSnackBar,\n private apiErrorService: ApiErrorService // Changed: injected so a failed load or plan change is classified rather than swallowed or echoed\n ) { }\n\n ngOnInit() {\n this.loadCurrentSubscription();\n this.loadAvailablePlans();\n }\n\n // Load the current tenant's active subscription\n loadCurrentSubscription() {\n this.httpService.Get('subscriptions/current').subscribe({\n next: (response: any) => {\n if (response?.success) {\n this.currentSubscription = response.data;\n } else {\n this.apiErrorService.presentAppFailure(response, 'load', 'subscriptions/current'); // Added: was silent — the \"your current plan\" panel stayed blank, and a user comparing plans could not tell which one they were already on\n }\n this.loading = false;\n },\n error: () => { this.loading = false; }\n });\n }\n\n // Load all available plans with their features\n loadAvailablePlans() {\n this.httpService.Get('subscriptions/plans').subscribe({\n next: (response: any) => {\n if (response?.success) {\n this.availablePlans = response.data || [];\n } else {\n this.apiErrorService.presentAppFailure(response, 'load', 'subscriptions/plans'); // Added: was silent. A plan-comparison page with no plans on it reads as \"there is nothing to upgrade to\", which is a commercially wrong thing to tell someone by accident\n }\n }\n });\n }\n\n // Get human-readable subscription status label\n getStatusLabel(status: number): string {\n const labels: Record<number, string> = { 0: 'Trial', 1: 'Active', 2: 'Past Due', 3: 'Cancelled', 4: 'Expired' };\n return labels[status] || 'Unknown';\n }\n\n // Check if the target plan is an upgrade (higher price)\n isPlanUpgrade(plan: any): boolean {\n if (!this.currentSubscription) return true;\n return (plan?.price || 0) > (this.currentSubscription?.planPrice || 0);\n }\n\n // Show confirmation dialog for plan change\n confirmChangePlan(plan: any) {\n this.selectedPlan = plan;\n this.showConfirmation = true;\n }\n\n // Cancel the plan change dialog\n cancelChange() {\n this.showConfirmation = false;\n this.selectedPlan = null;\n }\n\n // Execute the plan change via API\n executePlanChange() {\n if (!this.selectedPlan) return;\n this.changingPlan = true;\n\n this.httpService.Post('subscriptions/change', { planID: this.selectedPlan.planID }).subscribe({\n next: (response: any) => {\n this.changingPlan = false;\n this.showConfirmation = false;\n if (response?.success) {\n this.snackBar.open('Plan changed successfully', '', { duration: 3000 });\n this.loadCurrentSubscription(); // Refresh current subscription\n this.subscriptionService.loadFeatures(); // Refresh enabled features for UI gating\n } else {\n this.apiErrorService.presentAppFailure(response, 'action', 'subscriptions/change'); // Changed: was a bare MatSnackBar carrying response.message verbatim for 3 seconds. 'action' rather than 'submit' — this sits behind a confirmation panel with nothing typed into it, so the 'submit' wording about a still-populated form would not be true\n }\n },\n error: () => {\n this.changingPlan = false;\n this.snackBar.open('Failed to change plan', '', { duration: 3000 });\n }\n });\n }\n}\n","// Billing page — invoice history table, invoice detail dialog, and payment flow dialog\nimport { Component, OnInit } from '@angular/core';\nimport { HttpService } from 'tin-spa/core';\nimport { MatSnackBar } from '@angular/material/snack-bar';\nimport { ApiErrorService } from 'tin-spa/core'; // Added: this page had four unhandled `success` checks, two of them on a money path (WS-6 Phase 4)\nimport { redactSecrets } from 'tin-spa/core'; // Added (security 2026-08-31)\n\n@Component({\n selector: 'spa-billing',\n template: `\n <div class=\"billing-container\">\n <h4 class=\"page-title\"><mat-icon>receipt_long</mat-icon> Billing & Invoices</h4>\n\n <!-- Current Subscription Summary -->\n <mat-card class=\"summary-card\" *ngIf=\"currentSubscription\">\n <mat-card-content>\n <div class=\"summary-row\">\n <div class=\"summary-item\">\n <span class=\"summary-label\">Current Plan</span>\n <span class=\"summary-value\">{{ currentSubscription.planName || 'No Plan' }}</span>\n </div>\n <div class=\"summary-item\">\n <span class=\"summary-label\">Status</span>\n <span class=\"status-badge\" [ngClass]=\"'status-' + (currentSubscription.status || 0)\">\n {{ getStatusLabel(currentSubscription.status) }}\n </span>\n </div>\n <div class=\"summary-item\">\n <span class=\"summary-label\">Next Billing</span>\n <span class=\"summary-value\">{{ currentSubscription.endDate | date:'mediumDate' }}</span>\n </div>\n </div>\n </mat-card-content>\n </mat-card>\n\n <!-- Invoice History Table -->\n <mat-card class=\"invoices-card\">\n <mat-card-header>\n <mat-card-title>Invoice History</mat-card-title>\n </mat-card-header>\n <mat-card-content>\n <div class=\"table-container\" *ngIf=\"invoices.length > 0\">\n <table class=\"invoice-table\">\n <thead>\n <tr>\n <th>Date</th>\n <th>Description</th>\n <th>Amount</th>\n <th>Status</th>\n <th>Payment Method</th>\n <th>Actions</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let invoice of invoices\">\n <td>{{ invoice.invoiceDate | date:'mediumDate' }}</td>\n <td>{{ invoice.description || invoice.planName + ' Subscription' }}</td>\n <td>{{ invoice.currency }} {{ invoice.amount | number:'1.2-2' }}</td>\n <td>\n <span class=\"invoice-status\" [ngClass]=\"'inv-status-' + invoice.status\">\n {{ getInvoiceStatusLabel(invoice.status) }}\n </span>\n </td>\n <td>{{ invoice.paymentMethod || '-' }}</td>\n <td>\n <button mat-icon-button (click)=\"viewInvoiceDetail(invoice)\" matTooltip=\"View Details\">\n <mat-icon>launch</mat-icon><!-- Changed: 'visibility' (eye) -> 'launch'. This opens the invoice detail, so it is a view action and must carry the same icon as every other view in the estate -->\n </button>\n <button mat-icon-button *ngIf=\"invoice.status === 0\" (click)=\"initiatePayment(invoice)\" matTooltip=\"Pay Now\" color=\"primary\">\n <mat-icon>payment</mat-icon>\n </button>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <div class=\"empty-state\" *ngIf=\"invoices.length === 0 && !loading\">\n <mat-icon>receipt</mat-icon>\n <p>No invoices yet</p>\n </div>\n <div class=\"loading-state\" *ngIf=\"loading\">\n <mat-spinner diameter=\"32\"></mat-spinner>\n <p>Loading invoices...</p>\n </div>\n </mat-card-content>\n </mat-card>\n\n <!-- Invoice Detail Dialog (inline overlay) -->\n <div class=\"overlay\" *ngIf=\"showDetail\" (click)=\"closeDetail()\">\n <mat-card class=\"detail-dialog\" (click)=\"$event.stopPropagation()\">\n <mat-card-header>\n <mat-card-title>Invoice Detail</mat-card-title>\n <button mat-icon-button class=\"close-btn\" (click)=\"closeDetail()\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-card-header>\n <mat-card-content *ngIf=\"selectedInvoice\">\n <div class=\"detail-grid\">\n <div class=\"detail-field\">\n <span class=\"field-label\">Plan</span>\n <span class=\"field-value\">{{ selectedInvoice.planName }}</span>\n </div>\n <div class=\"detail-field\">\n <span class=\"field-label\">Amount</span>\n <span class=\"field-value\">{{ selectedInvoice.currency }} {{ selectedInvoice.amount | number:'1.2-2' }}</span>\n </div>\n <div class=\"detail-field\">\n <span class=\"field-label\">Status</span>\n <span class=\"invoice-status\" [ngClass]=\"'inv-status-' + selectedInvoice.status\">\n {{ getInvoiceStatusLabel(selectedInvoice.status) }}\n </span>\n </div>\n <div class=\"detail-field\">\n <span class=\"field-label\">Invoice Date</span>\n <span class=\"field-value\">{{ selectedInvoice.invoiceDate | date:'medium' }}</span>\n </div>\n <div class=\"detail-field\" *ngIf=\"selectedInvoice.paidDate\">\n <span class=\"field-label\">Paid Date</span>\n <span class=\"field-value\">{{ selectedInvoice.paidDate | date:'medium' }}</span>\n </div>\n <div class=\"detail-field\" *ngIf=\"selectedInvoice.paymentReference\">\n <span class=\"field-label\">Payment Reference</span>\n <span class=\"field-value\">{{ selectedInvoice.paymentReference }}</span>\n </div>\n <div class=\"detail-field\" *ngIf=\"selectedInvoice.paymentMethod\">\n <span class=\"field-label\">Payment Method</span>\n <span class=\"field-value\">{{ selectedInvoice.paymentMethod }}</span>\n </div>\n </div>\n\n <!-- Payment Transaction Audit Trail -->\n <div class=\"transactions-section\" *ngIf=\"selectedInvoice.transactions?.length > 0\">\n <h5>Payment Transactions</h5>\n <table class=\"transaction-table\">\n <thead>\n <tr>\n <th>Date</th>\n <th>Reference</th>\n <th>Amount</th>\n <th>Status</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let txn of selectedInvoice.transactions\">\n <td>{{ txn.createdDate | date:'medium' }}</td>\n <td>{{ txn.gatewayReference || '-' }}</td>\n <td>{{ txn.currency }} {{ txn.amount | number:'1.2-2' }}</td>\n <td>\n <span class=\"txn-status\" [ngClass]=\"'txn-status-' + txn.status\">\n {{ getPaymentStatusLabel(txn.status) }}\n </span>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <div class=\"transactions-section\" *ngIf=\"!selectedInvoice.transactions || selectedInvoice.transactions.length === 0\">\n <h5>Payment Transactions</h5>\n <p class=\"no-transactions\">No payment transactions recorded</p>\n </div>\n </mat-card-content>\n </mat-card>\n </div>\n\n <!-- Payment Flow Dialog (inline overlay) -->\n <div class=\"overlay\" *ngIf=\"showPayment\" (click)=\"closePayment()\">\n <mat-card class=\"payment-dialog\" (click)=\"$event.stopPropagation()\">\n <mat-card-header>\n <mat-card-title>Process Payment</mat-card-title>\n </mat-card-header>\n <mat-card-content *ngIf=\"paymentInvoice\">\n <div class=\"payment-summary\">\n <p>Plan: <strong>{{ paymentInvoice.planName }}</strong></p>\n <p>Amount: <strong>{{ paymentInvoice.currency }} {{ paymentInvoice.amount | number:'1.2-2' }}</strong></p>\n </div>\n\n <!-- Payment processing state -->\n <div class=\"payment-state\" *ngIf=\"paymentProcessing\">\n <mat-spinner diameter=\"40\"></mat-spinner>\n <p>Processing payment...</p>\n </div>\n\n <!-- Payment success state -->\n <div class=\"payment-state success\" *ngIf=\"paymentResult?.success\">\n <mat-icon class=\"result-icon success-icon\">check_circle</mat-icon>\n <p>Payment completed successfully!</p>\n <p class=\"payment-ref\" *ngIf=\"paymentResult.reference\">Reference: {{ paymentResult.reference }}</p>\n </div>\n\n <!-- Payment redirect state (live mode) -->\n <div class=\"payment-state redirect\" *ngIf=\"paymentResult && !paymentResult.success && paymentResult.redirectUrl\">\n <mat-icon class=\"result-icon redirect-icon\">open_in_new</mat-icon>\n <p>You will be redirected to complete payment</p>\n <a mat-raised-button color=\"primary\" [href]=\"paymentResult.redirectUrl\" target=\"_blank\">\n <mat-icon>payment</mat-icon> Complete Payment\n </a>\n </div>\n\n <!-- Payment failure state -->\n <div class=\"payment-state error\" *ngIf=\"paymentResult && !paymentResult.success && !paymentResult.redirectUrl\">\n <mat-icon class=\"result-icon error-icon\">error</mat-icon>\n <p>{{ paymentResult.message || 'Payment failed. Please try again.' }}</p>\n </div>\n </mat-card-content>\n <mat-card-actions align=\"end\">\n <button mat-button (click)=\"closePayment()\">{{ paymentResult?.success ? 'Done' : 'Cancel' }}</button>\n <button mat-raised-button color=\"primary\" *ngIf=\"!paymentProcessing && !paymentResult\" (click)=\"processPayment()\">\n <mat-icon>payment</mat-icon> Pay Now\n </button>\n </mat-card-actions>\n </mat-card>\n </div>\n </div>\n `,\n styles: [`\n .billing-container { padding: 16px; max-width: 1200px; }\n .page-title { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; color: #333; font-weight: 500; }\n\n .summary-card { margin-bottom: 24px; }\n .summary-row { display: flex; gap: 32px; flex-wrap: wrap; }\n .summary-item { display: flex; flex-direction: column; }\n .summary-label { font-size: 12px; color: #888; text-transform: uppercase; }\n .summary-value { font-size: 16px; font-weight: 500; }\n\n .status-badge { padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; }\n .status-0 { background: #e3f2fd; color: #1565c0; }\n .status-1 { background: #e8f5e9; color: #2e7d32; }\n .status-2 { background: #fff3e0; color: #e65100; }\n .status-3 { background: #fce4ec; color: #c62828; }\n .status-4 { background: #f5f5f5; color: #616161; }\n\n .invoices-card { margin-bottom: 24px; }\n .table-container { overflow-x: auto; }\n .invoice-table, .transaction-table { width: 100%; border-collapse: collapse; }\n .invoice-table th, .invoice-table td,\n .transaction-table th, .transaction-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #e0e0e0; font-size: 14px; }\n .invoice-table th, .transaction-table th { font-weight: 500; color: #666; font-size: 12px; text-transform: uppercase; }\n .invoice-table tbody tr:hover { background: #f5f5f5; }\n\n .invoice-status { padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 500; }\n .inv-status-0 { background: #fff3e0; color: #e65100; } /* Pending */\n .inv-status-1 { background: #e8f5e9; color: #2e7d32; } /* Paid */\n .inv-status-2 { background: #fce4ec; color: #c62828; } /* Failed */\n .inv-status-3 { background: #f3e5f5; color: #6a1b9a; } /* Refunded */\n\n .txn-status { padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 500; }\n .txn-status-0 { background: #e3f2fd; color: #1565c0; } /* Initiated */\n .txn-status-1 { background: #fff3e0; color: #e65100; } /* Pending */\n .txn-status-2 { background: #e8f5e9; color: #2e7d32; } /* Success */\n .txn-status-3 { background: #fce4ec; color: #c62828; } /* Failed */\n .txn-status-4 { background: #f5f5f5; color: #616161; } /* Cancelled */\n\n .empty-state, .loading-state { display: flex; flex-direction: column; align-items: center; padding: 32px; color: #999; }\n .empty-state mat-icon { font-size: 48px; width: 48px; height: 48px; margin-bottom: 8px; }\n\n .overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 1000; }\n .detail-dialog { max-width: 640px; width: 90%; max-height: 80vh; overflow-y: auto; }\n .payment-dialog { max-width: 440px; width: 90%; }\n\n .close-btn { position: absolute; top: 8px; right: 8px; }\n\n .detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }\n .detail-field { display: flex; flex-direction: column; }\n .field-label { font-size: 12px; color: #888; text-transform: uppercase; }\n .field-value { font-size: 14px; font-weight: 500; }\n\n .transactions-section { margin-top: 16px; }\n .transactions-section h5 { margin: 0 0 8px; color: #555; }\n .no-transactions { color: #999; font-size: 13px; }\n\n .payment-summary { margin-bottom: 16px; }\n .payment-summary p { margin: 4px 0; font-size: 15px; }\n\n .payment-state { display: flex; flex-direction: column; align-items: center; padding: 24px; text-align: center; }\n .result-icon { font-size: 48px; width: 48px; height: 48px; margin-bottom: 8px; }\n .success-icon { color: #4caf50; }\n .redirect-icon { color: #1976d2; }\n .error-icon { color: #f44336; }\n .payment-ref { font-size: 12px; color: #888; }\n `],\n standalone: false\n})\nexport class BillingPageComponent implements OnInit {\n\n currentSubscription: any = null;\n invoices: any[] = [];\n loading = true;\n\n // Invoice detail dialog state\n showDetail = false;\n selectedInvoice: any = null;\n\n // Payment dialog state\n showPayment = false;\n paymentInvoice: any = null;\n paymentProcessing = false;\n paymentResult: any = null;\n\n constructor(\n private httpService: HttpService,\n private snackBar: MatSnackBar,\n private apiErrorService: ApiErrorService // Changed: injected so failures on this page are classified, not swallowed or echoed\n ) { }\n\n ngOnInit() {\n this.loadCurrentSubscription();\n this.loadInvoices();\n }\n\n // Load current subscription summary\n loadCurrentSubscription() {\n this.httpService.Get('subscriptions/current').subscribe({\n next: (response: any) => {\n if (response?.success) {\n this.currentSubscription = response.data;\n } else {\n this.apiErrorService.presentAppFailure(response, 'load', 'subscriptions/current'); // Added: was silent — the subscription summary card simply did not render, so a tenant could not tell a broken read from having no plan\n }\n }\n });\n }\n\n // Load invoice history for the current tenant\n loadInvoices() {\n this.httpService.Get('tenantinvoices/all/x').subscribe({\n next: (response: any) => {\n if (response?.success) {\n this.invoices = response.data || [];\n } else {\n this.apiErrorService.presentAppFailure(response, 'load', 'tenantinvoices/all/x'); // Added: was silent. An empty invoice list is a perfectly normal state for a new tenant, which is precisely why a FAILED one must not look the same — \"you have no invoices\" is a different fact from \"we could not fetch them\"\n }\n this.loading = false;\n },\n error: () => { this.loading = false; }\n });\n }\n\n // Subscription status label mapping\n getStatusLabel(status: number): string {\n const labels: Record<number, string> = { 0: 'Trial', 1: 'Active', 2: 'Past Due', 3: 'Cancelled', 4: 'Expired' };\n return labels[status] || 'Unknown';\n }\n\n // Invoice status label mapping (TenantInvoiceStatus enum)\n getInvoiceStatusLabel(status: number): string {\n const labels: Record<number, string> = { 0: 'Pending', 1: 'Paid', 2: 'Failed', 3: 'Refunded' };\n return labels[status] || 'Unknown';\n }\n\n // Payment transaction status label mapping (GatewayPaymentStatus enum)\n getPaymentStatusLabel(status: number): string {\n const labels: Record<number, string> = { 0: 'Initiated', 1: 'Pending', 2: 'Success', 3: 'Failed', 4: 'Cancelled' };\n return labels[status] || 'Unknown';\n }\n\n // View invoice detail with payment transaction audit trail\n viewInvoiceDetail(invoice: any) {\n this.httpService.Get('tenantinvoices/detail/' + invoice.tenantInvoiceID).subscribe({\n next: (response: any) => {\n if (response?.success) {\n this.selectedInvoice = response.data;\n this.showDetail = true;\n } else {\n this.apiErrorService.presentAppFailure(response, 'action', 'tenantinvoices/detail/' + invoice.tenantInvoiceID); // Changed: was a bare MatSnackBar carrying response.message — raw server text for 3 seconds, ApiErrorService bypassed entirely, the same shape Phase 3 removed from groups.component.ts\n }\n },\n error: () => {\n this.snackBar.open('Failed to load invoice detail', '', { duration: 3000 });\n }\n });\n }\n\n // Close the invoice detail dialog\n closeDetail() {\n this.showDetail = false;\n this.selectedInvoice = null;\n }\n\n // Open payment dialog for a pending invoice\n initiatePayment(invoice: any) {\n this.paymentInvoice = invoice;\n this.paymentProcessing = false;\n this.paymentResult = null;\n this.showPayment = true;\n }\n\n // Process payment via payments API\n processPayment() {\n if (!this.paymentInvoice) return;\n this.paymentProcessing = true;\n\n this.httpService.Post('payments/process/' + this.paymentInvoice.tenantInvoiceID, {}).subscribe({\n next: (response: any) => {\n this.paymentProcessing = false;\n if (response?.success) {\n // Dev mode: payment auto-completed\n this.paymentResult = { success: true, reference: response.data?.reference };\n this.loadInvoices(); // Refresh invoice list\n } else if (response?.data?.redirectUrl) {\n // Live mode: redirect to Paynow\n this.paymentResult = { success: false, redirectUrl: response.data.redirectUrl };\n } else {\n this.paymentResult = { success: false, message: this.paymentFailureText(response, 'payments/process/' + this.paymentInvoice.tenantInvoiceID) }; // Changed: was `response?.message || 'Payment failed'` rendered verbatim at the template's failure state\n }\n },\n error: () => {\n this.paymentProcessing = false;\n this.paymentResult = { success: false, message: 'Payment request failed. Please try again.' };\n }\n });\n }\n\n // Added: the payment dialog is the one place in this sweep where a MODAL is the WRONG answer. It already\n // owns a dedicated failure state — error icon, red panel, inside the dialog the user is staring at — so\n // stacking presentAppFailure's dialog on top of it would talk over a surface that is already doing the job,\n // and would leave the panel underneath still showing the raw sentence anyway.\n //\n // What was actually wrong was the TEXT, not the surface. So the classifier is reused directly: a message a\n // backend author wrote for a human (\"Insufficient funds\", \"Card declined\") is exactly what someone paying an\n // invoice needs and is shown unchanged, while an implementation leak is replaced. The reference, when the\n // catch-all minted one, is kept — a failed payment is the single most likely thing a tenant phones about.\n private paymentFailureText(response: any, url: string): string {\n const raw = response?.message;\n console.error('[tin-spa] payment failure', { url: redactSecrets(url), message: redactSecrets(raw) }); // Changed (security 2026-08-31): dropped `response` — this is the PAYMENT path, and the raw response object is the last place in the library that should be printed to a console. URL and message, redacted, are the technical detail that matters.\n\n if (this.apiErrorService.classifyMessage(raw) === 'business') return raw;\n\n const reference = this.apiErrorService.extractReference(raw);\n return `We couldn't complete that payment because of a technical problem — not anything you did wrong. Nothing was charged.` +\n (reference ? ` Please try again shortly, and quote reference ${reference} if you contact your administrator.` : ` Please try again shortly.`);\n }\n\n // Close the payment dialog\n closePayment() {\n this.showPayment = false;\n this.paymentInvoice = null;\n this.paymentResult = null;\n if (this.paymentResult?.success) {\n this.loadInvoices(); // Refresh if payment was successful\n }\n }\n}\n","// Added (S10-part-1): the two Tier-3 leaves that used to sit inside the CORE TenancyModule — subscription and\n// billing (per [C-AMD-3] / AMB-1). Same shape as GeneralErpModule. URLs unchanged: home/tenancy/subscription\n// and home/tenancy/billing.\nimport { NgModule } from '@angular/core';\nimport { RouterModule, Routes } from '@angular/router';\nimport { CommonModule } from '@angular/common';\nimport { SpaAdminModule } from '../spa-admin.module';\nimport { SubscriptionPageComponent } from '../../pages/subscription/subscription.component';\nimport { BillingPageComponent } from '../../pages/billing/billing.component';\n\nexport const TENANCY_ERP_ROUTES: Routes = [\n { path: \"subscription\", component: SubscriptionPageComponent },\n { path: \"billing\", component: BillingPageComponent }\n];\n\n@NgModule({\n declarations: [SubscriptionPageComponent, BillingPageComponent],\n imports: [CommonModule, SpaAdminModule, RouterModule.forChild(TENANCY_ERP_ROUTES)]\n})\nexport class TenancyErpModule { }\n"],"names":["i3","i4","i5","i7","i8","i1"],"mappings":";;;;;;;;;;;;;;;;;AAAA;MA4Ka,yBAAyB,CAAA;IASpC,WAAA,CACU,WAAwB,EACxB,mBAAwC,EACxC,QAAqB,EACrB,eAAgC;;QAHhC,IAAA,CAAA,WAAW,GAAX,WAAW;QACX,IAAA,CAAA,mBAAmB,GAAnB,mBAAmB;QACnB,IAAA,CAAA,QAAQ,GAAR,QAAQ;QACR,IAAA,CAAA,eAAe,GAAf,eAAe;QAXzB,IAAA,CAAA,mBAAmB,GAAQ,IAAI;QAC/B,IAAA,CAAA,cAAc,GAAU,EAAE;QAC1B,IAAA,CAAA,OAAO,GAAG,IAAI;QACd,IAAA,CAAA,gBAAgB,GAAG,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