@saasicat/adapter-prisma 1.0.0-rc.21 → 1.0.0-rc.23

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/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { AdminResourcesPort, AdminTenantListFilter, AdminTenantListRow, AdminTenantDetail, AdminTenantStateResult, AdminUserListFilter, AdminUserListRow, AdminAuditListFilter, AuditEntry, AdminSubscriptionListRow, BundleRepository, TransactionContext, BundleVersionRow, BundleListFilter, BundleRow, CreateBundleData, UpdateBundleData, CreateBundleVersionDraftData, UpdateBundleVersionDraftData, PublishBundleVersionMeta, PersistenceInjectionToken, PasswordHasher, SaaSiCatPersistenceAdapter, TransactionRunner, MfaPort, AuditPort, AdminActor, AuditQueryPort, AuditQuery, AuditStatsPort, RlsBypassPort, SubscriptionRepository, SubscriptionRecord, SubscriptionUsagePort, SubscriptionUsageRecord, SubscriptionBundleRepository, SubscriptionBundleRecord, CreateSubscriptionBundleData, CancelSubscriptionBundleData, TenantSubscriptionWritePort, ApplyOnboardingSelectionInput, RedeemPromoInTransactionCallback, ApplyOnboardingSelectionResult, ImmediatePlanChangeInput, ScheduledPlanChangeInput, CancelSubscriptionInput, CancelSubscriptionResult, PlanVersionRepository, PlanVersionRecord, PromoCodeRepository, PromoCodeRecord, PromoCodeFilter, CreatePromoCodeData, UpdatePromoCodeData, PromoCodeHoldRepository, PromoCodeHoldRecord, PromoCodeHoldTaken, PromoCodeRedemptionRepository, PromoCodeRedemptionRecord, PromoCodeRedemptionStatus, PromoCodeRedemptionListItem, PromoCodeValidationLogRepository, PromoSubscriptionLookup, BillingCycle, PromoRevenueDeductionAggregator, SuperAdminProvisioningPort, CreateSuperAdminCliInput, PlatformUserDto, PlanCatalogReadSink, PlanCatalogReadSnapshot, PlanCatalogImportSink, UpsertPlanInput, UpsertResult, UpsertPlanVersionInput, UpsertFeatureCatalogEntryInput, PlanRepository, PlanVersionRow, PlanListFilter, PlanRow, CreatePlanData, UpdatePlanData, CreatePlanVersionDraftData, UpdatePlanVersionDraftData, VersionChange, CatalogEntryRepository, CatalogEntryFilter, CapabilityCatalogEntryRow, FeatureCatalogEntryRow, QuotaCatalogEntryRow, UpsertCapabilityEntryData, UpsertFeatureEntryData, UpsertQuotaEntryData, SetCatalogEntryReviewData, CatalogEntryI18n, UpdateCatalogEntryBaseData, MarketingProjectionRepository, MarketingProjectionFilter, MarketingProjectionRow, CreateMarketingProjectionData, UpdateMarketingProjectionData, MarketingSettingsRepository, MarketingSettingsRow, UpdateMarketingSettingsData, PromotionRepository, PromotionRow, CreatePromotionData, UpdatePromotionData, SubscriptionContractRepository, SubscriptionContractFilter, SubscriptionContractRecord, NewSubscriptionContractData, RunningContractIssuers, TerminateSubscriptionContractData, PaymentEventLog, PaymentEventClaim, SubscriberPaymentMethodRepository, RecordSubscriberPaymentMethodData, RecordSubscriberPaymentMethodResult, SubscriberPaymentMethodRecord, SubscriberPaymentMethodReference, SubscriberPaymentMethodSetupData, SubscriberPaymentMethodSetupMatch, SubscriberRepository, CreateSubscriberData, SubscriberRecord, SubscriberContactChange, SubscriberCorrectionData, SubscriberCorrectionResult, SubscriberCorrectionRecord, AppliedSettingsPort, AppliedSettingsRecord, NewSettingsChange, SettingsChangeRecord, SettingsChangeFilter } from '@saasicat/core';
1
+ import { AdminResourcesPort, AdminTenantListFilter, AdminTenantListRow, AdminTenantDetail, AdminTenantStateResult, AdminUserListFilter, AdminUserListRow, AdminAuditListFilter, AuditEntry, AdminSubscriptionListRow, BundleRepository, TransactionContext, BundleVersionRow, BundleListFilter, BundleRow, CreateBundleData, UpdateBundleData, CreateBundleVersionDraftData, UpdateBundleVersionDraftData, PublishBundleVersionMeta, PersistenceInjectionToken, PasswordHasher, SaaSiCatPersistenceAdapter, TransactionRunner, MfaPort, AuditPort, AdminActor, AuditQueryPort, AuditQuery, AuditStatsPort, RlsBypassPort, SubscriptionRepository, SubscriptionRecord, SubscriptionUsagePort, SubscriptionUsageRecord, SubscriptionBundleRepository, SubscriptionBundleRecord, CreateSubscriptionBundleData, CancelSubscriptionBundleData, TenantSubscriptionWritePort, ApplyOnboardingSelectionInput, RedeemPromoInTransactionCallback, ApplyOnboardingSelectionResult, ImmediatePlanChangeInput, ScheduledPlanChangeInput, CancelSubscriptionInput, CancelSubscriptionResult, PlanVersionRepository, PlanVersionRecord, PromoCodeRepository, PromoCodeRecord, PromoCodeFilter, CreatePromoCodeData, UpdatePromoCodeData, PromoCodeHoldRepository, PromoCodeHoldRecord, PromoCodeHoldTaken, PromoCodeRedemptionRepository, PromoCodeRedemptionRecord, PromoCodeRedemptionStatus, PromoCodeRedemptionListItem, PromoCodeValidationLogRepository, PromoSubscriptionLookup, BillingCycle, PromoRevenueDeductionAggregator, SuperAdminProvisioningPort, CreateSuperAdminCliInput, PlatformUserDto, PlanCatalogReadSink, PlanCatalogReadSnapshot, PlanCatalogImportSink, UpsertPlanInput, UpsertResult, UpsertPlanVersionInput, UpsertFeatureCatalogEntryInput, PlanRepository, PlanVersionRow, PlanListFilter, PlanRow, CreatePlanData, UpdatePlanData, CreatePlanVersionDraftData, UpdatePlanVersionDraftData, VersionChange, CatalogEntryRepository, CatalogEntryFilter, CapabilityCatalogEntryRow, FeatureCatalogEntryRow, QuotaCatalogEntryRow, UpsertCapabilityEntryData, UpsertFeatureEntryData, UpsertQuotaEntryData, SetCatalogEntryReviewData, CatalogEntryI18n, UpdateCatalogEntryBaseData, MarketingProjectionRepository, MarketingProjectionFilter, MarketingProjectionRow, CreateMarketingProjectionData, UpdateMarketingProjectionData, MarketingSettingsRepository, MarketingSettingsRow, UpdateMarketingSettingsData, PromotionRepository, PromotionRow, CreatePromotionData, UpdatePromotionData, SubscriptionContractRepository, SubscriptionContractFilter, SubscriptionContractRecord, NewSubscriptionContractData, RunningContractIssuers, TerminateSubscriptionContractData, SupersedeSubscriptionContractData, PaymentEventLog, PaymentEventClaim, SubscriberLedgerRepository, NewSubscriberCharge, SubscriberChargeRecord, SubscriberPaymentMethodRepository, RecordSubscriberPaymentMethodData, RecordSubscriberPaymentMethodResult, SubscriberPaymentMethodRecord, SubscriberPaymentMethodReference, SubscriberPaymentMethodSetupData, SubscriberPaymentMethodSetupMatch, SubscriberRepository, CreateSubscriberData, SubscriberRecord, SubscriberContactChange, SubscriberCorrectionData, SubscriberCorrectionResult, SubscriberCorrectionRecord, AppliedSettingsPort, AppliedSettingsRecord, NewSettingsChange, SettingsChangeRecord, SettingsChangeFilter, MaintenanceWindowPort, MaintenanceWindowRecord, NewMaintenanceWindow, MaintenanceWindowStage, MaintenanceWindowChanges } from '@saasicat/core';
2
2
 
