@happyvertical/smrt-sales 0.60.9 → 0.60.10

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.
@@ -1,4 +1,4 @@
1
- import { SmrtCollection, SmrtObject, SmrtRecipe, crossPackageRef, field, foreignKey, smrt } from "@happyvertical/smrt-core";
1
+ import { SmrtCollection, SmrtObject, SmrtRecipe, crossPackageRef, field, foreignKey, smrt, withCallerOwnedDatabaseTransaction } from "@happyvertical/smrt-core";
2
2
  import { TenantContextError, TenantScoped, getTenantId, requireTenant, requireTenantId, tenantId, withTenant } from "@happyvertical/smrt-tenancy";
3
3
  import { createHash } from "node:crypto";
4
4
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -2070,7 +2070,7 @@ var LeadConversionService = class LeadConversionService {
2070
2070
  }
2071
2071
  const scope = await this.scope(input);
2072
2072
  const id = receiptId(scope);
2073
- await this.activities.create({
2073
+ await withCallerOwnedDatabaseTransaction(this.activities.db, () => this.activities.create({
2074
2074
  id,
2075
2075
  tenantId: scope.tenantId,
2076
2076
  subjectKind: "lead",
@@ -2083,7 +2083,7 @@ var LeadConversionService = class LeadConversionService {
2083
2083
  targetId,
2084
2084
  metadata
2085
2085
  })
2086
- });
2086
+ }));
2087
2087
  return {
2088
2088
  ...scope,
2089
2089
  id,
@@ -3540,4 +3540,4 @@ function normalizeIdentityEnvelope(value) {
3540
3540
  //#endregion
3541
3541
  export { OPPORTUNITY_STATUSES as A, SalesActivity as C, DEFAULT_PIPELINE_KEY as D, Opportunity as E, Lead as F, SALES_ACTIVITY_KINDS as M, SALES_ACTIVITY_SUBJECT_KINDS as N, DEFAULT_PIPELINE_STAGES as O, SALES_REPRESENTATIVE_STATUSES as P, SalesActivityCollection as S, PipelineStage as T, SalesRepresentativeCollection as _, LeadWorkflowValidationError as a, PipelineDefinition as b, LeadConversionService as c, SalesGovernanceState as d, SalesGovernanceEventCollection as f, LeadCollection as g, OpportunityConversion as h, LeadWorkflowService as i, PIPELINE_STATUSES as j, LEAD_STATUSES as k, SalesPipelineRecipe as l, OpportunityConversionCollection as m, SalesGovernanceService as n, MAX_LEAD_WORKFLOW_TEXT_LENGTH as o, SalesGovernanceEvent as p, LEAD_HUMAN_ACTIVITY_KINDS as r, projectLeadWorkQueue as s, SalesGovernanceError as t, SalesGovernanceStateCollection as u, SalesRepresentative as v, PipelineStageCollection as w, OpportunityCollection as x, PipelineDefinitionCollection as y };
3542
3542
 
3543
- //# sourceMappingURL=crm-Bzk65hv_.js.map
3543
+ //# sourceMappingURL=crm-C4iAa-zA.js.map