@go-avro/avro-js 0.0.114 → 0.0.116

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.
@@ -13,6 +13,20 @@ export declare const TaskStatus: {
13
13
  readonly PENDING_ACTIVATION: "PENDING_ACTIVATION";
14
14
  };
15
15
  export type TaskStatus = (typeof TaskStatus)[keyof typeof TaskStatus];
16
+ export declare const UnroutedReason: {
17
+ readonly NOT_DUE: "NOT_DUE";
18
+ readonly DEPENDENCY_UNMET: "DEPENDENCY_UNMET";
19
+ readonly MISSING_SKILLS: "MISSING_SKILLS";
20
+ readonly OVER_CAPACITY: "OVER_CAPACITY";
21
+ readonly OWN_TIME_WINDOW: "OWN_TIME_WINDOW";
22
+ readonly TRAVEL_TIME: "TRAVEL_TIME";
23
+ readonly LOW_PRIORITY: "LOW_PRIORITY";
24
+ readonly DISPLACED_BY_CHEAPER: "DISPLACED_BY_CHEAPER";
25
+ readonly SCHEDULE_FULL: "SCHEDULE_FULL";
26
+ readonly DID_NOT_FIT: "DID_NOT_FIT";
27
+ };
28
+ export type UnroutedReason = (typeof UnroutedReason)[keyof typeof UnroutedReason];
29
+ export declare const UNROUTED_REASON_LABELS: Record<UnroutedReason, string>;
16
30
  declare module '../../types/api/Task' {
17
31
  interface Task {
18
32
  enforce_image_amount: boolean;
@@ -40,7 +54,7 @@ declare module '../../types/api/Task' {
40
54
  bill_mode: 'MONTH' | 'SERVICE' | 'NONE';
41
55
  autobill: boolean;
42
56
  price: number;
43
- last_unrouted_reason: 'NOT_DUE' | 'DEPENDENCY_UNMET' | 'MISSING_SKILLS' | 'OVER_CAPACITY' | 'TRAVEL_TIME' | 'LOW_PRIORITY' | 'DID_NOT_FIT' | null;
57
+ last_unrouted_reason: UnroutedReason | null;
44
58
  services_remaining: number;
45
59
  activate_on: number | null;
46
60
  expire_on: number | null;
@@ -54,6 +68,7 @@ declare module '../../types/api/Task' {
54
68
  export declare class Task {
55
69
  constructor(init?: Partial<Task>);
56
70
  getStatusLabel: () => "Active" | "Draft" | "Archived" | "Pending Customer Approval" | "Pending Company Approval" | "Pending Payment" | "Pending Activation";
71
+ getUnroutedReasonLabel: () => string | null;
57
72
  isOverdue: () => boolean;
58
73
  getOverdueLabel: () => string;
59
74
  getNextDue: () => number | null;
@@ -8,6 +8,30 @@ export const TaskStatus = {
8
8
  PENDING_PAYMENT: 'PENDING_PAYMENT',
9
9
  PENDING_ACTIVATION: 'PENDING_ACTIVATION',
10
10
  };
11
+ export const UnroutedReason = {
12
+ NOT_DUE: 'NOT_DUE',
13
+ DEPENDENCY_UNMET: 'DEPENDENCY_UNMET',
14
+ MISSING_SKILLS: 'MISSING_SKILLS',
15
+ OVER_CAPACITY: 'OVER_CAPACITY',
16
+ OWN_TIME_WINDOW: 'OWN_TIME_WINDOW',
17
+ TRAVEL_TIME: 'TRAVEL_TIME',
18
+ LOW_PRIORITY: 'LOW_PRIORITY',
19
+ DISPLACED_BY_CHEAPER: 'DISPLACED_BY_CHEAPER',
20
+ SCHEDULE_FULL: 'SCHEDULE_FULL',
21
+ DID_NOT_FIT: 'DID_NOT_FIT',
22
+ };
23
+ export const UNROUTED_REASON_LABELS = {
24
+ NOT_DUE: 'Not due yet',
25
+ DEPENDENCY_UNMET: 'Depends on an unrouted task',
26
+ MISSING_SKILLS: 'No available team has the required skills',
27
+ OVER_CAPACITY: 'Exceeds remaining team capacity',
28
+ OWN_TIME_WINDOW: 'Time window conflicts with team hours',
29
+ TRAVEL_TIME: 'Cannot be reached within the day',
30
+ LOW_PRIORITY: 'Crowded out by more urgent tasks',
31
+ DISPLACED_BY_CHEAPER: 'Lost its spot to a quicker-to-reach job',
32
+ SCHEDULE_FULL: 'No room left in the schedule',
33
+ DID_NOT_FIT: 'Did not fit any schedule',
34
+ };
11
35
  export class Task {
12
36
  constructor(init) {
13
37
  this.getStatusLabel = () => {
@@ -30,6 +54,11 @@ export class Task {
30
54
  return this.status;
31
55
  }
32
56
  };
57
+ this.getUnroutedReasonLabel = () => {
58
+ if (!this.last_unrouted_reason)
59
+ return null;
60
+ return UNROUTED_REASON_LABELS[this.last_unrouted_reason] ?? this.last_unrouted_reason;
61
+ };
33
62
  this.isOverdue = () => {
34
63
  return (this.status === TaskStatus.ACTIVE &&
35
64
  this.overdue_time !== undefined &&
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const AVRO_JS_VERSION = "0.0.114";
1
+ export declare const AVRO_JS_VERSION = "0.0.116";
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.114';
3
+ export const AVRO_JS_VERSION = '0.0.116';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-avro/avro-js",
3
- "version": "0.0.114",
3
+ "version": "0.0.116",
4
4
  "description": "JS client for Avro backend integration.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",