3
3
  declare const PRISMA_CLIENT_TOKEN: unique symbol;
4
4
  /** Prisma `Decimal` values arrive as objects with `toString()`; tests may use plain values. */
@@ -1651,6 +1651,7 @@ declare class PrismaSubscriptionContractRepository implements SubscriptionContra
1651
1651
  create(data: NewSubscriptionContractData, tx?: TransactionContext): Promise<SubscriptionContractRecord>;
1652
1652
  listRunningIssuers(limit: number, asOf?: Date): Promise<RunningContractIssuers>;
1653
1653
  terminate(contractId: string, data: TerminateSubscriptionContractData): Promise<SubscriptionContractRecord>;
1654
+ supersede(contractId: string, data: SupersedeSubscriptionContractData, tx?: TransactionContext): Promise<SubscriptionContractRecord | null>;
1654
1655
  }
1655
1656
 
1656
1657
  /** `PaymentEventLog` against the canonical `"PaymentEventLog"` table. */
@@ -1661,6 +1662,25 @@ declare class PrismaPaymentEventLog implements PaymentEventLog {
1661
1662
  releaseSession(gatewayAccount: string, eventId: string, tx: TransactionContext): Promise<void>;
1662
1663
  }
1663
1664
 
1665
+ interface LedgerClient {
1666
+ subscriberLedgerEntry: unknown;
1667
+ }
1668
+ /** `SubscriberLedgerRepository` against `subscriber_ledger_entries`. Append-only. */
1669
+ declare class PrismaSubscriberLedgerRepository implements SubscriberLedgerRepository {
1670
+ private readonly prisma;
1671
+ constructor(prisma: LedgerClient);
1672
+ private db;
1673
+ /**
1674
+ * One statement, `skipDuplicates` being `ON CONFLICT DO NOTHING`: a charge
1675
+ * another caller wrote first — committed or still in flight — is waited for
1676
+ * and skipped rather than raised, and only what this call wrote comes back.
1677
+ * It names no conflict target, so it suppresses every unique key; the only
1678
+ * one besides the natural key is the primary key, a uuid made per row here.
1679
+ */
1680
+ recordCharges(charges: readonly NewSubscriberCharge[], tx?: TransactionContext): Promise<SubscriberChargeRecord[]>;
1681
+ listBySubscription(subscriptionId: string, tx?: TransactionContext): Promise<SubscriberChargeRecord[]>;
1682
+ }
1683
+
1664
1684
  /** Root-client fields used directly: the delegate and the interactive transaction. */
