Add business-scoped invoices billed to users.

Introduce invoices.user_id, business template/invoice APIs, and tenant-domain public URLs so business dashboards can issue invoices without platform-scope template mismatches.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-08-11 15:17:03 +03:30
co-authored by Cursor
parent e59db25814
commit 5734a73c9c
8 changed files with 899 additions and 235 deletions
+1 -1
View File
@@ -134,7 +134,7 @@ export class CustomersService {
const businessId = BigInt(businessIdRaw);
await this.assertPermission(businessId, actor.id, 'orders.read');
const days = Math.min(Math.max(daysRaw ?? 30, 1), 90);
const days = Math.min(Math.max(daysRaw ?? 30, 1), 366);
const from = startOfLocalDay(days - 1);
const [registeredRows, activeRows] = await Promise.all([