@7365admin1/core 3.60.1-staging.273 → 3.60.1-staging.274

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.js CHANGED
@@ -53425,7 +53425,11 @@ function useVisitorTransactionService() {
53425
53425
  org: estate.org,
53426
53426
  site: estate.site,
53427
53427
  status: value?.type === "contractor" ? isAutoApprovedInvitation ? "approved" /* APPROVED */ : "pending" /* PENDING */ : "approved" /* APPROVED */,
53428
- inviterId: userId
53428
+ inviterId: userId,
53429
+ // Spread conditionally, exactly as the member fan-out does, so a caller
53430
+ // that names no origin leaves the key absent rather than writing null.
53431
+ // `memberPayload` is derived from this object, so members inherit it.
53432
+ ...estate.source ? { source: estate.source } : {}
53429
53433
  };
53430
53434
  const leadId = new import_mongodb88.ObjectId();
53431
53435
  const insertedIds = [];
@@ -53480,6 +53484,10 @@ function useVisitorTransactionService() {
53480
53484
  level: null,
53481
53485
  unit: null,
53482
53486
  unitName: null,
53487
+ // Stamps the record as raised at a gate rather than from a home, so a
53488
+ // reader can tell a guard's invitation from a resident's. "guard" matches
53489
+ // the route (`/guard-invite`) and this function, not the app's brand name.
53490
+ source: "guard",
53483
53491
  // `orgId` is the real field on `sites`; `org` is read as a fallback
53484
53492
  // exactly as `resolveSiteAccess` and `entitledSites` already do.
53485
53493
  org: (site?.orgId ?? site?.org)?.toString(),
@@ -58461,7 +58469,7 @@ function useVisitorTransactionController() {
58461
58469
  next(new import_node_server_utils140.InternalServerError("Failed to create visitor invitation."));
58462
58470
  return;
58463
58471
  }
58464
- res.status(200).json({ insertedId: leadId });
58472
+ res.status(200).json({ insertedId: leadId, inviterId: inviterUserId });
58465
58473
  return;
58466
58474
  } catch (error2) {
58467
58475
  import_node_server_utils140.logger.log({ level: "error", message: error2.message });