gtfs 3.1.2 → 3.2.1

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.
Files changed (111) hide show
  1. package/.eslintrc.json +14 -19
  2. package/.husky/pre-commit +4 -0
  3. package/@types/index.d.ts +269 -0
  4. package/@types/tests.ts +26 -0
  5. package/@types/tsconfig.json +17 -0
  6. package/CHANGELOG.md +181 -0
  7. package/README.md +168 -149
  8. package/bin/gtfs-export.js +4 -5
  9. package/bin/gtfs-import.js +6 -7
  10. package/config-sample-full.json +2 -7
  11. package/docs/images/node-gtfs-logo.svg +18 -0
  12. package/lib/db.js +64 -13
  13. package/lib/export.js +27 -13
  14. package/lib/file-utils.js +26 -9
  15. package/lib/geojson-utils.js +51 -38
  16. package/lib/gtfs/agencies.js +15 -4
  17. package/lib/gtfs/attributions.js +15 -4
  18. package/lib/gtfs/calendar-dates.js +15 -4
  19. package/lib/gtfs/calendars.js +15 -4
  20. package/lib/gtfs/fare-attributes.js +15 -4
  21. package/lib/gtfs/fare-rules.js +15 -4
  22. package/lib/gtfs/feed-info.js +15 -4
  23. package/lib/gtfs/frequencies.js +15 -4
  24. package/lib/gtfs/levels.js +15 -4
  25. package/lib/gtfs/pathways.js +15 -4
  26. package/lib/gtfs/routes.js +22 -6
  27. package/lib/gtfs/shapes.js +59 -23
  28. package/lib/gtfs/stop-times.js +15 -4
  29. package/lib/gtfs/stops.js +57 -23
  30. package/lib/gtfs/transfers.js +15 -4
  31. package/lib/gtfs/translations.js +15 -4
  32. package/lib/gtfs/trips.js +15 -4
  33. package/lib/gtfs-ride/board-alights.js +15 -4
  34. package/lib/gtfs-ride/ride-feed-infos.js +15 -4
  35. package/lib/gtfs-ride/rider-trips.js +15 -4
  36. package/lib/gtfs-ride/riderships.js +15 -4
  37. package/lib/gtfs-ride/trip-capacities.js +15 -4
  38. package/lib/import.js +201 -126
  39. package/lib/log-utils.js +8 -4
  40. package/lib/non-standard/directions.js +15 -4
  41. package/lib/non-standard/stop-attributes.js +15 -4
  42. package/lib/non-standard/timetable-notes-references.js +15 -4
  43. package/lib/non-standard/timetable-notes.js +15 -4
  44. package/lib/non-standard/timetable-pages.js +15 -4
  45. package/lib/non-standard/timetable-stop-order.js +15 -4
  46. package/lib/non-standard/timetables.js +15 -4
  47. package/lib/utils.js +26 -12
  48. package/models/gtfs/agency.js +11 -11
  49. package/models/gtfs/attributions.js +14 -14
  50. package/models/gtfs/calendar-dates.js +7 -7
  51. package/models/gtfs/calendar.js +12 -12
  52. package/models/gtfs/fare-attributes.js +9 -9
  53. package/models/gtfs/fare-rules.js +8 -8
  54. package/models/gtfs/feed-info.js +12 -12
  55. package/models/gtfs/frequencies.js +10 -10
  56. package/models/gtfs/levels.js +5 -5
  57. package/models/gtfs/pathways.js +14 -14
  58. package/models/gtfs/routes.js +14 -14
  59. package/models/gtfs/shapes.js +8 -8
  60. package/models/gtfs/stop-times.js +17 -17
  61. package/models/gtfs/stops.js +17 -17
  62. package/models/gtfs/transfers.js +7 -7
  63. package/models/gtfs/translations.js +10 -10
  64. package/models/gtfs/trips.js +12 -12
  65. package/models/gtfs-ride/board-alight.js +24 -24
  66. package/models/gtfs-ride/ride-feed-info.js +8 -8
  67. package/models/gtfs-ride/rider-trip.js +21 -21
  68. package/models/gtfs-ride/ridership.js +23 -23
  69. package/models/gtfs-ride/trip-capacity.js +10 -10
  70. package/models/models.js +1 -1
  71. package/models/non-standard/directions.js +6 -6
  72. package/models/non-standard/stop-attributes.js +5 -5
  73. package/models/non-standard/timetable-notes-references.js +9 -9
  74. package/models/non-standard/timetable-notes.js +5 -5
  75. package/models/non-standard/timetable-pages.js +5 -5
  76. package/models/non-standard/timetable-stop-order.js +6 -6
  77. package/models/non-standard/timetables.js +27 -27
  78. package/package.json +34 -12
  79. package/test/mocha/export-gtfs.js +74 -44
  80. package/test/mocha/get-agencies.js +20 -14
  81. package/test/mocha/get-attributions.js +10 -4
  82. package/test/mocha/get-board-alights.js +10 -4
  83. package/test/mocha/get-calendar-dates.js +31 -24
  84. package/test/mocha/get-calendars.js +17 -11
  85. package/test/mocha/get-db.js +71 -5
  86. package/test/mocha/get-directions.js +10 -4
  87. package/test/mocha/get-fare-attributes.js +12 -6
  88. package/test/mocha/get-fare-rules.js +17 -13
  89. package/test/mocha/get-feed-info.js +10 -4
  90. package/test/mocha/get-frequencies.js +10 -4
  91. package/test/mocha/get-levels.js +4 -4
  92. package/test/mocha/get-pathways.js +10 -4
  93. package/test/mocha/get-ride-feed-infos.js +9 -3
  94. package/test/mocha/get-rider-trips.js +10 -4
  95. package/test/mocha/get-riderships.js +10 -4
  96. package/test/mocha/get-routes.js +12 -16
  97. package/test/mocha/get-shapes-as-geojson.js +12 -6
  98. package/test/mocha/get-shapes.js +31 -39
  99. package/test/mocha/get-stop-attributes.js +10 -4
  100. package/test/mocha/get-stops-as-geojson.js +11 -5
  101. package/test/mocha/get-stops.js +62 -51
  102. package/test/mocha/get-stoptimes.js +18 -10
  103. package/test/mocha/get-timetable-pages.js +10 -4
  104. package/test/mocha/get-timetable-stop-orders.js +10 -4
  105. package/test/mocha/get-timetables.js +10 -4
  106. package/test/mocha/get-transfers.js +10 -4
  107. package/test/mocha/get-translations.js +10 -4
  108. package/test/mocha/get-trip-capacities.js +10 -4
  109. package/test/mocha/get-trips.js +6 -6
  110. package/test/mocha/import-gtfs.js +63 -46
  111. package/test/test-config.js +9 -4
