@fabriktor/fx 0.0.89 → 0.0.91

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.
@@ -3,6 +3,7 @@ import { type Bill, BillableFolder, Charge, Equipment, Item, LaborRate, MeterRea
3
3
  import type { ContactsFXOperator, EmploymentOwnerScope } from "../contacts/contacts.js";
4
4
  import { type OwnerSearchOptions, type SearchOptions, type SearchPage, type SearchQuery } from "../core/search.js";
5
5
  type GenerateBillPayload = Parameters<BillableOperator["generateBill"]>[0];
6
+ export type SalaryEstimateInput = GenerateBillPayload["salary_estimate"];
6
7
  type BillInsertOptions = Parameters<BillableOperator["insertOneBill"]>[0];
7
8
  type BillReplaceOptions = Parameters<BillableOperator["replaceOneBill"]>[0];
8
9
  type BillableFolderInsertOptions = Parameters<BillableOperator["insertOneBillableFolder"]>[0];
@@ -134,6 +135,7 @@ export type GenerateDynamicBillOptions = {
134
135
  in: GenerateBillPayload;
135
136
  exclude_billed?: boolean;
136
137
  };
138
+ export declare function zeroSalaryEstimate(): SalaryEstimateInput;
137
139
  export type MarkLocationAchievedOptions = {
138
140
  in: GenerateBillPayload;
139
141
  };
@@ -65,6 +65,14 @@ export const BillableReadResource = {
65
65
  VendorInvoice: "vendor_invoice",
66
66
  Warehouse: "warehouse",
67
67
  };
68
+ export function zeroSalaryEstimate() {
69
+ return {
70
+ employee_ids: [],
71
+ daily_work_hours: 0,
72
+ daily_transport_hours: 0,
73
+ days_per_week: 0,
74
+ };
75
+ }
68
76
  export const BillablePreActionReason = {
69
77
  VendorInvoiceNumberExists: "vendor_invoice_number_exists",
70
78
  };
@@ -364,6 +372,7 @@ export class BillableFX {
364
372
  is_estimate: false,
365
373
  upfront_rate: 0,
366
374
  exclude_billed: opts.exclude_billed,
375
+ salary_estimate: zeroSalaryEstimate(),
367
376
  }));
368
377
  }
369
378
  async markLocationAchieved(opts) {
@@ -32,7 +32,9 @@ export type SearchLocationsOptions = OwnerSearchOptions & {
32
32
  export type SearchAccessibleLocationsOptions = SearchOptions & {
33
33
  is_archived?: boolean;
34
34
  };
35
- export type SearchJobProgramsOptions = OwnerSearchOptions;
35
+ export type SearchJobProgramsOptions = OwnerSearchOptions & {
36
+ location_id?: string;
37
+ };
36
38
  export type SearchJobsOptions = OwnerSearchOptions & {
37
39
  location_id?: string;
38
40
  };
@@ -168,8 +168,12 @@ export class JobsFX {
168
168
  };
169
169
  }
170
170
  async searchJobPrograms(opts) {
171
+ const { location_id, ...searchOpts } = opts;
171
172
  return await runOwnerSearch({
172
- ...opts,
173
+ ...searchOpts,
174
+ query: location_id === undefined
175
+ ? undefined
176
+ : queryParams({ job_location_id: location_id }),
173
177
  search: (searchOpts) => this.jobs.searchManyJobPrograms(searchOpts),
174
178
  });
175
179
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fabriktor/fx",
3
- "version": "0.0.89",
3
+ "version": "0.0.91",
4
4
  "description": "![Fabriktor Logo](./img/fabriktor-character.gif)",
5
5
  "type": "module",
6
6
  "exports": {