@zeniai/client-epic-state 5.3.3 → 5.3.4

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.
@@ -12,7 +12,6 @@ export interface InvoicingLineItemPayload {
12
12
  discount_amount?: number;
13
13
  entity_description?: string;
14
14
  entity_type?: string;
15
- gross_amount?: number | null;
16
15
  id?: string;
17
16
  is_taxed?: boolean;
18
17
  item_level_discount_amount?: number;
@@ -17,9 +17,6 @@ const mapLineItem = (payload, currencyCode, currencySymbol) => ({
17
17
  : undefined,
18
18
  entityDescription: payload.entity_description,
19
19
  entityType: payload.entity_type,
20
- grossAmount: payload.gross_amount != null
21
- ? (0, amount_1.toAmount)(payload.gross_amount, currencyCode, currencySymbol)
22
- : undefined,
23
20
  id: payload.id,
24
21
  isTaxed: payload.is_taxed,
25
22
  itemLevelDiscountAmount: payload.item_level_discount_amount != null
@@ -13,8 +13,6 @@ export interface InvoicingLineItem {
13
13
  discountAmount?: Amount;
14
14
  entityDescription?: string;
15
15
  entityType?: string;
16
- /** Price before item-level coupons (`amount` is after); absent on older invoices. */
17
- grossAmount?: Amount;
18
16
  id?: ID;
19
17
  isTaxed?: boolean;
20
18
  itemLevelDiscountAmount?: Amount;
@@ -14,9 +14,6 @@ const mapLineItem = (payload, currencyCode, currencySymbol) => ({
14
14
  : undefined,
15
15
  entityDescription: payload.entity_description,
16
16
  entityType: payload.entity_type,
17
- grossAmount: payload.gross_amount != null
18
- ? toAmount(payload.gross_amount, currencyCode, currencySymbol)
19
- : undefined,
20
17
  id: payload.id,
21
18
  isTaxed: payload.is_taxed,
22
19
  itemLevelDiscountAmount: payload.item_level_discount_amount != null
@@ -26,10 +26,9 @@ export const fetchReconciliationViewEpic = (actions$, state$, zeniAPI) => action
26
26
  }
27
27
  let fetchState;
28
28
  if (accountId != null) {
29
- // Period bucket can be unhydrated during app-shell load.
30
29
  fetchState =
31
30
  accountReconciliationRecords[toMonthYearPeriodId(selectedPeriod)]
32
- ?.reconciliationByAccountID[accountId]?.transactionFetchState
31
+ .reconciliationByAccountID[accountId].transactionFetchState
33
32
  .fetchState;
34
33
  }
35
34
  else {
@@ -128,6 +128,7 @@ export const prepareCreateTransactionPayload = (state, localData) => {
128
128
  if (transactionType === 'journal_entry') {
129
129
  return {
130
130
  ...base,
131
+ document_id: localData.documentId,
131
132
  lines,
132
133
  };
133
134
  }
@@ -29,10 +29,9 @@ const fetchReconciliationViewEpic = (actions$, state$, zeniAPI) => actions$.pipe
29
29
  }
30
30
  let fetchState;
31
31
  if (accountId != null) {
32
- // Period bucket can be unhydrated during app-shell load.
33
32
  fetchState =
34
33
  accountReconciliationRecords[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]
35
- ?.reconciliationByAccountID[accountId]?.transactionFetchState
34
+ .reconciliationByAccountID[accountId].transactionFetchState
36
35
  .fetchState;
37
36
  }
38
37
  else {
@@ -12,8 +12,8 @@ import { CreateTransactionLocalData } from './createTransactionState';
12
12
  * 1. `line_detail_type` is snake_case. The PascalCase strings in the backend are Python
13
13
  * constant NAMES; ZENI_LINE_DETAIL_TYPE_TO_QBO_LINE_DETAIL_TYPE_MAP converts them for the
14
14
  * body the backend sends on to QuickBooks, never for ours.
15
- * 2. Only the QBO Purchases (check, credit_card_credit) send a reference number, as
16
- * `document_number`. A journal entry sends none.
15
+ * 2. The reference number uses two different keys depending on the QBO entity. check and
16
+ * expense are Purchases and take `document_number`; everything else takes `document_id`.
17
17
  */
18
18
  export interface CreateTransactionAccountPayload {
19
19
  qbo_id: ID;
@@ -51,6 +51,8 @@ export interface CreateTransactionRemitToAddressPayload {
51
51
  export interface CreateTransactionRequest extends Record<string, unknown> {
52
52
  transaction_date: string;
53
53
  transaction_type: string;
54
+ /** journal_entry reference number. */
55
+ document_id?: string;
54
56
  /** check / credit_card_credit reference number (QBO Purchase). */
55
57
  document_number?: string;
56
58
  from_account_id?: ID;
@@ -132,6 +132,7 @@ const prepareCreateTransactionPayload = (state, localData) => {
132
132
  if (transactionType === 'journal_entry') {
133
133
  return {
134
134
  ...base,
135
+ document_id: localData.documentId,
135
136
  lines,
136
137
  };
137
138
  }
@@ -54,6 +54,8 @@ export interface CreateTransactionLocalData {
54
54
  /** Empty for transfer, which has no lines at all. */
55
55
  lines: CreateTransactionLineLocalData[];
56
56
  transactionType: CreatableTransactionType;
57
+ /** journal_entry reference number. */
58
+ documentId?: string;
57
59
  /** check / credit_card_credit reference number. */
58
60
  documentNumber?: string;
59
61
  /** transfer */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.3.3",
3
+ "version": "5.3.4",
4
4
  "description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/esm/index.js",