@@ -2,18 +2,29 @@ import sqlString from 'sqlstring-sqlite';
2
2
 
3
3
  import { getDb } from '../db.js';
4
4
 
5
- import { formatOrderByClause, formatSelectClause, formatWhereClauses } from '../utils.js';
5
+ import {
6
+ formatOrderByClause,
7
+ formatSelectClause,
8
+ formatWhereClauses,
9
+ } from '../utils.js';
6
10
  import directions from '../../models/non-standard/directions.js';
7
11
 
8
12
  /*
9
13
  * Returns an array of all directions that match the query parameters.
10
14
  */
11
- export async function getDirections(query = {}, fields = [], orderBy = []) {
12
- const db = await getDb();
15
+ export async function getDirections(
16
+ query = {},
17
+ fields = [],
18
+ orderBy = [],
19
+ options = {}
20
+ ) {
21
+ const db = options.db ?? (await getDb());
13
22
  const tableName = sqlString.escapeId(directions.filenameBase);
14
23
  const selectClause = formatSelectClause(fields);
15
24
  const whereClause = formatWhereClauses(query);
16
25
  const orderByClause = formatOrderByClause(orderBy);
17
26
 
18
- return db.all(`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`);
27
+ return db.all(
28
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ );
19
30
  }
@@ -2,18 +2,29 @@ import sqlString from 'sqlstring-sqlite';
2
2
 
3
3
  import { getDb } from '../db.js';
4
4
 
5
- import { formatOrderByClause, formatSelectClause, formatWhereClauses } from '../utils.js';
5
+ import {
6
+ formatOrderByClause,
7
+ formatSelectClause,
8
+ formatWhereClauses,
9
+ } from '../utils.js';
6
10
  import stopAttributes from '../../models/non-standard/stop-attributes.js';
7
11
 
8
12
  /*
9
13
  * Returns an array of all stop attributes that match the query parameters.
10
14
  */
11
- export async function getStopAttributes(query = {}, fields = [], orderBy = []) {
12
- const db = await getDb();
15
+ export async function getStopAttributes(
16
+ query = {},
17
+ fields = [],
18
+ orderBy = [],
19
+ options = {}
20
+ ) {
21
+ const db = options.db ?? (await getDb());
13
22
  const tableName = sqlString.escapeId(stopAttributes.filenameBase);
14
23
  const selectClause = formatSelectClause(fields);
15
24
  const whereClause = formatWhereClauses(query);
16
25
  const orderByClause = formatOrderByClause(orderBy);
17
26
 
18
- return db.all(`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`);
27
+ return db.all(
28
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ );
19
30
  }
@@ -2,18 +2,29 @@ import sqlString from 'sqlstring-sqlite';
2
2
 
3
3
  import { getDb } from '../db.js';
4
4
 
5
- import { formatOrderByClause, formatSelectClause, formatWhereClauses } from '../utils.js';
5
+ import {
6
+ formatOrderByClause,
7
+ formatSelectClause,
8
+ formatWhereClauses,
9
+ } from '../utils.js';
6
10
  import timetableNotesReferences from '../../models/non-standard/timetable-notes-references.js';
7
11
 
8
12
  /*
9
13
  * Returns an array of all timetable notes references that match the query parameters.
10
14
  */
11
- export async function getTimetableNotesReferences(query = {}, fields = [], orderBy = []) {
12
- const db = await getDb();
15
+ export async function getTimetableNotesReferences(
16
+ query = {},
17
+ fields = [],
18
+ orderBy = [],
19
+ options = {}
20
+ ) {
21
+ const db = options.db ?? (await getDb());
13
22
  const tableName = sqlString.escapeId(timetableNotesReferences.filenameBase);
14
23
  const selectClause = formatSelectClause(fields);
15
24
  const whereClause = formatWhereClauses(query);
16
25
  const orderByClause = formatOrderByClause(orderBy);
17
26
 
18
- return db.all(`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`);
27
+ return db.all(
28
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ );
19
30
  }
@@ -2,18 +2,29 @@ import sqlString from 'sqlstring-sqlite';
2
2
 
3
3
  import { getDb } from '../db.js';
4
4
 
5
- import { formatOrderByClause, formatSelectClause, formatWhereClauses } from '../utils.js';
5
+ import {
6
+ formatOrderByClause,
7
+ formatSelectClause,
8
+ formatWhereClauses,
9
+ } from '../utils.js';
6
10
  import timetableNotes from '../../models/non-standard/timetable-notes.js';
7
11
 
8
12
  /*
9
13
  * Returns an array of all timetable notes that match the query parameters.
10
14
  */
11
- export async function getTimetableNotes(query = {}, fields = [], orderBy = []) {
12
- const db = await getDb();
15
+ export async function getTimetableNotes(
16
+ query = {},
17
+ fields = [],
18
+ orderBy = [],
19
+ options = {}
20
+ ) {
21
+ const db = options.db ?? (await getDb());
13
22
  const tableName = sqlString.escapeId(timetableNotes.filenameBase);
14
23
  const selectClause = formatSelectClause(fields);
15
24
  const whereClause = formatWhereClauses(query);
16
25
  const orderByClause = formatOrderByClause(orderBy);
17
26
 
18
- return db.all(`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`);
27
+ return db.all(
28
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ );
19
30
  }
@@ -2,18 +2,29 @@ import sqlString from 'sqlstring-sqlite';
2
2
 
3
3
  import { getDb } from '../db.js';
4
4
 
5
- import { formatOrderByClause, formatSelectClause, formatWhereClauses } from '../utils.js';
5
+ import {
6
+ formatOrderByClause,
7
+ formatSelectClause,
8
+ formatWhereClauses,
9
+ } from '../utils.js';
6
10
  import timetablePages from '../../models/non-standard/timetable-pages.js';
7
11
 
8
12
  /*
9
13
  * Returns an array of all timetable pages that match the query parameters.
10
14
  */
11
- export async function getTimetablePages(query = {}, fields = [], orderBy = []) {
12
- const db = await getDb();
15
+ export async function getTimetablePages(
16
+ query = {},
17
+ fields = [],
18
+ orderBy = [],
19
+ options = {}
20
+ ) {
21
+ const db = options.db ?? (await getDb());
13
22
  const tableName = sqlString.escapeId(timetablePages.filenameBase);
14
23
  const selectClause = formatSelectClause(fields);
15
24
  const whereClause = formatWhereClauses(query);
16
25
  const orderByClause = formatOrderByClause(orderBy);
17
26
 
18
- return db.all(`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`);
27
+ return db.all(
28
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ );
19
30
  }
@@ -2,18 +2,29 @@ import sqlString from 'sqlstring-sqlite';
2
2
 
3
3
  import { getDb } from '../db.js';
4
4
 
5
- import { formatOrderByClause, formatSelectClause, formatWhereClauses } from '../utils.js';
5
+ import {
6
+ formatOrderByClause,
7
+ formatSelectClause,
8
+ formatWhereClauses,
9
+ } from '../utils.js';
6
10
  import timetableStopOrder from '../../models/non-standard/timetable-stop-order.js';
7
11
 
8
12
  /*
9
13
  * Returns an array of all timetable stop orders that match the query parameters.
10
14
  */
11
- export async function getTimetableStopOrders(query = {}, fields = [], orderBy = []) {
12
- const db = await getDb();
15
+ export async function getTimetableStopOrders(
16
+ query = {},
17
+ fields = [],
18
+ orderBy = [],
19
+ options = {}
20
+ ) {
21
+ const db = options.db ?? (await getDb());
13
22
  const tableName = sqlString.escapeId(timetableStopOrder.filenameBase);
14
23
  const selectClause = formatSelectClause(fields);
15
24
  const whereClause = formatWhereClauses(query);
16
25
  const orderByClause = formatOrderByClause(orderBy);
17
26
 
18
- return db.all(`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`);
27
+ return db.all(
28
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ );
19
30
  }
@@ -2,18 +2,29 @@ import sqlString from 'sqlstring-sqlite';
2
2
 
3
3
  import { getDb } from '../db.js';
4
4
 
5
- import { formatOrderByClause, formatSelectClause, formatWhereClauses } from '../utils.js';
5
+ import {
6
+ formatOrderByClause,
7
+ formatSelectClause,
8
+ formatWhereClauses,
9
+ } from '../utils.js';
6
10
  import timetables from '../../models/non-standard/timetables.js';
7
11
 
8
12
  /*
9
13
  * Returns an array of all timetables that match the query parameters.
10
14
  */
11
- export async function getTimetables(query = {}, fields = [], orderBy = []) {
12
- const db = await getDb();
15
+ export async function getTimetables(
16
+ query = {},
17
+ fields = [],
18
+ orderBy = [],
19
+ options = {}
20
+ ) {
21
+ const db = options.db ?? (await getDb());
13
22
  const tableName = sqlString.escapeId(timetables.filenameBase);
14
23
  const selectClause = formatSelectClause(fields);
15
24
  const whereClause = formatWhereClauses(query);
16
25
  const orderByClause = formatOrderByClause(orderBy);
17
26
 
18
- return db.all(`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`);
27
+ return db.all(
28
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ );
19
30
  }
package/lib/utils.js CHANGED
@@ -10,7 +10,9 @@ export function validateConfigForImport(config) {
10
10
 
11
11
  for (const [index, agency] of config.agencies.entries()) {
12
12
  if (!agency.path && !agency.url) {
13
- throw new Error(`No Agency \`url\` or \`path\` specified in config for agency index ${index}.`);
13
+ throw new Error(
14
+ `No Agency \`url\` or \`path\` specified in config for agency index ${index}.`
15
+ );
14
16
  }
15
17
  }
16
18
 
@@ -22,33 +24,41 @@ export function validateConfigForImport(config) {
22
24
  */
23
25
  export function setDefaultConfig(initialConfig) {
24
26
  const defaults = {
25
- sqlitePath: ':memory:'
27
+ sqlitePath: ':memory:',
26
28
  };
27
29
 
28
- return Object.assign(defaults, initialConfig);
30
+ return {
31
+ ...defaults,
32
+ ...initialConfig,
33
+ };
29
34
  }
30
35
 
31
36
  /*
32
37
  * Calculate seconds from midnight for HH:mm:ss
33
38
  */
34
39
  export function calculateSecondsFromMidnight(time) {
35
- const split = time.split(':').map(d => Number.parseInt(d, 10));
40
+ const split = time.split(':').map((d) => Number.parseInt(d, 10));
36
41
  if (split.length !== 3) {
37
42
  return null;
38
43
  }
39
44
 
40
- return (split[0] * 3600) + (split[1] * 60) + split[2];
45
+ return split[0] * 3600 + split[1] * 60 + split[2];
41
46
  }
42
47
 
43
48
  export function formatSelectClause(fields) {
44
- const selectItem = fields.length > 0 ? fields.map(fieldName => sqlString.escapeId(fieldName)).join(', ') : '*';
49
+ const selectItem =
50
+ fields.length > 0
51
+ ? fields.map((fieldName) => sqlString.escapeId(fieldName)).join(', ')
52
+ : '*';
45
53
 
46
54
  return `SELECT ${selectItem}`;
47
55
  }
48
56
 
49
57
  export function formatWhereClause(key, value) {
50
58
  if (Array.isArray(value)) {
51
- return `${sqlString.escapeId(key)} IN (${value.map(v => sqlString.escape(v)).join(', ')})`;
59
+ return `${sqlString.escapeId(key)} IN (${value
60
+ .map((v) => sqlString.escape(v))
61
+ .join(', ')})`;
52
62
  }
53
63
 
54
64
  if (value === null) {
@@ -63,7 +73,9 @@ export function formatWhereClauses(query) {
63
73
  return '';
64
74
  }
65
75
 
66
- const whereClauses = Object.entries(query).map(([key, value]) => formatWhereClause(key, value));
76
+ const whereClauses = Object.entries(query).map(([key, value]) =>
77
+ formatWhereClause(key, value)
78
+ );
67
79
  return `WHERE ${whereClauses.join(' AND ')}`;
68
80
  }
69
81
 
@@ -73,10 +85,12 @@ export function formatOrderByClause(orderBy) {
73
85
  if (orderBy.length > 0) {
74
86
  orderByClause += 'ORDER BY ';
75
87
 
76
- orderByClause += orderBy.map(([key, value]) => {
77
- const direction = value === 'DESC' ? 'DESC' : 'ASC';
78
- return `${sqlString.escapeId(key)} ${direction}`;
79
- }).join(', ');
88
+ orderByClause += orderBy
89
+ .map(([key, value]) => {
90
+ const direction = value === 'DESC' ? 'DESC' : 'ASC';
91
+ return `${sqlString.escapeId(key)} ${direction}`;
92
+ })
93
+ .join(', ');
80
94
  }
81
95
 
82
96
  return orderByClause;
@@ -4,44 +4,44 @@ const model = {
4
4
  {
5
5
  name: 'id',
6
6
  type: 'integer',
7
- primary: true
7
+ primary: true,
8
8
  },
9
9
  {
10
10
  name: 'agency_id',
11
- type: 'varchar(255)'
11
+ type: 'varchar(255)',
12
12
  },
13
13
  {
14
14
  name: 'agency_name',
15
15
  type: 'varchar(255)',
16
- required: true
16
+ required: true,
17
17
  },
18
18
  {
19
19
  name: 'agency_url',
20
20
  type: 'varchar(2047)',
21
- required: true
21
+ required: true,
22
22
  },
23
23
  {
24
24
  name: 'agency_timezone',
25
25
  type: 'varchar(255)',
26
- required: true
26
+ required: true,
27
27
  },
28
28
  {
29
29
  name: 'agency_lang',
30
- type: 'varchar(255)'
30
+ type: 'varchar(255)',
31
31
  },
32
32
  {
33
33
  name: 'agency_phone',
34
- type: 'varchar(64)'
34
+ type: 'varchar(64)',
35
35
  },
36
36
  {
37
37
  name: 'agency_fare_url',
38
- type: 'varchar(2047)'
38
+ type: 'varchar(2047)',
39
39
  },
40
40
  {
41
41
  name: 'agency_email',
42
- type: 'varchar(255)'
43
- }
44
- ]
42
+ type: 'varchar(255)',
43
+ },
44
+ ],
45
45
  };
46
46
 
47
47
  export default model;
@@ -4,60 +4,60 @@ const model = {
4
4
  {
5
5
  name: 'id',
6
6
  type: 'integer',
7
- primary: true
7
+ primary: true,
8
8
  },
9
9
  {
10
10
  name: 'attribution_id',
11
- type: 'varchar(255)'
11
+ type: 'varchar(255)',
12
12
  },
13
13
  {
14
14
  name: 'agency_id',
15
- type: 'varchar(255)'
15
+ type: 'varchar(255)',
16
16
  },
17
17
  {
18
18
  name: 'route_id',
19
- type: 'varchar(255)'
19
+ type: 'varchar(255)',
20
20
  },
21
21
  {
22
22
  name: 'trip_id',
23
- type: 'varchar(255)'
23
+ type: 'varchar(255)',
24
24
  },
25
25
  {
26
26
  name: 'organization_name',
27
27
  type: 'varchar(255)',
28
- required: true
28
+ required: true,
29
29
  },
30
30
  {
31
31
  name: 'is_producer',
32
32
  type: 'integer',
33
33
  min: 0,
34
- max: 1
34
+ max: 1,
35
35
  },
36
36
  {
37
37
  name: 'is_operator',
38
38
  type: 'integer',
39
39
  min: 0,
40
- max: 1
40
+ max: 1,
41
41
  },
42
42
  {
43
43
  name: 'is_authority',
44
44
  type: 'integer',
45
45
  min: 0,
46
- max: 1
46
+ max: 1,
47
47
  },
48
48
  {
49
49
  name: 'attribution_url',
50
- type: 'varchar(2047)'
50
+ type: 'varchar(2047)',
51
51
  },
52
52
  {
53
53
  name: 'attribution_email',
54
- type: 'varchar(255)'
54
+ type: 'varchar(255)',
55
55
  },
56
56
  {
57
57
  name: 'attribution_phone',
58
- type: 'varchar(255)'
59
- }
60
- ]
58
+ type: 'varchar(255)',
59
+ },
60
+ ],
61
61
  };
62
62
 
63
63
  export default model;
@@ -4,19 +4,19 @@ const model = {
4
4
  {
5
5
  name: 'id',
6
6
  type: 'integer',
7
- primary: true
7
+ primary: true,
8
8
  },
9
9
  {
10
10
  name: 'service_id',
11
11
  type: 'varchar(255)',
12
12
  required: true,
13
- index: true
13
+ index: true,
14
14
  },
15
15
  {
16
16
  name: 'date',
17
17
  type: 'integer',
18
18
  required: true,
19
- index: true
19
+ index: true,
20
20
  },
21
21
  {
22
22
  name: 'exception_type',
@@ -24,13 +24,13 @@ const model = {
24
24
  required: true,
25
25
  min: 1,
26
26
  max: 2,
27
- index: true
27
+ index: true,
28
28
  },
29
29
  {
30
30
  name: 'holiday_name',
31
- type: 'varchar(255)'
32
- }
33
- ]
31
+ type: 'varchar(255)',
32
+ },
33
+ ],
34
34
  };
35
35
 
36
36
  export default model;
@@ -5,70 +5,70 @@ const model = {
5
5
  name: 'service_id',
6
6
  type: 'varchar(255)',
7
7
  required: true,
8
- primary: true
8
+ primary: true,
9
9
  },
10
10
  {
11
11
  name: 'monday',
12
12
  type: 'integer',
13
13
  required: true,
14
14
  min: 0,
15
- max: 1
15
+ max: 1,
16
16
  },
17
17
  {
18
18
  name: 'tuesday',
19
19
  type: 'integer',
20
20
  required: true,
21
21
  min: 0,
22
- max: 1
22
+ max: 1,
23
23
  },
24
24
  {
25
25
  name: 'wednesday',
26
26
  type: 'integer',
27
27
  required: true,
28
28
  min: 0,
29
- max: 1
29
+ max: 1,
30
30
  },
31
31
  {
32
32
  name: 'thursday',
33
33
  type: 'integer',
34
34
  required: true,
35
35
  min: 0,
36
- max: 1
36
+ max: 1,
37
37
  },
38
38
  {
39
39
  name: 'friday',
40
40
  type: 'integer',
41
41
  required: true,
42
42
  min: 0,
43
- max: 1
43
+ max: 1,
44
44
  },
45
45
  {
46
46
  name: 'saturday',
47
47
  type: 'integer',
48
48
  required: true,
49
49
  min: 0,
50
- max: 1
50
+ max: 1,
51
51
  },
52
52
  {
53
53
  name: 'sunday',
54
54
  type: 'integer',
55
55
  required: true,
56
56
  min: 0,
57
- max: 1
57
+ max: 1,
58
58
  },
59
59
  {
60
60
  name: 'start_date',
61
61
  type: 'integer',
62
62
  required: true,
63
- index: true
63
+ index: true,
64
64
  },
65
65
  {
66
66
  name: 'end_date',
67
67
  type: 'integer',
68
68
  required: true,
69
- index: true
70
- }
71
- ]
69
+ index: true,
70
+ },
71
+ ],
72
72
  };
