|
@@ -1,7 +1,7 @@
|
|
|
import { AppDataSource } from '../src/server/data-source.js';
|
|
import { AppDataSource } from '../src/server/data-source.js';
|
|
|
import { ActivityEntity, ActivityType } from '../src/server/modules/activities/activity.entity.js';
|
|
import { ActivityEntity, ActivityType } from '../src/server/modules/activities/activity.entity.js';
|
|
|
import { RouteEntity } from '../src/server/modules/routes/route.entity.js';
|
|
import { RouteEntity } from '../src/server/modules/routes/route.entity.js';
|
|
|
-import { VehicleType } from '../src/server/modules/routes/route.schema.js';
|
|
|
|
|
|
|
+import { VehicleType, TravelMode } from '../src/server/modules/routes/route.schema.js';
|
|
|
import { LocationEntity } from '../src/server/modules/locations/location.entity.js';
|
|
import { LocationEntity } from '../src/server/modules/locations/location.entity.js';
|
|
|
import fs from 'fs';
|
|
import fs from 'fs';
|
|
|
|
|
|
|
@@ -137,8 +137,8 @@ async function seed() {
|
|
|
venueLocationId: savedLocations[0].id, // 工人体育场
|
|
venueLocationId: savedLocations[0].id, // 工人体育场
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- name: '中超联赛北京国安主场赛事返程',
|
|
|
|
|
- description: '北京国安主场赛事结束后的返程服务',
|
|
|
|
|
|
|
+ name: '中超联赛北京国安主场赛事',
|
|
|
|
|
+ description: '北京国安主场赛事',
|
|
|
type: ActivityType.RETURN,
|
|
type: ActivityType.RETURN,
|
|
|
startDate: new Date('2025-10-15T21:00:00Z'),
|
|
startDate: new Date('2025-10-15T21:00:00Z'),
|
|
|
endDate: new Date('2025-10-16T02:00:00Z'),
|
|
endDate: new Date('2025-10-16T02:00:00Z'),
|
|
@@ -153,8 +153,8 @@ async function seed() {
|
|
|
venueLocationId: savedLocations[1].id, // 鸟巢
|
|
venueLocationId: savedLocations[1].id, // 鸟巢
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- name: '周杰伦北京演唱会返程',
|
|
|
|
|
- description: '周杰伦演唱会结束后的返程服务',
|
|
|
|
|
|
|
+ name: '周杰伦北京演唱会',
|
|
|
|
|
+ description: '周杰伦演唱会',
|
|
|
type: ActivityType.RETURN,
|
|
type: ActivityType.RETURN,
|
|
|
startDate: new Date('2025-11-01T22:30:00Z'),
|
|
startDate: new Date('2025-11-01T22:30:00Z'),
|
|
|
endDate: new Date('2025-11-02T01:00:00Z'),
|
|
endDate: new Date('2025-11-02T01:00:00Z'),
|
|
@@ -169,8 +169,8 @@ async function seed() {
|
|
|
venueLocationId: savedLocations[2].id, // 五棵松体育馆
|
|
venueLocationId: savedLocations[2].id, // 五棵松体育馆
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- name: 'CBA北京首钢主场赛事返程',
|
|
|
|
|
- description: '北京首钢主场赛事结束后的返程服务',
|
|
|
|
|
|
|
+ name: 'CBA北京首钢主场赛事',
|
|
|
|
|
+ description: '北京首钢主场赛事',
|
|
|
type: ActivityType.RETURN,
|
|
type: ActivityType.RETURN,
|
|
|
startDate: new Date('2025-10-20T21:30:00Z'),
|
|
startDate: new Date('2025-10-20T21:30:00Z'),
|
|
|
endDate: new Date('2025-10-21T00:30:00Z'),
|
|
endDate: new Date('2025-10-21T00:30:00Z'),
|
|
@@ -184,7 +184,7 @@ async function seed() {
|
|
|
|
|
|
|
|
// 创建示例路线数据 - 赛事和演唱会相关
|
|
// 创建示例路线数据 - 赛事和演唱会相关
|
|
|
const routes = [
|
|
const routes = [
|
|
|
- // 中超联赛去程路线
|
|
|
|
|
|
|
+ // 中超联赛去程路线 - 大巴拼车场景
|
|
|
{
|
|
{
|
|
|
name: '中关村-工人体育场专线',
|
|
name: '中关村-工人体育场专线',
|
|
|
description: '中关村到工人体育场的中超联赛专线',
|
|
description: '中关村到工人体育场的中超联赛专线',
|
|
@@ -194,6 +194,7 @@ async function seed() {
|
|
|
dropoffPoint: '工人体育场北门',
|
|
dropoffPoint: '工人体育场北门',
|
|
|
departureTime: new Date('2025-10-15T17:30:00Z'),
|
|
departureTime: new Date('2025-10-15T17:30:00Z'),
|
|
|
vehicleType: VehicleType.BUS,
|
|
vehicleType: VehicleType.BUS,
|
|
|
|
|
+ travelMode: TravelMode.CARPOOL,
|
|
|
price: 25,
|
|
price: 25,
|
|
|
seatCount: 50,
|
|
seatCount: 50,
|
|
|
availableSeats: 45,
|
|
availableSeats: 45,
|
|
@@ -201,6 +202,7 @@ async function seed() {
|
|
|
startLocationId: savedLocations[3].id, // 中关村
|
|
startLocationId: savedLocations[3].id, // 中关村
|
|
|
endLocationId: savedLocations[0].id, // 工人体育场
|
|
endLocationId: savedLocations[0].id, // 工人体育场
|
|
|
},
|
|
},
|
|
|
|
|
+ // 商务车拼车场景
|
|
|
{
|
|
{
|
|
|
name: '国贸-工人体育场专线',
|
|
name: '国贸-工人体育场专线',
|
|
|
description: '国贸到工人体育场的中超联赛专线',
|
|
description: '国贸到工人体育场的中超联赛专线',
|
|
@@ -209,14 +211,16 @@ async function seed() {
|
|
|
pickupPoint: '国贸地铁站C口',
|
|
pickupPoint: '国贸地铁站C口',
|
|
|
dropoffPoint: '工人体育场东门',
|
|
dropoffPoint: '工人体育场东门',
|
|
|
departureTime: new Date('2025-10-15T17:45:00Z'),
|
|
departureTime: new Date('2025-10-15T17:45:00Z'),
|
|
|
- vehicleType: VehicleType.MINIBUS,
|
|
|
|
|
- price: 20,
|
|
|
|
|
- seatCount: 30,
|
|
|
|
|
- availableSeats: 28,
|
|
|
|
|
|
|
+ vehicleType: VehicleType.BUSINESS,
|
|
|
|
|
+ travelMode: TravelMode.CARPOOL,
|
|
|
|
|
+ price: 35,
|
|
|
|
|
+ seatCount: 8,
|
|
|
|
|
+ availableSeats: 6,
|
|
|
activityId: savedActivities[0].id,
|
|
activityId: savedActivities[0].id,
|
|
|
startLocationId: savedLocations[4].id, // 国贸
|
|
startLocationId: savedLocations[4].id, // 国贸
|
|
|
endLocationId: savedLocations[0].id, // 工人体育场
|
|
endLocationId: savedLocations[0].id, // 工人体育场
|
|
|
},
|
|
},
|
|
|
|
|
+ // 商务车包车场景
|
|
|
{
|
|
{
|
|
|
name: '望京-工人体育场专线',
|
|
name: '望京-工人体育场专线',
|
|
|
description: '望京到工人体育场的中超联赛专线',
|
|
description: '望京到工人体育场的中超联赛专线',
|
|
@@ -225,16 +229,17 @@ async function seed() {
|
|
|
pickupPoint: '望京地铁站S口',
|
|
pickupPoint: '望京地铁站S口',
|
|
|
dropoffPoint: '工人体育场南门',
|
|
dropoffPoint: '工人体育场南门',
|
|
|
departureTime: new Date('2025-10-15T18:00:00Z'),
|
|
departureTime: new Date('2025-10-15T18:00:00Z'),
|
|
|
- vehicleType: VehicleType.CAR,
|
|
|
|
|
- price: 35,
|
|
|
|
|
- seatCount: 15,
|
|
|
|
|
- availableSeats: 12,
|
|
|
|
|
|
|
+ vehicleType: VehicleType.BUSINESS,
|
|
|
|
|
+ travelMode: TravelMode.CHARTER,
|
|
|
|
|
+ price: 150,
|
|
|
|
|
+ seatCount: 8,
|
|
|
|
|
+ availableSeats: 8,
|
|
|
activityId: savedActivities[0].id,
|
|
activityId: savedActivities[0].id,
|
|
|
startLocationId: savedLocations[5].id, // 望京
|
|
startLocationId: savedLocations[5].id, // 望京
|
|
|
endLocationId: savedLocations[0].id, // 工人体育场
|
|
endLocationId: savedLocations[0].id, // 工人体育场
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- // 中超联赛返程路线
|
|
|
|
|
|
|
+ // 中超联赛返程路线 - 大巴拼车场景
|
|
|
{
|
|
{
|
|
|
name: '工人体育场-中关村返程专线',
|
|
name: '工人体育场-中关村返程专线',
|
|
|
description: '工人体育场到中关村的中超联赛返程专线',
|
|
description: '工人体育场到中关村的中超联赛返程专线',
|
|
@@ -244,6 +249,7 @@ async function seed() {
|
|
|
dropoffPoint: '中关村地铁站A口',
|
|
dropoffPoint: '中关村地铁站A口',
|
|
|
departureTime: new Date('2025-10-15T22:00:00Z'),
|
|
departureTime: new Date('2025-10-15T22:00:00Z'),
|
|
|
vehicleType: VehicleType.BUS,
|
|
vehicleType: VehicleType.BUS,
|
|
|
|
|
+ travelMode: TravelMode.CARPOOL,
|
|
|
price: 25,
|
|
price: 25,
|
|
|
seatCount: 50,
|
|
seatCount: 50,
|
|
|
availableSeats: 40,
|
|
availableSeats: 40,
|
|
@@ -251,6 +257,7 @@ async function seed() {
|
|
|
startLocationId: savedLocations[0].id, // 工人体育场
|
|
startLocationId: savedLocations[0].id, // 工人体育场
|
|
|
endLocationId: savedLocations[3].id, // 中关村
|
|
endLocationId: savedLocations[3].id, // 中关村
|
|
|
},
|
|
},
|
|
|
|
|
+ // 大巴包车场景
|
|
|
{
|
|
{
|
|
|
name: '工人体育场-国贸返程专线',
|
|
name: '工人体育场-国贸返程专线',
|
|
|
description: '工人体育场到国贸的中超联赛返程专线',
|
|
description: '工人体育场到国贸的中超联赛返程专线',
|
|
@@ -259,16 +266,17 @@ async function seed() {
|
|
|
pickupPoint: '工人体育场东门',
|
|
pickupPoint: '工人体育场东门',
|
|
|
dropoffPoint: '国贸地铁站C口',
|
|
dropoffPoint: '国贸地铁站C口',
|
|
|
departureTime: new Date('2025-10-15T22:15:00Z'),
|
|
departureTime: new Date('2025-10-15T22:15:00Z'),
|
|
|
- vehicleType: VehicleType.MINIBUS,
|
|
|
|
|
- price: 20,
|
|
|
|
|
- seatCount: 30,
|
|
|
|
|
- availableSeats: 25,
|
|
|
|
|
|
|
+ vehicleType: VehicleType.BUS,
|
|
|
|
|
+ travelMode: TravelMode.CHARTER,
|
|
|
|
|
+ price: 300,
|
|
|
|
|
+ seatCount: 50,
|
|
|
|
|
+ availableSeats: 50,
|
|
|
activityId: savedActivities[1].id,
|
|
activityId: savedActivities[1].id,
|
|
|
startLocationId: savedLocations[0].id, // 工人体育场
|
|
startLocationId: savedLocations[0].id, // 工人体育场
|
|
|
endLocationId: savedLocations[4].id, // 国贸
|
|
endLocationId: savedLocations[4].id, // 国贸
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- // 周杰伦演唱会去程路线
|
|
|
|
|
|
|
+ // 周杰伦演唱会去程路线 - 大巴拼车场景
|
|
|
{
|
|
{
|
|
|
name: '五道口-鸟巢演唱会专线',
|
|
name: '五道口-鸟巢演唱会专线',
|
|
|
description: '五道口到鸟巢的周杰伦演唱会专线',
|
|
description: '五道口到鸟巢的周杰伦演唱会专线',
|
|
@@ -278,6 +286,7 @@ async function seed() {
|
|
|
dropoffPoint: '鸟巢东门',
|
|
dropoffPoint: '鸟巢东门',
|
|
|
departureTime: new Date('2025-11-01T18:00:00Z'),
|
|
departureTime: new Date('2025-11-01T18:00:00Z'),
|
|
|
vehicleType: VehicleType.BUS,
|
|
vehicleType: VehicleType.BUS,
|
|
|
|
|
+ travelMode: TravelMode.CARPOOL,
|
|
|
price: 30,
|
|
price: 30,
|
|
|
seatCount: 50,
|
|
seatCount: 50,
|
|
|
availableSeats: 48,
|
|
availableSeats: 48,
|
|
@@ -285,6 +294,7 @@ async function seed() {
|
|
|
startLocationId: savedLocations[6].id, // 五道口
|
|
startLocationId: savedLocations[6].id, // 五道口
|
|
|
endLocationId: savedLocations[1].id, // 鸟巢
|
|
endLocationId: savedLocations[1].id, // 鸟巢
|
|
|
},
|
|
},
|
|
|
|
|
+ // 商务车拼车场景
|
|
|
{
|
|
{
|
|
|
name: '西直门-鸟巢演唱会专线',
|
|
name: '西直门-鸟巢演唱会专线',
|
|
|
description: '西直门到鸟巢的周杰伦演唱会专线',
|
|
description: '西直门到鸟巢的周杰伦演唱会专线',
|
|
@@ -293,16 +303,17 @@ async function seed() {
|
|
|
pickupPoint: '西直门地铁站C口',
|
|
pickupPoint: '西直门地铁站C口',
|
|
|
dropoffPoint: '鸟巢西门',
|
|
dropoffPoint: '鸟巢西门',
|
|
|
departureTime: new Date('2025-11-01T18:15:00Z'),
|
|
departureTime: new Date('2025-11-01T18:15:00Z'),
|
|
|
- vehicleType: VehicleType.MINIBUS,
|
|
|
|
|
- price: 25,
|
|
|
|
|
- seatCount: 30,
|
|
|
|
|
- availableSeats: 28,
|
|
|
|
|
|
|
+ vehicleType: VehicleType.BUSINESS,
|
|
|
|
|
+ travelMode: TravelMode.CARPOOL,
|
|
|
|
|
+ price: 40,
|
|
|
|
|
+ seatCount: 8,
|
|
|
|
|
+ availableSeats: 6,
|
|
|
activityId: savedActivities[2].id,
|
|
activityId: savedActivities[2].id,
|
|
|
startLocationId: savedLocations[7].id, // 西直门
|
|
startLocationId: savedLocations[7].id, // 西直门
|
|
|
endLocationId: savedLocations[1].id, // 鸟巢
|
|
endLocationId: savedLocations[1].id, // 鸟巢
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- // 周杰伦演唱会返程路线
|
|
|
|
|
|
|
+ // 周杰伦演唱会返程路线 - 大巴拼车场景
|
|
|
{
|
|
{
|
|
|
name: '鸟巢-五道口返程专线',
|
|
name: '鸟巢-五道口返程专线',
|
|
|
description: '鸟巢到五道口的周杰伦演唱会返程专线',
|
|
description: '鸟巢到五道口的周杰伦演唱会返程专线',
|
|
@@ -312,6 +323,7 @@ async function seed() {
|
|
|
dropoffPoint: '五道口地铁站A口',
|
|
dropoffPoint: '五道口地铁站A口',
|
|
|
departureTime: new Date('2025-11-01T23:30:00Z'),
|
|
departureTime: new Date('2025-11-01T23:30:00Z'),
|
|
|
vehicleType: VehicleType.BUS,
|
|
vehicleType: VehicleType.BUS,
|
|
|
|
|
+ travelMode: TravelMode.CARPOOL,
|
|
|
price: 30,
|
|
price: 30,
|
|
|
seatCount: 50,
|
|
seatCount: 50,
|
|
|
availableSeats: 45,
|
|
availableSeats: 45,
|
|
@@ -319,6 +331,7 @@ async function seed() {
|
|
|
startLocationId: savedLocations[1].id, // 鸟巢
|
|
startLocationId: savedLocations[1].id, // 鸟巢
|
|
|
endLocationId: savedLocations[6].id, // 五道口
|
|
endLocationId: savedLocations[6].id, // 五道口
|
|
|
},
|
|
},
|
|
|
|
|
+ // 商务车包车场景
|
|
|
{
|
|
{
|
|
|
name: '鸟巢-西直门返程专线',
|
|
name: '鸟巢-西直门返程专线',
|
|
|
description: '鸟巢到西直门的周杰伦演唱会返程专线',
|
|
description: '鸟巢到西直门的周杰伦演唱会返程专线',
|
|
@@ -327,16 +340,17 @@ async function seed() {
|
|
|
pickupPoint: '鸟巢西门',
|
|
pickupPoint: '鸟巢西门',
|
|
|
dropoffPoint: '西直门地铁站C口',
|
|
dropoffPoint: '西直门地铁站C口',
|
|
|
departureTime: new Date('2025-11-01T23:45:00Z'),
|
|
departureTime: new Date('2025-11-01T23:45:00Z'),
|
|
|
- vehicleType: VehicleType.MINIBUS,
|
|
|
|
|
- price: 25,
|
|
|
|
|
- seatCount: 30,
|
|
|
|
|
- availableSeats: 26,
|
|
|
|
|
|
|
+ vehicleType: VehicleType.BUSINESS,
|
|
|
|
|
+ travelMode: TravelMode.CHARTER,
|
|
|
|
|
+ price: 180,
|
|
|
|
|
+ seatCount: 8,
|
|
|
|
|
+ availableSeats: 8,
|
|
|
activityId: savedActivities[3].id,
|
|
activityId: savedActivities[3].id,
|
|
|
startLocationId: savedLocations[1].id, // 鸟巢
|
|
startLocationId: savedLocations[1].id, // 鸟巢
|
|
|
endLocationId: savedLocations[7].id, // 西直门
|
|
endLocationId: savedLocations[7].id, // 西直门
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- // CBA赛事去程路线
|
|
|
|
|
|
|
+ // CBA赛事去程路线 - 大巴拼车场景
|
|
|
{
|
|
{
|
|
|
name: '朝阳门-五棵松体育馆专线',
|
|
name: '朝阳门-五棵松体育馆专线',
|
|
|
description: '朝阳门到五棵松体育馆的CBA赛事专线',
|
|
description: '朝阳门到五棵松体育馆的CBA赛事专线',
|
|
@@ -346,6 +360,7 @@ async function seed() {
|
|
|
dropoffPoint: '五棵松体育馆北门',
|
|
dropoffPoint: '五棵松体育馆北门',
|
|
|
departureTime: new Date('2025-10-20T18:30:00Z'),
|
|
departureTime: new Date('2025-10-20T18:30:00Z'),
|
|
|
vehicleType: VehicleType.BUS,
|
|
vehicleType: VehicleType.BUS,
|
|
|
|
|
+ travelMode: TravelMode.CARPOOL,
|
|
|
price: 20,
|
|
price: 20,
|
|
|
seatCount: 50,
|
|
seatCount: 50,
|
|
|
availableSeats: 46,
|
|
availableSeats: 46,
|
|
@@ -354,7 +369,7 @@ async function seed() {
|
|
|
endLocationId: savedLocations[2].id, // 五棵松体育馆
|
|
endLocationId: savedLocations[2].id, // 五棵松体育馆
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- // CBA赛事返程路线
|
|
|
|
|
|
|
+ // CBA赛事返程路线 - 大巴拼车场景
|
|
|
{
|
|
{
|
|
|
name: '五棵松体育馆-朝阳门返程专线',
|
|
name: '五棵松体育馆-朝阳门返程专线',
|
|
|
description: '五棵松体育馆到朝阳门的CBA赛事返程专线',
|
|
description: '五棵松体育馆到朝阳门的CBA赛事返程专线',
|
|
@@ -364,6 +379,7 @@ async function seed() {
|
|
|
dropoffPoint: '朝阳门地铁站B口',
|
|
dropoffPoint: '朝阳门地铁站B口',
|
|
|
departureTime: new Date('2025-10-20T22:00:00Z'),
|
|
departureTime: new Date('2025-10-20T22:00:00Z'),
|
|
|
vehicleType: VehicleType.BUS,
|
|
vehicleType: VehicleType.BUS,
|
|
|
|
|
+ travelMode: TravelMode.CARPOOL,
|
|
|
price: 20,
|
|
price: 20,
|
|
|
seatCount: 50,
|
|
seatCount: 50,
|
|
|
availableSeats: 42,
|
|
availableSeats: 42,
|