@go-avro/avro-js 0.0.87 → 0.0.89

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.
@@ -82,6 +82,7 @@ AvroQueryClient.prototype.useCreateBill = function () {
82
82
  entityKey: 'bills',
83
83
  id: result.id,
84
84
  fetchPath: `/bill/${result.id}`,
85
+ construct: (d) => new Bill(d),
85
86
  });
86
87
  },
87
88
  onError: (_err, _variables, context) => {
@@ -131,6 +132,7 @@ AvroQueryClient.prototype.useUpdateBill = function () {
131
132
  entityKey: 'bills',
132
133
  id: billId,
133
134
  fetchPath: `/bill/${billId}`,
135
+ construct: (d) => new Bill(d),
134
136
  });
135
137
  },
136
138
  onError: (err, variables, context) => {
@@ -162,6 +164,7 @@ AvroQueryClient.prototype.useUpdateBillLineItemStatus = function () {
162
164
  entityKey: 'bills',
163
165
  id: billId,
164
166
  fetchPath: `/bill/${billId}`,
167
+ construct: (d) => new Bill(d),
165
168
  });
166
169
  // Item paid state also lives on the underlying events,
167
170
  // service months and prepayments
@@ -3,6 +3,7 @@ import { BillUser } from '../../types/api/BillUser';
3
3
  import { CustomLineItem } from '../../types/api/CustomLineItem';
4
4
  import { LineItem } from '../../types/api/LineItem';
5
5
  import { PaymentType } from '../../types/api/PaymentType';
6
+ import { Refund } from '../../types/api/Refund';
6
7
  import { ProcessingFeeLineItem } from '../../types/api/ProcessingFeeLineItem';
7
8
  export type BillLineItem = CustomLineItem | ProcessingFeeLineItem;
8
9
  export declare const BillStatus: {
@@ -30,6 +31,7 @@ declare module '../../types/api/Bill' {
30
31
  intent_created_at: number;
31
32
  intent_last_created_at: number;
32
33
  payments: BillPayment[];
34
+ refunds: Refund[];
33
35
  line_items: LineItem[];
34
36
  prepayments: string[];
35
37
  months: string[];
@@ -26,9 +26,6 @@ declare module '../../types/api/LineItem' {
26
26
  cost: number;
27
27
  amount: number;
28
28
  status: LineItemStatus;
29
- job_id: string;
30
- job_name: string;
31
- job_address: string;
32
29
  job_labels: string[];
33
30
  bill_pub_id: number | null;
34
31
  parent_id: string | null;
@@ -4,6 +4,8 @@ declare module '../../types/api/Prepayment' {
4
4
  id: string;
5
5
  task_id: string | null;
6
6
  line_item_type: 'PREPAYMENT';
7
+ job_name: string;
8
+ job_address: string;
7
9
  type: 'SERVICE' | 'MONTH';
8
10
  time_updated: number | null;
9
11
  num_events: number;
@@ -1,5 +1,4 @@
1
1
  import { LineItem } from '../../types/api/LineItem';
2
- import { PaymentType } from '../../types/api/PaymentType';
3
2
  /**
4
3
  * A read-only line item populated by the backend when the bill has
5
4
  * `pass_on_fees` enabled. Represents the Stripe + Avro processing fees being
@@ -10,12 +9,9 @@ import { PaymentType } from '../../types/api/PaymentType';
10
9
  * changes at checkout, and reconciled to the actual collected fees on
11
10
  * `payment_intent.succeeded`).
12
11
  *
13
- * `payment_method_assumption` records which method was used to compute the
14
- * current `cost`. UI surfaces (invoice details, email PDF, QB sync) display
15
- * this value so the merchant knows whether the persisted figure is the card
16
- * estimate, the ACH estimate, or the actual reconciled amount.
12
+ * The method assumption behind the persisted `cost` is exposed by the
13
+ * payment-context endpoint, not on bill line items.
17
14
  */
18
15
  export interface ProcessingFeeLineItem extends LineItem {
19
16
  line_item_type: 'PROCESSING_FEE';
20
- payment_method_assumption: PaymentType | null;
21
17
  }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * A refund issued against a bill's payment, serialized on the bill
3
+ * payload so invoice surfaces can show refunded amounts without an
4
+ * extra query.
5
+ */
6
+ export interface Refund {
7
+ id: string;
8
+ amount: number;
9
+ stripe_pi_id: string;
10
+ status: 'created' | 'processing' | 'succeeded' | 'failed' | 'canceled' | 'requires_action' | 'in_transit' | 'deposited';
11
+ time_created: number;
12
+ time_updated: number | null;
13
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,9 @@
1
1
  import { LineItem } from '../../types/api/LineItem';
2
2
  export interface ServiceMonth extends LineItem {
3
3
  line_item_type: 'SERVICE_MONTH';
4
+ job_id: string | null;
5
+ job_name: string;
6
+ job_address: string;
4
7
  bill_id: string | null;
5
8
  tasks: string[];
6
9
  task_names: string[];
@@ -5,6 +5,9 @@ declare module '../../types/api/_Event' {
5
5
  interface _Event extends LineItem {
6
6
  breaks: string[];
7
7
  line_item_type: 'EVENT';
8
+ job_id: string;
9
+ job_name: string;
10
+ job_address: string;
8
11
  internal_notes: string;
9
12
  external_notes: string;
10
13
  proofs: string[];
@@ -7,6 +7,7 @@ export * from '../types/api/Address';
7
7
  export * from '../types/api/Avro';
8
8
  export * from '../types/api/Bill';
9
9
  export * from '../types/api/BillPayment';
10
+ export * from '../types/api/Refund';
10
11
  export * from '../types/api/BillUser';
11
12
  export * from '../types/api/Break';
12
13
  export * from '../types/api/CatalogItem';
package/dist/types/api.js CHANGED
@@ -4,6 +4,7 @@ export * from '../types/api/Address';
4
4
  export * from '../types/api/Avro';
5
5
  export * from '../types/api/Bill';
6
6
  export * from '../types/api/BillPayment';
7
+ export * from '../types/api/Refund';
7
8
  export * from '../types/api/BillUser';
8
9
  export * from '../types/api/Break';
9
10
  export * from '../types/api/CatalogItem';
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const AVRO_JS_VERSION = "0.0.87";
1
+ export declare const AVRO_JS_VERSION = "0.0.89";
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  // AUTO-GENERATED by scripts/gen-version.js — do not edit by hand.
2
2
  // Regenerated from package.json by the `prebuild` npm hook.
3
- export const AVRO_JS_VERSION = '0.0.87';
3
+ export const AVRO_JS_VERSION = '0.0.89';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-avro/avro-js",
3
- "version": "0.0.87",
3
+ "version": "0.0.89",
4
4
  "description": "JS client for Avro backend integration.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",