@things-factory/sales 10.1.227 → 10.1.229

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.
@@ -8,7 +8,9 @@ require("./routes");
8
8
  const auth_base_1 = require("@things-factory/auth-base");
9
9
  const role_tasks_1 = require("./role-tasks");
10
10
  const sales_read_1 = require("./service/sales-read");
11
+ const opportunity_subject_1 = require("./service/opportunity/opportunity-subject");
11
12
  for (const task of role_tasks_1.ROLE_TASKS)
12
13
  (0, auth_base_1.registerRoleTask)(task);
13
14
  (0, sales_read_1.registerSalesReads)();
15
+ (0, opportunity_subject_1.registerOpportunitySubject)();
14
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;AAAA,uDAA4B;AAC5B,wDAA6B;AAC7B,oDAAyB;AAEzB,oBAAiB;AAEjB,yDAA4D;AAC5D,6CAAyC;AACzC,qDAAyD;AAEzD,KAAK,MAAM,IAAI,IAAI,uBAAU;IAAE,IAAA,4BAAgB,EAAC,IAAI,CAAC,CAAA;AACrD,IAAA,+BAAkB,GAAE,CAAA","sourcesContent":["export * from './migrations'\nexport * from './middlewares'\nexport * from './service'\n\nimport './routes'\n\nimport { registerRoleTask } from '@things-factory/auth-base'\nimport { ROLE_TASKS } from './role-tasks'\nimport { registerSalesReads } from './service/sales-read'\n\nfor (const task of ROLE_TASKS) registerRoleTask(task)\nregisterSalesReads()\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;AAAA,uDAA4B;AAC5B,wDAA6B;AAC7B,oDAAyB;AAEzB,oBAAiB;AAEjB,yDAA4D;AAC5D,6CAAyC;AACzC,qDAAyD;AACzD,mFAAsF;AAEtF,KAAK,MAAM,IAAI,IAAI,uBAAU;IAAE,IAAA,4BAAgB,EAAC,IAAI,CAAC,CAAA;AACrD,IAAA,+BAAkB,GAAE,CAAA;AACpB,IAAA,gDAA0B,GAAE,CAAA","sourcesContent":["export * from './migrations'\nexport * from './middlewares'\nexport * from './service'\n\nimport './routes'\n\nimport { registerRoleTask } from '@things-factory/auth-base'\nimport { ROLE_TASKS } from './role-tasks'\nimport { registerSalesReads } from './service/sales-read'\nimport { registerOpportunitySubject } from './service/opportunity/opportunity-subject'\n\nfor (const task of ROLE_TASKS) registerRoleTask(task)\nregisterSalesReads()\nregisterOpportunitySubject()\n"]}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The opportunity whose 360 is open, named for the AI each turn (operato-application design/ai/screen-pattern.md §2-1).
3
+ *
4
+ * The 360 kind `opportunity` anchors its conversation to `opportunity:<uuid>`; the record is named only for someone
5
+ * the 360's own read (`Query.opportunity`) lets through.
6
+ */
7
+ import { type RecordSubject } from '@things-factory/ai-assistant';
8
+ export declare const OPPORTUNITY_SUBJECT: RecordSubject;
9
+ export declare function registerOpportunitySubject(): void;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OPPORTUNITY_SUBJECT = void 0;
4
+ exports.registerOpportunitySubject = registerOpportunitySubject;
5
+ /**
6
+ * The opportunity whose 360 is open, named for the AI each turn (operato-application design/ai/screen-pattern.md §2-1).
7
+ *
8
+ * The 360 kind `opportunity` anchors its conversation to `opportunity:<uuid>`; the record is named only for someone
9
+ * the 360's own read (`Query.opportunity`) lets through.
10
+ */
11
+ const ai_assistant_1 = require("@things-factory/ai-assistant");
12
+ const shell_1 = require("@things-factory/shell");
13
+ /* By entity name - the entity's decorators stay out of what a test of this has to load. */
14
+ exports.OPPORTUNITY_SUBJECT = {
15
+ axis: 'opportunity',
16
+ noun: 'sales opportunity',
17
+ door: 'Query.opportunity',
18
+ read: (rowId, domainId) => (0, shell_1.getRepository)('Opportunity').findOne({ where: { id: rowId, domain: { id: domainId } }, relations: ['counterparty'] }),
19
+ nameOf: row => [row.name, row.counterparty?.name].filter(Boolean).join(' ')
20
+ };
21
+ function registerOpportunitySubject() {
22
+ (0, ai_assistant_1.registerRecordSubject)(exports.OPPORTUNITY_SUBJECT);
23
+ }
24
+ //# sourceMappingURL=opportunity-subject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opportunity-subject.js","sourceRoot":"","sources":["../../../server/service/opportunity/opportunity-subject.ts"],"names":[],"mappings":";;;AAkBA,gEAEC;AApBD;;;;;GAKG;AACH,+DAAwF;AACxF,iDAAqD;AAErD,2FAA2F;AAC9E,QAAA,mBAAmB,GAAkB;IAChD,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,IAAA,qBAAa,EAAC,aAAa,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAS,EAAE,SAAS,EAAE,CAAC,cAAc,CAAC,EAAE,CAAC;IACvJ,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;CAC5E,CAAA;AAED,SAAgB,0BAA0B;IACxC,IAAA,oCAAqB,EAAC,2BAAmB,CAAC,CAAA;AAC5C,CAAC","sourcesContent":["/**\n * The opportunity whose 360 is open, named for the AI each turn (operato-application design/ai/screen-pattern.md §2-1).\n *\n * The 360 kind `opportunity` anchors its conversation to `opportunity:<uuid>`; the record is named only for someone\n * the 360's own read (`Query.opportunity`) lets through.\n */\nimport { registerRecordSubject, type RecordSubject } from '@things-factory/ai-assistant'\nimport { getRepository } from '@things-factory/shell'\n\n/* By entity name - the entity's decorators stay out of what a test of this has to load. */\nexport const OPPORTUNITY_SUBJECT: RecordSubject = {\n axis: 'opportunity',\n noun: 'sales opportunity',\n door: 'Query.opportunity',\n read: (rowId, domainId) => getRepository('Opportunity').findOne({ where: { id: rowId, domain: { id: domainId } } as any, relations: ['counterparty'] }),\n nameOf: row => [row.name, row.counterparty?.name].filter(Boolean).join(' ')\n}\n\nexport function registerOpportunitySubject(): void {\n registerRecordSubject(OPPORTUNITY_SUBJECT)\n}\n"]}