1665
1685
  interface PaymentMethodRepositoryClient {
1666
1686
  subscriberPaymentMethod: unknown;
@@ -1777,4 +1797,27 @@ declare class PrismaAppliedSettingsRepository implements AppliedSettingsPort {
1777
1797
  acknowledgeChange(id: string, acknowledgedBy: string, acknowledgedAt: Date): Promise<SettingsChangeRecord | null>;
1778
1798
  }
1779
1799
 
1780
- export { type AdminResourcesDelegates, type AdminResourcesFields, AsyncLocalRlsBypassAdapter, type DecimalLike, PASSWORD_HASHER_TOKEN, PRISMA_BUNDLE_REPOSITORY_OPTIONS, PRISMA_CLIENT_TOKEN, PRISMA_SCHEMA_OPTIONS_TOKEN, PrismaAdminResourcesAdapter, type PrismaAdminResourcesOptions, PrismaAppliedSettingsRepository, PrismaAuditAdapter, PrismaAuditQueryAdapter, PrismaAuditStatsAdapter, PrismaBundleRepository, type PrismaBundleRepositoryOptions, PrismaCatalogEntryRepository, type PrismaLike, PrismaMarketingProjectionRepository, PrismaMarketingSettingsRepository, PrismaMfaAdapter, type PrismaModelDelegateLike, PrismaPaymentEventLog, type PrismaPersistenceOptions, type PrismaPlanBindingMode, type PrismaPlanBindingOptions, type PrismaPlanBindingResolver, PrismaPlanCatalogImportSink, PrismaPlanCatalogReadSink, type PrismaPlanDelegateOptions, PrismaPlanRepository, type PrismaPlanVersionFieldCapabilities, type PrismaPlanVersionFieldOptions, PrismaPlanVersionRepository, PrismaPromoCodeHoldRepository, PrismaPromoCodeRedemptionRepository, PrismaPromoCodeRepository, PrismaPromoCodeValidationLogRepository, PrismaPromoSubscriptionLookup, PrismaPromotionRepository, type PrismaSchemaOptions, PrismaSubscriberPaymentMethodRepository, PrismaSubscriberRepository, PrismaSubscriptionBundleRepository, PrismaSubscriptionContractRepository, PrismaSubscriptionRepository, PrismaSubscriptionUsageAdapter, PrismaSuperAdminBootstrapAdapter, type PrismaTenantSubscriptionOptions, PrismaTenantSubscriptionWriteAdapter, PrismaTransactionRunner, type PrismaTxLike, type ResolvedAdminResourcesSchema, type ResolvedPrismaSchemaOptions, ZeroPromoRevenueDeductionAggregator, assertDelegatesExist, buildActorTag, createPrismaPlanBindingResolver, getPrismaDelegate, prismaPersistence, resolveAdminResourcesSchema, resolvePrismaSchemaOptions };
1800
+ /** `MaintenanceWindowPort` against the canonical `maintenance_windows` table. */
1801
+ declare class PrismaMaintenanceWindowRepository implements MaintenanceWindowPort {
1802
+ private readonly prisma;
1803
+ constructor(prisma: unknown);
1804
+ private get db();
1805
+ findOpen(): Promise<MaintenanceWindowRecord | null>;
1806
+ listRecent(limit: number): Promise<MaintenanceWindowRecord[]>;
1807
+ /**
1808
+ * One statement, `skipDuplicates` being `ON CONFLICT DO NOTHING`: the
1809
+ * partial unique index that holds an installation to one open window is
1810
+ * what refuses the second, and it refuses by returning no row rather than
1811
+ * by raising. The id is a uuid made here, so the primary key cannot be the
1812
+ * key it met.
1813
+ */
1814
+ open(window: NewMaintenanceWindow): Promise<MaintenanceWindowRecord | null>;
1815
+ /**
1816
+ * One guarded `UPDATE`: the stage the caller read is in the `WHERE`, so a
1817
+ * window another operator moved on a moment earlier leaves the count at
1818
+ * zero instead of being moved twice.
1819
+ */
1820
+ update(id: string, stage: MaintenanceWindowStage, changes: MaintenanceWindowChanges): Promise<MaintenanceWindowRecord | null>;
1821
+ }
1822
+
1823
+ export { type AdminResourcesDelegates, type AdminResourcesFields, AsyncLocalRlsBypassAdapter, type DecimalLike, PASSWORD_HASHER_TOKEN, PRISMA_BUNDLE_REPOSITORY_OPTIONS, PRISMA_CLIENT_TOKEN, PRISMA_SCHEMA_OPTIONS_TOKEN, PrismaAdminResourcesAdapter, type PrismaAdminResourcesOptions, PrismaAppliedSettingsRepository, PrismaAuditAdapter, PrismaAuditQueryAdapter, PrismaAuditStatsAdapter, PrismaBundleRepository, type PrismaBundleRepositoryOptions, PrismaCatalogEntryRepository, type PrismaLike, PrismaMaintenanceWindowRepository, PrismaMarketingProjectionRepository, PrismaMarketingSettingsRepository, PrismaMfaAdapter, type PrismaModelDelegateLike, PrismaPaymentEventLog, type PrismaPersistenceOptions, type PrismaPlanBindingMode, type PrismaPlanBindingOptions, type PrismaPlanBindingResolver, PrismaPlanCatalogImportSink, PrismaPlanCatalogReadSink, type PrismaPlanDelegateOptions, PrismaPlanRepository, type PrismaPlanVersionFieldCapabilities, type PrismaPlanVersionFieldOptions, PrismaPlanVersionRepository, PrismaPromoCodeHoldRepository, PrismaPromoCodeRedemptionRepository, PrismaPromoCodeRepository, PrismaPromoCodeValidationLogRepository, PrismaPromoSubscriptionLookup, PrismaPromotionRepository, type PrismaSchemaOptions, PrismaSubscriberLedgerRepository, PrismaSubscriberPaymentMethodRepository, PrismaSubscriberRepository, PrismaSubscriptionBundleRepository, PrismaSubscriptionContractRepository, PrismaSubscriptionRepository, PrismaSubscriptionUsageAdapter, PrismaSuperAdminBootstrapAdapter, type PrismaTenantSubscriptionOptions, PrismaTenantSubscriptionWriteAdapter, PrismaTransactionRunner, type PrismaTxLike, type ResolvedAdminResourcesSchema, type ResolvedPrismaSchemaOptions, ZeroPromoRevenueDeductionAggregator, assertDelegatesExist, buildActorTag, createPrismaPlanBindingResolver, getPrismaDelegate, prismaPersistence, resolveAdminResourcesSchema, resolvePrismaSchemaOptions };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AdminResourcesPort, AdminTenantListFilter, AdminTenantListRow, AdminTenantDetail, AdminTenantStateResult, AdminUserListFilter, AdminUserListRow, AdminAuditListFilter, AuditEntry, AdminSubscriptionListRow, BundleRepository, TransactionContext, BundleVersionRow, BundleListFilter, BundleRow, CreateBundleData, UpdateBundleData, CreateBundleVersionDraftData, UpdateBundleVersionDraftData, PublishBundleVersionMeta, PersistenceInjectionToken, PasswordHasher, SaaSiCatPersistenceAdapter, TransactionRunner, MfaPort, AuditPort, AdminActor, AuditQueryPort, AuditQuery, AuditStatsPort, RlsBypassPort, SubscriptionRepository, SubscriptionRecord, SubscriptionUsagePort, SubscriptionUsageRecord, SubscriptionBundleRepository, SubscriptionBundleRecord, CreateSubscriptionBundleData, CancelSubscriptionBundleData, TenantSubscriptionWritePort, ApplyOnboardingSelectionInput, RedeemPromoInTransactionCallback, ApplyOnboardingSelectionResult, ImmediatePlanChangeInput, ScheduledPlanChangeInput, CancelSubscriptionInput, CancelSubscriptionResult, PlanVersionRepository, PlanVersionRecord, PromoCodeRepository, PromoCodeRecord, PromoCodeFilter, CreatePromoCodeData, UpdatePromoCodeData, PromoCodeHoldRepository, PromoCodeHoldRecord, PromoCodeHoldTaken, PromoCodeRedemptionRepository, PromoCodeRedemptionRecord, PromoCodeRedemptionStatus, PromoCodeRedemptionListItem, PromoCodeValidationLogRepository, PromoSubscriptionLookup, BillingCycle, PromoRevenueDeductionAggregator, SuperAdminProvisioningPort, CreateSuperAdminCliInput, PlatformUserDto, PlanCatalogReadSink, PlanCatalogReadSnapshot, PlanCatalogImportSink, UpsertPlanInput, UpsertResult, UpsertPlanVersionInput, UpsertFeatureCatalogEntryInput, PlanRepository, PlanVersionRow, PlanListFilter, PlanRow, CreatePlanData, UpdatePlanData, CreatePlanVersionDraftData, UpdatePlanVersionDraftData, VersionChange, CatalogEntryRepository, CatalogEntryFilter, CapabilityCatalogEntryRow, FeatureCatalogEntryRow, QuotaCatalogEntryRow, UpsertCapabilityEntryData, UpsertFeatureEntryData, UpsertQuotaEntryData, SetCatalogEntryReviewData, CatalogEntryI18n, UpdateCatalogEntryBaseData, MarketingProjectionRepository, MarketingProjectionFilter, MarketingProjectionRow, CreateMarketingProjectionData, UpdateMarketingProjectionData, MarketingSettingsRepository, MarketingSettingsRow, UpdateMarketingSettingsData, PromotionRepository, PromotionRow, CreatePromotionData, UpdatePromotionData, SubscriptionContractRepository, SubscriptionContractFilter, SubscriptionContractRecord, NewSubscriptionContractData, RunningContractIssuers, TerminateSubscriptionContractData, PaymentEventLog, PaymentEventClaim, SubscriberPaymentMethodRepository, RecordSubscriberPaymentMethodData, RecordSubscriberPaymentMethodResult, SubscriberPaymentMethodRecord, SubscriberPaymentMethodReference, SubscriberPaymentMethodSetupData, SubscriberPaymentMethodSetupMatch, SubscriberRepository, CreateSubscriberData, SubscriberRecord, SubscriberContactChange, SubscriberCorrectionData, SubscriberCorrectionResult, SubscriberCorrectionRecord, AppliedSettingsPort, AppliedSettingsRecord, NewSettingsChange, SettingsChangeRecord, SettingsChangeFilter } from '@saasicat/core';
1
+ import { AdminResourcesPort, AdminTenantListFilter, AdminTenantListRow, AdminTenantDetail, AdminTenantStateResult, AdminUserListFilter, AdminUserListRow, AdminAuditListFilter, AuditEntry, AdminSubscriptionListRow, BundleRepository, TransactionContext, BundleVersionRow, BundleListFilter, BundleRow, CreateBundleData, UpdateBundleData, CreateBundleVersionDraftData, UpdateBundleVersionDraftData, PublishBundleVersionMeta, PersistenceInjectionToken, PasswordHasher, SaaSiCatPersistenceAdapter, TransactionRunner, MfaPort, AuditPort, AdminActor, AuditQueryPort, AuditQuery, AuditStatsPort, RlsBypassPort, SubscriptionRepository, SubscriptionRecord, SubscriptionUsagePort, SubscriptionUsageRecord, SubscriptionBundleRepository, SubscriptionBundleRecord, CreateSubscriptionBundleData, CancelSubscriptionBundleData, TenantSubscriptionWritePort, ApplyOnboardingSelectionInput, RedeemPromoInTransactionCallback, ApplyOnboardingSelectionResult, ImmediatePlanChangeInput, ScheduledPlanChangeInput, CancelSubscriptionInput, CancelSubscriptionResult, PlanVersionRepository, PlanVersionRecord, PromoCodeRepository, PromoCodeRecord, PromoCodeFilter, CreatePromoCodeData, UpdatePromoCodeData, PromoCodeHoldRepository, PromoCodeHoldRecord, PromoCodeHoldTaken, PromoCodeRedemptionRepository, PromoCodeRedemptionRecord, PromoCodeRedemptionStatus, PromoCodeRedemptionListItem, PromoCodeValidationLogRepository, PromoSubscriptionLookup, BillingCycle, PromoRevenueDeductionAggregator, SuperAdminProvisioningPort, CreateSuperAdminCliInput, PlatformUserDto, PlanCatalogReadSink, PlanCatalogReadSnapshot, PlanCatalogImportSink, UpsertPlanInput, UpsertResult, UpsertPlanVersionInput, UpsertFeatureCatalogEntryInput, PlanRepository, PlanVersionRow, PlanListFilter, PlanRow, CreatePlanData, UpdatePlanData, CreatePlanVersionDraftData, UpdatePlanVersionDraftData, VersionChange, CatalogEntryRepository, CatalogEntryFilter, CapabilityCatalogEntryRow, FeatureCatalogEntryRow, QuotaCatalogEntryRow, UpsertCapabilityEntryData, UpsertFeatureEntryData, UpsertQuotaEntryData, SetCatalogEntryReviewData, CatalogEntryI18n, UpdateCatalogEntryBaseData, MarketingProjectionRepository, MarketingProjectionFilter, MarketingProjectionRow, CreateMarketingProjectionData, UpdateMarketingProjectionData, MarketingSettingsRepository, MarketingSettingsRow, UpdateMarketingSettingsData, PromotionRepository, PromotionRow, CreatePromotionData, UpdatePromotionData, SubscriptionContractRepository, SubscriptionContractFilter, SubscriptionContractRecord, NewSubscriptionContractData, RunningContractIssuers, TerminateSubscriptionContractData, SupersedeSubscriptionContractData, PaymentEventLog, PaymentEventClaim, SubscriberLedgerRepository, NewSubscriberCharge, SubscriberChargeRecord, SubscriberPaymentMethodRepository, RecordSubscriberPaymentMethodData, RecordSubscriberPaymentMethodResult, SubscriberPaymentMethodRecord, SubscriberPaymentMethodReference, SubscriberPaymentMethodSetupData, SubscriberPaymentMethodSetupMatch, SubscriberRepository, CreateSubscriberData, SubscriberRecord, SubscriberContactChange, SubscriberCorrectionData, SubscriberCorrectionResult, SubscriberCorrectionRecord, AppliedSettingsPort, AppliedSettingsRecord, NewSettingsChange, SettingsChangeRecord, SettingsChangeFilter, MaintenanceWindowPort, MaintenanceWindowRecord, NewMaintenanceWindow, MaintenanceWindowStage, MaintenanceWindowChanges } from '@saasicat/core';
2
2
 
