@powerhousedao/contributor-billing 0.0.80 → 0.0.82

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.
Files changed (30) hide show
  1. package/dist/document-models/integrations/gen/ph-factories.js +6 -6
  2. package/dist/document-models/integrations/gen/utils.js +6 -6
  3. package/dist/editors/contributor-billing/components/DriveExplorer.d.ts.map +1 -1
  4. package/dist/editors/contributor-billing/components/DriveExplorer.js +26 -1
  5. package/dist/editors/contributor-billing/components/EditorContainer.d.ts.map +1 -1
  6. package/dist/editors/contributor-billing/components/EditorContainer.js +13 -1
  7. package/dist/editors/contributor-billing/components/InvoiceTable/HeaderControls.d.ts +2 -1
  8. package/dist/editors/contributor-billing/components/InvoiceTable/HeaderControls.d.ts.map +1 -1
  9. package/dist/editors/contributor-billing/components/InvoiceTable/HeaderControls.js +3 -12
  10. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTable.d.ts +3 -1
  11. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTable.d.ts.map +1 -1
  12. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTable.js +56 -112
  13. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableRow.d.ts.map +1 -1
  14. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableRow.js +19 -9
  15. package/dist/subgraphs/billing-statement/index.d.ts +1 -1
  16. package/dist/subgraphs/billing-statement/index.d.ts.map +1 -1
  17. package/dist/subgraphs/billing-statement/resolvers.d.ts +1 -1
  18. package/dist/subgraphs/billing-statement/resolvers.d.ts.map +1 -1
  19. package/dist/subgraphs/billing-statement/resolvers.js +4 -0
  20. package/dist/subgraphs/integrations/index.d.ts +1 -1
  21. package/dist/subgraphs/integrations/index.d.ts.map +1 -1
  22. package/dist/subgraphs/integrations/resolvers.d.ts +1 -1
  23. package/dist/subgraphs/integrations/resolvers.d.ts.map +1 -1
  24. package/dist/subgraphs/integrations/resolvers.js +4 -0
  25. package/dist/subgraphs/invoice/index.d.ts +1 -1
  26. package/dist/subgraphs/invoice/index.d.ts.map +1 -1
  27. package/dist/subgraphs/invoice/resolvers.d.ts +1 -1
  28. package/dist/subgraphs/invoice/resolvers.d.ts.map +1 -1
  29. package/dist/subgraphs/invoice/resolvers.js +4 -0
  30. package/package.json +12 -12
@@ -11,16 +11,16 @@ export function defaultGlobalState() {
11
11
  },
12
12
  googleCloud: {
13
13
  keyFile: {
14
+ type: "",
14
15
  project_id: "",
15
- client_email: "",
16
+ private_key_id: "",
16
17
  private_key: "",
17
- auth_provider_x509_cert_url: "",
18
- auth_uri: "",
18
+ client_email: "",
19
19
  client_id: "",
20
- client_x509_cert_url: "",
21
- private_key_id: "",
20
+ auth_uri: "",
22
21
  token_uri: "",
23
- type: "",
22
+ auth_provider_x509_cert_url: "",
23
+ client_x509_cert_url: "",
24
24
  universe_domain: "",
25
25
  },
26
26
  location: "",
@@ -7,16 +7,16 @@ export const initialGlobalState = {
7
7
  },
8
8
  googleCloud: {
9
9
  keyFile: {
10
+ type: "",
10
11
  project_id: "",
11
- client_email: "",
12
+ private_key_id: "",
12
13
  private_key: "",
13
- auth_provider_x509_cert_url: "",
14
- auth_uri: "",
14
+ client_email: "",
15
15
  client_id: "",
16
- client_x509_cert_url: "",
17
- private_key_id: "",
16
+ auth_uri: "",
18
17
  token_uri: "",
19
- type: "",
18
+ auth_provider_x509_cert_url: "",
19
+ client_x509_cert_url: "",
20
20
  universe_domain: "",
21
21
  },
22
22
  location: "",
@@ -1 +1 @@
1
- {"version":3,"file":"DriveExplorer.d.ts","sourceRoot":"","sources":["../../../../editors/contributor-billing/components/DriveExplorer.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,gBAAgB,EAUtB,MAAM,gCAAgC,CAAC;AAUxC;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,gBAAgB,2CAsUpD"}
1
+ {"version":3,"file":"DriveExplorer.d.ts","sourceRoot":"","sources":["../../../../editors/contributor-billing/components/DriveExplorer.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,gBAAgB,EAUtB,MAAM,gCAAgC,CAAC;AAUxC;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,gBAAgB,2CAuWpD"}
@@ -46,6 +46,31 @@ export function DriveExplorer(props) {
46
46
  // All document states
47
47
  const allDocuments = useSelectedDriveDocuments();
48
48
  const state = allDocuments;
49
+ // Handler for row selection (does not affect status filter display)
50
+ const handleRowSelection = useCallback((rowId, checked, rowStatus) => {
51
+ setSelected((prev) => ({
52
+ ...prev,
53
+ [rowId]: checked,
54
+ }));
55
+ }, []);
56
+ // Determine if CSV export should be enabled based on selected rows
57
+ const canExportSelectedRows = useCallback(() => {
58
+ const allowedStatuses = [
59
+ "ACCEPTED",
60
+ "AWAITINGPAYMENT",
61
+ "PAYMENTSCHEDULED",
62
+ "PAYMENTSENT",
63
+ "PAYMENTRECEIVED",
64
+ "PAYMENTCLOSED",
65
+ ];
66
+ // Get all selected row IDs
67
+ const selectedRowIds = Object.keys(selected).filter(id => selected[id]);
68
+ if (selectedRowIds.length === 0)
69
+ return false;
70
+ // Check if all selected rows have allowed statuses
71
+ const selectedRows = state?.filter(doc => selectedRowIds.includes(doc.header.id)) || [];
72
+ return selectedRows.every(row => allowedStatuses.includes(row.state.global.status));
73
+ }, [selected, state]);
49
74
  // Create a stable dispatcher map using useRef only (no useState to avoid re-renders)
50
75
  const dispatchersRef = useRef(new Map());
51
76
  // Create a working dispatch function that uses the existing reactor system
@@ -203,5 +228,5 @@ export function DriveExplorer(props) {
203
228
  // console.log("dropProps", dropProps);
204
229
  return (_jsx("div", { className: "flex h-full editor-container", children: _jsxs("div", { ...dropProps, className: twMerge("rounded-md border-2 border-transparent ", isDropTarget && "border-dashed border-blue-100"), children: [_jsx(ToastContainer, { position: "bottom-right", autoClose: 5000, hideProgressBar: false, newestOnTop: false, closeOnClick: false, rtl: false, pauseOnFocusLoss: true, draggable: true, pauseOnHover: true, theme: "light" }), _jsx("div", { className: "flex-1 p-4", children: activeDocument && documentModelModule && editorModule ? (
205
230
  // Document editor view
206
- _jsx(EditorContainer, { handleClose: () => setActiveDocumentId(undefined), activeDocumentId: activeDocumentId || "" })) : (_jsxs(_Fragment, { children: [_jsx(HeaderStats, {}), _jsx(InvoiceTable, { setActiveDocumentId: setActiveDocumentId, files: fileChildren, state: state || [], selected: selected, setSelected: setSelected, onBatchAction: () => { }, onDeleteNode: () => { }, renameNode: () => { }, filteredDocumentModels: documentModelModules, onSelectDocumentModel: onSelectDocumentModel, getDocDispatcher: getDocDispatcher, selectedStatuses: selectedStatuses, onStatusChange: handleStatusChange })] })) }), _jsx(CreateDocumentModal, { onContinue: onCreateDocument, onOpenChange: (open) => setOpenModal(open), open: openModal })] }) }));
231
+ _jsx(EditorContainer, { handleClose: () => setActiveDocumentId(undefined), activeDocumentId: activeDocumentId || "" })) : (_jsxs(_Fragment, { children: [_jsx(HeaderStats, {}), _jsx(InvoiceTable, { setActiveDocumentId: setActiveDocumentId, files: fileChildren, state: state || [], selected: selected, setSelected: setSelected, onBatchAction: () => { }, onDeleteNode: () => { }, renameNode: () => { }, filteredDocumentModels: documentModelModules, onSelectDocumentModel: onSelectDocumentModel, getDocDispatcher: getDocDispatcher, selectedStatuses: selectedStatuses, onStatusChange: handleStatusChange, onRowSelection: handleRowSelection, canExportSelectedRows: canExportSelectedRows })] })) }), _jsx(CreateDocumentModal, { onContinue: onCreateDocument, onOpenChange: (open) => setOpenModal(open), open: openModal })] }) }));
207
232
  }
