@tmscloud/tbt-knex 0.0.14 → 0.0.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.
- package/dist/dao/api-key/api-key.dao.js +2 -6
- package/dist/dao/api-key/api-key.dao.js.map +1 -1
- package/dist/dao/driver-tracking/driver-tracking.dao.d.ts +1 -9
- package/dist/dao/driver-tracking/driver-tracking.dao.js +11 -55
- package/dist/dao/driver-tracking/driver-tracking.dao.js.map +1 -1
- package/dist/dao/duty/duty.dao.d.ts +7 -1
- package/dist/dao/duty/duty.dao.js +24 -3
- package/dist/dao/duty/duty.dao.js.map +1 -1
- package/dist/dao/duty-item-progress/duty-item-progress.dao.js +1 -3
- package/dist/dao/duty-item-progress/duty-item-progress.dao.js.map +1 -1
- package/dist/dao/duty-template/duty-template.dao.d.ts +10 -2
- package/dist/dao/duty-template/duty-template.dao.js +39 -16
- package/dist/dao/duty-template/duty-template.dao.js.map +1 -1
- package/dist/dao/duty-track/duty-track.dao.d.ts +3 -4
- package/dist/dao/duty-track/duty-track.dao.js +3 -3
- package/dist/dao/duty-track/duty-track.dao.js.map +1 -1
- package/dist/dao/event/event.dao.js +3 -9
- package/dist/dao/event/event.dao.js.map +1 -1
- package/dist/dao/password-reset/password-reset.dao.js.map +1 -1
- package/dist/dao/route/route.dao.d.ts +5 -0
- package/dist/dao/route/route.dao.js +16 -0
- package/dist/dao/route/route.dao.js.map +1 -1
- package/dist/dao/system-setting/system-setting.dao.js.map +1 -1
- package/dist/dao/user/user.dao.d.ts +1 -5
- package/dist/dao/user/user.dao.js +9 -15
- package/dist/dao/user/user.dao.js.map +1 -1
- package/dist/index.d.ts +2 -7
- package/dist/index.js +1 -7
- package/dist/index.js.map +1 -1
- package/dist/interfaces/driver-tracking/driver-tracking.interfaces.d.ts +4 -17
- package/dist/interfaces/duty/duty.interfaces.d.ts +1 -1
- package/dist/interfaces/duty-template/duty-template.interfaces.d.ts +2 -0
- package/dist/interfaces/duty-track/duty-track.interfaces.d.ts +1 -1
- package/dist/interfaces/route/route-geojson.interfaces.d.ts +22 -6
- package/dist/interfaces/{trip-track/trip-track.interfaces.d.ts → tracking/tracking.interfaces.d.ts} +14 -40
- package/dist/interfaces/tracking/tracking.interfaces.js +7 -0
- package/dist/interfaces/tracking/tracking.interfaces.js.map +1 -0
- package/dist/interfaces/user/user.interfaces.d.ts +7 -0
- package/package.json +1 -1
- package/dist/dao/route-assignment/route-assignment.dao.d.ts +0 -58
- package/dist/dao/route-assignment/route-assignment.dao.js +0 -330
- package/dist/dao/route-assignment/route-assignment.dao.js.map +0 -1
- package/dist/dao/trip/trip.dao.d.ts +0 -107
- package/dist/dao/trip/trip.dao.js +0 -517
- package/dist/dao/trip/trip.dao.js.map +0 -1
- package/dist/dao/trip-track/trip-track.dao.d.ts +0 -56
- package/dist/dao/trip-track/trip-track.dao.js +0 -307
- package/dist/dao/trip-track/trip-track.dao.js.map +0 -1
- package/dist/interfaces/route-assignment/route-assignment.interfaces.d.ts +0 -18
- package/dist/interfaces/route-assignment/route-assignment.interfaces.js +0 -3
- package/dist/interfaces/route-assignment/route-assignment.interfaces.js.map +0 -1
- package/dist/interfaces/trip/trip.interfaces.d.ts +0 -48
- package/dist/interfaces/trip/trip.interfaces.js +0 -3
- package/dist/interfaces/trip/trip.interfaces.js.map +0 -1
- package/dist/interfaces/trip-track/trip-track.interfaces.js +0 -3
- package/dist/interfaces/trip-track/trip-track.interfaces.js.map +0 -1
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Optional arrival zone for stops.
|
|
3
|
+
* Polygon: driver arrives when entering the polygon boundary.
|
|
4
|
+
* Radius: driver arrives when within X meters of center.
|
|
5
|
+
* If omitted, uses the admin-configured default radius.
|
|
6
|
+
*/
|
|
7
|
+
export interface IArrivalZone {
|
|
8
|
+
type: "polygon" | "radius";
|
|
9
|
+
/** Closed ring of [lng, lat] coordinates for polygon (first == last) */
|
|
10
|
+
coordinates?: [number, number][];
|
|
11
|
+
/** Custom radius in meters (for radius type) */
|
|
12
|
+
meters?: number;
|
|
13
|
+
}
|
|
1
14
|
/**
|
|
2
15
|
* Properties on the FeatureCollection itself (top-level metadata).
|
|
3
16
|
* Non-standard but already used throughout the codebase.
|
|
@@ -17,11 +30,13 @@ export interface IRouteGeoJSONProperties {
|
|
|
17
30
|
* Feature.id === crypto.randomUUID()
|
|
18
31
|
*/
|
|
19
32
|
export interface IRouteStopProperties {
|
|
20
|
-
feature_type:
|
|
33
|
+
feature_type: "stop";
|
|
21
34
|
name: string;
|
|
22
35
|
address: string;
|
|
23
36
|
stop_sequence: number;
|
|
24
37
|
customInstruction?: string;
|
|
38
|
+
/** Optional custom arrival zone (polygon or radius). Falls back to admin setting if omitted. */
|
|
39
|
+
arrivalZone?: IArrivalZone;
|
|
25
40
|
}
|
|
26
41
|
/**
|
|
27
42
|
* A turn/waypoint -- auto-generated from Mapbox routing, optionally pinned by user.
|
|
@@ -29,7 +44,7 @@ export interface IRouteStopProperties {
|
|
|
29
44
|
* Feature.id === crypto.randomUUID()
|
|
30
45
|
*/
|
|
31
46
|
export interface IRouteWaypointProperties {
|
|
32
|
-
feature_type:
|
|
47
|
+
feature_type: "waypoint";
|
|
33
48
|
segment_index: number;
|
|
34
49
|
order_in_segment: number;
|
|
35
50
|
isPinned: boolean;
|
|
@@ -57,9 +72,9 @@ export interface IRouteSegmentInstruction {
|
|
|
57
72
|
* Feature.id === 'route-segment-{segment_index}'
|
|
58
73
|
*/
|
|
59
74
|
export interface IRouteSegmentProperties {
|
|
60
|
-
feature_type:
|
|
75
|
+
feature_type: "route_segment";
|
|
61
76
|
segment_index: number;
|
|
62
|
-
mode:
|
|
77
|
+
mode: "normal" | "offroad";
|
|
63
78
|
from_stop_id: string;
|
|
64
79
|
to_stop_id: string;
|
|
65
80
|
distance: number;
|
|
@@ -72,7 +87,7 @@ export interface IRouteSegmentProperties {
|
|
|
72
87
|
* Feature.id === 'route-main'
|
|
73
88
|
*/
|
|
74
89
|
export interface IRouteMainProperties {
|
|
75
|
-
feature_type:
|
|
90
|
+
feature_type: "route";
|
|
76
91
|
}
|
|
77
92
|
export type RouteFeatureProperties = IRouteStopProperties | IRouteWaypointProperties | IRouteSegmentProperties | IRouteMainProperties;
|
|
78
93
|
export interface IRouteStop {
|
|
@@ -83,6 +98,7 @@ export interface IRouteStop {
|
|
|
83
98
|
address: string;
|
|
84
99
|
stop_sequence: number;
|
|
85
100
|
customInstruction?: string;
|
|
101
|
+
arrivalZone?: IArrivalZone;
|
|
86
102
|
}
|
|
87
103
|
export interface IRouteWaypoint {
|
|
88
104
|
id: string;
|
|
@@ -95,7 +111,7 @@ export interface IRouteWaypoint {
|
|
|
95
111
|
}
|
|
96
112
|
export interface IRouteSegment {
|
|
97
113
|
segment_index: number;
|
|
98
|
-
mode:
|
|
114
|
+
mode: "normal" | "offroad";
|
|
99
115
|
from_stop_id: string;
|
|
100
116
|
to_stop_id: string;
|
|
101
117
|
distance: number;
|
package/dist/interfaces/{trip-track/trip-track.interfaces.d.ts → tracking/tracking.interfaces.d.ts}
RENAMED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Common tracking interfaces shared by duty tracking.
|
|
3
|
+
* These types are generic and not tied to any specific entity (trip or duty).
|
|
4
|
+
*/
|
|
1
5
|
export interface ITrackPoint {
|
|
2
6
|
lat: number;
|
|
3
7
|
lng: number;
|
|
@@ -22,46 +26,13 @@ export interface ITrackStatistics {
|
|
|
22
26
|
} | null;
|
|
23
27
|
duration_seconds: number | null;
|
|
24
28
|
}
|
|
25
|
-
export interface ITripTrack {
|
|
26
|
-
id?: number;
|
|
27
|
-
uuid?: string;
|
|
28
|
-
trip_id: number;
|
|
29
|
-
track_data: ITrackPoint[];
|
|
30
|
-
max_speed: number | null;
|
|
31
|
-
max_altitude: number | null;
|
|
32
|
-
total_distance: number | null;
|
|
33
|
-
total_points: number;
|
|
34
|
-
start_coords: {
|
|
35
|
-
lat: number;
|
|
36
|
-
lng: number;
|
|
37
|
-
} | null;
|
|
38
|
-
end_coords: {
|
|
39
|
-
lat: number;
|
|
40
|
-
lng: number;
|
|
41
|
-
} | null;
|
|
42
|
-
duration_seconds: number | null;
|
|
43
|
-
created_at?: string;
|
|
44
|
-
updated_at?: string;
|
|
45
|
-
}
|
|
46
|
-
export interface ITripTrackCreate {
|
|
47
|
-
trip_id: number;
|
|
48
|
-
track_data: ITrackPoint[];
|
|
49
|
-
max_speed: number | null;
|
|
50
|
-
max_altitude: number | null;
|
|
51
|
-
total_distance: number | null;
|
|
52
|
-
total_points: number;
|
|
53
|
-
start_coords: {
|
|
54
|
-
lat: number;
|
|
55
|
-
lng: number;
|
|
56
|
-
} | null;
|
|
57
|
-
end_coords: {
|
|
58
|
-
lat: number;
|
|
59
|
-
lng: number;
|
|
60
|
-
} | null;
|
|
61
|
-
duration_seconds: number | null;
|
|
62
|
-
}
|
|
63
29
|
export type TrackingStatus = "none" | "tracking" | "syncing" | "consolidated";
|
|
64
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Consolidated tracking history record.
|
|
32
|
+
* Used for displaying completed duty/tracking sessions.
|
|
33
|
+
* Note: 'trip_uuid' field is kept for API compatibility but contains duty UUID.
|
|
34
|
+
*/
|
|
35
|
+
export interface IConsolidatedTrackingHistory {
|
|
65
36
|
trip_uuid: string;
|
|
66
37
|
user: any;
|
|
67
38
|
assignment_uuid: string | null;
|
|
@@ -74,7 +45,10 @@ export interface IConsolidatedTripHistory {
|
|
|
74
45
|
duration_seconds: number | null;
|
|
75
46
|
max_speed: number | null;
|
|
76
47
|
}
|
|
77
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Filters for querying consolidated tracking history.
|
|
50
|
+
*/
|
|
51
|
+
export interface IConsolidatedTrackingFilters {
|
|
78
52
|
user_id?: number;
|
|
79
53
|
from_date?: string;
|
|
80
54
|
to_date?: string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Common tracking interfaces shared by duty tracking.
|
|
4
|
+
* These types are generic and not tied to any specific entity (trip or duty).
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
//# sourceMappingURL=tracking.interfaces.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracking.interfaces.js","sourceRoot":"","sources":["../../../src/interfaces/tracking/tracking.interfaces.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { IRole } from "../role/role.interfaces";
|
|
2
|
+
/**
|
|
3
|
+
* User settings stored in JSONB column
|
|
4
|
+
*/
|
|
5
|
+
export interface UserSettings {
|
|
6
|
+
forceSimulation?: boolean;
|
|
7
|
+
}
|
|
2
8
|
export interface IUser {
|
|
3
9
|
id?: number;
|
|
4
10
|
uuid?: string;
|
|
@@ -9,6 +15,7 @@ export interface IUser {
|
|
|
9
15
|
last_name?: string;
|
|
10
16
|
role_id?: number;
|
|
11
17
|
role?: IRole;
|
|
18
|
+
settings?: UserSettings;
|
|
12
19
|
is_active?: boolean;
|
|
13
20
|
last_login_at?: Date;
|
|
14
21
|
created_at?: Date;
|
package/package.json
CHANGED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { IRouteAssignment } from "../../interfaces/route-assignment/route-assignment.interfaces";
|
|
2
|
-
import { IBaseDAO, IDataPaginator } from "../../d.types";
|
|
3
|
-
export declare class RouteAssignmentDAO implements IBaseDAO<IRouteAssignment> {
|
|
4
|
-
private _knex?;
|
|
5
|
-
private get knex();
|
|
6
|
-
/**
|
|
7
|
-
* Parse JSON fields from database
|
|
8
|
-
*/
|
|
9
|
-
private parseAssignmentJson;
|
|
10
|
-
/**
|
|
11
|
-
* Base query with all joins
|
|
12
|
-
*/
|
|
13
|
-
private baseQuery;
|
|
14
|
-
/**
|
|
15
|
-
* Get all assignments with pagination
|
|
16
|
-
*/
|
|
17
|
-
getAll(page?: number, limit?: number): Promise<IDataPaginator<IRouteAssignment>>;
|
|
18
|
-
/**
|
|
19
|
-
* Get assignment by ID
|
|
20
|
-
*/
|
|
21
|
-
getById(id: number): Promise<IRouteAssignment | null>;
|
|
22
|
-
/**
|
|
23
|
-
* Get assignment by UUID
|
|
24
|
-
*/
|
|
25
|
-
getByUuid(uuid: string): Promise<IRouteAssignment | null>;
|
|
26
|
-
/**
|
|
27
|
-
* Get assignments by user ID
|
|
28
|
-
*/
|
|
29
|
-
getByUserId(userId: number, page?: number, limit?: number): Promise<IDataPaginator<IRouteAssignment>>;
|
|
30
|
-
/**
|
|
31
|
-
* Get assignments by route ID
|
|
32
|
-
*/
|
|
33
|
-
getByRouteId(routeId: number, page?: number, limit?: number): Promise<IDataPaginator<IRouteAssignment>>;
|
|
34
|
-
/**
|
|
35
|
-
* Get active assignments for a user
|
|
36
|
-
*/
|
|
37
|
-
getActiveByUserId(userId: number): Promise<IRouteAssignment[]>;
|
|
38
|
-
/**
|
|
39
|
-
* Get assignments by status
|
|
40
|
-
*/
|
|
41
|
-
getByStatus(status: string, page?: number, limit?: number): Promise<IDataPaginator<IRouteAssignment>>;
|
|
42
|
-
/**
|
|
43
|
-
* Create a new assignment
|
|
44
|
-
*/
|
|
45
|
-
create(data: IRouteAssignment): Promise<IRouteAssignment>;
|
|
46
|
-
/**
|
|
47
|
-
* Update an assignment by ID
|
|
48
|
-
*/
|
|
49
|
-
update(id: number, data: Partial<IRouteAssignment>): Promise<IRouteAssignment | null>;
|
|
50
|
-
/**
|
|
51
|
-
* Delete an assignment by ID
|
|
52
|
-
*/
|
|
53
|
-
delete(id: number): Promise<boolean>;
|
|
54
|
-
/**
|
|
55
|
-
* Check if a user has an active assignment for a specific route
|
|
56
|
-
*/
|
|
57
|
-
hasActiveAssignment(userId: number, routeId: number): Promise<boolean>;
|
|
58
|
-
}
|
|
@@ -1,330 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.RouteAssignmentDAO = void 0;
|
|
16
|
-
const KnexConnection_1 = __importDefault(require("../../KnexConnection"));
|
|
17
|
-
class RouteAssignmentDAO {
|
|
18
|
-
get knex() {
|
|
19
|
-
if (!this._knex) {
|
|
20
|
-
this._knex = KnexConnection_1.default.getConnection();
|
|
21
|
-
}
|
|
22
|
-
return this._knex;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Parse JSON fields from database
|
|
26
|
-
*/
|
|
27
|
-
parseAssignmentJson(assignment) {
|
|
28
|
-
var _a, _b, _c, _d;
|
|
29
|
-
// Parse route JSON if present
|
|
30
|
-
if (assignment.route && typeof assignment.route === "string") {
|
|
31
|
-
assignment.route = JSON.parse(assignment.route);
|
|
32
|
-
}
|
|
33
|
-
if (((_a = assignment.route) === null || _a === void 0 ? void 0 : _a.geojson) &&
|
|
34
|
-
typeof assignment.route.geojson === "string") {
|
|
35
|
-
assignment.route.geojson = JSON.parse(assignment.route.geojson);
|
|
36
|
-
}
|
|
37
|
-
if (((_b = assignment.route) === null || _b === void 0 ? void 0 : _b.custom_instructions) &&
|
|
38
|
-
typeof assignment.route.custom_instructions === "string") {
|
|
39
|
-
assignment.route.custom_instructions = JSON.parse(assignment.route.custom_instructions);
|
|
40
|
-
}
|
|
41
|
-
// Parse user JSON if present
|
|
42
|
-
if (assignment.user && typeof assignment.user === "string") {
|
|
43
|
-
assignment.user = JSON.parse(assignment.user);
|
|
44
|
-
}
|
|
45
|
-
if (((_c = assignment.user) === null || _c === void 0 ? void 0 : _c.role) && typeof assignment.user.role === "string") {
|
|
46
|
-
assignment.user.role = JSON.parse(assignment.user.role);
|
|
47
|
-
}
|
|
48
|
-
// Parse assigner JSON if present
|
|
49
|
-
if (assignment.assigner && typeof assignment.assigner === "string") {
|
|
50
|
-
assignment.assigner = JSON.parse(assignment.assigner);
|
|
51
|
-
}
|
|
52
|
-
if (((_d = assignment.assigner) === null || _d === void 0 ? void 0 : _d.role) &&
|
|
53
|
-
typeof assignment.assigner.role === "string") {
|
|
54
|
-
assignment.assigner.role = JSON.parse(assignment.assigner.role);
|
|
55
|
-
}
|
|
56
|
-
return assignment;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Base query with all joins
|
|
60
|
-
*/
|
|
61
|
-
baseQuery() {
|
|
62
|
-
return this.knex("route_assignments as ra")
|
|
63
|
-
.leftJoin("routes as r", "ra.route_id", "r.id")
|
|
64
|
-
.leftJoin("users as u", "ra.user_id", "u.id")
|
|
65
|
-
.leftJoin("roles as ur", "u.role_id", "ur.id")
|
|
66
|
-
.leftJoin("users as assignedBy", "ra.assigned_by", "assignedBy.id")
|
|
67
|
-
.leftJoin("roles as ar", "assignedBy.role_id", "ar.id")
|
|
68
|
-
.select("ra.*", this.knex.raw("to_jsonb(r.*) as route"), this.knex.raw(`jsonb_build_object(
|
|
69
|
-
'id', u.id,
|
|
70
|
-
'uuid', u.uuid,
|
|
71
|
-
'email', u.email,
|
|
72
|
-
'username', u.username,
|
|
73
|
-
'first_name', u.first_name,
|
|
74
|
-
'last_name', u.last_name,
|
|
75
|
-
'role_id', u.role_id,
|
|
76
|
-
'is_active', u.is_active,
|
|
77
|
-
'role', to_jsonb(ur.*)
|
|
78
|
-
) as user`), this.knex.raw(`jsonb_build_object(
|
|
79
|
-
'id', "assignedBy".id,
|
|
80
|
-
'uuid', "assignedBy".uuid,
|
|
81
|
-
'email', "assignedBy".email,
|
|
82
|
-
'username', "assignedBy".username,
|
|
83
|
-
'first_name', "assignedBy".first_name,
|
|
84
|
-
'last_name', "assignedBy".last_name,
|
|
85
|
-
'role_id', "assignedBy".role_id,
|
|
86
|
-
'is_active', "assignedBy".is_active,
|
|
87
|
-
'role', to_jsonb(ar.*)
|
|
88
|
-
) as assigner`));
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Get all assignments with pagination
|
|
92
|
-
*/
|
|
93
|
-
getAll() {
|
|
94
|
-
return __awaiter(this, arguments, void 0, function* (page = 1, limit = 10) {
|
|
95
|
-
const offset = (page - 1) * limit;
|
|
96
|
-
// Get paginated data
|
|
97
|
-
const rawData = yield this.baseQuery()
|
|
98
|
-
.limit(limit)
|
|
99
|
-
.offset(offset)
|
|
100
|
-
.orderBy("ra.created_at", "desc");
|
|
101
|
-
// Parse JSON fields
|
|
102
|
-
const data = rawData.map((assignment) => this.parseAssignmentJson(assignment));
|
|
103
|
-
// Get total count
|
|
104
|
-
const totalCountResult = yield this.knex("route_assignments")
|
|
105
|
-
.count("* as count")
|
|
106
|
-
.first();
|
|
107
|
-
const totalCount = Number((totalCountResult === null || totalCountResult === void 0 ? void 0 : totalCountResult.count) || 0);
|
|
108
|
-
const count = data.length;
|
|
109
|
-
const totalPages = Math.ceil(totalCount / limit);
|
|
110
|
-
return {
|
|
111
|
-
success: true,
|
|
112
|
-
data,
|
|
113
|
-
page,
|
|
114
|
-
limit,
|
|
115
|
-
count,
|
|
116
|
-
totalCount,
|
|
117
|
-
totalPages,
|
|
118
|
-
};
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Get assignment by ID
|
|
123
|
-
*/
|
|
124
|
-
getById(id) {
|
|
125
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
126
|
-
const result = yield this.baseQuery().where("ra.id", id).first();
|
|
127
|
-
return result ? this.parseAssignmentJson(result) : null;
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Get assignment by UUID
|
|
132
|
-
*/
|
|
133
|
-
getByUuid(uuid) {
|
|
134
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
135
|
-
const result = yield this.baseQuery().where("ra.uuid", uuid).first();
|
|
136
|
-
return result ? this.parseAssignmentJson(result) : null;
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Get assignments by user ID
|
|
141
|
-
*/
|
|
142
|
-
getByUserId(userId_1) {
|
|
143
|
-
return __awaiter(this, arguments, void 0, function* (userId, page = 1, limit = 10) {
|
|
144
|
-
const offset = (page - 1) * limit;
|
|
145
|
-
// Get paginated data
|
|
146
|
-
const rawData = yield this.baseQuery()
|
|
147
|
-
.where("ra.user_id", userId)
|
|
148
|
-
.limit(limit)
|
|
149
|
-
.offset(offset)
|
|
150
|
-
.orderBy("ra.start_date", "desc");
|
|
151
|
-
// Parse JSON fields
|
|
152
|
-
const data = rawData.map((assignment) => this.parseAssignmentJson(assignment));
|
|
153
|
-
// Get total count
|
|
154
|
-
const totalCountResult = yield this.knex("route_assignments")
|
|
155
|
-
.where("user_id", userId)
|
|
156
|
-
.count("* as count")
|
|
157
|
-
.first();
|
|
158
|
-
const totalCount = Number((totalCountResult === null || totalCountResult === void 0 ? void 0 : totalCountResult.count) || 0);
|
|
159
|
-
const count = data.length;
|
|
160
|
-
const totalPages = Math.ceil(totalCount / limit);
|
|
161
|
-
return {
|
|
162
|
-
success: true,
|
|
163
|
-
data,
|
|
164
|
-
page,
|
|
165
|
-
limit,
|
|
166
|
-
count,
|
|
167
|
-
totalCount,
|
|
168
|
-
totalPages,
|
|
169
|
-
};
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Get assignments by route ID
|
|
174
|
-
*/
|
|
175
|
-
getByRouteId(routeId_1) {
|
|
176
|
-
return __awaiter(this, arguments, void 0, function* (routeId, page = 1, limit = 10) {
|
|
177
|
-
const offset = (page - 1) * limit;
|
|
178
|
-
// Get paginated data
|
|
179
|
-
const rawData = yield this.baseQuery()
|
|
180
|
-
.where("ra.route_id", routeId)
|
|
181
|
-
.limit(limit)
|
|
182
|
-
.offset(offset)
|
|
183
|
-
.orderBy("ra.start_date", "desc");
|
|
184
|
-
// Parse JSON fields
|
|
185
|
-
const data = rawData.map((assignment) => this.parseAssignmentJson(assignment));
|
|
186
|
-
// Get total count
|
|
187
|
-
const totalCountResult = yield this.knex("route_assignments")
|
|
188
|
-
.where("route_id", routeId)
|
|
189
|
-
.count("* as count")
|
|
190
|
-
.first();
|
|
191
|
-
const totalCount = Number((totalCountResult === null || totalCountResult === void 0 ? void 0 : totalCountResult.count) || 0);
|
|
192
|
-
const count = data.length;
|
|
193
|
-
const totalPages = Math.ceil(totalCount / limit);
|
|
194
|
-
return {
|
|
195
|
-
success: true,
|
|
196
|
-
data,
|
|
197
|
-
page,
|
|
198
|
-
limit,
|
|
199
|
-
count,
|
|
200
|
-
totalCount,
|
|
201
|
-
totalPages,
|
|
202
|
-
};
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* Get active assignments for a user
|
|
207
|
-
*/
|
|
208
|
-
getActiveByUserId(userId) {
|
|
209
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
210
|
-
const rawData = yield this.baseQuery()
|
|
211
|
-
.where("ra.user_id", userId)
|
|
212
|
-
.where("ra.status", "active")
|
|
213
|
-
.where("ra.start_date", "<=", new Date())
|
|
214
|
-
.where(function () {
|
|
215
|
-
this.whereNull("ra.end_date").orWhere("ra.end_date", ">=", new Date());
|
|
216
|
-
})
|
|
217
|
-
.orderBy("ra.start_date", "desc");
|
|
218
|
-
return rawData.map((assignment) => this.parseAssignmentJson(assignment));
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* Get assignments by status
|
|
223
|
-
*/
|
|
224
|
-
getByStatus(status_1) {
|
|
225
|
-
return __awaiter(this, arguments, void 0, function* (status, page = 1, limit = 10) {
|
|
226
|
-
const offset = (page - 1) * limit;
|
|
227
|
-
// Get paginated data
|
|
228
|
-
const rawData = yield this.baseQuery()
|
|
229
|
-
.where("ra.status", status)
|
|
230
|
-
.limit(limit)
|
|
231
|
-
.offset(offset)
|
|
232
|
-
.orderBy("ra.created_at", "desc");
|
|
233
|
-
// Parse JSON fields
|
|
234
|
-
const data = rawData.map((assignment) => this.parseAssignmentJson(assignment));
|
|
235
|
-
// Get total count
|
|
236
|
-
const totalCountResult = yield this.knex("route_assignments")
|
|
237
|
-
.where("status", status)
|
|
238
|
-
.count("* as count")
|
|
239
|
-
.first();
|
|
240
|
-
const totalCount = Number((totalCountResult === null || totalCountResult === void 0 ? void 0 : totalCountResult.count) || 0);
|
|
241
|
-
const count = data.length;
|
|
242
|
-
const totalPages = Math.ceil(totalCount / limit);
|
|
243
|
-
return {
|
|
244
|
-
success: true,
|
|
245
|
-
data,
|
|
246
|
-
page,
|
|
247
|
-
limit,
|
|
248
|
-
count,
|
|
249
|
-
totalCount,
|
|
250
|
-
totalPages,
|
|
251
|
-
};
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* Create a new assignment
|
|
256
|
-
*/
|
|
257
|
-
create(data) {
|
|
258
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
259
|
-
const [result] = yield this.knex("route_assignments")
|
|
260
|
-
.insert({
|
|
261
|
-
route_id: data.route_id,
|
|
262
|
-
user_id: data.user_id,
|
|
263
|
-
assigned_by: data.assigned_by,
|
|
264
|
-
start_date: data.start_date,
|
|
265
|
-
end_date: data.end_date,
|
|
266
|
-
status: data.status || "active",
|
|
267
|
-
notes: data.notes,
|
|
268
|
-
})
|
|
269
|
-
.returning("*");
|
|
270
|
-
// Fetch with joins
|
|
271
|
-
return this.getById(result.id);
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
|
-
/**
|
|
275
|
-
* Update an assignment by ID
|
|
276
|
-
*/
|
|
277
|
-
update(id, data) {
|
|
278
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
279
|
-
const updateData = {};
|
|
280
|
-
if (data.route_id !== undefined)
|
|
281
|
-
updateData.route_id = data.route_id;
|
|
282
|
-
if (data.user_id !== undefined)
|
|
283
|
-
updateData.user_id = data.user_id;
|
|
284
|
-
if (data.start_date !== undefined)
|
|
285
|
-
updateData.start_date = data.start_date;
|
|
286
|
-
if (data.end_date !== undefined)
|
|
287
|
-
updateData.end_date = data.end_date;
|
|
288
|
-
if (data.status !== undefined)
|
|
289
|
-
updateData.status = data.status;
|
|
290
|
-
if (data.notes !== undefined)
|
|
291
|
-
updateData.notes = data.notes;
|
|
292
|
-
updateData.updated_at = new Date();
|
|
293
|
-
const [result] = yield this.knex("route_assignments")
|
|
294
|
-
.where("id", id)
|
|
295
|
-
.update(updateData)
|
|
296
|
-
.returning("*");
|
|
297
|
-
return result ? this.getById(result.id) : null;
|
|
298
|
-
});
|
|
299
|
-
}
|
|
300
|
-
/**
|
|
301
|
-
* Delete an assignment by ID
|
|
302
|
-
*/
|
|
303
|
-
delete(id) {
|
|
304
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
305
|
-
const result = yield this.knex("route_assignments")
|
|
306
|
-
.where("id", id)
|
|
307
|
-
.delete();
|
|
308
|
-
return result > 0;
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
/**
|
|
312
|
-
* Check if a user has an active assignment for a specific route
|
|
313
|
-
*/
|
|
314
|
-
hasActiveAssignment(userId, routeId) {
|
|
315
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
316
|
-
const result = yield this.knex("route_assignments")
|
|
317
|
-
.where("user_id", userId)
|
|
318
|
-
.where("route_id", routeId)
|
|
319
|
-
.where("status", "active")
|
|
320
|
-
.where("start_date", "<=", new Date())
|
|
321
|
-
.where(function () {
|
|
322
|
-
this.whereNull("end_date").orWhere("end_date", ">=", new Date());
|
|
323
|
-
})
|
|
324
|
-
.first();
|
|
325
|
-
return !!result;
|
|
326
|
-
});
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
exports.RouteAssignmentDAO = RouteAssignmentDAO;
|
|
330
|
-
//# sourceMappingURL=route-assignment.dao.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"route-assignment.dao.js","sourceRoot":"","sources":["../../../src/dao/route-assignment/route-assignment.dao.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,0EAA+C;AAI/C,MAAa,kBAAkB;IAG7B,IAAY,IAAI;QACd,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC,KAAK,GAAG,wBAAW,CAAC,aAAa,EAAE,CAAC;QAC3C,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;OAEG;IACK,mBAAmB,CAAC,UAAe;;QACzC,8BAA8B;QAC9B,IAAI,UAAU,CAAC,KAAK,IAAI,OAAO,UAAU,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC7D,UAAU,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAClD,CAAC;QACD,IACE,CAAA,MAAA,UAAU,CAAC,KAAK,0CAAE,OAAO;YACzB,OAAO,UAAU,CAAC,KAAK,CAAC,OAAO,KAAK,QAAQ,EAC5C,CAAC;YACD,UAAU,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAClE,CAAC;QACD,IACE,CAAA,MAAA,UAAU,CAAC,KAAK,0CAAE,mBAAmB;YACrC,OAAO,UAAU,CAAC,KAAK,CAAC,mBAA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