@@ -310,130 +310,12 @@ class ComRefund:
310310 order : Optional [ComOrder ] = field (default = None , metadata = {"fk_field" : "refund_order_id" , "description" : "included via include=['order']" })
311311
312312
313- @dataclass
314- class CrmPerson :
315- ws_id : str
316- person_id : str = field (default = "" , metadata = {"pkey" : True , "display_name" : "Person ID" })
317- person_label : str = field (default = "" , metadata = {"importance" : 1 , "display_name" : "Label" })
318- person_details : dict = field (default_factory = dict , metadata = {"display_name" : "Details" , "description" : "Custom JSON attributes for this person" })
319- person_created_ts : float = field (default = 0.0 , metadata = {"importance" : 1 , "display_name" : "Created at" })
320- person_modified_ts : float = field (default = 0.0 , metadata = {"display_name" : "Modified at" })
321- person_archived_ts : float = field (default = 0.0 , metadata = {"display_name" : "Archived at" })
322-
323- identities : Optional [List ["CrmPersonIdentity" ]] = field (default = None , metadata = {"inbound_fk_table" : "crm_person_identity" , "inbound_fk_col" : "person_id" })
324- applications : Optional [List ["CrmApplication" ]] = field (default = None , metadata = {"inbound_fk_table" : "crm_application" , "inbound_fk_col" : "person_id" })
325-
326-
327- @dataclass
328- class CrmPersonIdentity :
329- ws_id : str
330- person_id : str = field (metadata = {"importance" : 1 , "display_name" : "Person" })
331- identity_platform : str = field (metadata = {"importance" : 1 , "display_name" : "Platform" , "description" : "e.g. discord, slack, telegram, email, github" })
332- identity_external_user_id : str = field (metadata = {"importance" : 1 , "display_name" : "External User ID" })
333- identity_id : str = field (default = "" , metadata = {"pkey" : True , "display_name" : "Identity ID" })
334- identity_external_endpoint : str = field (default = "" , metadata = {"importance" : 1 , "display_name" : "Endpoint" , "description" : "Channel ID, DM endpoint, webhook URL, etc." })
335- identity_status : str = field (default = "linked" , metadata = {"importance" : 1 , "display_name" : "Status" , "enum" : [
336- {"value" : "linked" , "label" : "Linked" },
337- {"value" : "verified" , "label" : "Verified" },
338- {"value" : "revoked" , "label" : "Revoked" },
339- ]})
340- identity_details : dict = field (default_factory = dict , metadata = {"display_name" : "Details" })
341- identity_created_ts : float = field (default = 0.0 , metadata = {"display_name" : "Created at" })
342- identity_modified_ts : float = field (default = 0.0 , metadata = {"display_name" : "Modified at" })
343- identity_archived_ts : float = field (default = 0.0 , metadata = {"display_name" : "Archived at" })
344-
345- person : Optional [CrmPerson ] = field (default = None , metadata = {"fk_field" : "person_id" , "description" : "included via include=['person']" })
346-
347-
348- @dataclass
349- class CrmApplication :
350- ws_id : str
351- application_id : str = field (default = "" , metadata = {"pkey" : True , "display_name" : "Application ID" })
352- person_id : Optional [str ] = field (default = None , metadata = {"importance" : 1 , "display_name" : "Person" })
353- contact_id : Optional [str ] = field (default = None , metadata = {"importance" : 1 , "display_name" : "Contact" })
354- application_source : str = field (default = "" , metadata = {"importance" : 1 , "display_name" : "Source" , "description" : "Originating channel/system, e.g. discord_onboarding" })
355- application_platform : str = field (default = "" , metadata = {"importance" : 1 , "display_name" : "Platform" , "enum" : [
356- {"value" : "discord" , "label" : "Discord" },
357- {"value" : "slack" , "label" : "Slack" },
358- {"value" : "web" , "label" : "Web" },
359- {"value" : "email" , "label" : "Email" },
360- {"value" : "telegram" , "label" : "Telegram" },
361- ]})
362- application_status : str = field (default = "PENDING" , metadata = {"importance" : 1 , "display_name" : "Status" , "enum" : [
363- {"value" : "PENDING" , "label" : "Pending" },
364- {"value" : "REVIEWING" , "label" : "Reviewing" },
365- {"value" : "DECIDED" , "label" : "Decided" },
366- {"value" : "CLOSED" , "label" : "Closed" },
367- ]})
368- application_decision : str = field (default = "" , metadata = {"importance" : 1 , "display_name" : "Decision" , "enum" : [
369- {"value" : "" , "label" : "—" },
370- {"value" : "APPROVED" , "label" : "Approved" },
371- {"value" : "REJECTED" , "label" : "Rejected" },
372- {"value" : "WAITLISTED" , "label" : "Waitlisted" },
373- ]})
374- application_payload : dict = field (default_factory = dict , metadata = {"display_name" : "Payload" , "description" : "Raw inbound data from the originating event" })
375- application_details : dict = field (default_factory = dict , metadata = {"display_name" : "Details" , "description" : "Enriched/processed data and bot annotations" })
376- application_created_ts : float = field (default = 0.0 , metadata = {"importance" : 1 , "display_name" : "Created at" })
377- application_modified_ts : float = field (default = 0.0 , metadata = {"display_name" : "Modified at" })
378- application_archived_ts : float = field (default = 0.0 , metadata = {"display_name" : "Archived at" })
379- application_decision_ts : float = field (default = 0.0 , metadata = {"importance" : 1 , "display_name" : "Decided at" })
380-
381- person : Optional [CrmPerson ] = field (default = None , metadata = {"fk_field" : "person_id" , "description" : "included via include=['person']" })
382-
383-
384- @dataclass
385- class CrmThreadParticipationPolicy :
386- ws_id : str
387- ft_id : str = field (metadata = {"importance" : 1 , "display_name" : "Thread ID" })
388- policy_id : str = field (default = "" , metadata = {"pkey" : True , "display_name" : "Policy ID" })
389- persona_id : Optional [str ] = field (default = None , metadata = {"importance" : 1 , "display_name" : "Persona" })
390- person_id : Optional [str ] = field (default = None , metadata = {"importance" : 1 , "display_name" : "Person" })
391- policy_mode : str = field (default = "ACTIVE" , metadata = {"importance" : 1 , "display_name" : "Mode" , "enum" : [
392- {"value" : "ACTIVE" , "label" : "Active" },
393- {"value" : "PAUSED" , "label" : "Paused" },
394- {"value" : "TAKEOVER" , "label" : "Takeover" },
395- {"value" : "CLOSED" , "label" : "Closed" },
396- ]})
397- policy_active : bool = field (default = True , metadata = {"importance" : 1 , "display_name" : "Active" })
398- policy_timeout_ts : float = field (default = 0.0 , metadata = {"display_name" : "Timeout at" , "description" : "Epoch timestamp when mode should auto-expire; 0 = no timeout" })
399- policy_last_actor : str = field (default = "" , metadata = {"display_name" : "Last Actor" , "description" : "fuser_id, persona_id, or 'system'" })
400- policy_details : dict = field (default_factory = dict , metadata = {"display_name" : "Details" })
401- policy_created_ts : float = field (default = 0.0 , metadata = {"display_name" : "Created at" })
402- policy_modified_ts : float = field (default = 0.0 , metadata = {"display_name" : "Modified at" })
403-
404-
405- @dataclass
406- class CrmExternalConnection :
407- ws_id : str
408- connection_provider : str = field (metadata = {"importance" : 1 , "display_name" : "Provider" , "description" : "e.g. discord, slack, github, google" })
409- connection_id : str = field (default = "" , metadata = {"pkey" : True , "display_name" : "Connection ID" })
410- persona_id : Optional [str ] = field (default = None , metadata = {"importance" : 1 , "display_name" : "Persona" })
411- auth_id : Optional [str ] = field (default = None , metadata = {"display_name" : "Auth ID" })
412- connection_platform : str = field (default = "" , metadata = {"importance" : 1 , "display_name" : "Platform" , "description" : "Sub-platform or environment hint" })
413- connection_resource_type : str = field (default = "" , metadata = {"importance" : 1 , "display_name" : "Resource Type" , "description" : "e.g. guild, channel, workspace, dm, repo" })
414- connection_external_id : str = field (default = "" , metadata = {"importance" : 1 , "display_name" : "External ID" })
415- connection_status : str = field (default = "active" , metadata = {"importance" : 1 , "display_name" : "Status" , "enum" : [
416- {"value" : "active" , "label" : "Active" },
417- {"value" : "revoked" , "label" : "Revoked" },
418- {"value" : "error" , "label" : "Error" },
419- ]})
420- connection_details : dict = field (default_factory = dict , metadata = {"display_name" : "Details" })
421- connection_created_ts : float = field (default = 0.0 , metadata = {"display_name" : "Created at" })
422- connection_modified_ts : float = field (default = 0.0 , metadata = {"display_name" : "Modified at" })
423- connection_archived_ts : float = field (default = 0.0 , metadata = {"display_name" : "Archived at" })
424-
425-
426313ERP_TABLE_TO_SCHEMA : Dict [str , Type ] = {
427314 "crm_activity" : CrmActivity ,
428- "crm_application" : CrmApplication ,
429315 "crm_contact" : CrmContact ,
430316 "crm_deal" : CrmDeal ,
431- "crm_external_connection" : CrmExternalConnection ,
432- "crm_person" : CrmPerson ,
433- "crm_person_identity" : CrmPersonIdentity ,
434317 "crm_pipeline" : CrmPipeline ,
435318 "crm_pipeline_stage" : CrmPipelineStage ,
436- "crm_thread_participation_policy" : CrmThreadParticipationPolicy ,
437319 "com_order" : ComOrder ,
438320 "com_order_item" : ComOrderItem ,
439321 "com_payment" : ComPayment ,
@@ -460,15 +342,10 @@ class CrmExternalConnection:
460342
461343ERP_DISPLAY_NAME_CONFIGS : Dict [str , str ] = {
462344 "crm_activity" : "{activity_title}" ,
463- "crm_application" : "{application_platform} {application_status}" ,
464345 "crm_contact" : "{contact_first_name} {contact_last_name}" ,
465346 "crm_deal" : "{deal_name}" ,
466- "crm_external_connection" : "{connection_provider} {connection_resource_type}" ,
467- "crm_person" : "{person_label}" ,
468- "crm_person_identity" : "{identity_platform} {identity_external_user_id}" ,
469347 "crm_pipeline" : "{pipeline_name}" ,
470348 "crm_pipeline_stage" : "{stage_name}" ,
471- "crm_thread_participation_policy" : "{ft_id} {policy_mode}" ,
472349 "com_order" : "{order_number}" ,
473350 "com_order_item" : "{oitem_name}" ,
474351 "com_payment" : "{pay_id}" ,
0 commit comments