@things-factory/invoice 10.1.228 → 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.
@@ -6,7 +6,9 @@ tslib_1.__exportStar(require("./service"), exports);
6
6
  const auth_base_1 = require("@things-factory/auth-base");
7
7
  const role_tasks_1 = require("./role-tasks");
8
8
  const invoice_read_1 = require("./service/invoice/invoice-read");
9
+ const invoice_subject_1 = require("./service/invoice/invoice-subject");
9
10
  for (const task of role_tasks_1.ROLE_TASKS)
10
11
  (0, auth_base_1.registerRoleTask)(task);
11
12
  (0, invoice_read_1.registerInvoiceReads)();
13
+ (0, invoice_subject_1.registerInvoiceSubject)();
12
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;AAAA,oBAAiB;AACjB,oDAAyB;AAEzB,yDAA4D;AAC5D,6CAAyC;AACzC,iEAAqE;AAErE,KAAK,MAAM,IAAI,IAAI,uBAAU;IAAE,IAAA,4BAAgB,EAAC,IAAI,CAAC,CAAA;AACrD,IAAA,mCAAoB,GAAE,CAAA","sourcesContent":["import './routes'\nexport * from './service'\n\nimport { registerRoleTask } from '@things-factory/auth-base'\nimport { ROLE_TASKS } from './role-tasks'\nimport { registerInvoiceReads } from './service/invoice/invoice-read'\n\nfor (const task of ROLE_TASKS) registerRoleTask(task)\nregisterInvoiceReads()\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;AAAA,oBAAiB;AACjB,oDAAyB;AAEzB,yDAA4D;AAC5D,6CAAyC;AACzC,iEAAqE;AACrE,uEAA0E;AAE1E,KAAK,MAAM,IAAI,IAAI,uBAAU;IAAE,IAAA,4BAAgB,EAAC,IAAI,CAAC,CAAA;AACrD,IAAA,mCAAoB,GAAE,CAAA;AACtB,IAAA,wCAAsB,GAAE,CAAA","sourcesContent":["import './routes'\nexport * from './service'\n\nimport { registerRoleTask } from '@things-factory/auth-base'\nimport { ROLE_TASKS } from './role-tasks'\nimport { registerInvoiceReads } from './service/invoice/invoice-read'\nimport { registerInvoiceSubject } from './service/invoice/invoice-subject'\n\nfor (const task of ROLE_TASKS) registerRoleTask(task)\nregisterInvoiceReads()\nregisterInvoiceSubject()\n"]}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The invoice whose 360 is open, named for the AI each turn (operato-application design/ai/screen-pattern.md §2-1).
3
+ *
4
+ * The 360 kind `invoice` anchors its conversation to `invoice:<uuid>`; the record is named only for someone the
5
+ * 360's own read (`Query.invoice`) lets through.
6
+ */
7
+ import { type RecordSubject } from '@things-factory/ai-assistant';
8
+ export declare const INVOICE_SUBJECT: RecordSubject;
9
+ export declare function registerInvoiceSubject(): void;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.INVOICE_SUBJECT = void 0;
4
+ exports.registerInvoiceSubject = registerInvoiceSubject;
5
+ /**
6
+ * The invoice whose 360 is open, named for the AI each turn (operato-application design/ai/screen-pattern.md §2-1).
7
+ *
8
+ * The 360 kind `invoice` anchors its conversation to `invoice:<uuid>`; the record is named only for someone the
9
+ * 360's own read (`Query.invoice`) lets through.
10
+ */
11
+ const ai_assistant_1 = require("@things-factory/ai-assistant");
12
+ const shell_1 = require("@things-factory/shell");
13
+ /** The other party as the 360 titles it: the supplier of a purchase, the buyer of a sale. */
14
+ const counterpartOf = (row) => (row.direction === 'PURCHASE' ? row.supplierName : row.buyerName) || '';
15
+ /* By entity name - the entity's decorators stay out of what a test of this has to load. */
16
+ exports.INVOICE_SUBJECT = {
17
+ axis: 'invoice',
18
+ noun: 'invoice',
19
+ door: 'Query.invoice',
20
+ read: (rowId, domainId) => (0, shell_1.getRepository)('Invoice').findOne({ where: { id: rowId, domain: { id: domainId } } }),
21
+ nameOf: row => [row.number, counterpartOf(row)].filter(Boolean).join(' ')
22
+ };
23
+ function registerInvoiceSubject() {
24
+ (0, ai_assistant_1.registerRecordSubject)(exports.INVOICE_SUBJECT);
25
+ }
26
+ //# sourceMappingURL=invoice-subject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoice-subject.js","sourceRoot":"","sources":["../../../server/service/invoice/invoice-subject.ts"],"names":[],"mappings":";;;AAqBA,wDAEC;AAvBD;;;;;GAKG;AACH,+DAAwF;AACxF,iDAAqD;AAErD,6FAA6F;AAC7F,MAAM,aAAa,GAAG,CAAC,GAAQ,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,CAAA;AAE3G,2FAA2F;AAC9E,QAAA,eAAe,GAAkB;IAC5C,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,IAAA,qBAAa,EAAC,SAAS,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAS,EAAE,CAAC;IACtH,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;CAC1E,CAAA;AAED,SAAgB,sBAAsB;IACpC,IAAA,oCAAqB,EAAC,uBAAe,CAAC,CAAA;AACxC,CAAC","sourcesContent":["/**\n * The invoice whose 360 is open, named for the AI each turn (operato-application design/ai/screen-pattern.md §2-1).\n *\n * The 360 kind `invoice` anchors its conversation to `invoice:<uuid>`; the record is named only for someone the\n * 360's own read (`Query.invoice`) lets through.\n */\nimport { registerRecordSubject, type RecordSubject } from '@things-factory/ai-assistant'\nimport { getRepository } from '@things-factory/shell'\n\n/** The other party as the 360 titles it: the supplier of a purchase, the buyer of a sale. */\nconst counterpartOf = (row: any) => (row.direction === 'PURCHASE' ? row.supplierName : row.buyerName) || ''\n\n/* By entity name - the entity's decorators stay out of what a test of this has to load. */\nexport const INVOICE_SUBJECT: RecordSubject = {\n axis: 'invoice',\n noun: 'invoice',\n door: 'Query.invoice',\n read: (rowId, domainId) => getRepository('Invoice').findOne({ where: { id: rowId, domain: { id: domainId } } as any }),\n nameOf: row => [row.number, counterpartOf(row)].filter(Boolean).join(' ')\n}\n\nexport function registerInvoiceSubject(): void {\n registerRecordSubject(INVOICE_SUBJECT)\n}\n"]}