73
73
 
74
74
  export default model;
@@ -5,41 +5,41 @@ const model = {
5
5
  name: 'fare_id',
6
6
  type: 'varchar(255)',
7
7
  required: true,
8
- primary: true
8
+ primary: true,
9
9
  },
10
10
  {
11
11
  name: 'price',
12
12
  type: 'real',
13
- required: true
13
+ required: true,
14
14
  },
15
15
  {
16
16
  name: 'currency_type',
17
17
  type: 'varchar(255)',
18
- required: true
18
+ required: true,
19
19
  },
20
20
  {
21
21
  name: 'payment_method',
22
22
  type: 'integer',
23
23
  required: true,
24
24
  min: 0,
25
- max: 1
25
+ max: 1,
26
26
  },
27
27
  {
28
28
  name: 'transfers',
29
29
  type: 'integer',
30
30
  min: 0,
31
- max: 2
31
+ max: 2,
32
32
  },
33
33
  {
34
34
  name: 'agency_id',
35
- type: 'varchar(255)'
35
+ type: 'varchar(255)',
36
36
  },
37
37
  {
38
38
  name: 'transfer_duration',
39
39
  type: 'integer',
40
- min: 0
41
- }
42
- ]
40
+ min: 0,
41
+ },
42
+ ],
43
43
  };
44
44
 
45
45
  export default model;
@@ -4,32 +4,32 @@ const model = {
4
4
  {
5
5
  name: 'id',
6
6
  type: 'integer',
7
- primary: true
7
+ primary: true,
8
8
  },
9
9
  {
10
10
  name: 'fare_id',
11
11
  type: 'varchar(255)',
12
12
  required: true,
13
- index: true
13
+ index: true,
14
14
  },
15
15
  {
16
16
  name: 'route_id',
17
17
  type: 'varchar(255)',
18
- index: true
18
+ index: true,
19
19
  },
20
20
  {
21
21
  name: 'origin_id',
22
- type: 'varchar(255)'
22
+ type: 'varchar(255)',
23
23
  },
24
24
  {
25
25
  name: 'destination_id',
26
- type: 'varchar(255)'
26
+ type: 'varchar(255)',
27
27
  },
28
28
  {
29
29
  name: 'contains_id',
30
- type: 'varchar(255)'
31
- }
32
- ]
30
+ type: 'varchar(255)',
31
+ },
32
+ ],
33
33
  };
34
34
 
35
35
  export default model;