@powerhousedao/contributor-billing 0.0.20 → 0.0.21

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 (61) hide show
  1. package/dist/document-models/invoice/gen/document-model.d.ts.map +1 -1
  2. package/dist/document-models/invoice/gen/document-model.js +24 -2
  3. package/dist/document-models/invoice/gen/general/actions.d.ts +4 -2
  4. package/dist/document-models/invoice/gen/general/actions.d.ts.map +1 -1
  5. package/dist/document-models/invoice/gen/general/creators.d.ts +4 -2
  6. package/dist/document-models/invoice/gen/general/creators.d.ts.map +1 -1
  7. package/dist/document-models/invoice/gen/general/creators.js +2 -0
  8. package/dist/document-models/invoice/gen/general/object.d.ts +3 -1
  9. package/dist/document-models/invoice/gen/general/object.d.ts.map +1 -1
  10. package/dist/document-models/invoice/gen/general/object.js +7 -1
  11. package/dist/document-models/invoice/gen/general/operations.d.ts +3 -1
  12. package/dist/document-models/invoice/gen/general/operations.d.ts.map +1 -1
  13. package/dist/document-models/invoice/gen/reducer.d.ts.map +1 -1
  14. package/dist/document-models/invoice/gen/reducer.js +8 -0
  15. package/dist/document-models/invoice/gen/schema/types.d.ts +10 -0
  16. package/dist/document-models/invoice/gen/schema/types.d.ts.map +1 -1
  17. package/dist/document-models/invoice/gen/schema/zod.d.ts +3 -1
  18. package/dist/document-models/invoice/gen/schema/zod.d.ts.map +1 -1
  19. package/dist/document-models/invoice/gen/schema/zod.js +14 -0
  20. package/dist/document-models/invoice/gen/utils.d.ts.map +1 -1
  21. package/dist/document-models/invoice/gen/utils.js +3 -0
  22. package/dist/document-models/invoice/index.d.ts +2 -0
  23. package/dist/document-models/invoice/index.d.ts.map +1 -1
  24. package/dist/document-models/invoice/src/reducers/general.d.ts.map +1 -1
  25. package/dist/document-models/invoice/src/reducers/general.js +19 -0
  26. package/dist/document-models/invoice/src/tests/general.test.js +17 -0
  27. package/dist/editors/billing-statement/editor.js +2 -2
  28. package/dist/editors/billing-statement/lineItemTags/lineItemTags.js +5 -4
  29. package/dist/editors/billing-statement/lineItemTags/tagMapping.d.ts +2 -0
  30. package/dist/editors/billing-statement/lineItemTags/tagMapping.d.ts.map +1 -1
  31. package/dist/editors/billing-statement/lineItemTags/tagMapping.js +105 -26
  32. package/dist/editors/contributor-billing/components/DriveExplorer.d.ts +1 -1
  33. package/dist/editors/contributor-billing/components/DriveExplorer.d.ts.map +1 -1
  34. package/dist/editors/contributor-billing/components/DriveExplorer.js +5 -8
  35. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTable.d.ts +9 -1
  36. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTable.d.ts.map +1 -1
  37. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTable.js +128 -3
  38. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableRow.d.ts +10 -1
  39. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableRow.d.ts.map +1 -1
  40. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableRow.js +7 -8
  41. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableSection.d.ts +4 -1
  42. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableSection.d.ts.map +1 -1
  43. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableSection.js +5 -2
  44. package/dist/editors/invoice/editor.js +1 -1
  45. package/dist/editors/invoice/ingestPDF.js +1 -1
  46. package/dist/editors/invoice/invoiceToGnosis.d.ts.map +1 -1
  47. package/dist/editors/invoice/invoiceToGnosis.js +5 -2
  48. package/dist/editors/invoice/lineItemTags/lineItemTags.d.ts.map +1 -1
  49. package/dist/editors/invoice/lineItemTags/lineItemTags.js +1 -1
  50. package/dist/editors/invoice/lineItemTags/tagMapping.d.ts.map +1 -1
  51. package/dist/editors/invoice/lineItemTags/tagMapping.js +5 -1
  52. package/dist/editors/invoice/requestFinance.js +1 -1
  53. package/dist/editors/invoice/uploadPdfChunked.js +1 -1
  54. package/dist/scripts/invoice/gnosisTransactionBuilder.d.ts.map +1 -1
  55. package/dist/scripts/invoice/gnosisTransactionBuilder.js +9 -2
  56. package/dist/style.css +14 -8
  57. package/dist/subgraphs/invoice/resolvers.d.ts.map +1 -1
  58. package/dist/subgraphs/invoice/resolvers.js +14 -0
  59. package/dist/subgraphs/invoice/schema.d.ts.map +1 -1
  60. package/dist/subgraphs/invoice/schema.js +20 -0
  61. package/package.json +2 -2
