@go-avro/avro-js 0.0.2-beta.14 → 0.0.2-beta.16

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.
@@ -24,5 +24,6 @@ export declare class AvroQueryClient {
24
24
  logout(cancelToken?: CancelToken): Promise<void>;
25
25
  fetchJobs(companyGuid: string, amt?: number, knownIds?: string[], unknownIds?: string[], keyword?: string, offset?: number, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
26
26
  fetchEvents(companyGuid: string, amt?: number, knownIds?: string[], unknownIds?: string[], keyword?: string, offset?: number, unbilled?: boolean, billed?: boolean, paid?: boolean, jobId?: string | null, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
27
+ fetchMonths(companyGuid: string, amt?: number, knownIds?: string[], unknownIds?: string[], keyword?: string, offset?: number, unbilled?: boolean, billed?: boolean, paid?: boolean, jobId?: string | null, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
27
28
  fetchBills(companyGuid: string, amt?: number, knownIds?: string[], unknownIds?: string[], keyword?: string, offset?: number, paid?: boolean, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
28
29
  }
@@ -247,6 +247,29 @@ export class AvroQueryClient {
247
247
  throw new StandardError(500, 'Failed to fetch events');
248
248
  });
249
249
  }
250
+ fetchMonths(companyGuid, amt = 50, knownIds = [], unknownIds = [], keyword = '', offset = 0, unbilled = true, billed = true, paid = true, jobId = null, cancelToken, headers = {}) {
251
+ const body = {
252
+ amt,
253
+ known_ids: knownIds,
254
+ unknown_ids: unknownIds,
255
+ query: keyword,
256
+ job_id: jobId,
257
+ };
258
+ if (!companyGuid) {
259
+ return Promise.reject(new StandardError(400, 'Company GUID is required'));
260
+ }
261
+ return this._fetch('POST', `/company/${companyGuid}/months?amt=${amt}&offset=${offset}&unbilled=${unbilled}&billed=${billed}&paid=${paid}`, body, cancelToken, headers)
262
+ .then(response => {
263
+ if (!response || !Array.isArray(response)) {
264
+ throw new StandardError(400, 'Invalid months response');
265
+ }
266
+ return response;
267
+ })
268
+ .catch(err => {
269
+ console.error('Failed to fetch months:', err);
270
+ throw new StandardError(500, 'Failed to fetch months');
271
+ });
272
+ }
250
273
  fetchBills(companyGuid, amt = 50, knownIds = [], unknownIds = [], keyword = '', offset = 0, paid = true, cancelToken, headers = {}) {
251
274
  const body = {
252
275
  amt,
@@ -68,6 +68,7 @@ export interface MemberState {
68
68
  }
69
69
  export interface LineItem {
70
70
  id: string;
71
+ line_item_type: "CUSTOM";
71
72
  name: string;
72
73
  description: string;
73
74
  cost: number | null;
@@ -211,13 +212,17 @@ export interface Break {
211
212
  }
212
213
  export interface ServiceMonth {
213
214
  id: string;
215
+ line_item_type: "SERVICE_MONTH";
214
216
  job_name: string;
215
217
  job_id: string | null;
218
+ job_address: string;
219
+ job_labels: string[];
216
220
  bill_id: string | null;
217
221
  cost: number;
218
222
  billed: boolean;
219
223
  paid: boolean;
220
224
  amount: number;
225
+ tasks: string[];
221
226
  time_created: number;
222
227
  time_updated: number | null;
223
228
  }
@@ -473,6 +478,7 @@ export interface taskEndInfo {
473
478
  }
474
479
  export interface AdditionalCharge {
475
480
  id: string;
481
+ line_item_type: "ADDITIONAL_CHARGE";
476
482
  time_created: number;
477
483
  time_updated: number | null;
478
484
  name: string;
@@ -481,6 +487,7 @@ export interface AdditionalCharge {
481
487
  export interface _Event {
482
488
  breaks: string[];
483
489
  id: string;
490
+ line_item_type: "EVENT";
484
491
  name: string;
485
492
  internal_notes: string;
486
493
  external_notes: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-avro/avro-js",
3
- "version": "0.0.2-beta.14",
3
+ "version": "0.0.2-beta.16",
4
4
  "description": "JS client for Avro backend integration.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",