Browse Source

📝 docs(seed): 更新种子数据为赛事和演唱会相关内容

- 将原有节假日出行活动替换为中超联赛、周杰伦演唱会和CBA赛事相关活动
- 更新活动名称、描述和时间,使其与赛事和演唱会场景匹配
- 调整路线数据,包括起终点、上下车点、发车时间和价格等信息
- 修改注释以反映新的数据主题和内容结构
yourname 4 tháng trước cách đây
mục cha
commit
d503cf1f14
1 tập tin đã thay đổi với 153 bổ sung125 xóa
  1. 153 125
      scripts/seed.ts

+ 153 - 125
scripts/seed.ts

@@ -20,49 +20,49 @@ async function seed() {
     await activityRepository.createQueryBuilder().delete().execute();
     console.log('已清空现有数据');
 
-    // 创建示例活动数据
+    // 创建示例活动数据 - 赛事和演唱会相关
     const activities = [
       {
-        name: '国庆节去程活动',
-        description: '国庆节期间的去程出行活动',
+        name: '中超联赛北京国安主场赛事',
+        description: '北京国安主场对阵上海申花的中超联赛',
         type: ActivityType.DEPARTURE,
-        startDate: new Date('2025-10-01T00:00:00Z'),
-        endDate: new Date('2025-10-07T23:59:59Z'),
+        startDate: new Date('2025-10-15T00:00:00Z'),
+        endDate: new Date('2025-10-15T23:59:59Z'),
       },
       {
-        name: '国庆节返程活动',
-        description: '国庆节期间的返程出行活动',
+        name: '中超联赛北京国安主场赛事返程',
+        description: '北京国安主场赛事结束后的返程服务',
         type: ActivityType.RETURN,
-        startDate: new Date('2025-10-05T00:00:00Z'),
-        endDate: new Date('2025-10-10T23:59:59Z'),
+        startDate: new Date('2025-10-15T21:00:00Z'),
+        endDate: new Date('2025-10-16T02:00:00Z'),
       },
       {
-        name: '元旦去程活动',
-        description: '元旦期间的去程出行活动',
+        name: '周杰伦北京演唱会',
+        description: '周杰伦北京演唱会专场',
         type: ActivityType.DEPARTURE,
-        startDate: new Date('2026-01-01T00:00:00Z'),
-        endDate: new Date('2026-01-03T23:59:59Z'),
+        startDate: new Date('2025-11-01T00:00:00Z'),
+        endDate: new Date('2025-11-01T23:59:59Z'),
       },
       {
-        name: '元旦返程活动',
-        description: '元旦期间的返程出行活动',
+        name: '周杰伦北京演唱会返程',
+        description: '周杰伦演唱会结束后的返程服务',
         type: ActivityType.RETURN,
-        startDate: new Date('2026-01-02T00:00:00Z'),
-        endDate: new Date('2026-01-04T23:59:59Z'),
+        startDate: new Date('2025-11-01T22:30:00Z'),
+        endDate: new Date('2025-11-02T01:00:00Z'),
       },
       {
-        name: '春节去程活动',
-        description: '春节期间的去程出行活动',
+        name: 'CBA北京首钢主场赛事',
+        description: '北京首钢主场对阵广东宏远的CBA联赛',
         type: ActivityType.DEPARTURE,
-        startDate: new Date('2026-02-10T00:00:00Z'),
-        endDate: new Date('2026-02-16T23:59:59Z'),
+        startDate: new Date('2025-10-20T00:00:00Z'),
+        endDate: new Date('2025-10-20T23:59:59Z'),
       },
       {
-        name: '春节返程活动',
-        description: '春节期间的返程出行活动',
+        name: 'CBA北京首钢主场赛事返程',
+        description: '北京首钢主场赛事结束后的返程服务',
         type: ActivityType.RETURN,
-        startDate: new Date('2026-02-14T00:00:00Z'),
-        endDate: new Date('2026-02-20T23:59:59Z'),
+        startDate: new Date('2025-10-20T21:30:00Z'),
+        endDate: new Date('2025-10-21T00:30:00Z'),
       },
     ];
 
@@ -70,143 +70,171 @@ async function seed() {
     const savedActivities = await activityRepository.save(activities);
     console.log(`已创建 ${savedActivities.length} 个活动`);
 
-    // 创建示例路线数据
+    // 创建示例路线数据 - 赛事和演唱会相关
     const routes = [
-      // 国庆节去程路线
-      {
-        name: '北京-上海高铁',
-        description: '北京到上海的高铁专线',
-        startPoint: '北京',
-        endPoint: '上海',
-        pickupPoint: '北京南站',
-        dropoffPoint: '上海虹桥站',
-        departureTime: new Date('2025-10-01T08:00:00Z'),
+      // 中超联赛去程路线
+      {
+        name: '中关村-工人体育场专线',
+        description: '中关村到工人体育场的中超联赛专线',
+        startPoint: '中关村',
+        endPoint: '工人体育场',
+        pickupPoint: '中关村地铁站A口',
+        dropoffPoint: '工人体育场北门',
+        departureTime: new Date('2025-10-15T17:30:00Z'),
         vehicleType: VehicleType.BUS,
-        price: 553.5,
-        seatCount: 500,
-        availableSeats: 450,
+        price: 25,
+        seatCount: 50,
+        availableSeats: 45,
         activityId: savedActivities[0].id,
       },
       {
-        name: '北京-广州飞机',
-        description: '北京到广州的航班',
-        startPoint: '北京',
-        endPoint: '广州',
-        pickupPoint: '北京首都机场',
-        dropoffPoint: '广州白云机场',
-        departureTime: new Date('2025-10-01T10:30:00Z'),
+        name: '国贸-工人体育场专线',
+        description: '国贸到工人体育场的中超联赛专线',
+        startPoint: '国贸',
+        endPoint: '工人体育场',
+        pickupPoint: '国贸地铁站C口',
+        dropoffPoint: '工人体育场东门',
+        departureTime: new Date('2025-10-15T17:45:00Z'),
         vehicleType: VehicleType.MINIBUS,
-        price: 1200,
-        seatCount: 200,
-        availableSeats: 180,
+        price: 20,
+        seatCount: 30,
+        availableSeats: 28,
         activityId: savedActivities[0].id,
       },
       {
-        name: '北京-深圳动车',
-        description: '北京到深圳的动车专线',
-        startPoint: '京',
-        endPoint: '深圳',
-        pickupPoint: '北京西站',
-        dropoffPoint: '深圳北站',
-        departureTime: new Date('2025-10-01T09:15:00Z'),
+        name: '望京-工人体育场专线',
+        description: '望京到工人体育场的中超联赛专线',
+        startPoint: '京',
+        endPoint: '工人体育场',
+        pickupPoint: '望京地铁站S口',
+        dropoffPoint: '工人体育场南门',
+        departureTime: new Date('2025-10-15T18:00:00Z'),
         vehicleType: VehicleType.CAR,
-        price: 756,
-        seatCount: 600,
-        availableSeats: 550,
+        price: 35,
+        seatCount: 15,
+        availableSeats: 12,
         activityId: savedActivities[0].id,
       },
 
-      // 国庆节返程路线
+      // 中超联赛返程路线
       {
-        name: '上海-北京高铁',
-        description: '上海到北京的高铁专线',
-        startPoint: '上海',
-        endPoint: '北京',
-        pickupPoint: '上海虹桥站',
-        dropoffPoint: '北京南站',
-        departureTime: new Date('2025-10-07T14:00:00Z'),
+        name: '工人体育场-中关村返程专线',
+        description: '工人体育场到中关村的中超联赛返程专线',
+        startPoint: '工人体育场',
+        endPoint: '中关村',
+        pickupPoint: '工人体育场北门',
+        dropoffPoint: '中关村地铁站A口',
+        departureTime: new Date('2025-10-15T22:00:00Z'),
         vehicleType: VehicleType.BUS,
-        price: 553.5,
-        seatCount: 500,
-        availableSeats: 400,
+        price: 25,
+        seatCount: 50,
+        availableSeats: 40,
         activityId: savedActivities[1].id,
       },
       {
-        name: '广州-北京飞机',
-        description: '广州到北京的航班',
-        startPoint: '广州',
-        endPoint: '北京',
-        pickupPoint: '广州白云机场',
-        dropoffPoint: '北京首都机场',
-        departureTime: new Date('2025-10-07T16:30:00Z'),
+        name: '工人体育场-国贸返程专线',
+        description: '工人体育场到国贸的中超联赛返程专线',
+        startPoint: '工人体育场',
+        endPoint: '国贸',
+        pickupPoint: '工人体育场东门',
+        dropoffPoint: '国贸地铁站C口',
+        departureTime: new Date('2025-10-15T22:15:00Z'),
         vehicleType: VehicleType.MINIBUS,
-        price: 1100,
-        seatCount: 200,
-        availableSeats: 150,
+        price: 20,
+        seatCount: 30,
+        availableSeats: 25,
         activityId: savedActivities[1].id,
       },
 
-      // 元旦去程路线
+      // 周杰伦演唱会去程路线
       {
-        name: '北京-天津城际',
-        description: '北京到天津的城际列车',
-        startPoint: '北京',
-        endPoint: '天津',
-        pickupPoint: '北京南站',
-        dropoffPoint: '天津站',
-        departureTime: new Date('2026-01-01T09:00:00Z'),
-        vehicleType: VehicleType.CAR,
-        price: 54.5,
-        seatCount: 600,
-        availableSeats: 500,
+        name: '五道口-鸟巢演唱会专线',
+        description: '五道口到鸟巢的周杰伦演唱会专线',
+        startPoint: '五道口',
+        endPoint: '鸟巢',
+        pickupPoint: '五道口地铁站A口',
+        dropoffPoint: '鸟巢东门',
+        departureTime: new Date('2025-11-01T18:00:00Z'),
+        vehicleType: VehicleType.BUS,
+        price: 30,
+        seatCount: 50,
+        availableSeats: 48,
+        activityId: savedActivities[2].id,
+      },
+      {
+        name: '西直门-鸟巢演唱会专线',
+        description: '西直门到鸟巢的周杰伦演唱会专线',
+        startPoint: '西直门',
+        endPoint: '鸟巢',
+        pickupPoint: '西直门地铁站C口',
+        dropoffPoint: '鸟巢西门',
+        departureTime: new Date('2025-11-01T18:15:00Z'),
+        vehicleType: VehicleType.MINIBUS,
+        price: 25,
+        seatCount: 30,
+        availableSeats: 28,
         activityId: savedActivities[2].id,
       },
 
-      // 元旦返程路线
+      // 周杰伦演唱会返程路线
       {
-        name: '天津-北京城际',
-        description: '天津到北京的城际列车',
-        startPoint: '天津',
-        endPoint: '北京',
-        pickupPoint: '天津站',
-        dropoffPoint: '北京南站',
-        departureTime: new Date('2026-01-03T18:00:00Z'),
-        vehicleType: VehicleType.CAR,
-        price: 54.5,
-        seatCount: 600,
-        availableSeats: 450,
+        name: '鸟巢-五道口返程专线',
+        description: '鸟巢到五道口的周杰伦演唱会返程专线',
+        startPoint: '鸟巢',
+        endPoint: '五道口',
+        pickupPoint: '鸟巢东门',
+        dropoffPoint: '五道口地铁站A口',
+        departureTime: new Date('2025-11-01T23:30:00Z'),
+        vehicleType: VehicleType.BUS,
+        price: 30,
+        seatCount: 50,
+        availableSeats: 45,
+        activityId: savedActivities[3].id,
+      },
+      {
+        name: '鸟巢-西直门返程专线',
+        description: '鸟巢到西直门的周杰伦演唱会返程专线',
+        startPoint: '鸟巢',
+        endPoint: '西直门',
+        pickupPoint: '鸟巢西门',
+        dropoffPoint: '西直门地铁站C口',
+        departureTime: new Date('2025-11-01T23:45:00Z'),
+        vehicleType: VehicleType.MINIBUS,
+        price: 25,
+        seatCount: 30,
+        availableSeats: 26,
         activityId: savedActivities[3].id,
       },
 
-      // 春节去程路线
+      // CBA赛事去程路线
       {
-        name: '北京-哈尔滨高铁',
-        description: '北京到哈尔滨的高铁专线',
-        startPoint: '北京',
-        endPoint: '哈尔滨',
-        pickupPoint: '北京朝阳站',
-        dropoffPoint: '哈尔滨西站',
-        departureTime: new Date('2026-02-10T07:30:00Z'),
+        name: '朝阳门-五棵松体育馆专线',
+        description: '朝阳门到五棵松体育馆的CBA赛事专线',
+        startPoint: '朝阳门',
+        endPoint: '五棵松体育馆',
+        pickupPoint: '朝阳门地铁B口',
+        dropoffPoint: '五棵松体育馆北门',
+        departureTime: new Date('2025-10-20T18:30:00Z'),
         vehicleType: VehicleType.BUS,
-        price: 623.5,
-        seatCount: 500,
-        availableSeats: 480,
+        price: 20,
+        seatCount: 50,
+        availableSeats: 46,
         activityId: savedActivities[4].id,
       },
 
-      // 春节返程路线
+      // CBA赛事返程路线
       {
-        name: '哈尔滨-北京高铁',
-        description: '哈尔滨到北京的高铁专线',
-        startPoint: '哈尔滨',
-        endPoint: '北京',
-        pickupPoint: '哈尔滨西站',
-        dropoffPoint: '北京朝阳站',
-        departureTime: new Date('2026-02-17T15:00:00Z'),
+        name: '五棵松体育馆-朝阳门返程专线',
+        description: '五棵松体育馆到朝阳门的CBA赛事返程专线',
+        startPoint: '五棵松体育馆',
+        endPoint: '朝阳门',
+        pickupPoint: '五棵松体育馆北门',
+        dropoffPoint: '朝阳门地铁B口',
+        departureTime: new Date('2025-10-20T22:00:00Z'),
         vehicleType: VehicleType.BUS,
-        price: 623.5,
-        seatCount: 500,
-        availableSeats: 420,
+        price: 20,
+        seatCount: 50,
+        availableSeats: 42,
         activityId: savedActivities[5].id,
       },
     ];