@@ -36,7 +36,7 @@ export function LineItemTagsTable({ lineItems, onClose, dispatch, paymentAccount
36
36
  id: item.id,
37
37
  description: e.target.value,
38
38
  }));
39
- }, className: "w-full" }) }), _jsx("td", { className: "border-b border-gray-200 p-3", style: { width: "100px" }, children: _jsx(DatePicker, { name: "period", dateFormat: "YYYY-MM-DD", autoClose: true, placeholder: "Select Period", value: item.lineItemTag.find((tag) => tag.dimension === "accounting-period")?.label || "", onChange: (e) => dispatch(actions.setLineItemTag({
39
+ } }) }), _jsx("td", { className: "border-b border-gray-200 w-48", children: _jsx(DatePicker, { name: "period", dateFormat: "YYYY-MM-DD", autoClose: true, placeholder: "Select Period", value: item.lineItemTag.find((tag) => tag.dimension === "accounting-period")?.label || "", onChange: (e) => dispatch(actions.setLineItemTag({
40
40
  lineItemId: item.id,
41
41
  dimension: "accounting-period",
42
42
  value: new Date(e.target.value)
@@ -1 +1 @@
1
- {"version":3,"file":"tagMapping.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/lineItemTags/tagMapping.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAEtE,eAAO,MAAM,qBAAqB,EAAE,YAAY,EA6D/C,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,YAAY,EAc/C,CAAC"}
1
+ {"version":3,"file":"tagMapping.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/lineItemTags/tagMapping.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAEtE,eAAO,MAAM,qBAAqB,EAAE,YAAY,EAiE/C,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,YAAY,EAc/C,CAAC"}
@@ -1,5 +1,6 @@
1
1
  export const expenseAccountOptions = [
2
2
  { label: "Grants from Maker DAO", value: "200" },
3
+ { label: "Clearing Account", value: "2001" },
3
4
  { label: "Request Finance IC account", value: "2222" },
4
5
  { label: "Interest Income", value: "270" },
5
6
  { label: "Activities and Events", value: "3000" },
@@ -7,12 +8,13 @@ export const expenseAccountOptions = [
7
8
  { label: "Airfare", value: "3002" },
8
9
  { label: "Hotels", value: "3003" },
9
10
  { label: "Transportation (Uber, Taxi etc)", value: "3004" },
11
+ { label: "Other travel cost", value: "3005" },
10
12
  { label: "Cost of Goods Sold", value: "310" },
11
13
  { label: "Advertising", value: "400" },
12
14
  { label: "Legal Fees Abroad", value: "4001" },
13
15
  { label: "Legal Fees Switzerland", value: "4002" },
14
16
  { label: "Finance Team Fees Abroad", value: "4003" },
15
- { label: "Fnance and Accounting Fees Switzerland", value: "4004" },
17
+ { label: "Finance and Accounting Fees Switzerland", value: "4004" },
16
18
  { label: "Software Development Team Fees", value: "4005" },
17
19
  { label: "Research Team Fees", value: "4006" },
18
20
  { label: "Marketing Team Fees", value: "4007" },
@@ -36,6 +38,7 @@ export const expenseAccountOptions = [
36
38
  { label: "Prepayments", value: "620" },
37
39
  { label: "Inventory", value: "630" },
38
40
  { label: "Software/IT Subscriptions", value: "701" },
41
+ { label: "Telephone and Internet Charges", value: "702" },
39
42
  { label: "Office Equipment", value: "710" },
40
43
  { label: "Less Accumulated Depreciation on Office Equipment", value: "711" },
41
44
  { label: "Computer Equipment", value: "720" },
@@ -45,6 +48,7 @@ export const expenseAccountOptions = [
45
48
  { label: "Gas Fees", value: "8001" },
46
49
  { label: "Exchange Fees", value: "8003" },
47
50
  { label: "Unpaid Expense Claims", value: "801" },
51
+ { label: "Accrued Expenses", value: "802" },
48
52
  { label: "Wages Payable", value: "803" },
49
53
  { label: "Sales Tax", value: "820" },
50
54
  { label: "Employee Tax Payable", value: "825" },
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from "react";
3
3
  let GRAPHQL_URL = 'http://localhost:4001/graphql/invoice';
4
4
  if (window.document.baseURI !== 'http://localhost:3000/') {
5
- GRAPHQL_URL = 'https://switchboard.powerhouse.xyz/graphql/invoice';
5
+ GRAPHQL_URL = 'https://switchboard-dev.powerhouse.xyz/graphql/invoice';
6
6
  }
7
7
  const RequestFinance = ({ docState }) => {
8
8
  const [isLoading, setIsLoading] = useState(false);
@@ -7,7 +7,7 @@
7
7
  */
8
8
  let GRAPHQL_URL = 'http://localhost:4001/graphql/invoice';
9
9
  if (window.document.baseURI !== 'http://localhost:3000/') {
10
- GRAPHQL_URL = 'https://switchboard.powerhouse.xyz/graphql/invoice';
10
+ GRAPHQL_URL = 'https://switchboard-dev.powerhouse.xyz/graphql/invoice';
11
11
  }
12
12
  export async function uploadPdfChunked(pdfData, endpoint = GRAPHQL_URL, chunkSize = 500 * 1024, // 500KB chunks
13
13
  onProgress) {
@@ -1 +1 @@
1
- {"version":3,"file":"gnosisTransactionBuilder.d.ts","sourceRoot":"","sources":["../../../scripts/invoice/gnosisTransactionBuilder.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,WAAW,CAAC;IACzB,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,IAAI,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,aAAa,EAAE,CAAC;CACjC;AA6BD,iBAAe,uBAAuB,CACpC,SAAS,EAAE,MAAM,EACjB,mBAAmB,EAAE,aAAa,GAAG,aAAa,EAAE,GACnD,OAAO,CAAC,cAAc,CAAC,CAqFzB;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAA"}
1
+ {"version":3,"file":"gnosisTransactionBuilder.d.ts","sourceRoot":"","sources":["../../../scripts/invoice/gnosisTransactionBuilder.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,WAAW,CAAC;IACzB,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,IAAI,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,aAAa,EAAE,CAAC;CACjC;AA6BD,iBAAe,uBAAuB,CACpC,SAAS,EAAE,MAAM,EACjB,mBAAmB,EAAE,aAAa,GAAG,aAAa,EAAE,GACnD,OAAO,CAAC,cAAc,CAAC,CA6FzB;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAA"}
@@ -4,7 +4,7 @@ import { OperationType } from '@safe-global/types-kit';
4
4
  import { ethers, AbiCoder } from 'ethers';
5
5
  import dotenv from 'dotenv';
6
6
  dotenv.config();
7
- const safeAddress = process.env.PRODUCTION_SAFE_ADDRESS;
7
+ const safeAddress = process.env.DEV_STAGING_SAFE_ADDRESS;
8
8
  if (!safeAddress) {
9
9
  throw new Error('Missing SAFE_ADDRESS in .env');
10
10
  }
@@ -49,6 +49,8 @@ async function executeTransferProposal(chainName, paymentDetailsInput) {
49
49
  const safeApiKit = new SafeApiKit({
50
50
  chainId: Number(payerWallet.chainId),
51
51
  });
52
+ const nextNonce = await safeApiKit.getNextNonce(safeAddress);
53
+ console.log("Next Nonce: ", nextNonce);
52
54
  // @ts-ignore - Ignoring constructor error as per requirements
53
55
  const protocolKit = await Safe.init({
54
56
  provider: payerWallet.rpc,
@@ -78,7 +80,12 @@ async function executeTransferProposal(chainName, paymentDetailsInput) {
78
80
  };
79
81
  });
80
82
  console.log('\n=== Creating Safe transaction ===');
81
- const safeTx = await protocolKit.createTransaction({ transactions });
83
+ const safeTx = await protocolKit.createTransaction({
84
+ transactions,
85
+ options: {
86
+ nonce: nextNonce
87
+ }
88
+ });
82
89
  console.log('\n=== Signing & proposing ===');
83
90
  const safeTxHash = await protocolKit.getTransactionHash(safeTx);
84
91
  const signature = await protocolKit.signHash(safeTxHash);
package/dist/style.css CHANGED
@@ -400,9 +400,6 @@
400
400
  .h-full {
401
401
  height: 100%;
402
402
  }
403
- .max-h-\[500px\] {
404
- max-height: 500px;
405
- }
406
403
  .w-4 {
407
404
  width: calc(var(--spacing) * 4);
408
405
  }
@@ -424,6 +421,9 @@
424
421
  .w-48 {
425
422
  width: calc(var(--spacing) * 48);
426
423
  }
424
+ .w-50 {
425
+ width: calc(var(--spacing) * 50);
426
+ }
427
427
  .w-64 {
428
428
  width: calc(var(--spacing) * 64);
429
429
  }
@@ -544,6 +544,9 @@
544
544
  margin-inline-end: calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse)));
545
545
  }
546
546
  }
547
+ .justify-self-end {
548
+ justify-self: flex-end;
549
+ }
547
550
  .overflow-hidden {
548
551
  overflow: hidden;
549
552
  }
@@ -784,6 +787,9 @@
784
787
  .text-gray-900 {
785
788
  color: var(--color-gray-900);
786
789
  }
790
+ .text-green-500 {
791
+ color: var(--color-green-500);
792
+ }
787
793
  .text-green-600 {
788
794
  color: var(--color-green-600);
789
795
  }
@@ -970,6 +976,11 @@
970
976
  padding: calc(var(--spacing) * 0);
971
977
  }
972
978
  }
979
+ .sm\:mt-6 {
980
+ @media (width >= 40rem) {
981
+ margin-top: calc(var(--spacing) * 6);
982
+ }
983
+ }
973
984
  .sm\:grid-cols-2 {
974
985
  @media (width >= 40rem) {
975
986
  grid-template-columns: repeat(2, minmax(0, 1fr));
@@ -6355,11 +6366,6 @@ input[type="number"] {
6355
6366
  transform: none;
6356
6367
  }
6357
6368
  }
6358
- @media (min-width: 640px) {
6359
- .two-column-grid {
6360
- grid-template-columns: 1fr 1fr;
6361
- }
6362
- }
6363
6369
  @property --tw-border-spacing-x {
6364
6370
  syntax: "<length>";
6365
6371
  inherits: false;
@@ -1 +1 @@
1
- {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/invoice/resolvers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAQ3D,eAAO,MAAM,YAAY,GAAI,UAAU,QAAQ,KAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CA8SnE,CAAC"}
1
+ {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/invoice/resolvers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAQ3D,eAAO,MAAM,YAAY,GAAI,UAAU,QAAQ,KAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CA0UnE,CAAC"}
@@ -99,6 +99,20 @@ export const getResolvers = (subgraph) => {
99
99
  await reactor.addAction(driveId, docId, actions.deleteRef({ ...args.input }));
100
100
  return doc.revision.global + 1;
101
101
  },
102
+ Invoice_editPaymentData: async (_, args) => {
103
+ const driveId = args.driveId || DEFAULT_DRIVE_ID;
104
+ const docId = args.docId || "";
105
+ const doc = await reactor.getDocument(driveId, docId);
106
+ await reactor.addAction(driveId, docId, actions.editPaymentData({ ...args.input }));
107
+ return doc.revision.global + 1;
108
+ },
109
+ Invoice_setExported: async (_, args) => {
110
+ const driveId = args.driveId || DEFAULT_DRIVE_ID;
111
+ const docId = args.docId || "";
112
+ const doc = await reactor.getDocument(driveId, docId);
113
+ await reactor.addAction(driveId, docId, actions.setExported({ ...args.input }));
114
+ return doc.revision.global + 1;
115
+ },
102
116
  Invoice_editIssuer: async (_, args) => {
103
117
  const driveId = args.driveId || DEFAULT_DRIVE_ID;
104
118
  const docId = args.docId || "";
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../subgraphs/invoice/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,MAAM,EAAE,YA8cpB,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../subgraphs/invoice/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,MAAM,EAAE,YAkepB,CAAC"}
@@ -18,6 +18,9 @@ export const schema = gql `
18
18
  totalPriceTaxIncl: Float!
19
19
  invoiceTags: [InvoiceTag!]! # e.g. {'xero-payment-account', '090', 'PowerhouseUSD'}
20
20
  notes: String
21
+ paymentDate: String
22
+ txnHash: String
23
+ exported: Boolean
21
24
  }
22
25
 
23
26
  type Ref {
@@ -192,6 +195,16 @@ export const schema = gql `
192
195
  docId: PHID
193
196
  input: Invoice_DeleteRefInput
194
197
  ): Int
198
+ Invoice_editPaymentData(
199
+ driveId: String
200
+ docId: PHID
201
+ input: Invoice_EditPaymentDataInput
202
+ ): Int
203
+ Invoice_setExported(
204
+ driveId: String
205
+ docId: PHID
206
+ input: Invoice_SetExportedInput
207
+ ): Int
195
208
  Invoice_editIssuer(
196
209
  driveId: String
197
210
  docId: PHID
@@ -318,6 +331,13 @@ export const schema = gql `
318
331
  input Invoice_DeleteRefInput {
319
332
  id: OID!
320
333
  }
334
+ input Invoice_EditPaymentDataInput {
335
+ paymentDate: String
336
+ txnHash: String
337
+ }
338
+ input Invoice_SetExportedInput {
339
+ exported: Boolean
340
+ }
321
341
 
322
342
  """
323
343
  Module: Parties
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.20",
4
+ "version": "0.0.21",
5
5
  "license": "AGPL-3.0-only",
6
6
  "type": "module",
7
7
  "files": [
@@ -60,7 +60,7 @@
60
60
  "@powerhousedao/builder-tools": "^0.10.2",
61
61
  "@powerhousedao/common": "^1.11.2",
62
62
  "@powerhousedao/design-system": "^1.40.2",
63
- "@powerhousedao/document-engineering": "^1.12.0",
63
+ "@powerhousedao/document-engineering": "^1.13.0",
64
64
  "@react-pdf/renderer": "^4.3.0",
65
65
  "@safe-global/api-kit": "^3.0.1",
66
66
  "@safe-global/protocol-kit": "^6.0.3",