@@ -1 +1 @@
1
- {"version":3,"file":"EditorContainer.d.ts","sourceRoot":"","sources":["../../../../editors/contributor-billing/components/EditorContainer.tsx"],"names":[],"mappings":"AAiBA;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO;IACrC,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,4CAqFA,CAAC"}
1
+ {"version":3,"file":"EditorContainer.d.ts","sourceRoot":"","sources":["../../../../editors/contributor-billing/components/EditorContainer.tsx"],"names":[],"mappings":"AAiBA;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO;IACrC,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,4CAmGA,CAAC"}
@@ -17,7 +17,19 @@ export const EditorContainer = (props) => {
17
17
  const [selectedDrive] = useSelectedDrive();
18
18
  // Timeline data for revision history
19
19
  const timelineItems = useTimelineItems(selectedDocument?.header.id, selectedDocument?.header.createdAtUtcIso, selectedDrive?.header.id);
20
- const preferredEditor = selectedDocument?.header.meta?.preferredEditor ?? "powerhouse-invoice-editor";
20
+ // Determine the correct editor based on document type
21
+ const getEditorForDocumentType = (documentType) => {
22
+ switch (documentType) {
23
+ case "powerhouse/billing-statement":
24
+ return "powerhouse-billing-statement-editor";
25
+ case "powerhouse/invoice":
26
+ return "powerhouse-invoice-editor";
27
+ default:
28
+ return "powerhouse-invoice-editor";
29
+ }
30
+ };
31
+ const preferredEditor = selectedDocument?.header.meta?.preferredEditor ??
32
+ getEditorForDocumentType(selectedDocument?.header.documentType || "");
21
33
  const editorModule = useEditorModuleById(preferredEditor);
22
34
  // Document export functionality - customize export behavior here
23
35
  const onExport = useCallback(async () => {
@@ -1,4 +1,4 @@
1
- export declare const HeaderControls: ({ contributorOptions, statusOptions, onContributorChange, onStatusChange, onSearchChange, onExport, onBatchAction, selectedStatuses, createIntegrationsDocument, integrationsDoc, setActiveDocumentId }: {
1
+ export declare const HeaderControls: ({ contributorOptions, statusOptions, onContributorChange, onStatusChange, onSearchChange, onExport, onBatchAction, selectedStatuses, createIntegrationsDocument, integrationsDoc, setActiveDocumentId, canExportSelectedRows }: {
2
2
  contributorOptions?: {
3
3
  label: string;
4
4
  value: string;
@@ -16,5 +16,6 @@ export declare const HeaderControls: ({ contributorOptions, statusOptions, onCon
16
16
  createIntegrationsDocument?: () => void;
17
17
  integrationsDoc?: any | null;
18
18
  setActiveDocumentId?: (id: string) => void;
19
+ canExportSelectedRows?: () => boolean;
19
20
  }) => import("react/jsx-runtime").JSX.Element;
20
21
  //# sourceMappingURL=HeaderControls.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"HeaderControls.d.ts","sourceRoot":"","sources":["../../../../../editors/contributor-billing/components/InvoiceTable/HeaderControls.tsx"],"names":[],"mappings":"AAcA,eAAO,MAAM,cAAc,GAAI,yMAY5B;IACD,kBAAkB,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACxD,aAAa,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACnD,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC;IACzD,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC;IACpD,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,0BAA0B,CAAC,EAAE,MAAM,IAAI,CAAC;IACxC,eAAe,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;IAC7B,mBAAmB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C,4CAiKA,CAAC"}
1
+ {"version":3,"file":"HeaderControls.d.ts","sourceRoot":"","sources":["../../../../../editors/contributor-billing/components/InvoiceTable/HeaderControls.tsx"],"names":[],"mappings":"AAcA,eAAO,MAAM,cAAc,GAAI,gOAa5B;IACD,kBAAkB,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACxD,aAAa,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACnD,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC;IACzD,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC;IACpD,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,0BAA0B,CAAC,EAAE,MAAM,IAAI,CAAC;IACxC,eAAe,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;IAC7B,mBAAmB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,qBAAqB,CAAC,EAAE,MAAM,OAAO,CAAC;CACvC,4CAuJA,CAAC"}
@@ -10,23 +10,14 @@ const currencyOptions = [
10
10
  { label: "GBP", value: "GBP" },
11
11
  { label: "JPY", value: "JPY" },
12
12
  ];
13
- export const HeaderControls = ({ contributorOptions = [], statusOptions = [], onContributorChange, onStatusChange, onSearchChange, onExport, onBatchAction, selectedStatuses = [], createIntegrationsDocument, integrationsDoc, setActiveDocumentId }) => {
13
+ export const HeaderControls = ({ contributorOptions = [], statusOptions = [], onContributorChange, onStatusChange, onSearchChange, onExport, onBatchAction, selectedStatuses = [], createIntegrationsDocument, integrationsDoc, setActiveDocumentId, canExportSelectedRows }) => {
14
14
  const batchOptions = [
15
15
  { label: "$ Pay Selected", value: "pay" },
16
16
  { label: "Approve Selected", value: "approve" },
17
17
  { label: "Reject Selected", value: "reject" },
18
18
  ];
19
- // Only enable if all selected statuses are in the allowed set
20
- const allowedStatuses = [
21
- "ACCEPTED",
22
- "AWAITINGPAYMENT",
23
- "PAYMENTSCHEDULED",
24
- "PAYMENTSENT",
25
- "PAYMENTRECEIVED",
26
- "PAYMENTCLOSED",
27
- ];
28
- const canExport = selectedStatuses.length > 0 &&
29
- selectedStatuses.every((status) => allowedStatuses.includes(status));
19
+ // Use the function to determine if export should be enabled based on selected rows
20
+ const canExport = canExportSelectedRows ? canExportSelectedRows() : false;
30
21
  const [showCurrencyModal, setShowCurrencyModal] = useState(false);
31
22
  const [selectedCurrency, setSelectedCurrency] = useState("CHF");
32
23
  return (_jsxs("div", { className: "flex flex-col gap-4 mb-4", children: [_jsxs("div", { className: "flex justify-between items-center", children: [_jsxs("div", { className: "flex gap-2 items-center", children: [_jsx(Select, { style: {
@@ -21,7 +21,9 @@ interface InvoiceTableProps {
21
21
  getDocDispatcher: (id: string) => any;
22
22
  selectedStatuses: string[];
23
23
  onStatusChange: (value: string | string[]) => void;
24
+ onRowSelection: (rowId: string, checked: boolean, rowStatus: string) => void;
25
+ canExportSelectedRows: () => boolean;
24
26
  }
25
- export declare const InvoiceTable: ({ files, state, setActiveDocumentId, selected, setSelected, onBatchAction, onDeleteNode, renameNode, filteredDocumentModels, onSelectDocumentModel, getDocDispatcher, selectedStatuses, onStatusChange, }: InvoiceTableProps) => import("react/jsx-runtime").JSX.Element;
27
+ export declare const InvoiceTable: ({ files, state, setActiveDocumentId, selected, setSelected, onBatchAction, onDeleteNode, renameNode, filteredDocumentModels, onSelectDocumentModel, getDocDispatcher, selectedStatuses, onStatusChange, onRowSelection, canExportSelectedRows, }: InvoiceTableProps) => import("react/jsx-runtime").JSX.Element;
26
28
  export {};
27
29
  //# sourceMappingURL=InvoiceTable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"InvoiceTable.d.ts","sourceRoot":"","sources":["../../../../../editors/contributor-billing/components/InvoiceTable/InvoiceTable.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAsB1D,UAAU,iBAAiB;IACzB,KAAK,EAAE,GAAG,EAAE,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;IAC7B,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,QAAQ,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IACpC,WAAW,EAAE,CACX,QAAQ,EACJ;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GACzB,CAAC,CAAC,IAAI,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,KAAK;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC,KACjE,IAAI,CAAC;IACV,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,sBAAsB,EAAE,mBAAmB,EAAE,CAAC;IAC9C,qBAAqB,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC5D,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,GAAG,CAAC;IACtC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC;CACpD;AAED,eAAO,MAAM,YAAY,GAAI,2MAc1B,iBAAiB,4CAyqBnB,CAAC"}
1
+ {"version":3,"file":"InvoiceTable.d.ts","sourceRoot":"","sources":["../../../../../editors/contributor-billing/components/InvoiceTable/InvoiceTable.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AA2B1D,UAAU,iBAAiB;IACzB,KAAK,EAAE,GAAG,EAAE,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;IAC7B,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,QAAQ,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IACpC,WAAW,EAAE,CACX,QAAQ,EACJ;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GACzB,CAAC,CAAC,IAAI,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,KAAK;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC,KACjE,IAAI,CAAC;IACV,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,sBAAsB,EAAE,mBAAmB,EAAE,CAAC;IAC9C,qBAAqB,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC5D,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,GAAG,CAAC;IACtC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC;IACnD,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7E,qBAAqB,EAAE,MAAM,OAAO,CAAC;CACtC;AAED,eAAO,MAAM,YAAY,GAAI,kPAgB1B,iBAAiB,4CA0nBnB,CAAC"}
@@ -3,12 +3,12 @@ import React from "react";
3
3
  import { HeaderControls } from "./HeaderControls.js";
4
4
  import { InvoiceTableSection } from "./InvoiceTableSection.js";
5
5
  import { InvoiceTableRow } from "./InvoiceTableRow.js";
6
- import { createPresignedHeader } from "document-model";
7
6
  import { mapTags } from "../../../billing-statement/lineItemTags/tagMapping.js";
8
7
  import { exportInvoicesToXeroCSV } from "../../../../scripts/contributor-billing/createXeroCsv.js";
9
8
  import { toast } from "@powerhousedao/design-system";
10
9
  import { actions, } from "../../../../document-models/invoice/index.js";
11
- import { addDocument, useSelectedDrive } from "@powerhousedao/reactor-browser";
10
+ import { addDocument, useSelectedDrive, dispatchActions, } from "@powerhousedao/reactor-browser";
11
+ import { actions as billingStatementActions } from "../../../../document-models/billing-statement/index.js";
12
12
  const statusOptions = [
13
13
  { label: "Draft", value: "DRAFT" },
14
14
  { label: "Issued", value: "ISSUED" },
@@ -20,7 +20,7 @@ const statusOptions = [
20
20
  { label: "Rejected", value: "REJECTED" },
21
21
  { label: "Other", value: "OTHER" },
22
22
  ];
23
- export const InvoiceTable = ({ files, state, setActiveDocumentId, selected, setSelected, onBatchAction, onDeleteNode, renameNode, filteredDocumentModels, onSelectDocumentModel, getDocDispatcher, selectedStatuses, onStatusChange, }) => {
23
+ export const InvoiceTable = ({ files, state, setActiveDocumentId, selected, setSelected, onBatchAction, onDeleteNode, renameNode, filteredDocumentModels, onSelectDocumentModel, getDocDispatcher, selectedStatuses, onStatusChange, onRowSelection, canExportSelectedRows, }) => {
24
24
  const [selectedDrive] = useSelectedDrive();
25
25
  const billingDocStates = state
26
26
  .filter((doc) => doc.header.documentType === "powerhouse/billing-statement")
@@ -105,87 +105,58 @@ export const InvoiceTable = ({ files, state, setActiveDocumentId, selected, setS
105
105
  if (!invoiceState) {
106
106
  return;
107
107
  }
108
- await addDocument(selectedDrive?.header.id || "", `bill-${invoiceFile?.name}`, "powerhouse/billing-statement", undefined, {
109
- header: {
110
- ...createPresignedHeader(),
111
- ...{
112
- slug: `bill-${makeSlug(invoiceFile?.name || "")}`,
113
- name: `bill-${cleanName(invoiceFile?.name || "")}`,
114
- documentType: "powerhouse/billing-statement",
115
- },
116
- },
117
- state: {
118
- auth: {},
119
- document: {
120
- version: "1.0.0",
121
- },
122
- ...{
123
- global: {
124
- contributor: id,
125
- dateIssued: invoiceState.state.global.dateIssued,
126
- dateDue: invoiceState.state.global.dateDue,
127
- lineItems: invoiceState.state.global.lineItems.map((item) => {
128
- return {
129
- id: item.id,
130
- description: item.description,
131
- quantity: item.quantity,
132
- unit: "UNIT",
133
- unitPricePwt: 0,
134
- unitPriceCash: item.unitPriceTaxIncl,
135
- totalPricePwt: 0,
136
- totalPriceCash: item.totalPriceTaxIncl,
137
- lineItemTag: mapTags(item.lineItemTag || []),
138
- };
139
- }),
140
- status: invoiceState.state.global.status,
141
- currency: invoiceState.state.global.currency,
142
- totalCash: invoiceState.state.global.lineItems.reduce((acc, item) => acc + item.totalPriceTaxIncl, 0),
143
- totalPowt: 0,
144
- notes: invoiceState.state.global.notes,
145
- },
146
- local: {},
147
- },
148
- },
149
- operations: {
150
- global: [],
151
- local: [],
152
- },
153
- history: {
154
- global: [],
155
- local: [],
156
- },
157
- initialState: {
158
- ...{
159
- state: {
160
- global: {
161
- contributor: id,
162
- dateIssued: invoiceState.state.global.dateIssued,
163
- dateDue: invoiceState.state.global.dateDue,
164
- lineItems: invoiceState.state.global.lineItems.map((item) => {
165
- return {
166
- id: item.id,
167
- description: item.description,
168
- quantity: item.quantity,
169
- unit: "UNIT",
170
- unitPricePwt: 0,
171
- unitPriceCash: item.unitPriceTaxIncl,
172
- totalPricePwt: 0,
173
- totalPriceCash: item.totalPriceTaxIncl,
174
- lineItemTag: mapTags(item.lineItemTag || []),
175
- };
176
- }),
177
- status: invoiceState.state.global.status,
178
- currency: invoiceState.state.global.currency,
179
- totalCash: invoiceState.state.global.lineItems.reduce((acc, item) => acc + item.totalPriceTaxIncl, 0),
180
- totalPowt: 0,
181
- notes: invoiceState.state.global.notes,
182
- },
183
- local: {},
184
- },
185
- },
186
- },
187
- clipboard: [],
188
- }, undefined, "powerhouse-billing-statement-editor");
108
+ const createdNode = await addDocument(selectedDrive?.header.id || "", `bill-${invoiceFile?.name}`, "powerhouse/billing-statement", undefined, undefined, undefined, "powerhouse-billing-statement-editor");
109
+ console.log("created billing statement doc", createdNode);
110
+ if (!createdNode?.id) {
111
+ console.error("Failed to create billing statement");
112
+ return null;
113
+ }
114
+ await dispatchActions(billingStatementActions.editContributor({
115
+ contributor: id,
116
+ }), createdNode.id);
117
+ // Prepare billing statement data with empty input handlers
118
+ const billingStatementData = {
119
+ dateIssued: invoiceState.state.global.dateIssued &&
120
+ invoiceState.state.global.dateIssued.trim() !== ""
121
+ ? new Date(invoiceState.state.global.dateIssued).toISOString()
122
+ : null,
123
+ dateDue: invoiceState.state.global.dateDue &&
124
+ invoiceState.state.global.dateDue.trim() !== ""
125
+ ? new Date(invoiceState.state.global.dateDue).toISOString()
126
+ : null,
127
+ currency: invoiceState.state.global.currency || "",
128
+ notes: invoiceState.state.global.notes || "",
129
+ };
130
+ await dispatchActions(billingStatementActions.editBillingStatement(billingStatementData), createdNode.id);
131
+ await dispatchActions(billingStatementActions.editStatus({
132
+ status: invoiceState.state.global.status,
133
+ }), createdNode.id);
134
+ // add line items from invoiceState to billing statement
135
+ invoiceState.state.global.lineItems.forEach(async (lineItem) => {
136
+ await dispatchActions(billingStatementActions.addLineItem({
137
+ id: lineItem.id,
138
+ description: lineItem.description,
139
+ quantity: lineItem.quantity,
140
+ // Map invoice fields to billing statement fields
141
+ totalPriceCash: lineItem.totalPriceTaxIncl || 0,
142
+ totalPricePwt: 0, // Default to 0 since invoice doesn't have POWT pricing
143
+ unit: "UNIT", // Default to UNIT since invoice doesn't have unit field
144
+ unitPriceCash: lineItem.unitPriceTaxIncl || 0,
145
+ unitPricePwt: 0, // Default to 0 since invoice doesn't have POWT pricing
146
+ }), createdNode.id);
147
+ });
148
+ // add tags from each invoice line item to billing statement line item
149
+ invoiceState.state.global.lineItems.forEach(async (lineItem) => {
150
+ const lineItemTag = mapTags(lineItem.lineItemTag || []);
151
+ lineItemTag.forEach(async (tag) => {
152
+ await dispatchActions(billingStatementActions.editLineItemTag({
153
+ lineItemId: lineItem.id,
154
+ dimension: tag.dimension,
155
+ value: tag.value,
156
+ label: tag.label,
157
+ }), createdNode.id);
158
+ });
159
+ });
189
160
  };
190
161
  const selectedInvoiceIds = Object.keys(selected).filter((id) => selected[id]);
191
162
  const selectedInvoices = selectedInvoiceIds
@@ -237,32 +208,5 @@ export const InvoiceTable = ({ files, state, setActiveDocumentId, selected, setS
237
208
  onSelectDocumentModel(integrationsDocument);
238
209
  }
239
210
  };
240
- return (_jsxs("div", { className: "w-full h-full bg-white rounded-lg p-4 border border-gray-200 shadow-md mt-4 overflow-x-auto", children: [_jsx(HeaderControls, { statusOptions: statusOptions, onStatusChange: onStatusChange, onBatchAction: onBatchAction, onExport: handleCSVExport, selectedStatuses: selectedStatuses, createIntegrationsDocument: createIntegrationsDocument, integrationsDoc: integrationsDoc, setActiveDocumentId: setActiveDocumentId }), shouldShowSection("DRAFT") && (_jsx(InvoiceTableSection, { title: "Draft", count: draft.length, onSelectDocumentModel: onSelectDocumentModel, filteredDocumentModels: filteredDocumentModels, children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2", children: "Exported" })] }) }), _jsx("tbody", { children: draft.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => setSelected((prev) => ({
241
- ...prev,
242
- [row.id]: checked,
243
- })), setActiveDocumentId: setActiveDocumentId, onDeleteNode: handleDelete, renameNode: renameNode }, row.id))) })] }) })), shouldShowSection("ISSUED") && (_jsx(InvoiceTableSection, { title: "Issued", count: issued.length, children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Billing Statement" }), _jsx("th", { className: "px-2 py-2", children: "Exported" })] }) }), _jsx("tbody", { children: issued.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => setSelected((prev) => ({
244
- ...prev,
245
- [row.id]: checked,
246
- })), setActiveDocumentId: setActiveDocumentId, onDeleteNode: handleDelete, renameNode: renameNode, onCreateBillingStatement: handleCreateBillingStatement, billingDocStates: billingDocStates }, row.id))) })] }) })), shouldShowSection("ACCEPTED") && (_jsx(InvoiceTableSection, { title: "Accepted", count: accepted.length, color: "bg-green-100 text-green-600", children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Billing Statement" }), _jsx("th", { className: "px-2 py-2", children: "Exported" })] }) }), _jsx("tbody", { children: accepted.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => setSelected((prev) => ({
247
- ...prev,
248
- [row.id]: checked,
249
- })), setActiveDocumentId: setActiveDocumentId, onDeleteNode: handleDelete, renameNode: renameNode, onCreateBillingStatement: handleCreateBillingStatement, billingDocStates: billingDocStates }, row.id))) })] }) })), shouldShowSection("PAYMENTSCHEDULED") && (_jsx(InvoiceTableSection, { title: "Payment Scheduled", count: paymentScheduled.length, color: "bg-green-100 text-green-600", children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Billing Statement" }), _jsx("th", { className: "px-2 py-2", children: "Exported" })] }) }), _jsx("tbody", { children: paymentScheduled.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => setSelected((prev) => ({
250
- ...prev,
251
- [row.id]: checked,
252
- })), setActiveDocumentId: setActiveDocumentId, onDeleteNode: handleDelete, renameNode: renameNode, onCreateBillingStatement: handleCreateBillingStatement, billingDocStates: billingDocStates }, row.id))) })] }) })), shouldShowSection("PAYMENTSENT") && (_jsx(InvoiceTableSection, { title: "Payment Sent", count: paymentSent.length, color: "bg-green-100 text-green-600", children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Billing Statement" }), _jsx("th", { className: "px-2 py-2", children: "Exported" })] }) }), _jsx("tbody", { children: paymentSent.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => setSelected((prev) => ({
253
- ...prev,
254
- [row.id]: checked,
255
- })), setActiveDocumentId: setActiveDocumentId, onDeleteNode: handleDelete, renameNode: renameNode, onCreateBillingStatement: handleCreateBillingStatement, billingDocStates: billingDocStates }, row.id))) })] }) })), shouldShowSection("PAYMENTISSUE") && (_jsx(InvoiceTableSection, { title: "Payment Issue", count: paymentIssue.length, color: "bg-yellow-100 text-yellow-600", children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Billing Statement" }), _jsx("th", { className: "px-2 py-2", children: "Exported" })] }) }), _jsx("tbody", { children: paymentIssue.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => setSelected((prev) => ({
256
- ...prev,
257
- [row.id]: checked,
258
- })), setActiveDocumentId: setActiveDocumentId, onDeleteNode: handleDelete, renameNode: renameNode, onCreateBillingStatement: handleCreateBillingStatement, billingDocStates: billingDocStates }, row.id))) })] }) })), shouldShowSection("PAYMENTCLOSED") && (_jsx(InvoiceTableSection, { title: "Payment Closed", count: paymentClosed.length, color: "bg-red-500 text-black-600", children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2", children: "Exported" })] }) }), _jsx("tbody", { children: paymentClosed.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => setSelected((prev) => ({
259
- ...prev,
260
- [row.id]: checked,
261
- })), setActiveDocumentId: setActiveDocumentId, onDeleteNode: handleDelete, renameNode: renameNode }, row.id))) })] }) })), shouldShowSection("REJECTED") && (_jsx(InvoiceTableSection, { title: "Rejected", count: rejected.length, color: "bg-red-500 text-black-600", children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2", children: "Exported" })] }) }), _jsx("tbody", { children: rejected.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => setSelected((prev) => ({
262
- ...prev,
263
- [row.id]: checked,
264
- })), setActiveDocumentId: setActiveDocumentId, onDeleteNode: handleDelete, renameNode: renameNode }, row.id))) })] }) })), shouldShowSection("OTHER") && (_jsx(InvoiceTableSection, { title: "Other", count: otherInvoices.length, children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Exported" })] }) }), _jsx("tbody", { children: otherInvoices.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => setSelected((prev) => ({
265
- ...prev,
266
- [row.id]: checked,
267
- })), setActiveDocumentId: setActiveDocumentId, onDeleteNode: handleDelete, renameNode: renameNode }, row.id))) })] }) }))] }, `${state.length}`));
211
+ return (_jsxs("div", { className: "w-full h-full bg-white rounded-lg p-4 border border-gray-200 shadow-md mt-4 overflow-x-auto", children: [_jsx(HeaderControls, { statusOptions: statusOptions, onStatusChange: onStatusChange, onBatchAction: onBatchAction, onExport: handleCSVExport, selectedStatuses: selectedStatuses, createIntegrationsDocument: createIntegrationsDocument, integrationsDoc: integrationsDoc, setActiveDocumentId: setActiveDocumentId, canExportSelectedRows: canExportSelectedRows }), shouldShowSection("DRAFT") && (_jsx(InvoiceTableSection, { title: "Draft", count: draft.length, onSelectDocumentModel: onSelectDocumentModel, filteredDocumentModels: filteredDocumentModels, children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2", children: "Exported" })] }) }), _jsx("tbody", { children: draft.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => onRowSelection(row.id, checked, row.status), setActiveDocumentId: setActiveDocumentId, onDeleteNode: handleDelete, renameNode: renameNode }, row.id))) })] }) })), shouldShowSection("ISSUED") && (_jsx(InvoiceTableSection, { title: "Issued", count: issued.length, children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Billing Statement" }), _jsx("th", { className: "px-2 py-2", children: "Exported" })] }) }), _jsx("tbody", { children: issued.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => onRowSelection(row.id, checked, row.status), setActiveDocumentId: setActiveDocumentId, onDeleteNode: handleDelete, renameNode: renameNode, onCreateBillingStatement: handleCreateBillingStatement, billingDocStates: billingDocStates }, row.id))) })] }) })), shouldShowSection("ACCEPTED") && (_jsx(InvoiceTableSection, { title: "Accepted", count: accepted.length, color: "bg-green-100 text-green-600", children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Billing Statement" }), _jsx("th", { className: "px-2 py-2", children: "Exported" })] }) }), _jsx("tbody", { children: accepted.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => onRowSelection(row.id, checked, row.status), setActiveDocumentId: setActiveDocumentId, onDeleteNode: handleDelete, renameNode: renameNode, onCreateBillingStatement: handleCreateBillingStatement, billingDocStates: billingDocStates }, row.id))) })] }) })), shouldShowSection("PAYMENTSCHEDULED") && (_jsx(InvoiceTableSection, { title: "Payment Scheduled", count: paymentScheduled.length, color: "bg-green-100 text-green-600", children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Billing Statement" }), _jsx("th", { className: "px-2 py-2", children: "Exported" })] }) }), _jsx("tbody", { children: paymentScheduled.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => onRowSelection(row.id, checked, row.status), setActiveDocumentId: setActiveDocumentId, onDeleteNode: handleDelete, renameNode: renameNode, onCreateBillingStatement: handleCreateBillingStatement, billingDocStates: billingDocStates }, row.id))) })] }) })), shouldShowSection("PAYMENTSENT") && (_jsx(InvoiceTableSection, { title: "Payment Sent", count: paymentSent.length, color: "bg-green-100 text-green-600", children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Billing Statement" }), _jsx("th", { className: "px-2 py-2", children: "Exported" })] }) }), _jsx("tbody", { children: paymentSent.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => onRowSelection(row.id, checked, row.status), setActiveDocumentId: setActiveDocumentId, onDeleteNode: handleDelete, renameNode: renameNode, onCreateBillingStatement: handleCreateBillingStatement, billingDocStates: billingDocStates }, row.id))) })] }) })), shouldShowSection("PAYMENTISSUE") && (_jsx(InvoiceTableSection, { title: "Payment Issue", count: paymentIssue.length, color: "bg-yellow-100 text-yellow-600", children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Billing Statement" }), _jsx("th", { className: "px-2 py-2", children: "Exported" })] }) }), _jsx("tbody", { children: paymentIssue.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => onRowSelection(row.id, checked, row.status), setActiveDocumentId: setActiveDocumentId, onDeleteNode: handleDelete, renameNode: renameNode, onCreateBillingStatement: handleCreateBillingStatement, billingDocStates: billingDocStates }, row.id))) })] }) })), shouldShowSection("PAYMENTCLOSED") && (_jsx(InvoiceTableSection, { title: "Payment Closed", count: paymentClosed.length, color: "bg-red-500 text-black-600", children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2", children: "Exported" })] }) }), _jsx("tbody", { children: paymentClosed.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => onRowSelection(row.id, checked, row.status), setActiveDocumentId: setActiveDocumentId, onDeleteNode: handleDelete, renameNode: renameNode }, row.id))) })] }) })), shouldShowSection("REJECTED") && (_jsx(InvoiceTableSection, { title: "Rejected", count: rejected.length, color: "bg-red-500 text-black-600", children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2", children: "Exported" })] }) }), _jsx("tbody", { children: rejected.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => onRowSelection(row.id, checked, row.status), setActiveDocumentId: setActiveDocumentId, onDeleteNode: handleDelete, renameNode: renameNode }, row.id))) })] }) })), shouldShowSection("OTHER") && (_jsx(InvoiceTableSection, { title: "Other", count: otherInvoices.length, children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Exported" })] }) }), _jsx("tbody", { children: otherInvoices.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => onRowSelection(row.id, checked, row.status), setActiveDocumentId: setActiveDocumentId, onDeleteNode: handleDelete, renameNode: renameNode }, row.id))) })] }) }))] }, `${state.length}`));
268
212
  };
@@ -1 +1 @@
1
- {"version":3,"file":"InvoiceTableRow.d.ts","sourceRoot":"","sources":["../../../../../editors/contributor-billing/components/InvoiceTable/InvoiceTableRow.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe,GAAI,kIAU7B;IACD,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC;IACd,GAAG,EAAE,GAAG,CAAC;IACT,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,wBAAwB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,gBAAgB,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC1D,4CAoKA,CAAC"}
1
+ {"version":3,"file":"InvoiceTableRow.d.ts","sourceRoot":"","sources":["../../../../../editors/contributor-billing/components/InvoiceTable/InvoiceTableRow.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe,GAAI,kIAU7B;IACD,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC;IACd,GAAG,EAAE,GAAG,CAAC;IACT,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,wBAAwB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,gBAAgB,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC1D,4CAgLA,CAAC"}
@@ -7,25 +7,35 @@ export const InvoiceTableRow = ({ files, row, isSelected, onSelect, setActiveDoc
7
7
  const menuRef = useRef(null);
8
8
  const formatTimestamp = (timestamp) => {
9
9
  const date = new Date(timestamp);
10
- const day = date.getDate().toString().padStart(2, '0');
10
+ const day = date.getDate().toString().padStart(2, "0");
11
11
  // Use ISO short month names (Jan, Feb, etc.)
12
12
  const monthNames = [
13
- 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
14
- 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
13
+ "Jan",
14
+ "Feb",
15
+ "Mar",
16
+ "Apr",
17
+ "May",
18
+ "Jun",
19
+ "Jul",
20
+ "Aug",
21
+ "Sep",
22
+ "Oct",
23
+ "Nov",
24
+ "Dec",
15
25
  ];
16
26
  const month = monthNames[date.getMonth()];
17
27
  const year = date.getFullYear();
18
- const hours = date.getHours().toString().padStart(2, '0');
19
- const minutes = date.getMinutes().toString().padStart(2, '0');
28
+ const hours = date.getHours().toString().padStart(2, "0");
29
+ const minutes = date.getMinutes().toString().padStart(2, "0");
20
30
  return `${day}-${month}-${year} ${hours}:${minutes}`;
21
31
  };
22
32
  const formatAmount = (amount) => {
23
- const numAmount = typeof amount === 'string' ? parseFloat(amount) : amount;
33
+ const numAmount = typeof amount === "string" ? parseFloat(amount) : amount;
24
34
  if (isNaN(numAmount))
25
- return '0.00';
26
- return numAmount.toLocaleString('en-US', {
35
+ return "0.00";
36
+ return numAmount.toLocaleString("en-US", {
27
37
  minimumFractionDigits: 2,
28
- maximumFractionDigits: 2
38
+ maximumFractionDigits: 2,
29
39
  });
30
40
  };
31
41
  const billingDoc = billingDocStates?.find((doc) => doc.contributor === row.id);
@@ -3,7 +3,7 @@ import type { DocumentNode } from "graphql";
3
3
  export declare class BillingStatementSubgraph extends Subgraph {
4
4
  name: string;
5
5
  typeDefs: DocumentNode;
6
- resolvers: Record<string, any>;
6
+ resolvers: Record<string, unknown>;
7
7
  additionalContextFields: {};
8
8
  onSetup(): Promise<void>;
9
9
  onDisconnect(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../subgraphs/billing-statement/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C,qBAAa,wBAAyB,SAAQ,QAAQ;IACpD,IAAI,SAAuB;IAC3B,QAAQ,EAAE,YAAY,CAAU;IAChC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAsB;IACpD,uBAAuB,KAAM;IACvB,OAAO;IACP,YAAY;CACnB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../subgraphs/billing-statement/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C,qBAAa,wBAAyB,SAAQ,QAAQ;IACpD,IAAI,SAAuB;IAC3B,QAAQ,EAAE,YAAY,CAAU;IAChC,SAAS,0BAAsB;IAC/B,uBAAuB,KAAM;IACvB,OAAO;IACP,YAAY;CACnB"}
@@ -1,3 +1,3 @@
1
1
  import { type Subgraph } from "@powerhousedao/reactor-api";
2
- export declare const getResolvers: (subgraph: Subgraph) => Record<string, any>;
2
+ export declare const getResolvers: (subgraph: Subgraph) => Record<string, unknown>;
3
3
  //# sourceMappingURL=resolvers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/billing-statement/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAc3D,eAAO,MAAM,YAAY,GAAI,UAAU,QAAQ,KAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CA+NnE,CAAC"}
1
+ {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/billing-statement/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAc3D,eAAO,MAAM,YAAY,GAAI,UAAU,QAAQ,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAmOvE,CAAC"}
@@ -23,6 +23,8 @@ export const getResolvers = (subgraph) => {
23
23
  driveId: driveId,
24
24
  ...doc,
25
25
  ...doc.header,
26
+ created: doc.header.createdAtUtcIso,
27
+ lastModified: doc.header.lastModifiedAtUtcIso,
26
28
  state: doc.state.global,
27
29
  stateJSON: doc.state.global,
28
30
  revision: doc.header?.revision?.global ?? 0,
@@ -37,6 +39,8 @@ export const getResolvers = (subgraph) => {
37
39
  driveId: driveId,
38
40
  ...doc,
39
41
  ...doc.header,
42
+ created: doc.header.createdAtUtcIso,
43
+ lastModified: doc.header.lastModifiedAtUtcIso,
40
44
  state: doc.state.global,
41
45
  stateJSON: doc.state.global,
42
46
  revision: doc.header?.revision?.global ?? 0,
@@ -3,7 +3,7 @@ import type { DocumentNode } from "graphql";
3
3
  export declare class IntegrationsSubgraph extends Subgraph {
4
4
  name: string;
5
5
  typeDefs: DocumentNode;
6
- resolvers: Record<string, any>;
6
+ resolvers: Record<string, unknown>;
7
7
  additionalContextFields: {};
8
8
  onSetup(): Promise<void>;
9
9
  onDisconnect(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../subgraphs/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C,qBAAa,oBAAqB,SAAQ,QAAQ;IAChD,IAAI,SAAkB;IACtB,QAAQ,EAAE,YAAY,CAAU;IAChC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAsB;IACpD,uBAAuB,KAAM;IACvB,OAAO;IACP,YAAY;CACnB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../subgraphs/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C,qBAAa,oBAAqB,SAAQ,QAAQ;IAChD,IAAI,SAAkB;IACtB,QAAQ,EAAE,YAAY,CAAU;IAChC,SAAS,0BAAsB;IAC/B,uBAAuB,KAAM;IACvB,OAAO;IACP,YAAY;CACnB"}
@@ -1,3 +1,3 @@
1
1
  import { type Subgraph } from "@powerhousedao/reactor-api";
2
- export declare const getResolvers: (subgraph: Subgraph) => Record<string, any>;
2
+ export declare const getResolvers: (subgraph: Subgraph) => Record<string, unknown>;
3
3
  //# sourceMappingURL=resolvers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/integrations/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAW3D,eAAO,MAAM,YAAY,GAAI,UAAU,QAAQ,KAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAyJnE,CAAC"}
1
+ {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/integrations/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAW3D,eAAO,MAAM,YAAY,GAAI,UAAU,QAAQ,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CA6JvE,CAAC"}
@@ -23,6 +23,8 @@ export const getResolvers = (subgraph) => {
23
23
  driveId: driveId,
24
24
  ...doc,
25
25
  ...doc.header,
26
+ created: doc.header.createdAtUtcIso,
27
+ lastModified: doc.header.lastModifiedAtUtcIso,
26
28
  state: doc.state.global,
27
29
  stateJSON: doc.state.global,
28
30
  revision: doc.header?.revision?.global ?? 0,
@@ -37,6 +39,8 @@ export const getResolvers = (subgraph) => {
37
39
  driveId: driveId,
38
40
  ...doc,
39
41
  ...doc.header,
42
+ created: doc.header.createdAtUtcIso,
43
+ lastModified: doc.header.lastModifiedAtUtcIso,
40
44
  state: doc.state.global,
41
45
  stateJSON: doc.state.global,
42
46
  revision: doc.header?.revision?.global ?? 0,
@@ -3,7 +3,7 @@ import type { DocumentNode } from "graphql";
3
3
  export declare class InvoiceSubgraph extends Subgraph {
4
4
  name: string;
5
5
  typeDefs: DocumentNode;
6
- resolvers: Record<string, any>;
6
+ resolvers: Record<string, unknown>;
7
7
  additionalContextFields: {};
8
8
  onSetup(): Promise<void>;
9
9
  onDisconnect(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../subgraphs/invoice/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAQ5C,qBAAa,eAAgB,SAAQ,QAAQ;IAC3C,IAAI,SAAa;IACjB,QAAQ,EAAE,YAAY,CAAU;IAChC,SAAS,sBAAsB;IAC/B,uBAAuB,KAAM;IACvB,OAAO;IAsBP,YAAY;CACnB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../subgraphs/invoice/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAQ5C,qBAAa,eAAgB,SAAQ,QAAQ;IAC3C,IAAI,SAAa;IACjB,QAAQ,EAAE,YAAY,CAAU;IAChC,SAAS,0BAAsB;IAC/B,uBAAuB,KAAM;IACvB,OAAO;IAsBP,YAAY;CACnB"}
@@ -1,3 +1,3 @@
1
1
  import { type Subgraph } from "@powerhousedao/reactor-api";
2
- export declare const getResolvers: (subgraph: Subgraph) => Record<string, any>;
2
+ export declare const getResolvers: (subgraph: Subgraph) => Record<string, unknown>;
3
3
  //# sourceMappingURL=resolvers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/invoice/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAqC3D,eAAO,MAAM,YAAY,GAAI,UAAU,QAAQ,KAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAkrBnE,CAAC"}
1
+ {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/invoice/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAqC3D,eAAO,MAAM,YAAY,GAAI,UAAU,QAAQ,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAsrBvE,CAAC"}
@@ -24,6 +24,8 @@ export const getResolvers = (subgraph) => {
24
24
  driveId: driveId,
25
25
  ...doc,
26
26
  ...doc.header,
27
+ created: doc.header.createdAtUtcIso,
28
+ lastModified: doc.header.lastModifiedAtUtcIso,
27
29
  state: doc.state.global,
28
30
  stateJSON: doc.state.global,
29
31
  revision: doc.header?.revision?.global ?? 0,
@@ -38,6 +40,8 @@ export const getResolvers = (subgraph) => {
38
40
  driveId: driveId,
39
41
  ...doc,
40
42
  ...doc.header,
43
+ created: doc.header.createdAtUtcIso,
44
+ lastModified: doc.header.lastModifiedAtUtcIso,
41
45
  state: doc.state.global,
42
46
  stateJSON: doc.state.global,
43
47
  revision: doc.header?.revision?.global ?? 0,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@powerhousedao/contributor-billing",
3
3
  "description": "Document models that help contributors of open organisations get paid anonymously for their work on a monthly basis.",
4
- "version": "0.0.80",
4
+ "version": "0.0.82",
5
5
  "license": "AGPL-3.0-only",
6
6
  "type": "module",
7
7
  "files": [
@@ -57,9 +57,9 @@
57
57
  },
58
58
  "dependencies": {
59
59
  "@google-cloud/documentai": "^8.12.0",
60
- "@powerhousedao/builder-tools": "^5.0.0-staging.6",
61
- "@powerhousedao/common": "^5.0.0-staging.6",
62
- "@powerhousedao/design-system": "^5.0.0-staging.6",
60
+ "@powerhousedao/builder-tools": "^5.0.0-staging.9",
61
+ "@powerhousedao/common": "^5.0.0-staging.9",
62
+ "@powerhousedao/design-system": "^5.0.0-staging.9",
63
63
  "@powerhousedao/document-engineering": "^1.34.0",
64
64
  "@react-pdf/renderer": "^4.3.0",
65
65
  "@safe-global/api-kit": "^3.0.1",
@@ -69,7 +69,7 @@
69
69
  "@types/cors": "^2.8.17",
70
70
  "axios": "^1.9.0",
71
71
  "cors": "^2.8.5",
72
- "document-model": "^5.0.0-staging.6",
72
+ "document-model": "^5.0.0-staging.5",
73
73
  "dotenv": "^16.5.0",
74
74
  "error": "^10.4.0",
75
75
  "ethers": "^6.14.0",
@@ -85,19 +85,19 @@
85
85
  "@electric-sql/pglite": "^0.2.12",
86
86
  "@eslint/js": "^9.25.0",
87
87
  "@powerhousedao/analytics-engine-core": "^0.5.0",
88
- "@powerhousedao/codegen": "^5.0.0-staging.6",
89
- "@powerhousedao/ph-cli": "^5.0.0-staging.6",
90
- "@powerhousedao/reactor-api": "^5.0.0-staging.6",
91
- "@powerhousedao/reactor-browser": "^5.0.0-staging.6",
92
- "@powerhousedao/reactor-local": "^5.0.0-staging.6",
88
+ "@powerhousedao/codegen": "^5.0.0-staging.9",
89
+ "@powerhousedao/ph-cli": "^5.0.0-staging.9",
90
+ "@powerhousedao/reactor-api": "^5.0.0-staging.9",
91
+ "@powerhousedao/reactor-browser": "^5.0.0-staging.5",
92
+ "@powerhousedao/reactor-local": "^5.0.0-staging.9",
93
93
  "@powerhousedao/scalars": "^1.33.1-staging.5",
94
- "@powerhousedao/switchboard": "^5.0.0-staging.6",
94
+ "@powerhousedao/switchboard": "^5.0.0-staging.9",
95
95
  "@tailwindcss/cli": "^4.1.4",
96
96
  "@testing-library/react": "^16.3.0",
97
97
  "@types/node": "^22.14.1",
98
98
  "@types/react": "^18.3.20",
99
99
  "@vitejs/plugin-react": "^4.4.1",
100
- "document-drive": "^5.0.0-staging.6",
100
+ "document-drive": "^5.0.0-staging.5",
101
101
  "eslint": "^9.25.0",
102
102
  "eslint-plugin-react": "^7.37.5",
103
103
  "eslint-plugin-react-hooks": "^5.2.0",