uaxi-shared-entities 1.0.250 → 1.0.252
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/entities/driver-active-position-history.entity.d.ts +8 -1
- package/dist/entities/driver-active-position-history.entity.d.ts.map +1 -1
- package/dist/entities/driver-active-position-history.entity.js +14 -1
- package/dist/entities/driver-active-position-history.entity.js.map +1 -1
- package/dist/enums/driver.enum.d.ts +7 -0
- package/dist/enums/driver.enum.d.ts.map +1 -1
- package/dist/enums/driver.enum.js +9 -1
- package/dist/enums/driver.enum.js.map +1 -1
- package/package.json +1 -1
- package/src/entities/driver-active-position-history.entity.ts +19 -2
- package/src/enums/driver.enum.ts +8 -0
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Model } from "sequelize-typescript";
|
|
2
2
|
import { DriverProfile } from "./driver.entity";
|
|
3
|
+
import { DriverActivePositionSnapshotSource } from "../enums/driver.enum";
|
|
3
4
|
/**
|
|
4
|
-
* Snapshot periódico de la posición de conductores
|
|
5
|
+
* Snapshot periódico de la posición de conductores:
|
|
6
|
+
* - `drivers:active` (online/disponible)
|
|
7
|
+
* - `driver:trip:location:{driverId}` (busy, en viaje/paquete)
|
|
5
8
|
* Lo alimenta un cron cada 30 min en microservice-drivers.
|
|
6
9
|
*/
|
|
7
10
|
export interface DriverActivePositionHistoryAttributes {
|
|
@@ -9,6 +12,8 @@ export interface DriverActivePositionHistoryAttributes {
|
|
|
9
12
|
driverId: string;
|
|
10
13
|
latitude: number;
|
|
11
14
|
longitude: number;
|
|
15
|
+
/** online (active) vs busy (en viaje/paquete). */
|
|
16
|
+
source: DriverActivePositionSnapshotSource;
|
|
12
17
|
/** Momento en que se tomó el snapshot (corrida del cron). */
|
|
13
18
|
recordedAt: Date;
|
|
14
19
|
createdAt: Date;
|
|
@@ -18,6 +23,7 @@ export interface CreateDriverActivePositionHistoryData {
|
|
|
18
23
|
driverId: string;
|
|
19
24
|
latitude: number;
|
|
20
25
|
longitude: number;
|
|
26
|
+
source?: DriverActivePositionSnapshotSource;
|
|
21
27
|
recordedAt: Date;
|
|
22
28
|
}
|
|
23
29
|
export declare class DriverActivePositionHistory extends Model<DriverActivePositionHistoryAttributes, CreateDriverActivePositionHistoryData> {
|
|
@@ -25,6 +31,7 @@ export declare class DriverActivePositionHistory extends Model<DriverActivePosit
|
|
|
25
31
|
driverId: string;
|
|
26
32
|
latitude: number;
|
|
27
33
|
longitude: number;
|
|
34
|
+
source: DriverActivePositionSnapshotSource;
|
|
28
35
|
recordedAt: Date;
|
|
29
36
|
createdAt: Date;
|
|
30
37
|
updatedAt: Date;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver-active-position-history.entity.d.ts","sourceRoot":"","sources":["../../src/entities/driver-active-position-history.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,EAON,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"driver-active-position-history.entity.d.ts","sourceRoot":"","sources":["../../src/entities/driver-active-position-history.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,EAON,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,kCAAkC,EAAE,MAAM,sBAAsB,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,WAAW,qCAAqC;IACpD,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,MAAM,EAAE,kCAAkC,CAAC;IAC3C,6DAA6D;IAC7D,UAAU,EAAE,IAAI,CAAC;IACjB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,qCAAqC;IACpD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,kCAAkC,CAAC;IAC5C,UAAU,EAAE,IAAI,CAAC;CAClB;AAED,qBAkBa,2BAA4B,SAAQ,KAAK,CACpD,qCAAqC,EACrC,qCAAqC,CACtC;IAMS,EAAE,EAAE,MAAM,CAAC;IAWnB,QAAQ,EAAE,MAAM,CAAC;IAMjB,QAAQ,EAAE,MAAM,CAAC;IAMjB,SAAS,EAAE,MAAM,CAAC;IAOlB,MAAM,EAAE,kCAAkC,CAAC;IAO3C,UAAU,EAAE,IAAI,CAAC;IAGT,SAAS,EAAE,IAAI,CAAC;IAGhB,SAAS,EAAE,IAAI,CAAC;IAGxB,MAAM,EAAE,aAAa,CAAC;CACvB"}
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.DriverActivePositionHistory = void 0;
|
|
13
13
|
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
14
14
|
const driver_entity_1 = require("./driver.entity");
|
|
15
|
+
const driver_enum_1 = require("../enums/driver.enum");
|
|
15
16
|
let DriverActivePositionHistory = class DriverActivePositionHistory extends sequelize_typescript_1.Model {
|
|
16
17
|
};
|
|
17
18
|
exports.DriverActivePositionHistory = DriverActivePositionHistory;
|
|
@@ -31,7 +32,7 @@ __decorate([
|
|
|
31
32
|
(0, sequelize_typescript_1.Column)({
|
|
32
33
|
type: sequelize_typescript_1.DataType.UUID,
|
|
33
34
|
allowNull: false,
|
|
34
|
-
comment: "driver_profiles.id
|
|
35
|
+
comment: "driver_profiles.id",
|
|
35
36
|
}),
|
|
36
37
|
__metadata("design:type", String)
|
|
37
38
|
], DriverActivePositionHistory.prototype, "driverId", void 0);
|
|
@@ -49,6 +50,14 @@ __decorate([
|
|
|
49
50
|
}),
|
|
50
51
|
__metadata("design:type", Number)
|
|
51
52
|
], DriverActivePositionHistory.prototype, "longitude", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, sequelize_typescript_1.Column)({
|
|
55
|
+
type: sequelize_typescript_1.DataType.ENUM(...Object.values(driver_enum_1.DriverActivePositionSnapshotSource)),
|
|
56
|
+
allowNull: false,
|
|
57
|
+
defaultValue: driver_enum_1.DriverActivePositionSnapshotSource.ACTIVE,
|
|
58
|
+
}),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], DriverActivePositionHistory.prototype, "source", void 0);
|
|
52
61
|
__decorate([
|
|
53
62
|
(0, sequelize_typescript_1.Column)({
|
|
54
63
|
type: sequelize_typescript_1.DataType.DATE,
|
|
@@ -82,6 +91,10 @@ exports.DriverActivePositionHistory = DriverActivePositionHistory = __decorate([
|
|
|
82
91
|
fields: ["recordedAt"],
|
|
83
92
|
name: "driver_active_position_history_recorded_at_idx",
|
|
84
93
|
},
|
|
94
|
+
{
|
|
95
|
+
fields: ["source", "recordedAt"],
|
|
96
|
+
name: "driver_active_position_history_source_recorded_idx",
|
|
97
|
+
},
|
|
85
98
|
],
|
|
86
99
|
})
|
|
87
100
|
], DriverActivePositionHistory);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver-active-position-history.entity.js","sourceRoot":"","sources":["../../src/entities/driver-active-position-history.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAU8B;AAC9B,mDAAgD;
|
|
1
|
+
{"version":3,"file":"driver-active-position-history.entity.js","sourceRoot":"","sources":["../../src/entities/driver-active-position-history.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAU8B;AAC9B,mDAAgD;AAChD,sDAA0E;AA+CnE,IAAM,2BAA2B,GAAjC,MAAM,2BAA4B,SAAQ,4BAGhD;CAqDA,CAAA;AAxDY,kEAA2B;AAS9B;IALP,IAAA,6BAAM,EAAC;QACN,IAAI,EAAE,+BAAQ,CAAC,IAAI;QACnB,YAAY,EAAE,+BAAQ,CAAC,MAAM;QAC7B,UAAU,EAAE,IAAI;KACjB,CAAC;;uDACiB;AAWnB;IATC,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,6BAAa,CAAC;IAC/B,IAAA,4BAAK,EAAC;QACL,IAAI,EAAE,8CAA8C;KACrD,CAAC;IACD,IAAA,6BAAM,EAAC;QACN,IAAI,EAAE,+BAAQ,CAAC,IAAI;QACnB,SAAS,EAAE,KAAK;QAChB,OAAO,EAAE,oBAAoB;KAC9B,CAAC;;6DACe;AAMjB;IAJC,IAAA,6BAAM,EAAC;QACN,IAAI,EAAE,+BAAQ,CAAC,MAAM;QACrB,SAAS,EAAE,KAAK;KACjB,CAAC;;6DACe;AAMjB;IAJC,IAAA,6BAAM,EAAC;QACN,IAAI,EAAE,+BAAQ,CAAC,MAAM;QACrB,SAAS,EAAE,KAAK;KACjB,CAAC;;8DACgB;AAOlB;IALC,IAAA,6BAAM,EAAC;QACN,IAAI,EAAE,+BAAQ,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,gDAAkC,CAAC,CAAC;QACzE,SAAS,EAAE,KAAK;QAChB,YAAY,EAAE,gDAAkC,CAAC,MAAM;KACxD,CAAC;;2DACyC;AAO3C;IALC,IAAA,6BAAM,EAAC;QACN,IAAI,EAAE,+BAAQ,CAAC,IAAI;QACnB,SAAS,EAAE,KAAK;QAChB,OAAO,EAAE,0DAA0D;KACpE,CAAC;8BACU,IAAI;+DAAC;AAGT;IADP,gCAAS;8BACS,IAAI;8DAAC;AAGhB;IADP,gCAAS;8BACS,IAAI;8DAAC;AAGxB;IADC,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,6BAAa,CAAC;8BACvB,6BAAa;2DAAC;sCAvDX,2BAA2B;IAlBvC,IAAA,4BAAK,EAAC;QACL,SAAS,EAAE,gCAAgC;QAC3C,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE;YACP;gBACE,MAAM,EAAE,CAAC,UAAU,EAAE,YAAY,CAAC;gBAClC,IAAI,EAAE,oDAAoD;aAC3D;YACD;gBACE,MAAM,EAAE,CAAC,YAAY,CAAC;gBACtB,IAAI,EAAE,gDAAgD;aACvD;YACD;gBACE,MAAM,EAAE,CAAC,QAAQ,EAAE,YAAY,CAAC;gBAChC,IAAI,EAAE,oDAAoD;aAC3D;SACF;KACF,CAAC;GACW,2BAA2B,CAwDvC"}
|
|
@@ -22,6 +22,13 @@ export declare enum DriverClassification {
|
|
|
22
22
|
B = "B",
|
|
23
23
|
C = "C"
|
|
24
24
|
}
|
|
25
|
+
/** Origen del snapshot en driver_active_position_history. */
|
|
26
|
+
export declare enum DriverActivePositionSnapshotSource {
|
|
27
|
+
/** Conductor disponible/online en Redis `drivers:active`. */
|
|
28
|
+
ACTIVE = "active",
|
|
29
|
+
/** Conductor en viaje/paquete (busy) — Redis `driver:trip:location:{driverId}`. */
|
|
30
|
+
BUSY_TRIP = "busy_trip"
|
|
31
|
+
}
|
|
25
32
|
export declare enum EarningType {
|
|
26
33
|
TRIP = "trip",
|
|
27
34
|
PACKAGE = "package",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.enum.d.ts","sourceRoot":"","sources":["../../src/enums/driver.enum.ts"],"names":[],"mappings":"AAIA,oBAAY,YAAY;IACtB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,kBAAkB,uBAAuB;IACzC,IAAI,SAAS;CACd;AAED,oBAAY,mBAAmB;IAC7B,WAAW,gBAAgB;IAC3B,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,eAAe,oBAAoB;IACnC,QAAQ,aAAa;IACrB,OAAO,YAAY;CACpB;AAED,iFAAiF;AACjF,oBAAY,gBAAgB;IAC1B,SAAS,cAAc;IACvB,MAAM,WAAW;CAClB;AAED,oBAAY,oBAAoB;IAC9B,CAAC,MAAM;IACP,CAAC,MAAM;IACP,CAAC,MAAM;CACR;AAED,oBAAY,WAAW;IACrB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,yGAAyG;IACzG,SAAS,cAAc;IACvB,uDAAuD;IACvD,GAAG,QAAQ;CACZ"}
|
|
1
|
+
{"version":3,"file":"driver.enum.d.ts","sourceRoot":"","sources":["../../src/enums/driver.enum.ts"],"names":[],"mappings":"AAIA,oBAAY,YAAY;IACtB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,kBAAkB,uBAAuB;IACzC,IAAI,SAAS;CACd;AAED,oBAAY,mBAAmB;IAC7B,WAAW,gBAAgB;IAC3B,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,eAAe,oBAAoB;IACnC,QAAQ,aAAa;IACrB,OAAO,YAAY;CACpB;AAED,iFAAiF;AACjF,oBAAY,gBAAgB;IAC1B,SAAS,cAAc;IACvB,MAAM,WAAW;CAClB;AAED,oBAAY,oBAAoB;IAC9B,CAAC,MAAM;IACP,CAAC,MAAM;IACP,CAAC,MAAM;CACR;AAED,6DAA6D;AAC7D,oBAAY,kCAAkC;IAC5C,6DAA6D;IAC7D,MAAM,WAAW;IACjB,mFAAmF;IACnF,SAAS,cAAc;CACxB;AAED,oBAAY,WAAW;IACrB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,yGAAyG;IACzG,SAAS,cAAc;IACvB,uDAAuD;IACvD,GAAG,QAAQ;CACZ"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// DRIVER ENUMS
|
|
4
4
|
// =============================================
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.EarningType = exports.DriverClassification = exports.StripePayoutMode = exports.StripeAccountStatus = exports.DriverStatus = void 0;
|
|
6
|
+
exports.EarningType = exports.DriverActivePositionSnapshotSource = exports.DriverClassification = exports.StripePayoutMode = exports.StripeAccountStatus = exports.DriverStatus = void 0;
|
|
7
7
|
var DriverStatus;
|
|
8
8
|
(function (DriverStatus) {
|
|
9
9
|
DriverStatus["OFFLINE"] = "offline";
|
|
@@ -32,6 +32,14 @@ var DriverClassification;
|
|
|
32
32
|
DriverClassification["B"] = "B";
|
|
33
33
|
DriverClassification["C"] = "C";
|
|
34
34
|
})(DriverClassification || (exports.DriverClassification = DriverClassification = {}));
|
|
35
|
+
/** Origen del snapshot en driver_active_position_history. */
|
|
36
|
+
var DriverActivePositionSnapshotSource;
|
|
37
|
+
(function (DriverActivePositionSnapshotSource) {
|
|
38
|
+
/** Conductor disponible/online en Redis `drivers:active`. */
|
|
39
|
+
DriverActivePositionSnapshotSource["ACTIVE"] = "active";
|
|
40
|
+
/** Conductor en viaje/paquete (busy) — Redis `driver:trip:location:{driverId}`. */
|
|
41
|
+
DriverActivePositionSnapshotSource["BUSY_TRIP"] = "busy_trip";
|
|
42
|
+
})(DriverActivePositionSnapshotSource || (exports.DriverActivePositionSnapshotSource = DriverActivePositionSnapshotSource = {}));
|
|
35
43
|
var EarningType;
|
|
36
44
|
(function (EarningType) {
|
|
37
45
|
EarningType["TRIP"] = "trip";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.enum.js","sourceRoot":"","sources":["../../src/enums/driver.enum.ts"],"names":[],"mappings":";AAAA,gDAAgD;AAChD,eAAe;AACf,gDAAgD;;;AAEhD,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,iCAAiB,CAAA;IACjB,yDAAyC,CAAA;IACzC,6BAAa,CAAA;AACf,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB;AAED,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,kDAA2B,CAAA;IAC3B,0CAAmB,CAAA;IACnB,gDAAyB,CAAA;IACzB,0DAAmC,CAAA;IACnC,4CAAqB,CAAA;IACrB,0CAAmB,CAAA;AACrB,CAAC,EAPW,mBAAmB,mCAAnB,mBAAmB,QAO9B;AAED,iFAAiF;AACjF,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,2CAAuB,CAAA;IACvB,qCAAiB,CAAA;AACnB,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B;AAED,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,+BAAO,CAAA;IACP,+BAAO,CAAA;IACP,+BAAO,CAAA;AACT,CAAC,EAJW,oBAAoB,oCAApB,oBAAoB,QAI/B;AAED,IAAY,WAQX;AARD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,kCAAmB,CAAA;IACnB,8BAAe,CAAA;IACf,yGAAyG;IACzG,sCAAuB,CAAA;IACvB,uDAAuD;IACvD,0BAAW,CAAA;AACb,CAAC,EARW,WAAW,2BAAX,WAAW,QAQtB"}
|
|
1
|
+
{"version":3,"file":"driver.enum.js","sourceRoot":"","sources":["../../src/enums/driver.enum.ts"],"names":[],"mappings":";AAAA,gDAAgD;AAChD,eAAe;AACf,gDAAgD;;;AAEhD,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,iCAAiB,CAAA;IACjB,yDAAyC,CAAA;IACzC,6BAAa,CAAA;AACf,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB;AAED,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,kDAA2B,CAAA;IAC3B,0CAAmB,CAAA;IACnB,gDAAyB,CAAA;IACzB,0DAAmC,CAAA;IACnC,4CAAqB,CAAA;IACrB,0CAAmB,CAAA;AACrB,CAAC,EAPW,mBAAmB,mCAAnB,mBAAmB,QAO9B;AAED,iFAAiF;AACjF,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,2CAAuB,CAAA;IACvB,qCAAiB,CAAA;AACnB,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B;AAED,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,+BAAO,CAAA;IACP,+BAAO,CAAA;IACP,+BAAO,CAAA;AACT,CAAC,EAJW,oBAAoB,oCAApB,oBAAoB,QAI/B;AAED,6DAA6D;AAC7D,IAAY,kCAKX;AALD,WAAY,kCAAkC;IAC5C,6DAA6D;IAC7D,uDAAiB,CAAA;IACjB,mFAAmF;IACnF,6DAAuB,CAAA;AACzB,CAAC,EALW,kCAAkC,kDAAlC,kCAAkC,QAK7C;AAED,IAAY,WAQX;AARD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,kCAAmB,CAAA;IACnB,8BAAe,CAAA;IACf,yGAAyG;IACzG,sCAAuB,CAAA;IACvB,uDAAuD;IACvD,0BAAW,CAAA;AACb,CAAC,EARW,WAAW,2BAAX,WAAW,QAQtB"}
|
package/package.json
CHANGED
|
@@ -10,9 +10,12 @@ import {
|
|
|
10
10
|
Index,
|
|
11
11
|
} from "sequelize-typescript";
|
|
12
12
|
import { DriverProfile } from "./driver.entity";
|
|
13
|
+
import { DriverActivePositionSnapshotSource } from "../enums/driver.enum";
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
|
-
* Snapshot periódico de la posición de conductores
|
|
16
|
+
* Snapshot periódico de la posición de conductores:
|
|
17
|
+
* - `drivers:active` (online/disponible)
|
|
18
|
+
* - `driver:trip:location:{driverId}` (busy, en viaje/paquete)
|
|
16
19
|
* Lo alimenta un cron cada 30 min en microservice-drivers.
|
|
17
20
|
*/
|
|
18
21
|
export interface DriverActivePositionHistoryAttributes {
|
|
@@ -20,6 +23,8 @@ export interface DriverActivePositionHistoryAttributes {
|
|
|
20
23
|
driverId: string;
|
|
21
24
|
latitude: number;
|
|
22
25
|
longitude: number;
|
|
26
|
+
/** online (active) vs busy (en viaje/paquete). */
|
|
27
|
+
source: DriverActivePositionSnapshotSource;
|
|
23
28
|
/** Momento en que se tomó el snapshot (corrida del cron). */
|
|
24
29
|
recordedAt: Date;
|
|
25
30
|
createdAt: Date;
|
|
@@ -30,6 +35,7 @@ export interface CreateDriverActivePositionHistoryData {
|
|
|
30
35
|
driverId: string;
|
|
31
36
|
latitude: number;
|
|
32
37
|
longitude: number;
|
|
38
|
+
source?: DriverActivePositionSnapshotSource;
|
|
33
39
|
recordedAt: Date;
|
|
34
40
|
}
|
|
35
41
|
|
|
@@ -45,6 +51,10 @@ export interface CreateDriverActivePositionHistoryData {
|
|
|
45
51
|
fields: ["recordedAt"],
|
|
46
52
|
name: "driver_active_position_history_recorded_at_idx",
|
|
47
53
|
},
|
|
54
|
+
{
|
|
55
|
+
fields: ["source", "recordedAt"],
|
|
56
|
+
name: "driver_active_position_history_source_recorded_idx",
|
|
57
|
+
},
|
|
48
58
|
],
|
|
49
59
|
})
|
|
50
60
|
export class DriverActivePositionHistory extends Model<
|
|
@@ -65,7 +75,7 @@ export class DriverActivePositionHistory extends Model<
|
|
|
65
75
|
@Column({
|
|
66
76
|
type: DataType.UUID,
|
|
67
77
|
allowNull: false,
|
|
68
|
-
comment: "driver_profiles.id
|
|
78
|
+
comment: "driver_profiles.id",
|
|
69
79
|
})
|
|
70
80
|
driverId: string;
|
|
71
81
|
|
|
@@ -81,6 +91,13 @@ export class DriverActivePositionHistory extends Model<
|
|
|
81
91
|
})
|
|
82
92
|
longitude: number;
|
|
83
93
|
|
|
94
|
+
@Column({
|
|
95
|
+
type: DataType.ENUM(...Object.values(DriverActivePositionSnapshotSource)),
|
|
96
|
+
allowNull: false,
|
|
97
|
+
defaultValue: DriverActivePositionSnapshotSource.ACTIVE,
|
|
98
|
+
})
|
|
99
|
+
source: DriverActivePositionSnapshotSource;
|
|
100
|
+
|
|
84
101
|
@Column({
|
|
85
102
|
type: DataType.DATE,
|
|
86
103
|
allowNull: false,
|
package/src/enums/driver.enum.ts
CHANGED
|
@@ -30,6 +30,14 @@ export enum DriverClassification {
|
|
|
30
30
|
C = "C",
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
/** Origen del snapshot en driver_active_position_history. */
|
|
34
|
+
export enum DriverActivePositionSnapshotSource {
|
|
35
|
+
/** Conductor disponible/online en Redis `drivers:active`. */
|
|
36
|
+
ACTIVE = "active",
|
|
37
|
+
/** Conductor en viaje/paquete (busy) — Redis `driver:trip:location:{driverId}`. */
|
|
38
|
+
BUSY_TRIP = "busy_trip",
|
|
39
|
+
}
|
|
40
|
+
|
|
33
41
|
export enum EarningType {
|
|
34
42
|
TRIP = "trip",
|
|
35
43
|
PACKAGE = "package",
|