3
3
  declare const PRISMA_CLIENT_TOKEN: unique symbol;
4
4
  /** Prisma `Decimal` values arrive as objects with `toString()`; tests may use plain values. */
@@ -1651,6 +1651,7 @@ declare class PrismaSubscriptionContractRepository implements SubscriptionContra
1651
1651
  create(data: NewSubscriptionContractData, tx?: TransactionContext): Promise<SubscriptionContractRecord>;
1652
1652
  listRunningIssuers(limit: number, asOf?: Date): Promise<RunningContractIssuers>;
1653
1653
  terminate(contractId: string, data: TerminateSubscriptionContractData): Promise<SubscriptionContractRecord>;
1654
+ supersede(contractId: string, data: SupersedeSubscriptionContractData, tx?: TransactionContext): Promise<SubscriptionContractRecord | null>;
1654
1655
  }
1655
1656
 
1656
1657
  /** `PaymentEventLog` against the canonical `"PaymentEventLog"` table. */
@@ -1661,6 +1662,25 @@ declare class PrismaPaymentEventLog implements PaymentEventLog {
1661
1662
  releaseSession(gatewayAccount: string, eventId: string, tx: TransactionContext): Promise<void>;
1662
1663
  }
1663
1664
 
1665
+ interface LedgerClient {
1666
+ subscriberLedgerEntry: unknown;
1667
+ }
1668
+ /** `SubscriberLedgerRepository` against `subscriber_ledger_entries`. Append-only. */
1669
+ declare class PrismaSubscriberLedgerRepository implements SubscriberLedgerRepository {
1670
+ private readonly prisma;
1671
+ constructor(prisma: LedgerClient);
1672
+ private db;
1673
+ /**
1674
+ * One statement, `skipDuplicates` being `ON CONFLICT DO NOTHING`: a charge
1675
+ * another caller wrote first — committed or still in flight — is waited for
1676
+ * and skipped rather than raised, and only what this call wrote comes back.
1677
+ * It names no conflict target, so it suppresses every unique key; the only
1678
+ * one besides the natural key is the primary key, a uuid made per row here.
1679
+ */
1680
+ recordCharges(charges: readonly NewSubscriberCharge[], tx?: TransactionContext): Promise<SubscriberChargeRecord[]>;
1681
+ listBySubscription(subscriptionId: string, tx?: TransactionContext): Promise<SubscriberChargeRecord[]>;
1682
+ }
1683
+
1664
1684
  /** Root-client fields used directly: the delegate and the interactive transaction. */
