@fabriktor/fx 0.0.151 → 0.0.152

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.
@@ -29,6 +29,10 @@ export declare const RoutePlanningBlock: {
29
29
  readonly DepartureChanged: "route_departure_changed";
30
30
  readonly DestinationTimezone: "route_destination_timezone";
31
31
  readonly DestinationChanged: "route_destination_changed";
32
+ readonly DestinationOwner: "route_destination_owner";
33
+ readonly DestinationArchived: "route_destination_archived";
34
+ readonly DestinationAddress: "route_destination_address";
35
+ readonly DestinationClient: "route_destination_client";
32
36
  };
33
37
  export declare function companyRouteDeparture(user: User): RouteDeparture;
34
38
  export declare function warehouseRouteDeparture(warehouse: Warehouse, owner_id: string): RouteDeparture;
@@ -12,6 +12,10 @@ export const RoutePlanningBlock = {
12
12
  DepartureChanged: "route_departure_changed",
13
13
  DestinationTimezone: "route_destination_timezone",
14
14
  DestinationChanged: "route_destination_changed",
15
+ DestinationOwner: "route_destination_owner",
16
+ DestinationArchived: "route_destination_archived",
17
+ DestinationAddress: "route_destination_address",
18
+ DestinationClient: "route_destination_client",
15
19
  };
16
20
  export function companyRouteDeparture(user) {
17
21
  if (user.account_identity !== UserTypeEmployer ||
@@ -57,11 +61,14 @@ export async function loadRouteDeparture(readers, owner_id, reference, signal) {
57
61
  throw new PreActionBlocked(RoutePlanningBlock.Departure);
58
62
  }
59
63
  export function validateRoutePlanLocation(location, owner_id, timezone) {
60
- if (location.owner_id !== owner_id ||
61
- location.is_archived ||
62
- !location.place_id.trim() ||
63
- !resolvedID(location.client_id))
64
- throw new PreActionBlocked(RoutePlanningBlock.DestinationChanged);
64
+ if (location.owner_id !== owner_id)
65
+ throw new PreActionBlocked(RoutePlanningBlock.DestinationOwner);
66
+ if (location.is_archived)
67
+ throw new PreActionBlocked(RoutePlanningBlock.DestinationArchived);
68
+ if (!location.place_id?.trim())
69
+ throw new PreActionBlocked(RoutePlanningBlock.DestinationAddress);
70
+ if (!resolvedID(location.client_id))
71
+ throw new PreActionBlocked(RoutePlanningBlock.DestinationClient);
65
72
  if (addressTimezone(location) !== timezone)
66
73
  throw new PreActionBlocked(RoutePlanningBlock.DestinationTimezone);
67
74
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fabriktor/fx",
3
- "version": "0.0.151",
3
+ "version": "0.0.152",
4
4
  "description": "![Fabriktor Logo](./img/fabriktor-character.gif)",
5
5
  "type": "module",
6
6
  "exports": {