app.wholesale_statements
TablaSeguridad a nivel de fila activa
What the platform bills a partner for one month (Section 4.6.1): every client org at its plan's list price less the partner's wholesale discount. Written only by app.run_wholesale_billing; append-only. Totals cover priced lines; unpriced lines are counted, never treated as zero.
Clave primaria: id
| Columna | Tipo | Admite nulos | Descripción |
|---|---|---|---|
| id | uuid | No | Primary key, UUID v7. |
| org_id | uuid | No | Owning org. A row never moves to another org.Hace referencia a app.organizations.id |
| period_start | date | No | First day of the month billed. |
| currency_code | character(3) | No | Currency of the partner agreement.Hace referencia a private.currencies.currency_code |
| wholesale_discount_bps | integer | No | Discount in force when the statement ran. |
| client_count | integer | No | Client orgs on the statement. |
| list_total_minor | bigint | No | Sum of priced list prices in minor units. |
| wholesale_total_minor | bigint | No | Sum of priced wholesale amounts in minor units: what the partner owes. |
| unpriced_count | integer | No | Lines whose plan has no price in the currency. |
| created_at | timestamp with time zone | No | When the row was inserted. Set by the database. |
| created_by | uuid | Sí | Person who inserted the row, or null for a platform process. Set by the database.Hace referencia a app.people.id |
| updated_at | timestamp with time zone | No | When the row last changed. Set by the database. |
| updated_by | uuid | Sí | Person who last changed the row, or null for a platform process. Set by the database.Hace referencia a app.people.id |
| deleted_at | timestamp with time zone | Sí | Soft delete time. A row with deleted_at set is ignored by every access helper. |