1665
1685
  interface PaymentMethodRepositoryClient {
1666
1686
  subscriberPaymentMethod: unknown;
@@ -1777,4 +1797,27 @@ declare class PrismaAppliedSettingsRepository implements AppliedSettingsPort {
1777
1797
  acknowledgeChange(id: string, acknowledgedBy: string, acknowledgedAt: Date): Promise<SettingsChangeRecord | null>;
1778
1798
  }
1779
1799
 
1780
- export { type AdminResourcesDelegates, type AdminResourcesFields, AsyncLocalRlsBypassAdapter, type DecimalLike, PASSWORD_HASHER_TOKEN, PRISMA_BUNDLE_REPOSITORY_OPTIONS, PRISMA_CLIENT_TOKEN, PRISMA_SCHEMA_OPTIONS_TOKEN, PrismaAdminResourcesAdapter, type PrismaAdminResourcesOptions, PrismaAppliedSettingsRepository, PrismaAuditAdapter, PrismaAuditQueryAdapter, PrismaAuditStatsAdapter, PrismaBundleRepository, type PrismaBundleRepositoryOptions, PrismaCatalogEntryRepository, type PrismaLike, PrismaMarketingProjectionRepository, PrismaMarketingSettingsRepository, PrismaMfaAdapter, type PrismaModelDelegateLike, PrismaPaymentEventLog, type PrismaPersistenceOptions, type PrismaPlanBindingMode, type PrismaPlanBindingOptions, type PrismaPlanBindingResolver, PrismaPlanCatalogImportSink, PrismaPlanCatalogReadSink, type PrismaPlanDelegateOptions, PrismaPlanRepository, type PrismaPlanVersionFieldCapabilities, type PrismaPlanVersionFieldOptions, PrismaPlanVersionRepository, PrismaPromoCodeHoldRepository, PrismaPromoCodeRedemptionRepository, PrismaPromoCodeRepository, PrismaPromoCodeValidationLogRepository, PrismaPromoSubscriptionLookup, PrismaPromotionRepository, type PrismaSchemaOptions, PrismaSubscriberPaymentMethodRepository, PrismaSubscriberRepository, PrismaSubscriptionBundleRepository, PrismaSubscriptionContractRepository, PrismaSubscriptionRepository, PrismaSubscriptionUsageAdapter, PrismaSuperAdminBootstrapAdapter, type PrismaTenantSubscriptionOptions, PrismaTenantSubscriptionWriteAdapter, PrismaTransactionRunner, type PrismaTxLike, type ResolvedAdminResourcesSchema, type ResolvedPrismaSchemaOptions, ZeroPromoRevenueDeductionAggregator, assertDelegatesExist, buildActorTag, createPrismaPlanBindingResolver, getPrismaDelegate, prismaPersistence, resolveAdminResourcesSchema, resolvePrismaSchemaOptions };
1800
+ /** `MaintenanceWindowPort` against the canonical `maintenance_windows` table. */
1801
+ declare class PrismaMaintenanceWindowRepository implements MaintenanceWindowPort {
1802
+ private readonly prisma;
1803
+ constructor(prisma: unknown);
1804
+ private get db();
1805
+ findOpen(): Promise<MaintenanceWindowRecord | null>;
1806
+ listRecent(limit: number): Promise<MaintenanceWindowRecord[]>;
1807
+ /**
1808
+ * One statement, `skipDuplicates` being `ON CONFLICT DO NOTHING`: the
1809
+ * partial unique index that holds an installation to one open window is
1810
+ * what refuses the second, and it refuses by returning no row rather than
1811
+ * by raising. The id is a uuid made here, so the primary key cannot be the
1812
+ * key it met.
1813
+ */
1814
+ open(window: NewMaintenanceWindow): Promise<MaintenanceWindowRecord | null>;
1815
+ /**
1816
+ * One guarded `UPDATE`: the stage the caller read is in the `WHERE`, so a
1817
+ * window another operator moved on a moment earlier leaves the count at
1818
+ * zero instead of being moved twice.
1819
+ */
1820
+ update(id: string, stage: MaintenanceWindowStage, changes: MaintenanceWindowChanges): Promise<MaintenanceWindowRecord | null>;
1821
+ }
1822
+
1823
+ export { type AdminResourcesDelegates, type AdminResourcesFields, AsyncLocalRlsBypassAdapter, type DecimalLike, PASSWORD_HASHER_TOKEN, PRISMA_BUNDLE_REPOSITORY_OPTIONS, PRISMA_CLIENT_TOKEN, PRISMA_SCHEMA_OPTIONS_TOKEN, PrismaAdminResourcesAdapter, type PrismaAdminResourcesOptions, PrismaAppliedSettingsRepository, PrismaAuditAdapter, PrismaAuditQueryAdapter, PrismaAuditStatsAdapter, PrismaBundleRepository, type PrismaBundleRepositoryOptions, PrismaCatalogEntryRepository, type PrismaLike, PrismaMaintenanceWindowRepository, PrismaMarketingProjectionRepository, PrismaMarketingSettingsRepository, PrismaMfaAdapter, type PrismaModelDelegateLike, PrismaPaymentEventLog, type PrismaPersistenceOptions, type PrismaPlanBindingMode, type PrismaPlanBindingOptions, type PrismaPlanBindingResolver, PrismaPlanCatalogImportSink, PrismaPlanCatalogReadSink, type PrismaPlanDelegateOptions, PrismaPlanRepository, type PrismaPlanVersionFieldCapabilities, type PrismaPlanVersionFieldOptions, PrismaPlanVersionRepository, PrismaPromoCodeHoldRepository, PrismaPromoCodeRedemptionRepository, PrismaPromoCodeRepository, PrismaPromoCodeValidationLogRepository, PrismaPromoSubscriptionLookup, PrismaPromotionRepository, type PrismaSchemaOptions, PrismaSubscriberLedgerRepository, PrismaSubscriberPaymentMethodRepository, PrismaSubscriberRepository, PrismaSubscriptionBundleRepository, PrismaSubscriptionContractRepository, PrismaSubscriptionRepository, PrismaSubscriptionUsageAdapter, PrismaSuperAdminBootstrapAdapter, type PrismaTenantSubscriptionOptions, PrismaTenantSubscriptionWriteAdapter, PrismaTransactionRunner, type PrismaTxLike, type ResolvedAdminResourcesSchema, type ResolvedPrismaSchemaOptions, ZeroPromoRevenueDeductionAggregator, assertDelegatesExist, buildActorTag, createPrismaPlanBindingResolver, getPrismaDelegate, prismaPersistence, resolveAdminResourcesSchema, resolvePrismaSchemaOptions };