@go-avro/avro-js 0.0.114 → 0.0.115

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,17 @@ 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 TRAVEL_TIME: "TRAVEL_TIME";
22
+ readonly LOW_PRIORITY: "LOW_PRIORITY";
23
+ readonly DID_NOT_FIT: "DID_NOT_FIT";
24
+ };
25
+ export type UnroutedReason = (typeof UnroutedReason)[keyof typeof UnroutedReason];
26
+ export declare const UNROUTED_REASON_LABELS: Record<UnroutedReason, string>;
16
27
  declare module '../../types/api/Task' {
17
28
  interface Task {
18
29
  enforce_image_amount: boolean;
@@ -40,7 +51,7 @@ declare module '../../types/api/Task' {
40
51
  bill_mode: 'MONTH' | 'SERVICE' | 'NONE';
41
52
  autobill: boolean;
42
53
  price: number;
43
- last_unrouted_reason: 'NOT_DUE' | 'DEPENDENCY_UNMET' | 'MISSING_SKILLS' | 'OVER_CAPACITY' | 'TRAVEL_TIME' | 'LOW_PRIORITY' | 'DID_NOT_FIT' | null;
54
+ last_unrouted_reason: UnroutedReason | null;
44
55
  services_remaining: number;
45
56
  activate_on: number | null;
46
57
  expire_on: number | null;
@@ -54,6 +65,7 @@ declare module '../../types/api/Task' {
54
65
  export declare class Task {
55
66
  constructor(init?: Partial<Task>);
56
67
  getStatusLabel: () => "Active" | "Draft" | "Archived" | "Pending Customer Approval" | "Pending Company Approval" | "Pending Payment" | "Pending Activation";
68
+ getUnroutedReasonLabel: () => string | null;
57
69
  isOverdue: () => boolean;
58
70
  getOverdueLabel: () => string;
59
71
  getNextDue: () => number | null;
@@ -8,6 +8,24 @@ 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
+ TRAVEL_TIME: 'TRAVEL_TIME',
17
+ LOW_PRIORITY: 'LOW_PRIORITY',
18
+ DID_NOT_FIT: 'DID_NOT_FIT',
19
+ };
20
+ export const UNROUTED_REASON_LABELS = {
21
+ NOT_DUE: 'Not due yet',
22
+ DEPENDENCY_UNMET: 'Depends on an unrouted task',
23
+ MISSING_SKILLS: 'No available team has the required skills',
24
+ OVER_CAPACITY: 'Exceeds remaining team capacity',
25
+ TRAVEL_TIME: 'Too much travel time to reach',
26
+ LOW_PRIORITY: 'Crowded out by higher-priority tasks',
27
+ DID_NOT_FIT: 'Did not fit any schedule',
28
+ };
11
29
  export class Task {
12
30
  constructor(init) {
13
31
  this.getStatusLabel = () => {
@@ -30,6 +48,11 @@ export class Task {
30
48
  return this.status;
31
49
  }
32
50
  };
51
+ this.getUnroutedReasonLabel = () => {
52
+ if (!this.last_unrouted_reason)
53
+ return null;
54
+ return UNROUTED_REASON_LABELS[this.last_unrouted_reason] ?? this.last_unrouted_reason;
55
+ };
33
56
  this.isOverdue = () => {
34
57
  return (this.status === TaskStatus.ACTIVE &&
35
58
  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.115";
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.115';
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.115",
4
4
  "description": "JS client for Avro backend integration.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",