@foundrynorth/flux-schema 1.7.0 → 1.7.2

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/schema.js CHANGED
@@ -264,6 +264,8 @@ export const fluxProjects = pgTable("flux_projects", {
264
264
  isDemo: boolean("is_demo").default(false).notNull(),
265
265
  createdAt: timestamp("created_at").defaultNow().notNull(),
266
266
  updatedAt: timestamp("updated_at").defaultNow().notNull(),
267
+ /** Array of monitored properties for social mention scanning */
268
+ monitoredProperties: jsonb("monitored_properties").$type().default([]),
267
269
  }, (table) => ({
268
270
  hubspotIdIdx: uniqueIndex("flux_projects_hubspot_id_idx").on(table.hubspotCompanyId),
269
271
  primaryStrategistIdx: index("flux_projects_primary_strategist_idx").on(table.primaryStrategistId),
@@ -5142,4 +5144,33 @@ export const fluxProductDeliveryCategoryMapRelations = relations(fluxProductDeli
5142
5144
  references: [fluxClientAccounts.id],
5143
5145
  }),
5144
5146
  }));
5147
+ // =============================================================================
5148
+ // SOCIAL COMMENTS
5149
+ // =============================================================================
5150
+ /**
5151
+ * flux_social_comments — Social media comments and reviews for client properties.
5152
+ * Fed by scraper webhooks (ScrapeCreators, DataForSEO, Yelp), Trigify bridge, and manual entry.
5153
+ */
5154
+ export const fluxSocialComments = pgTable("flux_social_comments", {
5155
+ id: text("id").primaryKey().$defaultFn(() => crypto.randomUUID()),
5156
+ projectId: text("project_id").references(() => fluxProjects.id, { onDelete: "set null" }),
5157
+ propertyAccountId: text("property_account_id").references(() => fluxClientAccounts.id, { onDelete: "set null" }),
5158
+ propertyName: text("property_name"),
5159
+ platform: text("platform").notNull(),
5160
+ postUrl: text("post_url").notNull().unique(),
5161
+ postText: text("post_text"),
5162
+ authorName: text("author_name"),
5163
+ authorUrl: text("author_url"),
5164
+ postedAt: timestamp("posted_at", { withTimezone: true }),
5165
+ sentimentScore: real("sentiment_score"),
5166
+ isFlagged: boolean("is_flagged").notNull().default(false),
5167
+ flaggedReason: text("flagged_reason"),
5168
+ isResponded: boolean("is_responded").notNull().default(false),
5169
+ respondedAt: timestamp("responded_at", { withTimezone: true }),
5170
+ ingestSource: text("ingest_source").notNull().default("api"),
5171
+ rawPayload: jsonb("raw_payload"),
5172
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
5173
+ }, (table) => ({
5174
+ propertyAccountIdx: index("flux_social_comments_property_account_idx").on(table.propertyAccountId),
5175
+ }));
5145
5176
  //# sourceMappingURL=schema.js.map