Compare commits
543 Commits
v7.0.0-alp
...
v7.0.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f7735afa7 | ||
|
|
3aef1a0aae | ||
|
|
cd327502d9 | ||
|
|
900e8ffe26 | ||
|
|
270556eb1c | ||
|
|
e319f8eba4 | ||
|
|
48b14091c4 | ||
|
|
88122c14d2 | ||
|
|
3911d95107 | ||
|
|
61c7a3d54d | ||
|
|
075d4b3069 | ||
|
|
c5498937dc | ||
|
|
f8b21c99e2 | ||
|
|
8b6c44de6f | ||
|
|
b852bdc411 | ||
|
|
2e0cc10ded | ||
|
|
7707d8816e | ||
|
|
a3239e78db | ||
|
|
bbce735e31 | ||
|
|
262aad2d7a | ||
|
|
99e472f99c | ||
|
|
d40c9ba91f | ||
|
|
ab5480fdc9 | ||
|
|
fbcaa382f4 | ||
|
|
aebb517791 | ||
|
|
2de900eaa8 | ||
|
|
e878168d4c | ||
|
|
d04565919b | ||
|
|
146fe05bdc | ||
|
|
daffd1017f | ||
|
|
b66f10510e | ||
|
|
9e55f8ecf0 | ||
|
|
bac6396b19 | ||
|
|
b73182f830 | ||
|
|
ec873f2b82 | ||
|
|
24fb55872f | ||
|
|
f7ae027156 | ||
|
|
f46e5090ae | ||
|
|
c95fe3c971 | ||
|
|
5992dad5a3 | ||
|
|
646987764f | ||
|
|
ebac18ebef | ||
|
|
f2f0873b2e | ||
|
|
f14f7c1a5e | ||
|
|
fbe3804658 | ||
|
|
1c1c0d55f4 | ||
|
|
20d8a2d0a7 | ||
|
|
e71f12311a | ||
|
|
19a206f4ac | ||
|
|
8171d681a6 | ||
|
|
aba23f99bd | ||
|
|
525e8ba8bb | ||
|
|
75ef658d8f | ||
|
|
e5935507c8 | ||
|
|
3c32f2d89d | ||
|
|
e95b3eb366 | ||
|
|
0f3424f41e | ||
|
|
046dac5db5 | ||
|
|
9596d88b48 | ||
|
|
20f46adbc4 | ||
|
|
7b8e20f348 | ||
|
|
996ebde501 | ||
|
|
36d91265d3 | ||
|
|
796053cfa5 | ||
|
|
1c32ef838d | ||
|
|
a62c938099 | ||
|
|
a9536064d3 | ||
|
|
543026da18 | ||
|
|
e77488c66a | ||
|
|
91a64113fb | ||
|
|
25cead3288 | ||
|
|
80556dcda3 | ||
|
|
ffccb01670 | ||
|
|
299f391455 | ||
|
|
666c5d50d4 | ||
|
|
56c1f5ce4d | ||
|
|
79806c3b42 | ||
|
|
66a9b361cb | ||
|
|
89baf34824 | ||
|
|
5ee053cace | ||
|
|
2dee3190ce | ||
|
|
1f50d2b7f7 | ||
|
|
c40a8c893d | ||
|
|
b2cc818b7a | ||
|
|
0ce86e9e44 | ||
|
|
e680f33326 | ||
|
|
69eebd9370 | ||
|
|
fb17159743 | ||
|
|
0f1a4bbf33 | ||
|
|
68b00f776a | ||
|
|
87206ed2b4 | ||
|
|
5b233da11b | ||
|
|
28f10eaf41 | ||
|
|
26061deced | ||
|
|
3f3f0dd81d | ||
|
|
4596ddae58 | ||
|
|
91b1fd5dca | ||
|
|
1b51bc8c04 | ||
|
|
0af85a3fff | ||
|
|
4ca58ed754 | ||
|
|
f640381978 | ||
|
|
761c845300 | ||
|
|
1b62cb7109 | ||
|
|
ad7aa7c8ce | ||
|
|
9cc640b866 | ||
|
|
85615300e0 | ||
|
|
5caecf9c5f | ||
|
|
a1868075ed | ||
|
|
81ecb5673f | ||
|
|
7c414e5419 | ||
|
|
8b368a3808 | ||
|
|
fef36f89f4 | ||
|
|
e9aaa85fc7 | ||
|
|
9125cc3d87 | ||
|
|
230d3bebd3 | ||
|
|
5b227c3a60 | ||
|
|
316bc14526 | ||
|
|
9bc3a67c9a | ||
|
|
a083f9c671 | ||
|
|
b7a6cb4fbc | ||
|
|
d76b264238 | ||
|
|
e02ae682a8 | ||
|
|
59b99497a7 | ||
|
|
42fb13294b | ||
|
|
a515921143 | ||
|
|
019cf9b4fb | ||
|
|
17cece598b | ||
|
|
8179611cac | ||
|
|
0a7f002217 | ||
|
|
36dcd61feb | ||
|
|
072a7ffe12 | ||
|
|
9173558a0b | ||
|
|
7cba92d420 | ||
|
|
3288467aa1 | ||
|
|
2b074ee894 | ||
|
|
33ef3dd252 | ||
|
|
bd84877f0e | ||
|
|
1258b87671 | ||
|
|
ba1bf4581d | ||
|
|
440a0c5425 | ||
|
|
74b53b4ba7 | ||
|
|
1a3065b1ca | ||
|
|
fb6fc118e3 | ||
|
|
b63c9a8cd4 | ||
|
|
203b6496fc | ||
|
|
a747657642 | ||
|
|
ba9c64f420 | ||
|
|
c2bcebdb29 | ||
|
|
f4ca576178 | ||
|
|
459f69f609 | ||
|
|
06f8322eeb | ||
|
|
84f64f45d9 | ||
|
|
6899ea1964 | ||
|
|
81c148fc4d | ||
|
|
89ebcbdb10 | ||
|
|
a38bad9648 | ||
|
|
7432ea5cc7 | ||
|
|
1c84dd1e44 | ||
|
|
078f361a39 | ||
|
|
0b1670aae5 | ||
|
|
10867b2641 | ||
|
|
a346b0df2e | ||
|
|
ba8a819c7d | ||
|
|
77a2fd70c3 | ||
|
|
1c0c7e0012 | ||
|
|
e026a8d333 | ||
|
|
650d9884b0 | ||
|
|
0d53c5487d | ||
|
|
993513c22b | ||
|
|
959db2e247 | ||
|
|
c64dec1080 | ||
|
|
da0a7cbe81 | ||
|
|
a63a784dec | ||
|
|
40c7fd8977 | ||
|
|
3e96b195a6 | ||
|
|
c8a9ebd26d | ||
|
|
63897a5666 | ||
|
|
9332f64284 | ||
|
|
3f1bb26ee5 | ||
|
|
9ca8825868 | ||
|
|
b8424f712d | ||
|
|
bc7fccfb95 | ||
|
|
605bf477ad | ||
|
|
df88cb141a | ||
|
|
5230fc9600 | ||
|
|
62aa825c0f | ||
|
|
42c6a11780 | ||
|
|
4fa024045d | ||
|
|
9542c23717 | ||
|
|
7d2d932f50 | ||
|
|
bd7bd7e802 | ||
|
|
4fc30ec4bc | ||
|
|
00458ee754 | ||
|
|
3f1f83438d | ||
|
|
f593c7d92f | ||
|
|
feeb4946d1 | ||
|
|
f671d3f624 | ||
|
|
0cd7b3b71f | ||
|
|
d80e70e2b1 | ||
|
|
f8965f1785 | ||
|
|
23f1a8225a | ||
|
|
cbb5182cea | ||
|
|
ff8f29be24 | ||
|
|
64302252c0 | ||
|
|
d768b9cc0e | ||
|
|
4bc7d7735d | ||
|
|
8aa629fc56 | ||
|
|
ec273d2928 | ||
|
|
06d767279b | ||
|
|
b1209712d1 | ||
|
|
ecf2307542 | ||
|
|
24a2467338 | ||
|
|
4c65bf8142 | ||
|
|
31d0683592 | ||
|
|
41f4c76006 | ||
|
|
d0485f98a9 | ||
|
|
ec565fa0de | ||
|
|
4f9c028676 | ||
|
|
5dff563c75 | ||
|
|
9183e0b2aa | ||
|
|
6701ce8c1a | ||
|
|
3a81e2ec27 | ||
|
|
b96f1cd7c4 | ||
|
|
50abda71cb | ||
|
|
73ffc9cf44 | ||
|
|
7decac105f | ||
|
|
89f067807b | ||
|
|
5cd9c608a7 | ||
|
|
531e86f5e7 | ||
|
|
fb6d5a6a0a | ||
|
|
fe5400a3bb | ||
|
|
9502dd9835 | ||
|
|
203ee72052 | ||
|
|
29d206bba3 | ||
|
|
110fde34ea | ||
|
|
2c2b569c6c | ||
|
|
6c83b539c8 | ||
|
|
b7a1c2cb41 | ||
|
|
cff7e2c4da | ||
|
|
59302ded0f | ||
|
|
ea32353890 | ||
|
|
0965465601 | ||
|
|
2319a8c9f4 | ||
|
|
63c5d69e10 | ||
|
|
e369695da5 | ||
|
|
775900bb14 | ||
|
|
9d3d284df7 | ||
|
|
395642f69c | ||
|
|
8d2fd22e3e | ||
|
|
e668a5089e | ||
|
|
f54f19100c | ||
|
|
4a19f609fc | ||
|
|
e109e00aa8 | ||
|
|
e1c8174b3f | ||
|
|
0986cddae1 | ||
|
|
86d28aafd6 | ||
|
|
f842e86885 | ||
|
|
5a30ba683e | ||
|
|
c102a0d858 | ||
|
|
eae5989845 | ||
|
|
f4f41cd900 | ||
|
|
078f8038e4 | ||
|
|
d5fba47dc6 | ||
|
|
3e89a53fc1 | ||
|
|
7179910bc6 | ||
|
|
12a442970e | ||
|
|
42264eb180 | ||
|
|
a31b704203 | ||
|
|
129c551fa0 | ||
|
|
d8dad44e43 | ||
|
|
e27f6f1b14 | ||
|
|
052813ba4a | ||
|
|
7a3a2f3e9a | ||
|
|
9ff3c1ab10 | ||
|
|
a0422899a5 | ||
|
|
6fb66a1d80 | ||
|
|
4d3fb5b873 | ||
|
|
af28156498 | ||
|
|
99555539a7 | ||
|
|
04d63ca931 | ||
|
|
2351dbe717 | ||
|
|
717118cfb4 | ||
|
|
3dba586f83 | ||
|
|
36a7886668 | ||
|
|
0f98e729ce | ||
|
|
ccfa904300 | ||
|
|
9e1e0142e9 | ||
|
|
3ddee56359 | ||
|
|
bbfad3a0ef | ||
|
|
026a83591d | ||
|
|
6c516cf4bf | ||
|
|
c000034cab | ||
|
|
f84ff8de92 | ||
|
|
bb73af3806 | ||
|
|
cfd0853d79 | ||
|
|
2a01a935c0 | ||
|
|
02fa97504e | ||
|
|
eb06c07fdb | ||
|
|
0f521c3af9 | ||
|
|
ee077ffa16 | ||
|
|
e358b8706f | ||
|
|
793b3e7134 | ||
|
|
0bed38c78b | ||
|
|
46f9b3d9b9 | ||
|
|
1275d7ebc4 | ||
|
|
3744dbfd5d | ||
|
|
8fb239fb8f | ||
|
|
9eb8ed1804 | ||
|
|
a3bfcf01b7 | ||
|
|
71da25eca5 | ||
|
|
217da07007 | ||
|
|
70e5ccda6f | ||
|
|
777167f46e | ||
|
|
f2952c6567 | ||
|
|
2c726f6c52 | ||
|
|
1cbfdbdac5 | ||
|
|
63544088cd | ||
|
|
bd30b1f900 | ||
|
|
35fb6f0e52 | ||
|
|
36063e2ca6 | ||
|
|
08d3578d38 | ||
|
|
2090f05236 | ||
|
|
7fbcfa391b | ||
|
|
2ab4db3a2e | ||
|
|
be6fead812 | ||
|
|
badfcb0e76 | ||
|
|
cf43685740 | ||
|
|
0bf1286c3a | ||
|
|
184123194b | ||
|
|
bc013e31c8 | ||
|
|
b31384f429 | ||
|
|
ec553f06c8 | ||
|
|
95fed87ad4 | ||
|
|
d5452d6517 | ||
|
|
e366ca9375 | ||
|
|
12caa3b214 | ||
|
|
226c3d0ce2 | ||
|
|
a1a8c6f141 | ||
|
|
1518b8d4f7 | ||
|
|
999b11deb5 | ||
|
|
30a8028827 | ||
|
|
8ad83a5f9f | ||
|
|
504b33ba2a | ||
|
|
5cbb480f6e | ||
|
|
46f49048c8 | ||
|
|
5cad037d7d | ||
|
|
75874e1ed0 | ||
|
|
9387ad1891 | ||
|
|
ca831170f4 | ||
|
|
c51b074e32 | ||
|
|
c9b58a4d9d | ||
|
|
99142f9fec | ||
|
|
46e956475a | ||
|
|
5ecfc2d437 | ||
|
|
ca2f8e1aa5 | ||
|
|
204f0b7a10 | ||
|
|
699883f2fc | ||
|
|
eefce8bab6 | ||
|
|
02ae2353d4 | ||
|
|
0671742703 | ||
|
|
1eb7e5d59a | ||
|
|
33daaf4a35 | ||
|
|
f5c492bb7e | ||
|
|
c81fc5f25b | ||
|
|
eb64f268d3 | ||
|
|
f8f5a71564 | ||
|
|
1161106d9c | ||
|
|
c6f423087d | ||
|
|
182cb2d33b | ||
|
|
49dfa7fc17 | ||
|
|
28a44631fc | ||
|
|
29b84f9281 | ||
|
|
7105e82922 | ||
|
|
8b53ca2fdc | ||
|
|
112a72ac6f | ||
|
|
46d8fb125a | ||
|
|
a44204b185 | ||
|
|
4e3a9fd9ea | ||
|
|
d4f79b1331 | ||
|
|
78e70fec3b | ||
|
|
fbfd71adcf | ||
|
|
9657e8bd40 | ||
|
|
276b93fc57 | ||
|
|
95a7365fee | ||
|
|
dad44db0bc | ||
|
|
0dca866f11 | ||
|
|
bb5bb4d4c7 | ||
|
|
b9beb6c804 | ||
|
|
782121829a | ||
|
|
5d5565e5a8 | ||
|
|
9e43955fbb | ||
|
|
25a299fb74 | ||
|
|
485c6e86bb | ||
|
|
a9454c319a | ||
|
|
712cb185b4 | ||
|
|
4e59bd0442 | ||
|
|
06e1cd15c0 | ||
|
|
273ccc648d | ||
|
|
ccf56ddec1 | ||
|
|
04c5b9e7bf | ||
|
|
36ea12e135 | ||
|
|
6b002f24a8 | ||
|
|
6fa724d7b7 | ||
|
|
02a6d0d056 | ||
|
|
28d180e850 | ||
|
|
3a1ee94acf | ||
|
|
776cea7055 | ||
|
|
4b7cd6ce6e | ||
|
|
67ef6872af | ||
|
|
3c39aeee43 | ||
|
|
e9baf4acb5 | ||
|
|
a21e2dd412 | ||
|
|
7feecb507d | ||
|
|
26f00ccaae | ||
|
|
31b9195a6e | ||
|
|
45a22e26be | ||
|
|
7dd6a7e7f3 | ||
|
|
067fb0f9f0 | ||
|
|
d34de098e5 | ||
|
|
428d016e26 | ||
|
|
15d483b332 | ||
|
|
92bb56e344 | ||
|
|
b9380b2c3a | ||
|
|
ccbc109db2 | ||
|
|
58fbbd98a4 | ||
|
|
2aae789e2a | ||
|
|
e5ff927f7d | ||
|
|
afd7aebe20 | ||
|
|
7148f27d33 | ||
|
|
6975167a77 | ||
|
|
57cddee3fd | ||
|
|
684ee545cf | ||
|
|
bff80c2dc7 | ||
|
|
acb289f6d0 | ||
|
|
05655632cc | ||
|
|
1896e1cc35 | ||
|
|
0f9ce8bbb9 | ||
|
|
8076c2d8c1 | ||
|
|
17f9464208 | ||
|
|
843cf26140 | ||
|
|
a3264c1cd1 | ||
|
|
46452edf55 | ||
|
|
d90e118f56 | ||
|
|
7cc3fc6a3a | ||
|
|
98ebd5e358 | ||
|
|
f05e37767f | ||
|
|
03c15473b9 | ||
|
|
df8f6372f1 | ||
|
|
2ec7bc1caa | ||
|
|
4f8f82f69f | ||
|
|
724daabc5a | ||
|
|
83f0f1bfe3 | ||
|
|
aac355b077 | ||
|
|
f13c961863 | ||
|
|
fefc6bc22a | ||
|
|
d42bfc7aae | ||
|
|
dc2570a408 | ||
|
|
a325470b8f | ||
|
|
c7925db0e7 | ||
|
|
dad923489b | ||
|
|
453ca5b180 | ||
|
|
9d3953f3ac | ||
|
|
db10ebf807 | ||
|
|
88a8fd2bbd | ||
|
|
8c05ad134e | ||
|
|
505931736c | ||
|
|
01af6f6855 | ||
|
|
8b163348a2 | ||
|
|
53e4bf533f | ||
|
|
33c2ee702b | ||
|
|
a7a70ce423 | ||
|
|
96e8fbfa78 | ||
|
|
bf94a20e57 | ||
|
|
65940c6df2 | ||
|
|
56f5276bae | ||
|
|
454b2b488b | ||
|
|
2eb0f76f32 | ||
|
|
9424bf7c46 | ||
|
|
fa5237179b | ||
|
|
586769fbf0 | ||
|
|
2df09c533b | ||
|
|
9d65515290 | ||
|
|
607367feb2 | ||
|
|
9f89447070 | ||
|
|
284db21a3a | ||
|
|
02374dcd57 | ||
|
|
92a18448eb | ||
|
|
a3305249a6 | ||
|
|
f9208c9d72 | ||
|
|
2c52a2f7e6 | ||
|
|
f1b9ea94dc | ||
|
|
d22eed50ad | ||
|
|
498e795e4b | ||
|
|
1794549a20 | ||
|
|
d1fcecf873 | ||
|
|
f557e9f965 | ||
|
|
7ffef849d2 | ||
|
|
448a9846c9 | ||
|
|
3188f356eb | ||
|
|
e7868868c4 | ||
|
|
208b6e73dc | ||
|
|
6993cba55a | ||
|
|
e03abc1a64 | ||
|
|
777bd5e26d | ||
|
|
a6afcc944c | ||
|
|
ae0c3c5f27 | ||
|
|
bb4fdc5b7f | ||
|
|
dfa6d6da51 | ||
|
|
81b867fa20 | ||
|
|
3aa4b8a410 | ||
|
|
f0977b48e5 | ||
|
|
baccf7e3ad | ||
|
|
97764866f2 | ||
|
|
c89926399b | ||
|
|
a38b4e063b | ||
|
|
4c22a098c1 | ||
|
|
18aa573a16 | ||
|
|
d61ade4482 | ||
|
|
920b92c096 | ||
|
|
10a2084163 | ||
|
|
e6d78f3e22 | ||
|
|
cdd5fc749c | ||
|
|
f6ec647eb6 | ||
|
|
4a73a5a6b3 | ||
|
|
286ed78436 | ||
|
|
4393523929 | ||
|
|
d9abaa2f06 | ||
|
|
88e4c26b8f | ||
|
|
f20cfb53a6 | ||
|
|
82b5ff620d | ||
|
|
44f839e104 | ||
|
|
3bbcd2a20d | ||
|
|
d0b3b27975 | ||
|
|
7345dd8076 | ||
|
|
2e57f84657 | ||
|
|
58e0f50c48 | ||
|
|
910c0e0eab | ||
|
|
709aec83e2 | ||
|
|
db94f5b405 | ||
|
|
4142d5d28a | ||
|
|
b8b4fe7a8a | ||
|
|
d5aef6fb87 | ||
|
|
78724e981c |
7
.eslintignore
Normal file
7
.eslintignore
Normal file
@@ -0,0 +1,7 @@
|
||||
.travis/*
|
||||
.idea/*
|
||||
.vscode/*
|
||||
node_modules/*
|
||||
public/*
|
||||
gulpfile.js
|
||||
webpack.mix.js
|
||||
25
.eslintrc
Normal file
25
.eslintrc
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"extends": "airbnb",
|
||||
"env": {
|
||||
"es6": true,
|
||||
"mocha": true
|
||||
},
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 8
|
||||
},
|
||||
"rules": {
|
||||
"camelcase": 0,
|
||||
"no-param-reassign": [
|
||||
2,
|
||||
{
|
||||
"props": false
|
||||
}
|
||||
],
|
||||
"import/no-extraneous-dependencies": [
|
||||
"error",
|
||||
{
|
||||
"devDependencies": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -3,7 +3,8 @@ _ide_helper.php
|
||||
/vendor
|
||||
node_modules/
|
||||
npm-debug.log
|
||||
|
||||
composer.phar
|
||||
yarn-error.log
|
||||
*.bak
|
||||
|
||||
# Laravel 4 specific
|
||||
|
||||
31
.styleci.yml
Normal file
31
.styleci.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
preset: recommended
|
||||
risky: true
|
||||
enabled:
|
||||
- align_double_arrow_minimal
|
||||
# - align_equals_minimal
|
||||
# - date_time_immutable
|
||||
- ereg_to_preg
|
||||
- function_to_constant
|
||||
# - mb_str_functions
|
||||
- modernize_types_casting
|
||||
# - native_function_invocation
|
||||
- no_blank_lines_after_return
|
||||
- no_homoglyph_names
|
||||
- no_php4_constructor
|
||||
- no_useless_else
|
||||
- phpdoc_add_missing_param_annotation
|
||||
disabled:
|
||||
- align_double_arrow
|
||||
- blank_line_before_return
|
||||
# - hash_to_slash_comment
|
||||
- phpdoc_summary
|
||||
- phpdoc_var_without_name
|
||||
# - unalign_equals
|
||||
finder:
|
||||
exclude:
|
||||
- modules
|
||||
- node_modules
|
||||
- storage
|
||||
- vendor
|
||||
name: "*.php"
|
||||
not-name: "*.blade.php"
|
||||
@@ -15,7 +15,7 @@ services:
|
||||
|
||||
before_script:
|
||||
- cp .travis/env.travis.php env.php
|
||||
- composer install --no-interaction --verbose
|
||||
- composer install --dev --no-interaction --verbose
|
||||
|
||||
script:
|
||||
- php artisan database:create --reset
|
||||
|
||||
27
.travis/Formatting.xml
Normal file
27
.travis/Formatting.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<code_scheme name="PHPVMS" version="173">
|
||||
<option name="RIGHT_MARGIN" value="100" />
|
||||
<PHPCodeStyleSettings>
|
||||
<option name="ALIGN_KEY_VALUE_PAIRS" value="true" />
|
||||
<option name="LOWER_CASE_BOOLEAN_CONST" value="true" />
|
||||
<option name="LOWER_CASE_NULL_CONST" value="true" />
|
||||
<option name="ALIGN_CLASS_CONSTANTS" value="true" />
|
||||
<option name="FORCE_SHORT_DECLARATION_ARRAY_STYLE" value="true" />
|
||||
</PHPCodeStyleSettings>
|
||||
<XML>
|
||||
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
|
||||
</XML>
|
||||
<codeStyleSettings language="JAVA">
|
||||
<indentOptions>
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="JSON">
|
||||
<indentOptions>
|
||||
<option name="INDENT_SIZE" value="4" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="PHP">
|
||||
<option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
|
||||
<option name="ALIGN_MULTILINE_ARRAY_INITIALIZER_EXPRESSION" value="true" />
|
||||
</codeStyleSettings>
|
||||
</code_scheme>
|
||||
@@ -28,40 +28,92 @@ if [ "$TRAVIS" = "true" ]; then
|
||||
|
||||
echo "Cleaning files"
|
||||
|
||||
make clean
|
||||
rm -rf vendor
|
||||
composer install --no-dev --prefer-dist --no-interaction --verbose
|
||||
|
||||
# Clean up the dependencies to remove some of the dev packages
|
||||
# declare -a remove_packages=(
|
||||
# 'barryvdh/laravel-ide-helper'
|
||||
# 'bpocallaghan/generators'
|
||||
# 'codedungeon/phpunit-result-printer'
|
||||
# 'fzaninotto/faker'
|
||||
# 'nikic/php-parser'
|
||||
# 'phpstan/phpstan'
|
||||
# 'phpunit/phpunit',
|
||||
# 'weebly/phpstan-laravel'
|
||||
# )
|
||||
#
|
||||
# for pkg in "${remove_packages[@]}"
|
||||
# do
|
||||
# composer --optimize-autoloader --no-interaction remove $pkg
|
||||
# done
|
||||
|
||||
# Leftover individual files to delete
|
||||
declare -a remove_files=(
|
||||
.git
|
||||
.sass-cache
|
||||
.idea
|
||||
.travis
|
||||
tests
|
||||
_ide_helper.php
|
||||
.dpl
|
||||
.eslintignore
|
||||
.eslintrc
|
||||
.phpstorm.meta.php
|
||||
.styleci.yml
|
||||
env.php
|
||||
config.php
|
||||
Makefile
|
||||
phpunit.xml
|
||||
phpvms.iml
|
||||
Procfile
|
||||
phpstan.neon
|
||||
node_modules
|
||||
composer.phar
|
||||
vendor/willdurand/geocoder/tests
|
||||
)
|
||||
|
||||
for file in "${remove_files[@]}"
|
||||
do
|
||||
rm -rf $file
|
||||
done
|
||||
|
||||
rm -rf env.php config.php
|
||||
find ./vendor -type d -name ".git" -print0 | xargs rm -rf
|
||||
find . -type d -name "sass-cache" -print0 | xargs rm -rf
|
||||
|
||||
# clear any app specific stuff that might have been loaded in
|
||||
find storage/app -mindepth 1 -not -name '.gitignore' -not -name public -not -name import -print0 -exec rm -rf {} +
|
||||
find storage/app/public -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
|
||||
find storage/app -mindepth 1 -not -name '.gitignore' -not -name public -print0 -exec rm -rf {} +
|
||||
find storage/framework/cache -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
|
||||
find storage/framework/sessions -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
|
||||
find storage/framework/views -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
|
||||
find storage/logs -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
|
||||
|
||||
# Remove any development files
|
||||
rm -rf .sass-cache
|
||||
rm -rf .idea phpvms.iml .travis .dpl
|
||||
rm -rf .phpstorm.meta.php _ide_helper.php phpunit.xml Procfile
|
||||
make clean
|
||||
|
||||
# remove large sized files
|
||||
rm -rf .git
|
||||
rm -rf node_modules
|
||||
rm -rf composer.phar
|
||||
|
||||
# delete files in vendor that are rather large
|
||||
rm -rf vendor/willdurand/geocoder/tests
|
||||
|
||||
echo "creating tarball"
|
||||
echo "Creating Tarball"
|
||||
cd /tmp
|
||||
tar -czf $TAR_NAME -C $TRAVIS_BUILD_DIR/../ phpvms
|
||||
sha256sum $TAR_NAME > "$TAR_NAME.sha256"
|
||||
|
||||
echo "uploading to s3"
|
||||
echo "Uploading to S3"
|
||||
mkdir -p $TRAVIS_BUILD_DIR/build
|
||||
cd $TRAVIS_BUILD_DIR/build
|
||||
|
||||
mv "/tmp/$TAR_NAME" "/tmp/$TAR_NAME.sha256" .
|
||||
artifacts upload --target-paths "/" $TAR_NAME $TRAVIS_BUILD_DIR/VERSION $TAR_NAME.sha256
|
||||
|
||||
# Upload the version for a tagged release. Move to a version file in different
|
||||
# tags. Within phpVMS, we have an option of which version to track in the admin
|
||||
if test "$TRAVIS_TAG"; then
|
||||
echo "Uploading release version file"
|
||||
cp "$TRAVIS_BUILD_DIR/VERSION" release_version
|
||||
artifacts upload --target-paths "/" release_version
|
||||
else
|
||||
echo "Uploading ${TRAVIS_BRANCH}_version file"
|
||||
cp $TRAVIS_BUILD_DIR/VERSION ${TRAVIS_BRANCH}_version
|
||||
artifacts upload --target-paths "/" ${TRAVIS_BRANCH}_version
|
||||
fi
|
||||
|
||||
curl -X POST --data "{\"content\": \"A new build is available at http://downloads.phpvms.net/$TAR_NAME ($VERSION)\"}" -H "Content-Type: application/json" $DISCORD_WEBHOOK_URL
|
||||
fi
|
||||
|
||||
23
CHANGELOG.md
23
CHANGELOG.md
@@ -1,3 +1,26 @@
|
||||
## Alpha 3
|
||||
|
||||
!! Please do a complete reinstall, with a new database
|
||||
|
||||
- Finances! The finance portions have been implemented, you can [read about them here](http://docs.phpvms.net/concepts/finances)
|
||||
- Awards! Added the award plugin system. [see docs](http://docs.phpvms.net/customizing/awards)
|
||||
- Import/Export in admin panel for aircraft, airports, expenses, fares, flights and subfleets
|
||||
- Changed theme system to using [laravel-theme](https://github.com/igaster/laravel-theme), there are changes to making theming much simpler with much more flexibility.
|
||||
- Added cron task for background tasks
|
||||
- Expanded on flight types to match IATA SIMM format
|
||||
- Added subfleet `cost_block_hour`
|
||||
- Fixed several security vulnerabilities (thanks magicflyer!)
|
||||
- Fuel units changed to lbs/kgs [#193](https://github.com/nabeelio/phpvms/issues/193)
|
||||
- Airports can be restricted to only hubs on registration/user profile
|
||||
- Cleaned up a lot unused icons and files [#195](https://github.com/nabeelio/phpvms/issues/195)
|
||||
- Rank restrictions for PIREPs are respected [#170](https://github.com/nabeelio/phpvms/issues/170)
|
||||
- API: Added the ability to get/update/delete user bids [#172](https://github.com/nabeelio/phpvms/issues/172)
|
||||
- API: Added `block_time` parameter for PIREP prefile/update/file calls
|
||||
- API: Added `block_on_time` and `block_off_time` for PIREP prefile/update/file calls
|
||||
- Artisan: Added a `phpvms:csv-import [table] [file]` to import from CSV
|
||||
- Artisan: Added a `phpvms:yaml-export [tables]` to export tables to YAML files which can be re-imported using `phpvms:yaml-import`
|
||||
- Numerous bug fixes
|
||||
|
||||
## Alpha 2 (2018-02-23, v7.0.0-alpha2)
|
||||
|
||||
!! Please do a full reinstall, with recreating the database
|
||||
|
||||
15
Makefile
15
Makefile
@@ -36,8 +36,7 @@ build:
|
||||
# This is to build all the stylesheets, etc
|
||||
.PHONY: build-assets
|
||||
build-assets:
|
||||
npm update
|
||||
npm run dev
|
||||
yarn run dev
|
||||
|
||||
.PHONY: install
|
||||
install: build
|
||||
@@ -53,17 +52,13 @@ update: build
|
||||
@echo "Done!"
|
||||
|
||||
.PHONY: reset
|
||||
reset: clean
|
||||
reset: cleanapp/Models/Traits/JournalTrait.php
|
||||
@php $(COMPOSER) dump-autoload
|
||||
@make reload-db
|
||||
|
||||
.PHONY: reload-db
|
||||
reload-db:
|
||||
@php artisan database:create --reset
|
||||
@php artisan migrate:fresh --seed
|
||||
@php artisan phpvms:import app/Database/seeds/sample.yml
|
||||
@php artisan phpvms:import app/Database/seeds/acars.yml
|
||||
#php artisan phpvms:navdata
|
||||
@php artisan phpvms:dev-install --reset-db
|
||||
|
||||
.PHONY: tests
|
||||
tests: test
|
||||
@@ -73,6 +68,10 @@ test:
|
||||
#php artisan database:create --reset
|
||||
vendor/bin/phpunit --debug --verbose
|
||||
|
||||
.PHONY:
|
||||
phpstan:
|
||||
vendor/bin/phpstan analyse -c phpstan.neon -v --level 2 app
|
||||
|
||||
.PHONY: replay-acars
|
||||
replay-acars:
|
||||
#@php artisan phpvms:replay AAL10,AAL3113,BAW172,DAL988,FIN6,MSR986 --manual
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# phpvms <sup>7</sup>
|
||||
|
||||
[](https://travis-ci.org/nabeelio/phpvms) [](https://www.codacy.com/app/nabeelio/phpvms?utm_source=github.com&utm_medium=referral&utm_content=nabeelio/phpvms&utm_campaign=Badge_Grade) [](https://packagist.org/packages/nabeel/phpvms) [](https://packagist.org/packages/nabeel/phpvms) [](https://packagist.org/packages/nabeel/phpvms) [](https://packagist.org/packages/nabeel/phpvms)
|
||||
[](https://travis-ci.org/nabeelio/phpvms) [](https://www.codacy.com/app/nabeelio/phpvms?utm_source=github.com&utm_medium=referral&utm_content=nabeelio/phpvms&utm_campaign=Badge_Grade) [](https://packagist.org/packages/nabeel/phpvms)  [](https://packagist.org/packages/nabeel/phpvms)
|
||||
|
||||
The next phpvms version built on the laravel framework. work in progress. If you're looking for
|
||||
the old, phpVMS classic, it's [available here](https://github.com/nabeelio/phpvms_v2).
|
||||
@@ -25,11 +25,11 @@ The latest documentation, with installation instructions is available
|
||||
- Database:
|
||||
- MySQL 5.5+ (or MySQL variant, including MariaDB and Percona)
|
||||
|
||||
[View more details on requirements](http://docs.phpvms.net/basics/requirements)
|
||||
[View more details on requirements](http://docs.phpvms.net/setup/requirements)
|
||||
|
||||
## Installer
|
||||
|
||||
1. Upload to your server
|
||||
2. Visit the site, and follow the link to the installer
|
||||
|
||||
[View installation details](http://docs.phpvms.net/basics/installation)
|
||||
[View installation details](http://docs.phpvms.net/setup/installation)
|
||||
|
||||
50
app/Awards/PilotFlightAwards.php
Normal file
50
app/Awards/PilotFlightAwards.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Awards;
|
||||
|
||||
use App\Interfaces\Award;
|
||||
|
||||
/**
|
||||
* Simple example of an awards class, where you can apply an award when a user
|
||||
* has 100 flights. All award classes need to extend the AwardInterface
|
||||
*/
|
||||
class PilotFlightAwards extends Award
|
||||
{
|
||||
/**
|
||||
* Set the name of this award class to make it easier to see when
|
||||
* assigning to a specific award
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name = 'Pilot Flights';
|
||||
|
||||
/**
|
||||
* The description to show under the parameters field, so the admin knows
|
||||
* what the parameter actually controls. You can leave this blank if there
|
||||
* isn't a parameter.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $param_description = 'The number of flights at which to give this award';
|
||||
|
||||
/**
|
||||
* If the user has over N flights, then we can give them this award. This method
|
||||
* only needs to return a true or false of whether it should be awarded or not.
|
||||
*
|
||||
* If no parameter is passed in, just default it to 100. You should check if there
|
||||
* is a parameter or not. You can call it whatever you want, since that would make
|
||||
* sense with the $param_description.
|
||||
*
|
||||
* @param int|null $number_of_flights The parameters passed in from the UI
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function check($number_of_flights = null): bool
|
||||
{
|
||||
if (!$number_of_flights) {
|
||||
$number_of_flights = 100;
|
||||
}
|
||||
|
||||
return $this->user->flights >= $number_of_flights;
|
||||
}
|
||||
}
|
||||
@@ -7,31 +7,22 @@ use Illuminate\Contracts\Foundation\Application;
|
||||
|
||||
/**
|
||||
* Class LoadConfiguration
|
||||
* @package App\Bootstrap
|
||||
*
|
||||
* I'm overriding this to take advantage of the configuration caching
|
||||
* and not needing to read the files from disk every time.
|
||||
*
|
||||
* Hopefully it won't affect anything within core framework but this
|
||||
* should be ok. Will just have to be cognizant of any changes to the
|
||||
* LoadConfiguration parent class, or if the Kernel changes the boot
|
||||
* order -NS
|
||||
*/
|
||||
class LoadConfiguration extends \Illuminate\Foundation\Bootstrap\LoadConfiguration
|
||||
{
|
||||
/**
|
||||
* Load the configuration items from all of the files.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Foundation\Application $app
|
||||
* @param \Illuminate\Contracts\Config\Repository $repository
|
||||
* @return void
|
||||
* @param \Illuminate\Contracts\Foundation\Application $app
|
||||
* @param \Illuminate\Contracts\Config\Repository $repository
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
protected function loadConfigurationFiles(Application $app, RepositoryContract $repository)
|
||||
{
|
||||
parent::loadConfigurationFiles($app, $repository);
|
||||
|
||||
/**
|
||||
/*
|
||||
* Read in the base config, only if it exists
|
||||
*/
|
||||
if (file_exists($app->basePath().'/config.php')) {
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Symfony\Component\Process\Process;
|
||||
|
||||
class BaseCommand extends Command
|
||||
{
|
||||
|
||||
/**
|
||||
* Streaming file read
|
||||
* @param $filename
|
||||
* @return \Generator
|
||||
*/
|
||||
public function readFile($filename)
|
||||
{
|
||||
$fp = fopen($filename, 'rb');
|
||||
|
||||
while (($line = fgets($fp)) !== false) {
|
||||
$line = rtrim($line, "\r\n");
|
||||
if ($line[0] === ';') {
|
||||
continue;
|
||||
}
|
||||
|
||||
yield $line;
|
||||
}
|
||||
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $cmd
|
||||
* @param bool $return
|
||||
* @return string
|
||||
*/
|
||||
public function runCommand($cmd, $return=false, $verbose=true)
|
||||
{
|
||||
if (\is_array($cmd)) {
|
||||
$cmd = join(' ', $cmd);
|
||||
}
|
||||
|
||||
if($verbose) {
|
||||
$this->info('Running "' . $cmd . '"');
|
||||
}
|
||||
|
||||
$val = '';
|
||||
$process = new Process($cmd);
|
||||
$process->run(function ($type, $buffer) use ($return, $val) {
|
||||
if ($return) {
|
||||
$val .= $buffer;
|
||||
} else {
|
||||
echo $buffer;
|
||||
}
|
||||
|
||||
/*if (Process::ERR === $type) {
|
||||
echo $buffer;
|
||||
} else {
|
||||
echo $buffer;
|
||||
}*/
|
||||
});
|
||||
|
||||
return $val;
|
||||
}
|
||||
}
|
||||
106
app/Console/Command.php
Normal file
106
app/Console/Command.php
Normal file
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console;
|
||||
|
||||
use Log;
|
||||
use Symfony\Component\Process\Process;
|
||||
|
||||
/**
|
||||
* Class BaseCommand
|
||||
*/
|
||||
abstract class Command extends \Illuminate\Console\Command
|
||||
{
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
abstract public function handle();
|
||||
|
||||
/**
|
||||
* Splice the logger and replace the active handlers with
|
||||
* the handlers from the "cron" stack in config/logging.php
|
||||
*
|
||||
* Close out any of the existing handlers so we don't leave
|
||||
* file descriptors leaking around
|
||||
*
|
||||
* @param string $channel_name Channel name to grab the handlers from
|
||||
*/
|
||||
public function redirectLoggingToStdout($channel_name): void
|
||||
{
|
||||
$logger = app(\Illuminate\Log\Logger::class);
|
||||
|
||||
// Close the existing loggers
|
||||
try {
|
||||
$handlers = $logger->getHandlers();
|
||||
foreach ($handlers as $handler) {
|
||||
$handler->close();
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$this->error('Error closing handlers: '.$e->getMessage());
|
||||
}
|
||||
|
||||
// Open the handlers for the channel name,
|
||||
// and then set them to the main logger
|
||||
try {
|
||||
$logger->setHandlers(
|
||||
Log::channel($channel_name)->getHandlers()
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
$this->error('Couldn\'t splice the logger: '.$e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Streaming file reader
|
||||
*
|
||||
* @param $filename
|
||||
*
|
||||
* @return \Generator
|
||||
*/
|
||||
public function readFile($filename): ?\Generator
|
||||
{
|
||||
$fp = fopen($filename, 'rb');
|
||||
while (($line = fgets($fp)) !== false) {
|
||||
$line = rtrim($line, "\r\n");
|
||||
if ($line[0] === ';') {
|
||||
continue;
|
||||
}
|
||||
|
||||
yield $line;
|
||||
}
|
||||
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $cmd
|
||||
* @param bool $return
|
||||
* @param mixed $verbose
|
||||
*
|
||||
* @throws \Symfony\Component\Process\Exception\RuntimeException
|
||||
* @throws \Symfony\Component\Process\Exception\LogicException
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function runCommand($cmd, $return = false, $verbose = true): string
|
||||
{
|
||||
if (\is_array($cmd)) {
|
||||
$cmd = implode(' ', $cmd);
|
||||
}
|
||||
|
||||
if ($verbose) {
|
||||
$this->info('Running "'.$cmd.'"');
|
||||
}
|
||||
|
||||
$val = '';
|
||||
$process = new Process($cmd);
|
||||
$process->run(function ($type, $buffer) use ($return, &$val) {
|
||||
if ($return) {
|
||||
$val .= $buffer;
|
||||
} else {
|
||||
echo $buffer;
|
||||
}
|
||||
});
|
||||
|
||||
return $val;
|
||||
}
|
||||
}
|
||||
@@ -2,24 +2,29 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Console\BaseCommand;
|
||||
use App\Console\Command;
|
||||
use App\Facades\Utils;
|
||||
use GuzzleHttp\Client;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
|
||||
class AcarsReplay extends BaseCommand
|
||||
/**
|
||||
* Class AcarsReplay
|
||||
*/
|
||||
class AcarsReplay extends Command
|
||||
{
|
||||
protected $signature = 'phpvms:replay {files} {--manual} {--write-all} {--no-submit}';
|
||||
protected $description = 'Replay an ACARS file';
|
||||
|
||||
/**
|
||||
* API Key to post as
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $apiKey = 'testadminapikey';
|
||||
|
||||
/**
|
||||
* For automatic updates, how many seconds to sleep between updates
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $sleepTime = 10;
|
||||
@@ -35,7 +40,6 @@ class AcarsReplay extends BaseCommand
|
||||
*/
|
||||
protected $httpClient;
|
||||
|
||||
|
||||
/**
|
||||
* Return an instance of an HTTP client all ready to post
|
||||
*/
|
||||
@@ -45,148 +49,159 @@ class AcarsReplay extends BaseCommand
|
||||
|
||||
$this->httpClient = new Client([
|
||||
'base_uri' => config('app.url'),
|
||||
'headers' => [
|
||||
'headers' => [
|
||||
'Authorization' => $this->apiKey,
|
||||
]
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
/*protected function getArguments()
|
||||
{
|
||||
return [
|
||||
['--files', InputOption::VALUE_OPTIONAL]
|
||||
];
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Make a request to start a PIREP
|
||||
*
|
||||
* @param \stdClass $flight
|
||||
*
|
||||
* @throws \RuntimeException
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function startPirep($flight): string
|
||||
{
|
||||
# convert the planned flight time to be completely in minutes
|
||||
$pft = Utils::hoursToMinutes($flight->planned_hrsenroute,
|
||||
$flight->planned_minenroute);
|
||||
// convert the planned flight time to be completely in minutes
|
||||
$pft = Utils::hoursToMinutes(
|
||||
$flight->planned_hrsenroute,
|
||||
$flight->planned_minenroute
|
||||
);
|
||||
|
||||
$flight_number = substr($flight->callsign, 3);
|
||||
|
||||
$response = $this->httpClient->post('/api/pireps/prefile', [
|
||||
'json' => [
|
||||
'airline_id' => 1,
|
||||
'flight_number' => $flight_number,
|
||||
'aircraft_id' => 1,
|
||||
'dpt_airport_id' => $flight->planned_depairport,
|
||||
'arr_airport_id' => $flight->planned_destairport,
|
||||
'level' => $flight->planned_altitude,
|
||||
'planned_flight_time' => $pft,
|
||||
'route' => $flight->planned_route,
|
||||
]
|
||||
'airline_id' => 1,
|
||||
'flight_number' => $flight_number,
|
||||
'aircraft_id' => 1,
|
||||
'dpt_airport_id' => $flight->planned_depairport,
|
||||
'arr_airport_id' => $flight->planned_destairport,
|
||||
'level' => $flight->planned_altitude,
|
||||
'planned_flight_time' => $pft,
|
||||
'route' => $flight->planned_route,
|
||||
],
|
||||
]);
|
||||
|
||||
$body = \json_decode($response->getBody()->getContents());
|
||||
|
||||
return $body->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mark the PIREP as filed
|
||||
*
|
||||
* @param $pirep_id
|
||||
*
|
||||
* @throws \RuntimeException
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
protected function filePirep($pirep_id)
|
||||
{
|
||||
$response = $this->httpClient->post('/api/pireps/'.$pirep_id.'/file', [
|
||||
'json'=> []
|
||||
'json' => [],
|
||||
]);
|
||||
|
||||
$body = \json_decode($response->getBody()->getContents());
|
||||
|
||||
return $body;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $pirep_id
|
||||
* @param $data
|
||||
*
|
||||
* @throws \RuntimeException
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function postUpdate($pirep_id, $data)
|
||||
{
|
||||
$uri = '/api/pireps/' . $pirep_id . '/acars/position';
|
||||
$uri = '/api/pireps/'.$pirep_id.'/acars/position';
|
||||
|
||||
$position = [
|
||||
'log' => '',
|
||||
'lat' => $data->latitude,
|
||||
'lon' => $data->longitude,
|
||||
'heading' => $data->heading,
|
||||
'altitude' => $data->altitude,
|
||||
'gs' => $data->groundspeed,
|
||||
'log' => '',
|
||||
'lat' => $data->latitude,
|
||||
'lon' => $data->longitude,
|
||||
'heading' => $data->heading,
|
||||
'altitude' => $data->altitude,
|
||||
'gs' => $data->groundspeed,
|
||||
'transponder' => $data->transponder,
|
||||
];
|
||||
|
||||
$upd = [
|
||||
'positions' => [
|
||||
$position
|
||||
]
|
||||
$position,
|
||||
],
|
||||
];
|
||||
|
||||
$this->info("Update: $data->callsign, $position[lat] x $position[lon] \t\t"
|
||||
. "hdg: $position[heading]\t\talt: $position[altitude]\t\tgs: $position[gs]");
|
||||
."hdg: $position[heading]\t\talt: $position[altitude]\t\tgs: $position[gs]");
|
||||
|
||||
$response = $this->httpClient->post($uri, [
|
||||
'json' => $upd
|
||||
'json' => $upd,
|
||||
]);
|
||||
|
||||
$body = \json_decode($response->getBody()->getContents());
|
||||
|
||||
return [
|
||||
$data->callsign,
|
||||
$position['lat'],
|
||||
$position['lon'],
|
||||
$position['heading'],
|
||||
$position['altitude'],
|
||||
$position['gs']
|
||||
$position['gs'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse this file and run the updates
|
||||
*
|
||||
* @param array $files
|
||||
*
|
||||
* @throws \RuntimeException
|
||||
*/
|
||||
protected function updatesFromFile(array $files)
|
||||
{
|
||||
/**
|
||||
* @var $flights Collection
|
||||
*/
|
||||
$flights = collect($files)->transform(function ($f)
|
||||
{
|
||||
$file = storage_path('/replay/' . $f . '.json');
|
||||
$flights = collect($files)->transform(function ($f) {
|
||||
$file = storage_path('/replay/'.$f.'.json');
|
||||
if (file_exists($file)) {
|
||||
$this->info('Loading ' . $file);
|
||||
$this->info('Loading '.$file);
|
||||
$contents = file_get_contents($file);
|
||||
$contents = \json_decode($contents);
|
||||
|
||||
return collect($contents->updates);
|
||||
} else {
|
||||
$this->error($file . ' not found, skipping');
|
||||
return false;
|
||||
}
|
||||
$this->error($file.' not found, skipping');
|
||||
|
||||
return false;
|
||||
})
|
||||
# remove any of errored file entries
|
||||
// remove any of errored file entries
|
||||
->filter(function ($value, $key) {
|
||||
return $value !== false;
|
||||
});
|
||||
|
||||
$this->info('Starting playback');
|
||||
|
||||
/**
|
||||
/*
|
||||
* File the initial pirep to get a "preflight" status
|
||||
*/
|
||||
$flights->each(function ($updates, $idx)
|
||||
{
|
||||
$flights->each(function ($updates, $idx) {
|
||||
$update = $updates->first();
|
||||
$pirep_id = $this->startPirep($update);
|
||||
$this->pirepList[$update->callsign] = $pirep_id;
|
||||
$this->info('Prefiled ' . $update->callsign . ', ID: ' . $pirep_id);
|
||||
$this->info('Prefiled '.$update->callsign.', ID: '.$pirep_id);
|
||||
});
|
||||
|
||||
/**
|
||||
/*
|
||||
* Iterate through all of the flights, retrieving the updates
|
||||
* from each individual flight. Remove the update. Continue through
|
||||
* until there are no updates left, at which point we remove the flight
|
||||
@@ -201,15 +216,15 @@ class AcarsReplay extends BaseCommand
|
||||
|
||||
$this->postUpdate($pirep_id, $update);
|
||||
|
||||
# we're done and don't put the "no-submit" option
|
||||
if($updates->count() === 0 && !$this->option('no-submit')) {
|
||||
// we're done and don't put the "no-submit" option
|
||||
if ($updates->count() === 0 && !$this->option('no-submit')) {
|
||||
$this->filePirep($pirep_id);
|
||||
}
|
||||
})->filter(function ($updates, $idx) {
|
||||
return $updates->count() > 0;
|
||||
});
|
||||
|
||||
if(!$this->option('write-all')) {
|
||||
if (!$this->option('write-all')) {
|
||||
if (!$this->option('manual')) {
|
||||
sleep($this->sleepTime);
|
||||
} else {
|
||||
@@ -222,9 +237,11 @@ class AcarsReplay extends BaseCommand
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @throws \RuntimeException
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
public function handle(): void
|
||||
{
|
||||
$files = $this->argument('files');
|
||||
$manual_mode = $this->option('manual');
|
||||
@@ -232,6 +249,7 @@ class AcarsReplay extends BaseCommand
|
||||
if ($this->option('write-all')) {
|
||||
$this->info('In "dump-all" mode, just writing it all in');
|
||||
} else {
|
||||
/* @noinspection NestedPositiveIfStatementsInspection */
|
||||
if (!$manual_mode) {
|
||||
$this->info('Going to send updates every 10s');
|
||||
} else {
|
||||
|
||||
43
app/Console/Commands/ComposerCommand.php
Normal file
43
app/Console/Commands/ComposerCommand.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Console\Command;
|
||||
use Artisan;
|
||||
|
||||
/**
|
||||
* Class ComposerCommand
|
||||
*/
|
||||
class ComposerCommand extends Command
|
||||
{
|
||||
protected $signature = 'phpvms:composer {cmd}';
|
||||
protected $description = 'Composer related tasks';
|
||||
|
||||
/**
|
||||
* Run composer update related commands
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
switch (trim($this->argument('cmd'))) {
|
||||
case 'post-update':
|
||||
$this->postUpdate();
|
||||
break;
|
||||
default:
|
||||
$this->error('Command exists');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Any composer post update tasks
|
||||
*/
|
||||
protected function postUpdate(): void
|
||||
{
|
||||
if (config('app.env') === 'dev') {
|
||||
/* @noinspection NestedPositiveIfStatementsInspection */
|
||||
if (class_exists(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class)) {
|
||||
Artisan::call('ide-helper:generate');
|
||||
Artisan::call('ide-helper:meta');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,15 +2,21 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Console\BaseCommand;
|
||||
use App\Console\Command;
|
||||
use Log;
|
||||
|
||||
class CreateDatabase extends BaseCommand
|
||||
/**
|
||||
* Class CreateDatabase
|
||||
*/
|
||||
class CreateDatabase extends Command
|
||||
{
|
||||
protected $signature = 'database:create {--reset} {--conn=?}';
|
||||
protected $description = 'Create a database';
|
||||
protected $os;
|
||||
|
||||
/**
|
||||
* CreateDatabase constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
@@ -19,31 +25,35 @@ class CreateDatabase extends BaseCommand
|
||||
|
||||
/**
|
||||
* Create the mysql database
|
||||
*
|
||||
* @param $dbkey
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function create_mysql($dbkey)
|
||||
{
|
||||
$host = config($dbkey . 'host');
|
||||
$port = config($dbkey . 'port');
|
||||
$name = config($dbkey . 'database');
|
||||
$user = config($dbkey . 'username');
|
||||
$pass = config($dbkey . 'password');
|
||||
$host = config($dbkey.'host');
|
||||
$port = config($dbkey.'port');
|
||||
$name = config($dbkey.'database');
|
||||
$user = config($dbkey.'username');
|
||||
$pass = config($dbkey.'password');
|
||||
|
||||
$dbSvc = new \App\Console\Services\Database();
|
||||
|
||||
$dsn = $dbSvc->createDsn($host, $port);
|
||||
Log::info('Connection string: ' . $dsn);
|
||||
Log::info('Connection string: '.$dsn);
|
||||
|
||||
try {
|
||||
$conn = $dbSvc->createPDO($dsn, $user, $pass);
|
||||
} catch (\PDOException $e) {
|
||||
Log::error($e);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->option('reset') === true) {
|
||||
$sql = "DROP DATABASE IF EXISTS `$name`";
|
||||
|
||||
try {
|
||||
Log::info('Dropping database: '.$sql);
|
||||
$conn->exec($sql);
|
||||
@@ -59,12 +69,14 @@ class CreateDatabase extends BaseCommand
|
||||
$conn->exec($sql);
|
||||
} catch (\PDOException $e) {
|
||||
Log::error($e);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the sqlite database
|
||||
*
|
||||
* @param $dbkey
|
||||
*/
|
||||
protected function create_sqlite($dbkey)
|
||||
@@ -75,14 +87,14 @@ class CreateDatabase extends BaseCommand
|
||||
}
|
||||
|
||||
if ($this->option('reset') === true) {
|
||||
$cmd = ['rm', '-rf', config($dbkey . 'database')];
|
||||
$cmd = ['rm', '-rf', config($dbkey.'database')];
|
||||
$this->runCommand($cmd);
|
||||
}
|
||||
|
||||
if (!file_exists(config($dbkey . 'database'))) {
|
||||
if (!file_exists(config($dbkey.'database'))) {
|
||||
$cmd = [
|
||||
$exec,
|
||||
config($dbkey . 'database'),
|
||||
config($dbkey.'database'),
|
||||
'""',
|
||||
];
|
||||
|
||||
@@ -108,21 +120,17 @@ class CreateDatabase extends BaseCommand
|
||||
}
|
||||
}*/
|
||||
|
||||
$this->info('Using connection "' . config('database.default') . '"');
|
||||
$this->info('Using connection "'.config('database.default').'"');
|
||||
|
||||
$conn = config('database.default');
|
||||
$dbkey = 'database.connections.' . $conn . '.';
|
||||
$dbkey = 'database.connections.'.$conn.'.';
|
||||
|
||||
if (config($dbkey . 'driver') === 'mysql') {
|
||||
if (config($dbkey.'driver') === 'mysql') {
|
||||
$this->create_mysql($dbkey);
|
||||
}
|
||||
|
||||
elseif (config($dbkey . 'driver') === 'sqlite') {
|
||||
} elseif (config($dbkey.'driver') === 'sqlite') {
|
||||
$this->create_sqlite($dbkey);
|
||||
}
|
||||
|
||||
// TODO: Eventually
|
||||
elseif (config($dbkey . 'driver') === 'postgres') {
|
||||
} // TODO: Eventually
|
||||
elseif (config($dbkey.'driver') === 'postgres') {
|
||||
$this->create_postgres($dbkey);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,19 +2,36 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Console\BaseCommand;
|
||||
use App\Console\Command;
|
||||
use App\Models\Acars;
|
||||
use App\Models\Airline;
|
||||
use App\Models\Pirep;
|
||||
use App\Models\User;
|
||||
use App\Services\AwardService;
|
||||
use App\Services\DatabaseService;
|
||||
use DB;
|
||||
use PDO;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
class DevCommands extends BaseCommand
|
||||
/**
|
||||
* Class DevCommands
|
||||
*/
|
||||
class DevCommands extends Command
|
||||
{
|
||||
protected $signature = 'phpvms {cmd} {param?}';
|
||||
protected $description = 'Developer commands';
|
||||
protected $dbSvc;
|
||||
|
||||
/**
|
||||
* DevCommands constructor.
|
||||
*
|
||||
* @param DatabaseService $dbSvc
|
||||
*/
|
||||
public function __construct(DatabaseService $dbSvc)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbSvc = $dbSvc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run dev related commands
|
||||
@@ -29,14 +46,16 @@ class DevCommands extends BaseCommand
|
||||
}
|
||||
|
||||
$commands = [
|
||||
'clear-acars' => 'clearAcars',
|
||||
'clear-users' => 'clearUsers',
|
||||
'list-awards' => 'listAwardClasses',
|
||||
'clear-acars' => 'clearAcars',
|
||||
'clear-users' => 'clearUsers',
|
||||
'compile-assets' => 'compileAssets',
|
||||
'db-attrs' => 'dbAttrs',
|
||||
'xml-to-yaml' => 'xmlToYaml',
|
||||
'db-attrs' => 'dbAttrs',
|
||||
'manual-insert' => 'manualInsert',
|
||||
'xml-to-yaml' => 'xmlToYaml',
|
||||
];
|
||||
|
||||
if(!array_key_exists($command, $commands)) {
|
||||
if (!array_key_exists($command, $commands)) {
|
||||
$this->error('Command not found!');
|
||||
exit();
|
||||
}
|
||||
@@ -44,12 +63,29 @@ class DevCommands extends BaseCommand
|
||||
$this->{$commands[$command]}();
|
||||
}
|
||||
|
||||
/**
|
||||
* List all award classes
|
||||
*/
|
||||
protected function listAwardClasses()
|
||||
{
|
||||
$awardSvc = app(AwardService::class);
|
||||
$awards = $awardSvc->findAllAwardClasses();
|
||||
|
||||
$headers = ['Award Name', 'Class'];
|
||||
$formatted_awards = [];
|
||||
foreach ($awards as $award) {
|
||||
$formatted_awards[] = [$award->name, \get_class($award)];
|
||||
}
|
||||
|
||||
$this->table($headers, $formatted_awards);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all the data from the ACARS and PIREP tables
|
||||
*/
|
||||
protected function clearAcars()
|
||||
{
|
||||
if(config('database.default') === 'mysql') {
|
||||
if (config('database.default') === 'mysql') {
|
||||
DB::statement('SET foreign_key_checks=0');
|
||||
}
|
||||
|
||||
@@ -103,7 +139,7 @@ class DevCommands extends BaseCommand
|
||||
$server_version = $pdo->getAttribute(PDO::ATTR_SERVER_VERSION);
|
||||
$emulate_prepares = version_compare($server_version, $emulate_prepares_below_version, '<');
|
||||
|
||||
$this->info('Server Version: '. $server_version);
|
||||
$this->info('Server Version: '.$server_version);
|
||||
$this->info('Emulate Prepares: '.$emulate_prepares);
|
||||
|
||||
$pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, $emulate_prepares);
|
||||
@@ -115,7 +151,7 @@ class DevCommands extends BaseCommand
|
||||
protected function xmlToYaml()
|
||||
{
|
||||
$file = $this->argument('param');
|
||||
$this->info('Reading '. $file);
|
||||
$this->info('Reading '.$file);
|
||||
|
||||
$xml_str = file_get_contents($file);
|
||||
$xml = new \SimpleXMLElement($xml_str);
|
||||
@@ -129,7 +165,7 @@ class DevCommands extends BaseCommand
|
||||
|
||||
foreach ($xml->database->table_data->row as $row) {
|
||||
$yaml_row = [];
|
||||
foreach($row->field as $field) {
|
||||
foreach ($row->field as $field) {
|
||||
$fname = (string) $field['name'];
|
||||
$fvalue = (string) $field;
|
||||
|
||||
@@ -137,13 +173,43 @@ class DevCommands extends BaseCommand
|
||||
}
|
||||
|
||||
$yaml[$table_name][] = $yaml_row;
|
||||
++$count;
|
||||
$count++;
|
||||
}
|
||||
|
||||
$this->info('Exporting '.$count.' rows');
|
||||
|
||||
$file_name = $table_name.'.yml';
|
||||
file_put_contents(storage_path($file_name), Yaml::dump($yaml, 4, 2));
|
||||
$this->info('Writing yaml to storage: '. $file_name);
|
||||
$this->info('Writing yaml to storage: '.$file_name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert the rows from the file, manually advancing each row
|
||||
*/
|
||||
protected function manualInsert(): void
|
||||
{
|
||||
$file = $this->argument('param');
|
||||
$this->info('Reading '.$file);
|
||||
|
||||
if (!file_exists($file)) {
|
||||
$this->error('File '.$file.' doesn\'t exist');
|
||||
exit;
|
||||
}
|
||||
|
||||
$yml = Yaml::parse(file_get_contents($file));
|
||||
foreach ($yml as $table => $rows) {
|
||||
$this->info('Importing table '.$table);
|
||||
$this->info('Number of rows: '.\count($rows));
|
||||
|
||||
foreach ($rows as $row) {
|
||||
try {
|
||||
$this->dbSvc->insert_row($table, $row);
|
||||
} catch (\Exception $e) {
|
||||
$this->error($e);
|
||||
}
|
||||
|
||||
$this->confirm('Insert next row?', true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,63 +2,65 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Console\BaseCommand;
|
||||
use App\Console\Command;
|
||||
use Modules\Installer\Services\ConfigService;
|
||||
|
||||
/**
|
||||
* Create a fresh development install
|
||||
* @package App\Console\Commands
|
||||
*/
|
||||
class DevInstall extends BaseCommand
|
||||
class DevInstall extends Command
|
||||
{
|
||||
protected $signature = 'phpvms:dev-install {--reset-db}';
|
||||
protected $signature = 'phpvms:dev-install {--reset-db} {--reset-configs}';
|
||||
protected $description = 'Run a developer install and run the sample migration';
|
||||
|
||||
/**
|
||||
* The YAML files with sample data to import
|
||||
*/
|
||||
protected $yaml_imports = [
|
||||
'sample.yml',
|
||||
'acars.yml',
|
||||
];
|
||||
|
||||
/**
|
||||
* Run dev related commands
|
||||
*
|
||||
* @throws \Symfony\Component\HttpFoundation\File\Exception\FileException
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
if(!$this->option('reset-db')) {
|
||||
if ($this->option('reset-configs')) {
|
||||
$this->rewriteConfigs();
|
||||
}
|
||||
|
||||
# Reload the configuration
|
||||
// Reload the configuration
|
||||
\App::boot();
|
||||
|
||||
$this->info('Recreating database');
|
||||
\Artisan::call('database:create', [
|
||||
$this->call('database:create', [
|
||||
'--reset' => true,
|
||||
]);
|
||||
|
||||
$this->info(\Artisan::output());
|
||||
|
||||
#
|
||||
#
|
||||
|
||||
$this->info('Running migrations');
|
||||
\Artisan::call('migrate:fresh', [
|
||||
$this->call('migrate:fresh', [
|
||||
'--seed' => true,
|
||||
]);
|
||||
|
||||
$this->info(\Artisan::output());
|
||||
|
||||
#
|
||||
#
|
||||
//
|
||||
//
|
||||
|
||||
$this->info('Importing sample data');
|
||||
\Artisan::call('phpvms:import', [
|
||||
'files' => ['app/Database/seeds/sample.yml'],
|
||||
]);
|
||||
|
||||
$this->info(\Artisan::output());
|
||||
foreach ($this->yaml_imports as $yml) {
|
||||
$this->call('phpvms:yaml-import', [
|
||||
'files' => ['app/Database/seeds/'.$yml],
|
||||
]);
|
||||
}
|
||||
|
||||
$this->info('Done!');
|
||||
}
|
||||
|
||||
/**
|
||||
* Rewrite the configuration files
|
||||
*
|
||||
* @throws \Symfony\Component\HttpFoundation\File\Exception\FileException
|
||||
*/
|
||||
protected function rewriteConfigs()
|
||||
@@ -67,28 +69,28 @@ class DevInstall extends BaseCommand
|
||||
|
||||
$this->info('Removing the old config files');
|
||||
|
||||
# Remove the old files
|
||||
// Remove the old files
|
||||
$config_file = base_path('config.php');
|
||||
if(file_exists($config_file)) {
|
||||
if (file_exists($config_file)) {
|
||||
unlink($config_file);
|
||||
}
|
||||
|
||||
$env_file = base_path('env.php');
|
||||
if(file_exists($env_file)) {
|
||||
if (file_exists($env_file)) {
|
||||
unlink($env_file);
|
||||
}
|
||||
|
||||
$this->info('Removing the sqlite db');
|
||||
$db_file = storage_path('db.sqlite');
|
||||
if(file_exists($db_file)) {
|
||||
if (file_exists($db_file)) {
|
||||
unlink($db_file);
|
||||
}
|
||||
|
||||
$this->info('Regenerating the config files');
|
||||
$cfgSvc->createConfigFiles([
|
||||
'APP_ENV' => 'dev',
|
||||
'APP_ENV' => 'dev',
|
||||
'SITE_NAME' => 'phpvms test',
|
||||
'DB_CONN' => 'sqlite',
|
||||
'DB_CONN' => 'sqlite',
|
||||
]);
|
||||
|
||||
$this->info('Config files generated!');
|
||||
|
||||
57
app/Console/Commands/ImportCsv.php
Normal file
57
app/Console/Commands/ImportCsv.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Console\Command;
|
||||
use App\Services\ImportService;
|
||||
|
||||
/**
|
||||
* Class ImportCsv
|
||||
*/
|
||||
class ImportCsv extends Command
|
||||
{
|
||||
protected $signature = 'phpvms:csv-import {type} {file}';
|
||||
protected $description = 'Import from a CSV file';
|
||||
|
||||
private $importer;
|
||||
|
||||
/**
|
||||
* Import constructor.
|
||||
*
|
||||
* @param ImportService $importer
|
||||
*/
|
||||
public function __construct(ImportService $importer)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->importer = $importer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Illuminate\Validation\ValidationException
|
||||
*
|
||||
* @return mixed|void
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$type = $this->argument('type');
|
||||
$file = $this->argument('file');
|
||||
|
||||
if (\in_array($type, ['flight', 'flights'])) {
|
||||
$status = $this->importer->importFlights($file);
|
||||
} elseif ($type === 'aircraft') {
|
||||
$status = $this->importer->importAircraft($file);
|
||||
} elseif (\in_array($type, ['airport', 'airports'])) {
|
||||
$status = $this->importer->importAirports($file);
|
||||
} elseif ($type === 'subfleet') {
|
||||
$status = $this->importer->importSubfleets($file);
|
||||
}
|
||||
|
||||
foreach ($status['success'] as $line) {
|
||||
$this->info($line);
|
||||
}
|
||||
|
||||
foreach ($status['errors'] as $line) {
|
||||
$this->error($line);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Console\BaseCommand;
|
||||
use App\Console\Command;
|
||||
|
||||
class ImportFromClassic extends BaseCommand
|
||||
class ImportFromClassic extends Command
|
||||
{
|
||||
protected $signature = 'phpvms:importer {db_host} {db_name} {db_user} {db_pass?} {table_prefix=phpvms_}';
|
||||
protected $description = 'Import from an older version of phpVMS';
|
||||
@@ -15,11 +15,11 @@ class ImportFromClassic extends BaseCommand
|
||||
public function handle()
|
||||
{
|
||||
$db_creds = [
|
||||
'host' => $this->argument('db_host'),
|
||||
'name' => $this->argument('db_name'),
|
||||
'user' => $this->argument('db_user'),
|
||||
'pass' => $this->argument('db_pass'),
|
||||
'table_prefix' => $this->argument('table_prefix')
|
||||
'host' => $this->argument('db_host'),
|
||||
'name' => $this->argument('db_name'),
|
||||
'user' => $this->argument('db_user'),
|
||||
'pass' => $this->argument('db_pass'),
|
||||
'table_prefix' => $this->argument('table_prefix'),
|
||||
];
|
||||
|
||||
$importerSvc = new \App\Console\Services\Importer($db_creds);
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Console\BaseCommand;
|
||||
|
||||
class Install extends BaseCommand
|
||||
{
|
||||
protected $signature = 'phpvms:install
|
||||
{--update}
|
||||
{--airline-name?}
|
||||
{--airline-code?}';
|
||||
|
||||
protected $description = 'Install or update phpVMS';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
$this->info('Installing phpVMS...');
|
||||
|
||||
$this->setupDatabase();
|
||||
|
||||
# Only run these if we're doing an initial install
|
||||
if(!$this->option('update')) {
|
||||
$this->writeLocalConfig();
|
||||
$this->initialData();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup the database and run the migrations
|
||||
* Only call the database creation if we're not
|
||||
* explicitly trying to upgrade
|
||||
*/
|
||||
protected function setupDatabase()
|
||||
{
|
||||
if(!$this->option('update')) {
|
||||
$this->call('database:create');
|
||||
}
|
||||
|
||||
$this->info('Running database migrations...');
|
||||
$this->call('migrate');
|
||||
|
||||
# TODO: Call initial seed data, for the groups and other supporting data
|
||||
}
|
||||
|
||||
/**
|
||||
* Write a local config file
|
||||
*/
|
||||
protected function writeLocalConfig()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Set an initial airline and admin user/password
|
||||
*/
|
||||
protected function initialData()
|
||||
{
|
||||
# TODO: Prompt for initial airline info
|
||||
$airline_name = $this->option('airline-name');
|
||||
if(!$airline_name) {
|
||||
$airline_name = $this->ask('Enter your airline name');
|
||||
}
|
||||
|
||||
$airline_code = $this->option('airline-code');
|
||||
if(!$airline_code) {
|
||||
$airline_code = $this->ask('Enter your airline code');
|
||||
}
|
||||
|
||||
# TODO: Prompt for admin user/password
|
||||
}
|
||||
}
|
||||
@@ -2,20 +2,41 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Console\BaseCommand;
|
||||
use App\Console\Command;
|
||||
use App\Models\Enums\NavaidType;
|
||||
use App\Models\Navdata;
|
||||
|
||||
class NavdataImport extends BaseCommand
|
||||
/**
|
||||
* Class NavdataImport
|
||||
*/
|
||||
class NavdataImport extends Command
|
||||
{
|
||||
protected $signature = 'phpvms:navdata';
|
||||
protected $description = '';
|
||||
|
||||
/**
|
||||
* Read and parse in the navaid file
|
||||
* @throws \League\Geotools\Exception\InvalidArgumentException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function read_wp_nav_aid()
|
||||
public function handle()
|
||||
{
|
||||
$this->info('Emptying the current navdata...');
|
||||
Navdata::query()->truncate();
|
||||
|
||||
$this->info('Looking for nav files...');
|
||||
$this->read_wp_nav_aid();
|
||||
$this->read_wp_nav_fix();
|
||||
}
|
||||
|
||||
/**
|
||||
* Read and parse in the navaid file
|
||||
*
|
||||
* @throws \League\Geotools\Exception\InvalidArgumentException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function read_wp_nav_aid(): void
|
||||
{
|
||||
/*
|
||||
* ....,....1....,....2....,....3....,....4....,....5....,....6..
|
||||
@@ -49,7 +70,7 @@ class NavdataImport extends BaseCommand
|
||||
$file_path = storage_path('/navdata/WPNAVAID.txt');
|
||||
if (!file_exists($file_path)) {
|
||||
$this->error('WPNAVAID.txt not found in storage/navdata');
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
$this->info('Importing navaids (WPNAVAID.txt) ...');
|
||||
@@ -57,10 +78,9 @@ class NavdataImport extends BaseCommand
|
||||
|
||||
$imported = 0;
|
||||
|
||||
foreach($generator as $line) {
|
||||
|
||||
foreach ($generator as $line) {
|
||||
$navaid = [
|
||||
'id' => trim(substr($line, 24, 4)), // ident column
|
||||
'id' => trim(substr($line, 24, 4)), // ident column
|
||||
'name' => trim(substr($line, 0, 24)),
|
||||
'type' => trim(substr($line, 29, 4)),
|
||||
'lat' => trim(substr($line, 33, 9)),
|
||||
@@ -69,9 +89,8 @@ class NavdataImport extends BaseCommand
|
||||
'class' => trim($line[60]),
|
||||
];
|
||||
|
||||
# Map to the Navaid enum
|
||||
switch($navaid['type'])
|
||||
{
|
||||
// Map to the Navaid enum
|
||||
switch ($navaid['type']) {
|
||||
case 'ILS':
|
||||
$navaid['type'] = NavaidType::LOC;
|
||||
break;
|
||||
@@ -100,22 +119,22 @@ class NavdataImport extends BaseCommand
|
||||
}*/
|
||||
|
||||
Navdata::updateOrCreate([
|
||||
'id' => $navaid['id'], 'name' => $navaid['name']
|
||||
'id' => $navaid['id'], 'name' => $navaid['name'],
|
||||
], $navaid);
|
||||
|
||||
$imported++;
|
||||
if($imported % 100 === 0) {
|
||||
$this->info('Imported ' . $imported . ' entries...');
|
||||
if ($imported % 100 === 0) {
|
||||
$this->info('Imported '.$imported.' entries...');
|
||||
}
|
||||
}
|
||||
|
||||
$this->info('Imported a total of ' . $imported . ' nav aids');
|
||||
$this->info('Imported a total of '.$imported.' nav aids');
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function read_wp_nav_fix()
|
||||
public function read_wp_nav_fix(): void
|
||||
{
|
||||
/*
|
||||
* ....,....1....,....2....,...3....,....4....,....
|
||||
@@ -137,9 +156,9 @@ class NavdataImport extends BaseCommand
|
||||
*/
|
||||
|
||||
$file_path = storage_path('/navdata/WPNAVFIX.txt');
|
||||
if(!file_exists($file_path)) {
|
||||
if (!file_exists($file_path)) {
|
||||
$this->error('WPNAVFIX.txt not found in storage/navdata');
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
$this->info('Importing navaids (WPNAVFIX.txt) ...');
|
||||
@@ -148,37 +167,23 @@ class NavdataImport extends BaseCommand
|
||||
$imported = 0;
|
||||
foreach ($generator as $line) {
|
||||
$navfix = [
|
||||
'id' => trim(substr($line, 0, 4)), // ident column
|
||||
'id' => trim(substr($line, 0, 4)), // ident column
|
||||
'name' => trim(substr($line, 24, 6)),
|
||||
'type' => NavaidType::FIX,
|
||||
'lat' => trim(substr($line, 30, 10)),
|
||||
'lon' => trim(substr($line, 40, 11)),
|
||||
'lat' => trim(substr($line, 30, 10)),
|
||||
'lon' => trim(substr($line, 40, 11)),
|
||||
];
|
||||
|
||||
switch ($navfix['type']) {
|
||||
default:
|
||||
$navfix['type'] = NavaidType::UNKNOWN;
|
||||
break;
|
||||
}
|
||||
|
||||
Navdata::updateOrCreate(['id' => $navfix['id']], $navfix);
|
||||
Navdata::updateOrCreate([
|
||||
'id' => $navfix['id'], 'name' => $navfix['name'],
|
||||
], $navfix);
|
||||
|
||||
$imported++;
|
||||
if ($imported % 100 === 0) {
|
||||
$this->info('Imported ' . $imported . ' entries...');
|
||||
$this->info('Imported '.$imported.' entries...');
|
||||
}
|
||||
}
|
||||
|
||||
$this->info('Imported a total of ' . $imported . ' nav fixes');
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
$this->info('Emptying the current navdata...');
|
||||
Navdata::query()->truncate();
|
||||
|
||||
$this->info('Looking for nav files...');
|
||||
$this->read_wp_nav_aid();
|
||||
$this->read_wp_nav_fix();
|
||||
$this->info('Imported a total of '.$imported.' nav fixes');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Console\BaseCommand;
|
||||
use App\Console\Command;
|
||||
use GuzzleHttp\Client;
|
||||
|
||||
class TestApi extends BaseCommand
|
||||
/**
|
||||
* Class TestApi
|
||||
*/
|
||||
class TestApi extends Command
|
||||
{
|
||||
protected $signature = 'phpvms:test-api {apikey} {url}';
|
||||
|
||||
protected $httpClient;
|
||||
|
||||
/**
|
||||
@@ -17,11 +19,11 @@ class TestApi extends BaseCommand
|
||||
public function handle()
|
||||
{
|
||||
$this->httpClient = new Client([
|
||||
'headers' => [
|
||||
'Authorization' => $this->argument('apikey'),
|
||||
'Content-type' => 'application/json',
|
||||
'X-API-Key' => $this->argument('apikey'),
|
||||
]
|
||||
'headers' => [
|
||||
'Authorization' => $this->argument('apikey'),
|
||||
'Content-type' => 'application/json',
|
||||
'X-API-Key' => $this->argument('apikey'),
|
||||
],
|
||||
]);
|
||||
|
||||
$result = $this->httpClient->get($this->argument('url'));
|
||||
|
||||
@@ -2,24 +2,30 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Console\BaseCommand;
|
||||
use App\Console\Command;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
class Version extends BaseCommand
|
||||
/**
|
||||
* Class Version
|
||||
*/
|
||||
class Version extends Command
|
||||
{
|
||||
protected $signature = 'phpvms:version {--write} {--base-only}';
|
||||
|
||||
/**
|
||||
* Create the version number that gets written out
|
||||
*
|
||||
* @param mixed $cfg
|
||||
*
|
||||
* @return bool|string
|
||||
*/
|
||||
protected function createVersionNumber($cfg)
|
||||
{
|
||||
exec($cfg['git']['git-local'], $version);
|
||||
$version = substr($version[0], 0, $cfg['build']['length']);
|
||||
|
||||
# prefix with the date in YYMMDD format
|
||||
// prefix with the date in YYMMDD format
|
||||
$date = date('ymd');
|
||||
|
||||
$version = $date.'-'.$version;
|
||||
|
||||
return $version;
|
||||
@@ -27,6 +33,7 @@ class Version extends BaseCommand
|
||||
|
||||
/**
|
||||
* Run dev related commands
|
||||
*
|
||||
* @throws \Symfony\Component\Yaml\Exception\ParseException
|
||||
*/
|
||||
public function handle()
|
||||
@@ -34,24 +41,24 @@ class Version extends BaseCommand
|
||||
$version_file = config_path('version.yml');
|
||||
$cfg = Yaml::parse(file_get_contents($version_file));
|
||||
|
||||
if($this->option('write')) {
|
||||
$version = $this->createVersionNumber($cfg);
|
||||
$cfg['build']['number'] = $version;
|
||||
// Get the current build id
|
||||
$build_number = $this->createVersionNumber($cfg);
|
||||
$cfg['build']['number'] = $build_number;
|
||||
|
||||
$c = $cfg['current'];
|
||||
$version = "v{$c['major']}.{$c['minor']}.{$c['patch']}-{$build_number}";
|
||||
|
||||
if ($this->option('write')) {
|
||||
file_put_contents($version_file, Yaml::dump($cfg, 4, 2));
|
||||
}
|
||||
|
||||
# Only show the major.minor.patch version
|
||||
if($this->option('base-only')) {
|
||||
$version = 'v'.$cfg['current']['major'] . '.'
|
||||
.$cfg['current']['minor'] . '.'
|
||||
.$cfg['current']['patch'];
|
||||
|
||||
print $version;
|
||||
} else {
|
||||
$this->call('version:show', [
|
||||
'--format' => 'compact',
|
||||
'--suppress-app-name' => true
|
||||
]);
|
||||
// Only show the major.minor.patch version
|
||||
if ($this->option('base-only')) {
|
||||
$version = 'v'.$cfg['current']['major'].'.'
|
||||
.$cfg['current']['minor'].'.'
|
||||
.$cfg['current']['patch'];
|
||||
}
|
||||
|
||||
echo $version."\n";
|
||||
}
|
||||
}
|
||||
|
||||
52
app/Console/Commands/YamlExport.php
Normal file
52
app/Console/Commands/YamlExport.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Console\Command;
|
||||
use App\Services\DatabaseService;
|
||||
use DB;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
/**
|
||||
* Class YamlExport
|
||||
*/
|
||||
class YamlExport extends Command
|
||||
{
|
||||
protected $signature = 'phpvms:yaml-export {tables*}';
|
||||
protected $description = 'YAML table export';
|
||||
|
||||
/**
|
||||
* YamlExport constructor.
|
||||
*
|
||||
* @param DatabaseService $dbSvc
|
||||
*/
|
||||
public function __construct(DatabaseService $dbSvc)
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Run dev related commands
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$tables = $this->argument('tables');
|
||||
if (empty($tables)) {
|
||||
$this->error('No tables specified');
|
||||
exit();
|
||||
}
|
||||
|
||||
$export_tables = [];
|
||||
foreach ($tables as $table) {
|
||||
$export_tables[$table] = [];
|
||||
|
||||
$rows = DB::table($table)->get();
|
||||
foreach ($rows as $row) {
|
||||
$export_tables[$table][] = (array) $row;
|
||||
}
|
||||
}
|
||||
|
||||
$yaml = Yaml::dump($export_tables, 4, 2);
|
||||
echo $yaml;
|
||||
}
|
||||
}
|
||||
@@ -2,16 +2,23 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Console\BaseCommand;
|
||||
use App\Console\Command;
|
||||
use App\Services\DatabaseService;
|
||||
|
||||
class YamlImport extends BaseCommand
|
||||
/**
|
||||
* Class YamlImport
|
||||
*/
|
||||
class YamlImport extends Command
|
||||
{
|
||||
protected $signature = 'phpvms:import {files*}';
|
||||
protected $signature = 'phpvms:yaml-import {files*}';
|
||||
protected $description = 'Developer commands';
|
||||
|
||||
protected $dbSvc;
|
||||
|
||||
/**
|
||||
* YamlImport constructor.
|
||||
*
|
||||
* @param DatabaseService $dbSvc
|
||||
*/
|
||||
public function __construct(DatabaseService $dbSvc)
|
||||
{
|
||||
parent::__construct();
|
||||
@@ -20,31 +27,29 @@ class YamlImport extends BaseCommand
|
||||
|
||||
/**
|
||||
* Run dev related commands
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$files = $this->argument('files');
|
||||
if(empty($files)) {
|
||||
if (empty($files)) {
|
||||
$this->error('No files to import specified!');
|
||||
exit();
|
||||
}
|
||||
|
||||
$ignore_errors = true;
|
||||
/*$ignore_errors = $this->option('ignore_errors');
|
||||
if(!$ignore_errors) {
|
||||
$ignore_errors = false;
|
||||
}*/
|
||||
|
||||
foreach($files as $file) {
|
||||
if(!file_exists($file)) {
|
||||
$this->error('File ' . $file .' doesn\'t exist');
|
||||
foreach ($files as $file) {
|
||||
if (!file_exists($file)) {
|
||||
$this->error('File '.$file.' doesn\'t exist');
|
||||
exit;
|
||||
}
|
||||
|
||||
$this->info('Importing ' . $file);
|
||||
$this->info('Importing '.$file);
|
||||
|
||||
$imported = $this->dbSvc->seed_from_yaml_file($file, $ignore_errors);
|
||||
foreach($imported as $table => $count) {
|
||||
foreach ($imported as $table => $count) {
|
||||
$this->info('Imported '.$count.' records from "'.$table.'"');
|
||||
}
|
||||
}
|
||||
|
||||
23
app/Console/Cron/Hourly.php
Normal file
23
app/Console/Cron/Hourly.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Cron;
|
||||
|
||||
use App\Console\Command;
|
||||
use App\Events\CronHourly;
|
||||
|
||||
/**
|
||||
* This just calls the CronHourly event, so all of the
|
||||
* listeners, etc can just be called to run those tasks
|
||||
*/
|
||||
class Hourly extends Command
|
||||
{
|
||||
protected $signature = 'cron:hourly';
|
||||
protected $description = 'Run the hourly cron tasks';
|
||||
protected $schedule;
|
||||
|
||||
public function handle(): void
|
||||
{
|
||||
$this->redirectLoggingToStdout('cron');
|
||||
event(new CronHourly());
|
||||
}
|
||||
}
|
||||
25
app/Console/Cron/Monthly.php
Normal file
25
app/Console/Cron/Monthly.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Cron;
|
||||
|
||||
use App\Console\Command;
|
||||
use App\Events\CronMonthly;
|
||||
|
||||
/**
|
||||
* This just calls the CronMonthly event, so all of the
|
||||
* listeners, etc can just be called to run those tasks
|
||||
*
|
||||
* The actual cron tasks are in app/Cron
|
||||
*/
|
||||
class Monthly extends Command
|
||||
{
|
||||
protected $signature = 'cron:monthly';
|
||||
protected $description = 'Run the monthly cron tasks';
|
||||
protected $schedule;
|
||||
|
||||
public function handle(): void
|
||||
{
|
||||
$this->redirectLoggingToStdout('cron');
|
||||
event(new CronMonthly());
|
||||
}
|
||||
}
|
||||
25
app/Console/Cron/Nightly.php
Normal file
25
app/Console/Cron/Nightly.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Cron;
|
||||
|
||||
use App\Console\Command;
|
||||
use App\Events\CronNightly;
|
||||
|
||||
/**
|
||||
* This just calls the CronNightly event, so all of the
|
||||
* listeners, etc can just be called to run those tasks
|
||||
*
|
||||
* The actual cron tasks are in app/Cron
|
||||
*/
|
||||
class Nightly extends Command
|
||||
{
|
||||
protected $signature = 'cron:nightly';
|
||||
protected $description = 'Run the nightly cron tasks';
|
||||
protected $schedule;
|
||||
|
||||
public function handle(): void
|
||||
{
|
||||
$this->redirectLoggingToStdout('cron');
|
||||
event(new CronNightly());
|
||||
}
|
||||
}
|
||||
25
app/Console/Cron/Weekly.php
Normal file
25
app/Console/Cron/Weekly.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Cron;
|
||||
|
||||
use App\Console\Command;
|
||||
use App\Events\CronWeekly;
|
||||
|
||||
/**
|
||||
* This just calls the CronWeekly event, so all of the
|
||||
* listeners, etc can just be called to run those tasks.
|
||||
*
|
||||
* The actual cron tasks are in app/Cron
|
||||
*/
|
||||
class Weekly extends Command
|
||||
{
|
||||
protected $signature = 'cron:weekly';
|
||||
protected $description = 'Run the weekly cron tasks';
|
||||
protected $schedule;
|
||||
|
||||
public function handle(): void
|
||||
{
|
||||
$this->redirectLoggingToStdout('cron');
|
||||
event(new CronWeekly());
|
||||
}
|
||||
}
|
||||
@@ -2,37 +2,31 @@
|
||||
|
||||
namespace App\Console;
|
||||
|
||||
use App\Console\Cron\Hourly;
|
||||
use App\Console\Cron\Monthly;
|
||||
use App\Console\Cron\Nightly;
|
||||
use App\Console\Cron\Weekly;
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
|
||||
/**
|
||||
* Class Kernel
|
||||
*/
|
||||
class Kernel extends ConsoleKernel
|
||||
{
|
||||
/**
|
||||
* The Artisan commands provided by your application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $commands = [
|
||||
Commands\AcarsReplay::class,
|
||||
Commands\CreateDatabase::class,
|
||||
Commands\DevCommands::class,
|
||||
Commands\YamlImport::class,
|
||||
Commands\ImportFromClassic::class,
|
||||
Commands\Install::class,
|
||||
Commands\NavdataImport::class,
|
||||
Commands\TestApi::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* Define the application's command schedule.
|
||||
*
|
||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function schedule(Schedule $schedule)
|
||||
protected function schedule(Schedule $schedule): void
|
||||
{
|
||||
// $schedule->command('inspire')
|
||||
// ->hourly();
|
||||
$schedule->command(Nightly::class)->dailyAt('01:00');
|
||||
$schedule->command(Weekly::class)->weeklyOn(0);
|
||||
$schedule->command(Monthly::class)->monthlyOn(1);
|
||||
$schedule->command(Hourly::class)->hourly();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -40,9 +34,10 @@ class Kernel extends ConsoleKernel
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function commands()
|
||||
protected function commands(): void
|
||||
{
|
||||
require app_path('Routes/console.php');
|
||||
$this->load(__DIR__ . '/Commands');
|
||||
$this->load(__DIR__.'/Commands');
|
||||
$this->load(__DIR__.'/Cron');
|
||||
}
|
||||
}
|
||||
|
||||
23
app/Console/Logger.php
Normal file
23
app/Console/Logger.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console;
|
||||
|
||||
use Monolog\Handler\StreamHandler;
|
||||
|
||||
/**
|
||||
* Just a simple custom logger that dumps to the console
|
||||
*/
|
||||
class Logger
|
||||
{
|
||||
public function __invoke(array $config)
|
||||
{
|
||||
$logger = new \Monolog\Logger('console');
|
||||
|
||||
try {
|
||||
$logger->pushHandler(new StreamHandler('php://stdout'));
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
|
||||
return $logger;
|
||||
}
|
||||
}
|
||||
@@ -2,27 +2,27 @@
|
||||
|
||||
namespace App\Console\Services;
|
||||
|
||||
use Doctrine\DBAL\Driver\PDOException;
|
||||
use PDO;
|
||||
|
||||
/**
|
||||
* Class Database
|
||||
* @package App\Console\Services
|
||||
*/
|
||||
class Database
|
||||
{
|
||||
/**
|
||||
* Create the base connection DSN, optionally include the DB name
|
||||
* @param $host
|
||||
* @param $port
|
||||
*
|
||||
* @param $host
|
||||
* @param $port
|
||||
* @param null $name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function createDsn($host, $port, $name=null)
|
||||
public function createDsn($host, $port, $name = null)
|
||||
{
|
||||
$conn = config('database.default');
|
||||
$dsn = "$conn:host=$host;port=$port";
|
||||
if(filled($name)) {
|
||||
if (filled($name)) {
|
||||
$dsn .= ';dbname='.$name;
|
||||
}
|
||||
|
||||
@@ -33,8 +33,10 @@ class Database
|
||||
* @param $dsn
|
||||
* @param $user
|
||||
* @param $pass
|
||||
* @return PDO
|
||||
*
|
||||
* @throws \PDOException
|
||||
*
|
||||
* @return PDO
|
||||
*/
|
||||
public function createPDO($dsn, $user, $pass)
|
||||
{
|
||||
|
||||
@@ -15,17 +15,16 @@ use App\Models\Rank;
|
||||
use App\Models\Subfleet;
|
||||
use App\Models\User;
|
||||
use Carbon\Carbon;
|
||||
use Doctrine\DBAL\Driver\PDOException;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Str;
|
||||
use PDO;
|
||||
use PDOException;
|
||||
use Symfony\Component\Console\Output\ConsoleOutput;
|
||||
|
||||
/**
|
||||
* Class Importer
|
||||
* TODO: Batch import
|
||||
* @package App\Console\Services
|
||||
*/
|
||||
class Importer
|
||||
{
|
||||
@@ -36,6 +35,7 @@ class Importer
|
||||
|
||||
/**
|
||||
* Hold the PDO connection to the old database
|
||||
*
|
||||
* @var
|
||||
*/
|
||||
private $conn;
|
||||
@@ -43,10 +43,11 @@ class Importer
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $creds = [];
|
||||
private $creds;
|
||||
|
||||
/**
|
||||
* Hold the instance of the console logger
|
||||
*
|
||||
* @var
|
||||
*/
|
||||
private $log;
|
||||
@@ -54,12 +55,12 @@ class Importer
|
||||
/**
|
||||
* CONSTANTS
|
||||
*/
|
||||
|
||||
const BATCH_READ_ROWS = 300;
|
||||
const SUBFLEET_NAME = 'Imported Aircraft';
|
||||
public const BATCH_READ_ROWS = 300;
|
||||
public const SUBFLEET_NAME = 'Imported Aircraft';
|
||||
|
||||
/**
|
||||
* Importer constructor.
|
||||
*
|
||||
* @param $db_creds
|
||||
*/
|
||||
public function __construct($db_creds)
|
||||
@@ -67,14 +68,14 @@ class Importer
|
||||
// Setup the logger
|
||||
$this->log = new ConsoleOutput();
|
||||
|
||||
# The db credentials
|
||||
// The db credentials
|
||||
$this->creds = array_merge([
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 3306,
|
||||
'name' => '',
|
||||
'user' => '',
|
||||
'pass' => '',
|
||||
'table_prefix' => 'phpvms_'
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 3306,
|
||||
'name' => '',
|
||||
'user' => '',
|
||||
'pass' => '',
|
||||
'table_prefix' => 'phpvms_',
|
||||
], $db_creds);
|
||||
}
|
||||
|
||||
@@ -85,7 +86,7 @@ class Importer
|
||||
{
|
||||
$this->reconnect();
|
||||
|
||||
# Import all the different parts
|
||||
// Import all the different parts
|
||||
$this->importRanks();
|
||||
$this->importAirlines();
|
||||
$this->importAircraft();
|
||||
@@ -95,7 +96,7 @@ class Importer
|
||||
$this->importFlights();
|
||||
$this->importPireps();
|
||||
|
||||
# Finish up
|
||||
// Finish up
|
||||
$this->findLastPireps();
|
||||
$this->recalculateRanks();
|
||||
}
|
||||
@@ -105,13 +106,13 @@ class Importer
|
||||
*/
|
||||
protected function reconnect()
|
||||
{
|
||||
$dsn = 'mysql:' . implode(';', [
|
||||
'host=' . $this->creds['host'],
|
||||
'port=' . $this->creds['port'],
|
||||
'dbname=' . $this->creds['name']
|
||||
$dsn = 'mysql:'.implode(';', [
|
||||
'host='.$this->creds['host'],
|
||||
'port='.$this->creds['port'],
|
||||
'dbname='.$this->creds['name'],
|
||||
]);
|
||||
|
||||
$this->info('Connection string: ' . $dsn);
|
||||
$this->info('Connection string: '.$dsn);
|
||||
|
||||
try {
|
||||
$this->conn = new PDO($dsn, $this->creds['user'], $this->creds['pass']);
|
||||
@@ -127,37 +128,40 @@ class Importer
|
||||
*/
|
||||
protected function comment($message)
|
||||
{
|
||||
$this->log->writeln('<comment>' . $message . '</comment>');
|
||||
$this->log->writeln('<comment>'.$message.'</comment>');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $message
|
||||
*/
|
||||
protected function error($message) {
|
||||
$this->log->writeln('<error>' . $message . '</error>');
|
||||
protected function error($message)
|
||||
{
|
||||
$this->log->writeln('<error>'.$message.'</error>');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
* @param string|array $message
|
||||
*/
|
||||
protected function info($message)
|
||||
{
|
||||
if(\is_array($message)) {
|
||||
if (\is_array($message)) {
|
||||
/* @noinspection ForgottenDebugOutputInspection */
|
||||
print_r($message);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$this->log->writeln('<info>'.$message.'</info>');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the table name with the prefix
|
||||
*
|
||||
* @param $table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function tableName($table)
|
||||
{
|
||||
if($this->creds['table_prefix'] !== false) {
|
||||
if ($this->creds['table_prefix'] !== false) {
|
||||
return $this->creds['table_prefix'].$table;
|
||||
}
|
||||
|
||||
@@ -165,17 +169,18 @@ class Importer
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Model $model
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function saveModel($model)
|
||||
{
|
||||
try {
|
||||
$model->save();
|
||||
|
||||
return true;
|
||||
} catch (QueryException $e) {
|
||||
if($e->getCode() !== '23000') {
|
||||
if ($e->getCode() !== '23000') {
|
||||
$this->error($e);
|
||||
}
|
||||
|
||||
@@ -185,13 +190,14 @@ class Importer
|
||||
|
||||
/**
|
||||
* Create a new mapping between an old ID and the new one
|
||||
*
|
||||
* @param $entity
|
||||
* @param $old_id
|
||||
* @param $new_id
|
||||
*/
|
||||
protected function addMapping($entity, $old_id, $new_id)
|
||||
{
|
||||
if(!array_key_exists($entity, $this->mappedEntities)) {
|
||||
if (!array_key_exists($entity, $this->mappedEntities)) {
|
||||
$this->mappedEntities[$entity] = [];
|
||||
}
|
||||
|
||||
@@ -200,18 +206,20 @@ class Importer
|
||||
|
||||
/**
|
||||
* Return the ID for a mapping
|
||||
*
|
||||
* @param $entity
|
||||
* @param $old_id
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function getMapping($entity, $old_id)
|
||||
{
|
||||
if(!array_key_exists($entity, $this->mappedEntities)) {
|
||||
if (!array_key_exists($entity, $this->mappedEntities)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
$entity = $this->mappedEntities[$entity];
|
||||
if(array_key_exists($old_id, $entity)) {
|
||||
if (array_key_exists($old_id, $entity)) {
|
||||
return $entity[$old_id];
|
||||
}
|
||||
|
||||
@@ -220,27 +228,31 @@ class Importer
|
||||
|
||||
/**
|
||||
* @param $date
|
||||
*
|
||||
* @return Carbon
|
||||
*/
|
||||
protected function parseDate($date)
|
||||
{
|
||||
$carbon = Carbon::parse($date);
|
||||
|
||||
return $carbon;
|
||||
}
|
||||
|
||||
/**
|
||||
* Take a decimal duration and convert it to minutes
|
||||
*
|
||||
* @param $duration
|
||||
*
|
||||
* @return float|int
|
||||
*/
|
||||
protected function convertDuration($duration)
|
||||
{
|
||||
if(strpos($duration, '.') !== false) {
|
||||
if (strpos($duration, '.') !== false) {
|
||||
$delim = '.';
|
||||
} elseif(strpos($duration, ':')) {
|
||||
} elseif (strpos($duration, ':')) {
|
||||
$delim = ':';
|
||||
} else {
|
||||
# no delimiter, assume it's just a straight hour
|
||||
// no delimiter, assume it's just a straight hour
|
||||
return (int) $duration * 60;
|
||||
}
|
||||
|
||||
@@ -253,58 +265,61 @@ class Importer
|
||||
|
||||
/**
|
||||
* @param $table
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
protected function getTotalRows($table)
|
||||
{
|
||||
$table = $this->tableName($table);
|
||||
|
||||
$sql = 'SELECT COUNT(*) FROM ' . $table;
|
||||
$sql = 'SELECT COUNT(*) FROM '.$table;
|
||||
$rows = $this->conn->query($sql)->fetchColumn();
|
||||
|
||||
$this->info('Found '.$rows.' rows in '.$table);
|
||||
|
||||
return (int) $rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read all the rows in a table, but read them in a batched manner
|
||||
* @param string $table The name of the table
|
||||
* @param null $read_rows Number of rows to read
|
||||
*
|
||||
* @param string $table The name of the table
|
||||
* @param null $read_rows Number of rows to read
|
||||
*
|
||||
* @return \Generator
|
||||
*/
|
||||
protected function readRows($table, $read_rows=null)
|
||||
protected function readRows($table, $read_rows = null)
|
||||
{
|
||||
// Set the table prefix if it has been entered
|
||||
$this->tableName($table);
|
||||
|
||||
$offset = 0;
|
||||
if($read_rows === null) {
|
||||
if ($read_rows === null) {
|
||||
$read_rows = self::BATCH_READ_ROWS;
|
||||
}
|
||||
|
||||
$total_rows = $this->getTotalRows($table);
|
||||
|
||||
while($offset < $total_rows)
|
||||
{
|
||||
while ($offset < $total_rows) {
|
||||
$rows_to_read = $offset + $read_rows;
|
||||
if($rows_to_read > $total_rows) {
|
||||
if ($rows_to_read > $total_rows) {
|
||||
$rows_to_read = $total_rows;
|
||||
}
|
||||
|
||||
$this->info('Reading '.$offset.' to '.$rows_to_read.' of '.$total_rows);
|
||||
|
||||
$sql = 'SELECT * FROM ' . $this->tableName($table)
|
||||
. ' LIMIT ' . self::BATCH_READ_ROWS . ' OFFSET ' . $offset;
|
||||
$sql = 'SELECT * FROM '.$this->tableName($table)
|
||||
.' LIMIT '.self::BATCH_READ_ROWS.' OFFSET '.$offset;
|
||||
|
||||
try {
|
||||
foreach ($this->conn->query($sql) as $row) {
|
||||
yield $row;
|
||||
}
|
||||
} catch(PDOException $e) {
|
||||
} catch (PDOException $e) {
|
||||
// Without incrementing the offset, it should re-run the same query
|
||||
$this->error($e);
|
||||
|
||||
if(strpos($e->getMessage(), 'server has gone away') !== false) {
|
||||
if (strpos($e->getMessage(), 'server has gone away') !== false) {
|
||||
$this->reconnect();
|
||||
continue;
|
||||
}
|
||||
@@ -316,6 +331,7 @@ class Importer
|
||||
|
||||
/**
|
||||
* Return the subfleet
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
protected function getSubfleet()
|
||||
@@ -330,10 +346,8 @@ class Importer
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* All the individual importers, done on a per-table basis
|
||||
* Some tables get saved locally for tables that use FK refs
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -344,22 +358,21 @@ class Importer
|
||||
$this->comment('--- RANK IMPORT ---');
|
||||
|
||||
$count = 0;
|
||||
foreach ($this->readRows('ranks') as $row)
|
||||
{
|
||||
foreach ($this->readRows('ranks') as $row) {
|
||||
$rank = Rank::firstOrCreate(
|
||||
['name' => $row->rank],
|
||||
['image_link' => $row->rankimage, 'hours'=>$row->minhours]
|
||||
['image_url' => $row->rankimage, 'hours' => $row->minhours]
|
||||
);
|
||||
|
||||
$this->addMapping('ranks', $row->rankid, $rank->id);
|
||||
$this->addMapping('ranks', $row->rank, $rank->id);
|
||||
|
||||
if($rank->wasRecentlyCreated) {
|
||||
++$count;
|
||||
if ($rank->wasRecentlyCreated) {
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
|
||||
$this->info('Imported ' . $count . ' ranks');
|
||||
$this->info('Imported '.$count.' ranks');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -371,8 +384,7 @@ class Importer
|
||||
$this->comment('--- AIRLINE IMPORT ---');
|
||||
|
||||
$count = 0;
|
||||
foreach ($this->readRows('airlines') as $row)
|
||||
{
|
||||
foreach ($this->readRows('airlines') as $row) {
|
||||
$airline = Airline::firstOrCreate(
|
||||
['icao' => $row->code],
|
||||
['iata' => $row->code, 'name' => $row->name, 'active' => $row->enabled]
|
||||
@@ -382,11 +394,11 @@ class Importer
|
||||
$this->addMapping('airlines', $row->code, $airline->id);
|
||||
|
||||
if ($airline->wasRecentlyCreated) {
|
||||
++$count;
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
|
||||
$this->info('Imported '. $count.' airlines');
|
||||
$this->info('Imported '.$count.' airlines');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -401,23 +413,22 @@ class Importer
|
||||
$this->info('Subfleet ID is '.$subfleet->id);
|
||||
|
||||
$count = 0;
|
||||
foreach($this->readRows('aircraft') as $row)
|
||||
{
|
||||
foreach ($this->readRows('aircraft') as $row) {
|
||||
$aircraft = Aircraft::firstOrCreate(
|
||||
['name' => $row->fullname, 'registration' => $row->registration],
|
||||
['icao' => $row->icao,
|
||||
['icao' => $row->icao,
|
||||
'subfleet_id' => $subfleet->id,
|
||||
'active' => $row->enabled
|
||||
'active' => $row->enabled,
|
||||
]);
|
||||
|
||||
$this->addMapping('aircraft', $row->id, $aircraft->id);
|
||||
|
||||
if($aircraft->wasRecentlyCreated) {
|
||||
++$count;
|
||||
if ($aircraft->wasRecentlyCreated) {
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
|
||||
$this->info('Imported ' . $count . ' aircraft');
|
||||
$this->info('Imported '.$count.' aircraft');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -428,16 +439,15 @@ class Importer
|
||||
$this->comment('--- AIRPORT IMPORT ---');
|
||||
|
||||
$count = 0;
|
||||
foreach ($this->readRows('airports') as $row)
|
||||
{
|
||||
foreach ($this->readRows('airports') as $row) {
|
||||
$attrs = [
|
||||
'id' => trim($row->icao),
|
||||
'icao' => trim($row->icao),
|
||||
'name' => $row->name,
|
||||
'id' => trim($row->icao),
|
||||
'icao' => trim($row->icao),
|
||||
'name' => $row->name,
|
||||
'country' => $row->country,
|
||||
'lat' => $row->lat,
|
||||
'lon' => $row->lng,
|
||||
'hub' => $row->hub,
|
||||
'lat' => $row->lat,
|
||||
'lon' => $row->lng,
|
||||
'hub' => $row->hub,
|
||||
];
|
||||
|
||||
$airport = Airport::updateOrCreate(
|
||||
@@ -445,12 +455,12 @@ class Importer
|
||||
$attrs
|
||||
);
|
||||
|
||||
if($airport->wasRecentlyCreated) {
|
||||
++$count;
|
||||
if ($airport->wasRecentlyCreated) {
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
|
||||
$this->info('Imported ' . $count . ' airports');
|
||||
$this->info('Imported '.$count.' airports');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -461,8 +471,7 @@ class Importer
|
||||
$this->comment('--- FLIGHT SCHEDULE IMPORT ---');
|
||||
|
||||
$count = 0;
|
||||
foreach ($this->readRows('schedules') as $row)
|
||||
{
|
||||
foreach ($this->readRows('schedules') as $row) {
|
||||
$airline_id = $this->getMapping('airlines', $row->code);
|
||||
|
||||
$flight_num = trim($row->flightnum);
|
||||
@@ -470,14 +479,14 @@ class Importer
|
||||
$attrs = [
|
||||
'dpt_airport_id' => $row->depicao,
|
||||
'arr_airport_id' => $row->arricao,
|
||||
'route' => $row->route ?: '',
|
||||
'distance' => round($row->distance ?: 0, 2),
|
||||
'level' => $row->flightlevel ?: 0,
|
||||
'dpt_time' => $row->deptime ?: '',
|
||||
'arr_time' => $row->arrtime ?: '',
|
||||
'flight_time' => $this->convertDuration($row->flighttime) ?: '',
|
||||
'notes' => $row->notes ?: '',
|
||||
'active' => $row->enabled ?: true,
|
||||
'route' => $row->route ?: '',
|
||||
'distance' => round($row->distance ?: 0, 2),
|
||||
'level' => $row->flightlevel ?: 0,
|
||||
'dpt_time' => $row->deptime ?: '',
|
||||
'arr_time' => $row->arrtime ?: '',
|
||||
'flight_time' => $this->convertDuration($row->flighttime) ?: '',
|
||||
'notes' => $row->notes ?: '',
|
||||
'active' => $row->enabled ?: true,
|
||||
];
|
||||
|
||||
try {
|
||||
@@ -486,19 +495,19 @@ class Importer
|
||||
$attrs
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
#$this->error($e);
|
||||
//$this->error($e);
|
||||
}
|
||||
|
||||
$this->addMapping('flights', $row->id, $flight->id);
|
||||
|
||||
// TODO: deserialize route_details into ACARS table
|
||||
|
||||
if($flight->wasRecentlyCreated) {
|
||||
++$count;
|
||||
if ($flight->wasRecentlyCreated) {
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
|
||||
$this->info('Imported ' . $count . ' flights');
|
||||
$this->info('Imported '.$count.' flights');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -509,57 +518,56 @@ class Importer
|
||||
$this->comment('--- PIREP IMPORT ---');
|
||||
|
||||
$count = 0;
|
||||
foreach ($this->readRows('pireps') as $row)
|
||||
{
|
||||
foreach ($this->readRows('pireps') as $row) {
|
||||
$pirep_id = $row->pirepid;
|
||||
$user_id = $this->getMapping('users', $row->pilotid);
|
||||
$airline_id = $this->getMapping('airlines', $row->code);
|
||||
$aircraft_id = $this->getMapping('aircraft', $row->aircraft);
|
||||
|
||||
$attrs = [
|
||||
#'id' => $pirep_id,
|
||||
'user_id' => $user_id,
|
||||
'airline_id' => $airline_id,
|
||||
'aircraft_id' => $aircraft_id,
|
||||
'flight_number' => $row->flightnum ?: '',
|
||||
//'id' => $pirep_id,
|
||||
'user_id' => $user_id,
|
||||
'airline_id' => $airline_id,
|
||||
'aircraft_id' => $aircraft_id,
|
||||
'flight_number' => $row->flightnum ?: '',
|
||||
'dpt_airport_id' => $row->depicao,
|
||||
'arr_airport_id' => $row->arricao,
|
||||
'block_fuel' => $row->fuelused,
|
||||
'route' => $row->route ?: '',
|
||||
'source_name' => $row->source,
|
||||
'created_at' => $this->parseDate($row->submitdate),
|
||||
'updated_at' => $this->parseDate($row->modifieddate),
|
||||
'block_fuel' => $row->fuelused,
|
||||
'route' => $row->route ?: '',
|
||||
'source_name' => $row->source,
|
||||
'created_at' => $this->parseDate($row->submitdate),
|
||||
'updated_at' => $this->parseDate($row->modifieddate),
|
||||
];
|
||||
|
||||
# Set the distance
|
||||
// Set the distance
|
||||
$distance = round($row->distance ?: 0, 2);
|
||||
$attrs['distance'] = $distance;
|
||||
$attrs['planned_distance'] = $distance;
|
||||
|
||||
# Set the flight time properly
|
||||
// Set the flight time properly
|
||||
$duration = $this->convertDuration($row->flighttime_stamp);
|
||||
$attrs['flight_time'] = $duration;
|
||||
$attrs['planned_flight_time'] = $duration;
|
||||
|
||||
# Set how it was filed
|
||||
if(strtoupper($row->source) === 'MANUAL') {
|
||||
// Set how it was filed
|
||||
if (strtoupper($row->source) === 'MANUAL') {
|
||||
$attrs['source'] = PirepSource::MANUAL;
|
||||
} else {
|
||||
$attrs['source'] = PirepSource::ACARS;
|
||||
}
|
||||
|
||||
# Set the flight type
|
||||
// Set the flight type
|
||||
$row->flighttype = strtoupper($row->flighttype);
|
||||
if($row->flighttype === 'P') {
|
||||
$attrs['flight_type'] = FlightType::PASSENGER;
|
||||
} elseif($row->flighttype === 'C') {
|
||||
$attrs['flight_type'] = FlightType::CARGO;
|
||||
if ($row->flighttype === 'P') {
|
||||
$attrs['flight_type'] = FlightType::SCHED_PAX;
|
||||
} elseif ($row->flighttype === 'C') {
|
||||
$attrs['flight_type'] = FlightType::SCHED_CARGO;
|
||||
} else {
|
||||
$attrs['flight_type'] = FlightType::CHARTER;
|
||||
$attrs['flight_type'] = FlightType::CHARTER_PAX_ONLY;
|
||||
}
|
||||
|
||||
# Set the flight level of the PIREP is set
|
||||
if(property_exists($row, 'flightlevel')) {
|
||||
// Set the flight level of the PIREP is set
|
||||
if (property_exists($row, 'flightlevel')) {
|
||||
$attrs['level'] = $row->flightlevel;
|
||||
} else {
|
||||
$attrs['level'] = 0;
|
||||
@@ -571,23 +579,23 @@ class Importer
|
||||
);
|
||||
|
||||
$source = strtoupper($row->source);
|
||||
if($source === 'SMARTCARS') {
|
||||
# TODO: Parse smartcars log into the acars table
|
||||
} elseif($source === 'KACARS') {
|
||||
# TODO: Parse kACARS log into acars table
|
||||
} elseif($source === 'XACARS') {
|
||||
# TODO: Parse XACARS log into acars table
|
||||
if ($source === 'SMARTCARS') {
|
||||
// TODO: Parse smartcars log into the acars table
|
||||
} elseif ($source === 'KACARS') {
|
||||
// TODO: Parse kACARS log into acars table
|
||||
} elseif ($source === 'XACARS') {
|
||||
// TODO: Parse XACARS log into acars table
|
||||
}
|
||||
|
||||
# TODO: Add extra fields in as PIREP fields
|
||||
// TODO: Add extra fields in as PIREP fields
|
||||
$this->addMapping('pireps', $row->pirepid, $pirep->id);
|
||||
|
||||
if ($pirep->wasRecentlyCreated) {
|
||||
++$count;
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
|
||||
$this->info('Imported ' . $count . ' pireps');
|
||||
$this->info('Imported '.$count.' pireps');
|
||||
}
|
||||
|
||||
protected function importUsers()
|
||||
@@ -596,10 +604,9 @@ class Importer
|
||||
|
||||
$count = 0;
|
||||
foreach ($this->readRows('pilots', 50) as $row) {
|
||||
// TODO: What to do about pilot ids
|
||||
|
||||
# TODO: What to do about pilot ids
|
||||
|
||||
$name = $row->firstname . ' ' . $row->lastname;
|
||||
$name = $row->firstname.' '.$row->lastname;
|
||||
|
||||
$airline_id = $this->getMapping('airlines', $row->code);
|
||||
$rank_id = $this->getMapping('ranks', $row->rank);
|
||||
@@ -608,17 +615,17 @@ class Importer
|
||||
$new_password = Str::random(60);
|
||||
|
||||
$attrs = [
|
||||
'name' => $name,
|
||||
'password' => Hash::make($new_password),
|
||||
'api_key' => Utils::generateApiKey(),
|
||||
'airline_id' => $airline_id,
|
||||
'rank_id' => $rank_id,
|
||||
'name' => $name,
|
||||
'password' => Hash::make($new_password),
|
||||
'api_key' => Utils::generateApiKey(),
|
||||
'airline_id' => $airline_id,
|
||||
'rank_id' => $rank_id,
|
||||
'home_airport_id' => $row->hub,
|
||||
'curr_airport_id' => $row->hub,
|
||||
'flights' => (int)$row->totalflights,
|
||||
'flight_time' => Utils::hoursToMinutes($row->totalhours),
|
||||
'state' => $state,
|
||||
'created_at' => $this->parseDate($row->joindate),
|
||||
'flights' => (int) $row->totalflights,
|
||||
'flight_time' => Utils::hoursToMinutes($row->totalhours),
|
||||
'state' => $state,
|
||||
'created_at' => $this->parseDate($row->joindate),
|
||||
];
|
||||
|
||||
$user = User::updateOrCreate(
|
||||
@@ -629,11 +636,11 @@ class Importer
|
||||
$this->addMapping('users', $row->pilotid, $user->id);
|
||||
|
||||
if ($user->wasRecentlyCreated) {
|
||||
++$count;
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
|
||||
$this->info('Imported ' . $count . ' users');
|
||||
$this->info('Imported '.$count.' users');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -641,7 +648,6 @@ class Importer
|
||||
*/
|
||||
protected function findLastPireps()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -654,7 +660,9 @@ class Importer
|
||||
|
||||
/**
|
||||
* Get the user's new state from their original state
|
||||
*
|
||||
* @param $state
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
protected function getUserState($state)
|
||||
@@ -665,24 +673,23 @@ class Importer
|
||||
|
||||
// Declare array of classic states
|
||||
$phpvms_classic_states = [
|
||||
'ACTIVE' => 0,
|
||||
'ACTIVE' => 0,
|
||||
'INACTIVE' => 1,
|
||||
'BANNED' => 2,
|
||||
'ON_LEAVE' => 3
|
||||
'BANNED' => 2,
|
||||
'ON_LEAVE' => 3,
|
||||
];
|
||||
|
||||
// Decide which state they will be in accordance with v7
|
||||
if ($state === $phpvms_classic_states['ACTIVE']) {
|
||||
return UserState::ACTIVE;
|
||||
} elseif ($state === $phpvms_classic_states['INACTIVE']) {
|
||||
# TODO: Make an inactive state?
|
||||
// TODO: Make an inactive state?
|
||||
return UserState::REJECTED;
|
||||
} elseif ($state === $phpvms_classic_states['BANNED']) {
|
||||
return UserState::SUSPENDED;
|
||||
} elseif ($state === $phpvms_classic_states['ON_LEAVE']) {
|
||||
return UserState::ON_LEAVE;
|
||||
} else {
|
||||
$this->error('Unknown status: '. $state);
|
||||
}
|
||||
$this->error('Unknown status: '.$state);
|
||||
}
|
||||
}
|
||||
|
||||
31
app/Cron/Hourly/RemoveExpiredBids.php
Normal file
31
app/Cron/Hourly/RemoveExpiredBids.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Cron\Hourly;
|
||||
|
||||
use App\Events\CronHourly;
|
||||
use App\Interfaces\Listener;
|
||||
use App\Models\Bid;
|
||||
use Carbon\Carbon;
|
||||
|
||||
/**
|
||||
* Remove expired bids
|
||||
*/
|
||||
class RemoveExpiredBids extends Listener
|
||||
{
|
||||
/**
|
||||
* Remove expired bids
|
||||
*
|
||||
* @param CronHourly $event
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function handle(CronHourly $event): void
|
||||
{
|
||||
if (setting('bids.expire_time') === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$date = Carbon::now()->subHours(setting('bids.expire_time'));
|
||||
Bid::whereDate('created_at', '<', $date)->delete();
|
||||
}
|
||||
}
|
||||
33
app/Cron/Hourly/RemoveExpiredLiveFlights.php
Normal file
33
app/Cron/Hourly/RemoveExpiredLiveFlights.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Cron\Hourly;
|
||||
|
||||
use App\Events\CronHourly;
|
||||
use App\Interfaces\Listener;
|
||||
use App\Models\Pirep;
|
||||
use Carbon\Carbon;
|
||||
|
||||
/**
|
||||
* Remove expired live flights
|
||||
*/
|
||||
class RemoveExpiredLiveFlights extends Listener
|
||||
{
|
||||
/**
|
||||
* Remove expired live flights
|
||||
*
|
||||
* @param CronHourly $event
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function handle(CronHourly $event): void
|
||||
{
|
||||
if (setting('acars.live_time') === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$date = Carbon::now()->subHours(setting('acars.live_time'));
|
||||
Pirep::whereDate('created_at', '<', $date)
|
||||
->where('state', PirepState::IN_PROGRESS)
|
||||
->delete();
|
||||
}
|
||||
}
|
||||
40
app/Cron/Monthly/ApplyExpenses.php
Normal file
40
app/Cron/Monthly/ApplyExpenses.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Cron\Monthly;
|
||||
|
||||
use App\Events\CronMonthly;
|
||||
use App\Interfaces\Listener;
|
||||
use App\Models\Enums\ExpenseType;
|
||||
use App\Services\Finance\RecurringFinanceService;
|
||||
|
||||
/**
|
||||
* Go through and apply any finances that are daily
|
||||
*/
|
||||
class ApplyExpenses extends Listener
|
||||
{
|
||||
private $financeSvc;
|
||||
|
||||
/**
|
||||
* ApplyExpenses constructor.
|
||||
*
|
||||
* @param RecurringFinanceService $financeSvc
|
||||
*/
|
||||
public function __construct(RecurringFinanceService $financeSvc)
|
||||
{
|
||||
$this->financeSvc = $financeSvc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply all of the expenses for a month
|
||||
*
|
||||
* @param CronMonthly $event
|
||||
*
|
||||
* @throws \UnexpectedValueException
|
||||
* @throws \InvalidArgumentException
|
||||
* @throws \Prettus\Validator\Exceptions\ValidatorException
|
||||
*/
|
||||
public function handle(CronMonthly $event): void
|
||||
{
|
||||
$this->financeSvc->processExpenses(ExpenseType::MONTHLY);
|
||||
}
|
||||
}
|
||||
40
app/Cron/Nightly/ApplyExpenses.php
Normal file
40
app/Cron/Nightly/ApplyExpenses.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Cron\Nightly;
|
||||
|
||||
use App\Events\CronNightly;
|
||||
use App\Interfaces\Listener;
|
||||
use App\Models\Enums\ExpenseType;
|
||||
use App\Services\Finance\RecurringFinanceService;
|
||||
|
||||
/**
|
||||
* Go through and apply any finances that are daily
|
||||
*/
|
||||
class ApplyExpenses extends Listener
|
||||
{
|
||||
private $financeSvc;
|
||||
|
||||
/**
|
||||
* ApplyExpenses constructor.
|
||||
*
|
||||
* @param RecurringFinanceService $financeSvc
|
||||
*/
|
||||
public function __construct(RecurringFinanceService $financeSvc)
|
||||
{
|
||||
$this->financeSvc = $financeSvc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply all of the expenses for a day
|
||||
*
|
||||
* @param CronNightly $event
|
||||
*
|
||||
* @throws \UnexpectedValueException
|
||||
* @throws \InvalidArgumentException
|
||||
* @throws \Prettus\Validator\Exceptions\ValidatorException
|
||||
*/
|
||||
public function handle(CronNightly $event): void
|
||||
{
|
||||
$this->financeSvc->processExpenses(ExpenseType::DAILY);
|
||||
}
|
||||
}
|
||||
50
app/Cron/Nightly/PilotLeave.php
Normal file
50
app/Cron/Nightly/PilotLeave.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Cron\Nightly;
|
||||
|
||||
use App\Events\CronNightly;
|
||||
use App\Interfaces\Listener;
|
||||
use App\Models\Enums\UserState;
|
||||
use App\Models\User;
|
||||
use App\Services\UserService;
|
||||
use Carbon\Carbon;
|
||||
|
||||
/**
|
||||
* Determine if any pilots should be set to ON LEAVE status
|
||||
*/
|
||||
class PilotLeave extends Listener
|
||||
{
|
||||
private $userSvc;
|
||||
|
||||
/**
|
||||
* PilotLeave constructor.
|
||||
*/
|
||||
public function __construct(UserService $userSvc)
|
||||
{
|
||||
$this->userSvc = $userSvc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set any users to being on leave after X days
|
||||
*
|
||||
* @param CronNightly $event
|
||||
*
|
||||
* @throws \UnexpectedValueException
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function handle(CronNightly $event): void
|
||||
{
|
||||
if (setting('pilots.auto_leave_days') === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$date = Carbon::now()->subDay(setting('pilots.auto_leave_days'));
|
||||
$users = User::where('status', UserState::ACTIVE)
|
||||
->whereDate('updated_at', '<', $date);
|
||||
|
||||
foreach ($users as $user) {
|
||||
Log::info('Setting user '.$user->ident.' to ON LEAVE status');
|
||||
$this->userSvc->setStatusOnLeave($user);
|
||||
}
|
||||
}
|
||||
}
|
||||
54
app/Cron/Nightly/RecalculateBalances.php
Normal file
54
app/Cron/Nightly/RecalculateBalances.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Cron\Nightly;
|
||||
|
||||
use App\Events\CronNightly;
|
||||
use App\Interfaces\Listener;
|
||||
use App\Models\Journal;
|
||||
use App\Repositories\JournalRepository;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* This recalculates the balances on all of the journals
|
||||
*/
|
||||
class RecalculateBalances extends Listener
|
||||
{
|
||||
private $journalRepo;
|
||||
|
||||
/**
|
||||
* Nightly constructor.
|
||||
*
|
||||
* @param JournalRepository $journalRepo
|
||||
*/
|
||||
public function __construct(JournalRepository $journalRepo)
|
||||
{
|
||||
$this->journalRepo = $journalRepo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recalculate all the balances for the different ledgers
|
||||
*
|
||||
* @param CronNightly $event
|
||||
*
|
||||
* @throws \UnexpectedValueException
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function handle(CronNightly $event): void
|
||||
{
|
||||
Log::info('Recalculating balances');
|
||||
|
||||
$journals = Journal::all();
|
||||
foreach ($journals as $journal) {
|
||||
$old_balance = $journal->balance;
|
||||
|
||||
$this->journalRepo->recalculateBalance($journal);
|
||||
$journal->refresh();
|
||||
|
||||
Log::info('Adjusting balance on '.
|
||||
$journal->morphed_type.':'.$journal->morphed_id
|
||||
.' from '.$old_balance.' to '.$journal->balance);
|
||||
}
|
||||
|
||||
Log::info('Done calculating balances');
|
||||
}
|
||||
}
|
||||
49
app/Cron/Nightly/RecalculateStats.php
Normal file
49
app/Cron/Nightly/RecalculateStats.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Cron\Nightly;
|
||||
|
||||
use App\Events\CronNightly;
|
||||
use App\Interfaces\Listener;
|
||||
use App\Models\Enums\UserState;
|
||||
use App\Repositories\UserRepository;
|
||||
use App\Services\UserService;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* This recalculates the balances on all of the journals
|
||||
*/
|
||||
class RecalculateStats extends Listener
|
||||
{
|
||||
private $userRepo;
|
||||
private $userSvc;
|
||||
|
||||
public function __construct(UserRepository $userRepo, UserService $userService)
|
||||
{
|
||||
$this->userRepo = $userRepo;
|
||||
$this->userSvc = $userService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recalculate the stats for active users
|
||||
*
|
||||
* @param CronNightly $event
|
||||
*
|
||||
* @throws \UnexpectedValueException
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function handle(CronNightly $event): void
|
||||
{
|
||||
Log::info('Recalculating balances');
|
||||
|
||||
$w = [
|
||||
['state', '!=', UserState::REJECTED],
|
||||
];
|
||||
|
||||
$users = $this->userRepo->findWhere($w, ['id', 'name', 'airline_id']);
|
||||
foreach ($users as $user) {
|
||||
$this->userSvc->recalculateStats($user);
|
||||
}
|
||||
|
||||
Log::info('Done recalculating stats');
|
||||
}
|
||||
}
|
||||
97
app/Cron/Nightly/SetActiveFlights.php
Normal file
97
app/Cron/Nightly/SetActiveFlights.php
Normal file
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
namespace App\Cron\Nightly;
|
||||
|
||||
use App\Events\CronNightly;
|
||||
use App\Interfaces\Listener;
|
||||
use App\Models\Enums\Days;
|
||||
use App\Models\Flight;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
/**
|
||||
* Figure out what flights need to be active for today
|
||||
*/
|
||||
class SetActiveFlights extends Listener
|
||||
{
|
||||
/**
|
||||
* @param CronNightly $event
|
||||
*/
|
||||
public function handle(CronNightly $event): void
|
||||
{
|
||||
$this->checkFlights();
|
||||
}
|
||||
|
||||
/**
|
||||
* Look through every single flight, check the start/end dates,
|
||||
* as well of the days of week if this flight is active on this day
|
||||
*
|
||||
* TODO: Option to check the flight active/inactive against departure TZ
|
||||
* TODO: Move to FlightService
|
||||
*/
|
||||
public function checkFlights(): void
|
||||
{
|
||||
$today = Carbon::now('UTC');
|
||||
$flights = Flight::all();
|
||||
|
||||
/**
|
||||
* @var Flight $flight
|
||||
*/
|
||||
foreach ($flights as $flight) {
|
||||
if (!$flight->active) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// dates aren't set, so just save if there were any changes above
|
||||
// and move onto the next one
|
||||
if ($flight->start_date === null || $flight->end_date === null) {
|
||||
if ($flight->days !== null && $flight->days > 0) {
|
||||
$visible = Days::isToday($flight->days);
|
||||
if ($flight->visible !== $visible) {
|
||||
Log::info('Flight '.$flight->ident.' to '.($visible ? 'shown' : 'hidden'));
|
||||
|
||||
$flight->visible = $visible;
|
||||
if ($visible === false) {
|
||||
Log::info('Today='.date('N').', start=no, mask='.$flight->days.', in='
|
||||
.Days::in($flight->days, Days::$isoDayMap[(int) date('N')]));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log::info('Toggling flight '.$flight->ident.' to visible');
|
||||
$flight->visible = true;
|
||||
}
|
||||
|
||||
$flight->save();
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check the day of week now first
|
||||
|
||||
// Start/end date is set, so make sure today is valid for it to be alive
|
||||
// and then make sure if days of the week are specified, check that too
|
||||
if ($today->gte($flight->start_date) && $today->lte($flight->end_date)) {
|
||||
if ($flight->days !== null && $flight->days > 0) {
|
||||
$visible = Days::isToday($flight->days);
|
||||
if ($flight->visible !== $visible) {
|
||||
Log::info('Toggling flight '.$flight->ident.' to '.($visible ? 'shown' : 'hidden').'');
|
||||
|
||||
$flight->visible = $visible;
|
||||
if ($visible === false) {
|
||||
Log::info('Today='.date('N').', start='.$flight->start_date
|
||||
.', end='.$flight->end_date.', mask='.$flight->days.', in='
|
||||
.Days::in($flight->days, Days::$isoDayMap[(int) date('N')]));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log::info('Toggling flight '.$flight->ident.' to visible');
|
||||
$flight->visible = true;
|
||||
}
|
||||
} else {
|
||||
$flight->visible = false;
|
||||
Log::info('Toggling flight '.$flight->ident.' to hidden, outside of start/end boundary');
|
||||
}
|
||||
|
||||
$flight->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,18 +4,20 @@ use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Models\Acars::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => null,
|
||||
'pirep_id' => null,
|
||||
'log' => $faker->text(100),
|
||||
'lat' => $faker->latitude,
|
||||
'lon' => $faker->longitude,
|
||||
'heading' => $faker->numberBetween(0, 359),
|
||||
'altitude' => $faker->numberBetween(20, 400),
|
||||
'vs' => $faker->numberBetween(-5000, 5000),
|
||||
'gs' => $faker->numberBetween(300, 500),
|
||||
'id' => null,
|
||||
'pirep_id' => null,
|
||||
'log' => $faker->text(100),
|
||||
'lat' => $faker->latitude,
|
||||
'lon' => $faker->longitude,
|
||||
'distance' => $faker->randomFloat(2, 0, 6000),
|
||||
'heading' => $faker->numberBetween(0, 359),
|
||||
'altitude' => $faker->numberBetween(20, 400),
|
||||
'vs' => $faker->numberBetween(-5000, 5000),
|
||||
'gs' => $faker->numberBetween(300, 500),
|
||||
'transponder' => $faker->numberBetween(200, 9999),
|
||||
'autopilot' => $faker->text(10),
|
||||
'fuel_flow' => $faker->randomFloat(2, 100, 1000),
|
||||
'sim_time' => $faker->dateTime('now', 'UTC'),
|
||||
'autopilot' => $faker->text(10),
|
||||
'fuel' => $faker->randomFloat(2, 100, 1000),
|
||||
'fuel_flow' => $faker->randomFloat(2, 100, 1000),
|
||||
'sim_time' => $faker->dateTime('now', 'UTC'),
|
||||
];
|
||||
});
|
||||
|
||||
@@ -4,20 +4,23 @@ use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Models\Aircraft::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => null,
|
||||
'subfleet_id' => function() {
|
||||
'id' => null,
|
||||
'subfleet_id' => function () {
|
||||
return factory(App\Models\Subfleet::class)->create()->id;
|
||||
},
|
||||
'airport_id' => function () {
|
||||
return factory(App\Models\Airport::class)->create()->id;
|
||||
},
|
||||
'icao' => $faker->unique()->text(5),
|
||||
'name' => $faker->unique()->text(50),
|
||||
'iata' => $faker->unique()->text(5),
|
||||
'icao' => $faker->unique()->text(5),
|
||||
'name' => $faker->text(50),
|
||||
'registration' => $faker->unique()->text(10),
|
||||
'hex_code' => \App\Support\ICAO::createHexCode(),
|
||||
'active' => true,
|
||||
'created_at' => $faker->dateTimeBetween('-1 week', 'now'),
|
||||
'updated_at' => function (array $pirep) {
|
||||
'hex_code' => \App\Support\ICAO::createHexCode(),
|
||||
'zfw' => $faker->randomFloat(2, 0, 50000),
|
||||
'status' => \App\Models\Enums\AircraftStatus::ACTIVE,
|
||||
'state' => \App\Models\Enums\AircraftState::PARKED,
|
||||
'created_at' => $faker->dateTimeBetween('-1 week', 'now'),
|
||||
'updated_at' => function (array $pirep) {
|
||||
return $pirep['created_at'];
|
||||
},
|
||||
];
|
||||
|
||||
@@ -3,20 +3,23 @@
|
||||
use Faker\Generator as Faker;
|
||||
use Hashids\Hashids;
|
||||
|
||||
/**
|
||||
/*
|
||||
* Add any number of airports. Don't really care if they're real or not
|
||||
*/
|
||||
$factory->define(App\Models\Airline::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => null,
|
||||
'id' => null,
|
||||
'icao' => function (array $apt) use ($faker) {
|
||||
$hashids = new Hashids(microtime(), 5);
|
||||
$mt = str_replace('.', '', microtime(true));
|
||||
|
||||
return $hashids->encode($mt);
|
||||
},
|
||||
'iata' => function (array $apt) { return $apt['icao']; },
|
||||
'name' => $faker->sentence(3),
|
||||
'iata' => function (array $apt) {
|
||||
return $apt['icao'];
|
||||
},
|
||||
'name' => $faker->sentence(3),
|
||||
'country' => $faker->country,
|
||||
'active' => 1
|
||||
'active' => 1,
|
||||
];
|
||||
});
|
||||
|
||||
@@ -2,31 +2,54 @@
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
/**
|
||||
/*
|
||||
* Create an ICAO for use in the factory.
|
||||
*/
|
||||
if (!function_exists('createFactoryICAO')) {
|
||||
function createFactoryICAO(): string
|
||||
{
|
||||
$characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
$max = strlen($characters) - 1;
|
||||
$string = '';
|
||||
for ($i = 0; $i < 4; $i++) {
|
||||
try {
|
||||
$string .= $characters[random_int(0, $max)];
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
}
|
||||
|
||||
return $string;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Add any number of airports. Don't really care if they're real or not
|
||||
*/
|
||||
$factory->define(App\Models\Airport::class, function (Faker $faker) {
|
||||
|
||||
$used = [];
|
||||
return [
|
||||
'id' => function() {
|
||||
$characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
$string = '';
|
||||
$max = strlen($characters) - 1;
|
||||
for ($i = 0; $i < 5; $i++) {
|
||||
$string .= $characters[random_int(0, $max)];
|
||||
}
|
||||
'id' => function () use ($used) {
|
||||
do {
|
||||
$string = createFactoryICAO();
|
||||
} while (in_array($string, $used, true));
|
||||
|
||||
return $string;
|
||||
},
|
||||
'icao' => function(array $apt) { return $apt['id']; },
|
||||
'iata' => function (array $apt) { return $apt['id']; },
|
||||
'name' => $faker->sentence(3),
|
||||
'country' => $faker->country,
|
||||
'timezone' => $faker->timezone,
|
||||
'lat' => $faker->latitude,
|
||||
'lon' => $faker->longitude,
|
||||
'fuel_100ll_cost' => $faker->randomFloat(2),
|
||||
'fuel_jeta_cost' => $faker->randomFloat(2),
|
||||
'fuel_mogas_cost' => $faker->randomFloat(2),
|
||||
'icao' => function (array $apt) {
|
||||
return $apt['id'];
|
||||
},
|
||||
'iata' => function (array $apt) {
|
||||
return $apt['id'];
|
||||
},
|
||||
'name' => $faker->sentence(3),
|
||||
'country' => $faker->country,
|
||||
'timezone' => $faker->timezone,
|
||||
'lat' => $faker->latitude,
|
||||
'lon' => $faker->longitude,
|
||||
'hub' => false,
|
||||
'ground_handling_cost' => $faker->randomFloat(2, 0, 500),
|
||||
'fuel_100ll_cost' => $faker->randomFloat(2, 0, 100),
|
||||
'fuel_jeta_cost' => $faker->randomFloat(2, 0, 100),
|
||||
'fuel_mogas_cost' => $faker->randomFloat(2, 0, 100),
|
||||
];
|
||||
});
|
||||
|
||||
13
app/Database/factories/AwardsFactory.php
Normal file
13
app/Database/factories/AwardsFactory.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Models\Award::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => null,
|
||||
'name' => $faker->name,
|
||||
'description' => $faker->text(10),
|
||||
'ref_model' => null,
|
||||
'ref_model_params' => null,
|
||||
];
|
||||
});
|
||||
18
app/Database/factories/ExpenseFactory.php
Normal file
18
app/Database/factories/ExpenseFactory.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Enums\ExpenseType;
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Models\Expense::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => null,
|
||||
'airline_id' => null,
|
||||
'name' => $faker->text(20),
|
||||
'amount' => $faker->randomFloat(2, 100, 1000),
|
||||
'type' => ExpenseType::FLIGHT,
|
||||
'multiplier' => false,
|
||||
'ref_model' => \App\Models\Expense::class,
|
||||
'ref_model_id' => null,
|
||||
'active' => true,
|
||||
];
|
||||
});
|
||||
@@ -4,10 +4,13 @@ use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Models\Fare::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => null,
|
||||
'code' => $faker->text(5),
|
||||
'name' => $faker->text(20),
|
||||
'id' => null,
|
||||
'code' => $faker->unique()->text(50),
|
||||
'name' => $faker->text(50),
|
||||
'price' => $faker->randomFloat(2, 100, 1000),
|
||||
'cost' => function (array $fare) {
|
||||
return round($fare['price'] / 2);
|
||||
},
|
||||
'capacity' => $faker->randomFloat(0, 20, 500),
|
||||
];
|
||||
});
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Create flights
|
||||
*/
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
# Match the list available in tests/data/*.yml
|
||||
|
||||
$airlinesAvailable = [1];
|
||||
|
||||
$factory->define(App\Models\Flight::class, function (Faker $faker) use ($airlinesAvailable) {
|
||||
$factory->define(App\Models\Flight::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => null,
|
||||
'id' => $faker->unique()->numberBetween(10, 10000000),
|
||||
'airline_id' => function () {
|
||||
return factory(App\Models\Airline::class)->create()->id;
|
||||
},
|
||||
'flight_number' => $faker->unique()->numberBetween(10, 1000000),
|
||||
'route_code' => $faker->randomElement(['', $faker->text(5)]),
|
||||
'route_leg' => $faker->randomElement(['', $faker->text(5)]),
|
||||
'dpt_airport_id' => function() {
|
||||
'flight_number' => $faker->unique()->numberBetween(10, 1000000),
|
||||
'route_code' => $faker->randomElement(['', $faker->text(5)]),
|
||||
'route_leg' => $faker->randomElement(['', $faker->numberBetween(0, 1000)]),
|
||||
'dpt_airport_id' => function () {
|
||||
return factory(App\Models\Airport::class)->create()->id;
|
||||
},
|
||||
'arr_airport_id' => function () {
|
||||
@@ -24,15 +22,20 @@ $factory->define(App\Models\Flight::class, function (Faker $faker) use ($airline
|
||||
'alt_airport_id' => function () {
|
||||
return factory(App\Models\Airport::class)->create()->id;
|
||||
},
|
||||
'distance' => $faker->numberBetween(0, 3000),
|
||||
'route' => null,
|
||||
'dpt_time' => $faker->time(),
|
||||
'arr_time' => $faker->time(),
|
||||
'distance' => $faker->numberBetween(0, 3000),
|
||||
'route' => null,
|
||||
'level' => 0,
|
||||
'dpt_time' => $faker->time(),
|
||||
'arr_time' => $faker->time(),
|
||||
'flight_time' => $faker->numberBetween(60, 360),
|
||||
'has_bid' => false,
|
||||
'active' => true,
|
||||
'created_at' => $faker->dateTimeBetween('-1 week', 'now'),
|
||||
'updated_at' => function (array $flight) {
|
||||
'has_bid' => false,
|
||||
'active' => true,
|
||||
'visible' => true,
|
||||
'days' => 0,
|
||||
'start_date' => null,
|
||||
'end_date' => null,
|
||||
'created_at' => $faker->dateTimeBetween('-1 week', 'now'),
|
||||
'updated_at' => function (array $flight) {
|
||||
return $flight['created_at'];
|
||||
},
|
||||
];
|
||||
|
||||
9
app/Database/factories/JournalFactory.php
Normal file
9
app/Database/factories/JournalFactory.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Models\Journal::class, function (Faker $faker) {
|
||||
return [
|
||||
'currency' => 'USD',
|
||||
];
|
||||
});
|
||||
17
app/Database/factories/JournalTransactionsFactory.php
Normal file
17
app/Database/factories/JournalTransactionsFactory.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Models\JournalTransactions::class, function (Faker $faker) {
|
||||
return [
|
||||
'transaction_group' => \Ramsey\Uuid\Uuid::uuid4()->toString(),
|
||||
'journal_id' => function () {
|
||||
return factory(App\Models\Journal::class)->create()->id;
|
||||
},
|
||||
'credit' => $faker->numberBetween(100, 10000),
|
||||
'debit' => $faker->numberBetween(100, 10000),
|
||||
'currency' => 'USD',
|
||||
'memo' => $faker->sentence(6),
|
||||
'post_date' => \Carbon\Carbon::now(),
|
||||
];
|
||||
});
|
||||
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Enums\NavaidType;
|
||||
use Faker\Generator as Faker;
|
||||
use \App\Models\Enums\NavaidType;
|
||||
|
||||
$factory->define(App\Models\Navdata::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => str_replace(' ', '', str_replace('.', '', $faker->unique()->text(5))),
|
||||
'id' => str_replace(' ', '', str_replace('.', '', $faker->unique()->text(5))),
|
||||
'name' => str_replace('.', '', $faker->unique()->word),
|
||||
'type' => $faker->randomElement([NavaidType::VOR, NavaidType::NDB]),
|
||||
'lat' => $faker->latitude,
|
||||
'lon' => $faker->longitude,
|
||||
'lat' => $faker->latitude,
|
||||
'lon' => $faker->longitude,
|
||||
'freq' => $faker->randomFloat(2, 100, 1000),
|
||||
];
|
||||
});
|
||||
|
||||
14
app/Database/factories/NewsFactory.php
Normal file
14
app/Database/factories/NewsFactory.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Models\News::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => null,
|
||||
'user_id' => function () {
|
||||
return factory(App\Models\User::class)->create()->id;
|
||||
},
|
||||
'subject' => $faker->text(),
|
||||
'body' => $faker->sentence,
|
||||
];
|
||||
});
|
||||
@@ -3,13 +3,12 @@
|
||||
use Carbon\Carbon;
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
/**
|
||||
/*
|
||||
* Create a new PIREP
|
||||
*/
|
||||
$factory->define(App\Models\Pirep::class, function (Faker $faker) {
|
||||
|
||||
return [
|
||||
'id' => null,
|
||||
'id' => $faker->unique()->numberBetween(10, 10000000),
|
||||
'airline_id' => function () {
|
||||
return factory(App\Models\Airline::class)->create()->id;
|
||||
},
|
||||
@@ -21,33 +20,38 @@ $factory->define(App\Models\Pirep::class, function (Faker $faker) {
|
||||
},
|
||||
'flight_number' => function (array $pirep) {
|
||||
return factory(App\Models\Flight::class)->create([
|
||||
'airline_id' => $pirep['airline_id']
|
||||
'airline_id' => $pirep['airline_id'],
|
||||
])->flight_number;
|
||||
},
|
||||
'route_code' => null,
|
||||
'route_leg' => null,
|
||||
'route_code' => null,
|
||||
'route_leg' => null,
|
||||
'dpt_airport_id' => function () {
|
||||
return factory(App\Models\Airport::class)->create()->id;
|
||||
},
|
||||
'arr_airport_id' => function () {
|
||||
return factory(App\Models\Airport::class)->create()->id;
|
||||
},
|
||||
'level' => $faker->numberBetween(20, 400),
|
||||
'distance' => $faker->randomFloat(2, 0, 6000),
|
||||
'planned_distance' => $faker->randomFloat(2, 0, 6000),
|
||||
'flight_time' => $faker->numberBetween(60, 360),
|
||||
'level' => $faker->numberBetween(20, 400),
|
||||
'distance' => $faker->randomFloat(2, 0, 6000),
|
||||
'planned_distance' => $faker->randomFloat(2, 0, 6000),
|
||||
'flight_time' => $faker->numberBetween(60, 360),
|
||||
'planned_flight_time' => $faker->numberBetween(60, 360),
|
||||
'zfw' => $faker->randomFloat(2),
|
||||
'block_fuel' => $faker->randomFloat(2, 0, 30000),
|
||||
'fuel_used' => $faker->randomFloat(2, 0, 30000),
|
||||
'route' => $faker->text(200),
|
||||
'notes' => $faker->text(200),
|
||||
'source' => $faker->randomElement([PirepSource::MANUAL, PirepSource::ACARS]),
|
||||
'source_name' => 'Test Factory',
|
||||
'state' => PirepState::PENDING,
|
||||
'status' => PirepStatus::SCHEDULED,
|
||||
'created_at' => Carbon::now()->toDateTimeString(),
|
||||
'updated_at' => function(array $pirep) {
|
||||
'zfw' => $faker->randomFloat(2),
|
||||
'block_fuel' => $faker->randomFloat(2, 0, 30000),
|
||||
'fuel_used' => $faker->randomFloat(2, 0, 30000),
|
||||
'block_on_time' => Carbon::now('UTC'),
|
||||
'block_off_time' => function (array $pirep) {
|
||||
return $pirep['block_on_time']->subMinutes($pirep['flight_time']);
|
||||
},
|
||||
'route' => $faker->text(200),
|
||||
'notes' => $faker->text(200),
|
||||
'source' => $faker->randomElement([PirepSource::MANUAL, PirepSource::ACARS]),
|
||||
'source_name' => 'Test Factory',
|
||||
'state' => PirepState::PENDING,
|
||||
'status' => PirepStatus::SCHEDULED,
|
||||
'submitted_at' => Carbon::now('UTC')->toDateTimeString(),
|
||||
'created_at' => Carbon::now('UTC')->toDateTimeString(),
|
||||
'updated_at' => function (array $pirep) {
|
||||
return $pirep['created_at'];
|
||||
},
|
||||
];
|
||||
|
||||
@@ -11,11 +11,13 @@ use Faker\Generator as Faker;
|
||||
*/
|
||||
$factory->define(App\Models\Rank::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => null,
|
||||
'name' => $faker->unique()->text(50),
|
||||
'hours' => $faker->numberBetween(10, 50),
|
||||
'auto_approve_acars' => 0,
|
||||
'auto_approve_manual' => 0,
|
||||
'auto_promote' => 0,
|
||||
'id' => null,
|
||||
'name' => $faker->unique()->text(50),
|
||||
'hours' => $faker->numberBetween(10, 50),
|
||||
'acars_base_pay_rate' => $faker->numberBetween(10, 100),
|
||||
'manual_base_pay_rate' => $faker->numberBetween(10, 100),
|
||||
'auto_approve_acars' => 0,
|
||||
'auto_approve_manual' => 0,
|
||||
'auto_promote' => 0,
|
||||
];
|
||||
});
|
||||
|
||||
@@ -4,11 +4,12 @@ use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Models\Subfleet::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => null,
|
||||
'id' => null,
|
||||
'airline_id' => function () {
|
||||
return factory(App\Models\Airline::class)->create()->id;
|
||||
},
|
||||
'name' => $faker->unique()->text(50),
|
||||
'type' => $faker->unique()->text(7),
|
||||
'name' => $faker->unique()->text(50),
|
||||
'type' => $faker->unique()->text(7),
|
||||
'ground_handling_multiplier' => $faker->numberBetween(50, 200),
|
||||
];
|
||||
});
|
||||
|
||||
@@ -1,26 +1,25 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
use App\Models\Enums\UserState;
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Models\User::class, function (Faker $faker)
|
||||
{
|
||||
$factory->define(App\Models\User::class, function (Faker $faker) {
|
||||
static $password;
|
||||
|
||||
return [
|
||||
'id' => null,
|
||||
'name' => $faker->name,
|
||||
'email' => $faker->safeEmail,
|
||||
'password' => $password ?: $password = Hash::make('secret'),
|
||||
'api_key' => $faker->sha1,
|
||||
'id' => null,
|
||||
'name' => $faker->name,
|
||||
'email' => $faker->safeEmail,
|
||||
'password' => $password ?: $password = Hash::make('secret'),
|
||||
'api_key' => $faker->sha1,
|
||||
'airline_id' => function () {
|
||||
return factory(App\Models\Airline::class)->create()->id;
|
||||
},
|
||||
'rank_id' => 1,
|
||||
'flights' => $faker->numberBetween(0, 1000),
|
||||
'flight_time' => $faker->numberBetween(0, 10000),
|
||||
'transfer_time' => $faker->numberBetween(0, 10000),
|
||||
'state' => UserState::ACTIVE,
|
||||
'rank_id' => 1,
|
||||
'flights' => $faker->numberBetween(0, 1000),
|
||||
'flight_time' => $faker->numberBetween(0, 10000),
|
||||
'transfer_time' => $faker->numberBetween(0, 10000),
|
||||
'state' => UserState::ACTIVE,
|
||||
'remember_token' => $faker->unique()->text(5),
|
||||
];
|
||||
});
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Migrations\Migration;
|
||||
use App\Interfaces\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreateSettingsTable extends Migration
|
||||
{
|
||||
private $migrationSvc;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->migrationSvc = new \Modules\Installer\Services\MigrationService();
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -22,7 +29,7 @@ class CreateSettingsTable extends Migration
|
||||
$table->string('default')->nullable();
|
||||
$table->string('group')->nullable();
|
||||
$table->string('type')->nullable();
|
||||
$table->string('options')->nullable();
|
||||
$table->text('options')->nullable();
|
||||
$table->string('description')->nullable();
|
||||
|
||||
$table->primary('id');
|
||||
@@ -30,181 +37,7 @@ class CreateSettingsTable extends Migration
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
/**
|
||||
* Initial default settings
|
||||
*/
|
||||
|
||||
$this->addSetting('general.start_date', [
|
||||
'name' => 'Start Date',
|
||||
'group' => 'general',
|
||||
'value' => '',
|
||||
'type' => 'date',
|
||||
'description' => 'The date your VA started',
|
||||
]);
|
||||
|
||||
$this->addSetting('general.admin_email', [
|
||||
'name' => 'Admin Email',
|
||||
'group' => 'general',
|
||||
'value' => '',
|
||||
'type' => 'text',
|
||||
'description' => 'Email where notices, etc are sent',
|
||||
]);
|
||||
|
||||
$this->addSetting('general.currency', [
|
||||
'name' => 'Currency to Use',
|
||||
'group' => 'general',
|
||||
'value' => 'dollar',
|
||||
'type' => 'select',
|
||||
'options' => 'dollar,euro,gbp,yen,jpy,rupee,ruble',
|
||||
'description' => 'Currency to show in the interface',
|
||||
]);
|
||||
|
||||
$this->addSetting('general.distance_unit', [
|
||||
'name' => 'Distance Units',
|
||||
'group' => 'general',
|
||||
'value' => 'NM',
|
||||
'type' => 'select',
|
||||
'options' => 'km,mi,NM',
|
||||
'description' => 'The distance unit to show',
|
||||
]);
|
||||
|
||||
$this->addSetting('general.weight_unit', [
|
||||
'name' => 'Weight Units',
|
||||
'group' => 'general',
|
||||
'value' => 'lbs',
|
||||
'type' => 'select',
|
||||
'options' => 'lbs,kg',
|
||||
'description' => 'The weight unit',
|
||||
]);
|
||||
|
||||
$this->addSetting('general.speed_unit', [
|
||||
'name' => 'Speed Units',
|
||||
'group' => 'general',
|
||||
'value' => 'knot',
|
||||
'type' => 'select',
|
||||
'options' => 'km/h,knot',
|
||||
'description' => 'The speed unit',
|
||||
]);
|
||||
|
||||
$this->addSetting('general.altitude_unit', [
|
||||
'name' => 'Altitude Units',
|
||||
'group' => 'general',
|
||||
'value' => 'ft',
|
||||
'type' => 'select',
|
||||
'options' => 'ft,m',
|
||||
'description' => 'The altitude units',
|
||||
]);
|
||||
|
||||
$this->addSetting('general.fuel_unit', [
|
||||
'name' => 'Fuel Units',
|
||||
'group' => 'general',
|
||||
'value' => 'lbs',
|
||||
'type' => 'select',
|
||||
'options' => 'lbs,kg',
|
||||
'description' => 'The units for fuel',
|
||||
]);
|
||||
|
||||
/**
|
||||
* BIDS
|
||||
*/
|
||||
|
||||
$this->addSetting('bids.disable_flight_on_bid', [
|
||||
'name' => 'Disable flight on bid',
|
||||
'group' => 'bids',
|
||||
'value' => true,
|
||||
'type' => 'boolean',
|
||||
'description' => 'When a flight is bid on, no one else can bid on it',
|
||||
]);
|
||||
|
||||
$this->addSetting('bids.allow_multiple_bids', [
|
||||
'name' => 'Allow multiple bids',
|
||||
'group' => 'bids',
|
||||
'value' => true,
|
||||
'type' => 'boolean',
|
||||
'description' => 'Whether or not someone can bid on multiple flights',
|
||||
]);
|
||||
|
||||
/**
|
||||
* PIREPS
|
||||
*/
|
||||
|
||||
$this->addSetting('pireps.duplicate_check_time', [
|
||||
'name' => 'PIREP duplicate time check',
|
||||
'group' => 'pireps',
|
||||
'value' => 10,
|
||||
'type' => 'int',
|
||||
'description' => 'The time in minutes to check for a duplicate PIREP',
|
||||
]);
|
||||
|
||||
/*$this->addSetting('pireps.hide_cancelled_pireps', [
|
||||
'name' => 'Hide Cancelled PIREPs',
|
||||
'group' => 'pireps',
|
||||
'value' => true,
|
||||
'type' => 'boolean',
|
||||
'description' => 'Hide any cancelled PIREPs in the front-end',
|
||||
]);*/
|
||||
|
||||
$this->addSetting('pireps.restrict_aircraft_to_rank', [
|
||||
'name' => 'Restrict Aircraft to Ranks',
|
||||
'group' => 'pireps',
|
||||
'value' => true,
|
||||
'type' => 'boolean',
|
||||
'description' => 'Aircraft that can be flown are restricted to a user\'s rank',
|
||||
]);
|
||||
|
||||
$this->addSetting('pireps.only_aircraft_at_dep_airport', [
|
||||
'name' => 'Restrict Aircraft At Departure',
|
||||
'group' => 'pireps',
|
||||
'value' => false,
|
||||
'type' => 'boolean',
|
||||
'description' => 'Only allow aircraft that are at the departure airport',
|
||||
]);
|
||||
|
||||
/**
|
||||
* PILOTS
|
||||
*/
|
||||
|
||||
$this->addSetting('pilots.id_length', [
|
||||
'name' => 'Pilot ID Length',
|
||||
'group' => 'pilots',
|
||||
'value' => 4,
|
||||
'default' => 4,
|
||||
'type' => 'int',
|
||||
'description' => 'The length of a pilot\'s ID',
|
||||
]);
|
||||
|
||||
$this->addSetting('pilot.auto_accept', [
|
||||
'name' => 'Auto Accept New Pilot',
|
||||
'group' => 'pilots',
|
||||
'value' => true,
|
||||
'type' => 'boolean',
|
||||
'description' => 'Automatically accept a pilot when they register',
|
||||
]);
|
||||
|
||||
$this->addSetting('pilots.only_flights_from_current', [
|
||||
'name' => 'Flights from Current',
|
||||
'group' => 'pilots',
|
||||
'value' => false,
|
||||
'type' => 'boolean',
|
||||
'description' => 'Only show/allow flights from their current location',
|
||||
]);
|
||||
|
||||
$this->addSetting('pilot.auto_leave_days', [
|
||||
'name' => 'Pilot to ON LEAVE days',
|
||||
'group' => 'pilots',
|
||||
'value' => 30,
|
||||
'default' => 30,
|
||||
'type' => 'int',
|
||||
'description' => 'Automatically set a pilot to ON LEAVE status after N days of no activity',
|
||||
]);
|
||||
|
||||
$this->addSetting('pilots.hide_inactive', [
|
||||
'name' => 'Hide Inactive Pilots',
|
||||
'group' => 'pilots',
|
||||
'value' => true,
|
||||
'type' => 'boolean',
|
||||
'description' => 'Don\'t show inactive pilots in the public view',
|
||||
]);
|
||||
$this->migrationSvc->updateAllSettings();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Migrations\Migration;
|
||||
use App\Interfaces\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
@@ -28,10 +28,12 @@ class CreateUsersTable extends Migration
|
||||
$table->unsignedBigInteger('flights')->default(0);
|
||||
$table->unsignedBigInteger('flight_time')->nullable()->default(0);
|
||||
$table->unsignedBigInteger('transfer_time')->nullable()->default(0);
|
||||
$table->decimal('balance')->nullable();
|
||||
$table->string('avatar')->nullable();
|
||||
$table->string('timezone', 64)->nullable();
|
||||
$table->unsignedTinyInteger('status')->nullable()->default(0);
|
||||
$table->unsignedTinyInteger('state')->nullable()->default(0);
|
||||
$table->boolean('toc_accepted')->nullable();
|
||||
$table->boolean('opt_in')->nullable();
|
||||
$table->boolean('active')->nullable();
|
||||
$table->ipAddress('last_ip')->nullable();
|
||||
$table->rememberToken();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Migrations\Migration;
|
||||
use App\Interfaces\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class RolesPermissionsTables extends Migration
|
||||
@@ -8,7 +8,7 @@ class RolesPermissionsTables extends Migration
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
@@ -67,28 +67,27 @@ class RolesPermissionsTables extends Migration
|
||||
$table->primary(['permission_id', 'role_id']);
|
||||
});
|
||||
|
||||
# create a default user/role
|
||||
// create a default user/role
|
||||
$roles = [
|
||||
[
|
||||
'id' => 1,
|
||||
'name' => 'admin',
|
||||
'id' => 1,
|
||||
'name' => 'admin',
|
||||
'display_name' => 'Administrators',
|
||||
],
|
||||
[
|
||||
'id' => 2,
|
||||
'name' => 'user',
|
||||
'display_name' => 'Pilot'
|
||||
'id' => 2,
|
||||
'name' => 'user',
|
||||
'display_name' => 'Pilot',
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
$this->addData('roles', $roles);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use App\Interfaces\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use App\Interfaces\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use App\Interfaces\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreateAirlinesTable extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
use App\Interfaces\Migration;
|
||||
use App\Models\Enums\AircraftState;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use App\Models\Enums\AircraftStatus;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreateAircraftsTable extends Migration
|
||||
@@ -12,6 +13,7 @@ class CreateAircraftsTable extends Migration
|
||||
$table->increments('id');
|
||||
$table->unsignedInteger('subfleet_id');
|
||||
$table->string('icao', 4)->nullable();
|
||||
$table->string('iata', 4)->nullable();
|
||||
$table->string('airport_id', 5)->nullable();
|
||||
$table->timestamp('landing_time')->nullable();
|
||||
$table->string('name', 50);
|
||||
@@ -19,14 +21,13 @@ class CreateAircraftsTable extends Migration
|
||||
$table->string('hex_code', 10)->nullable();
|
||||
$table->unsignedDecimal('zfw')->nullable()->default(0);
|
||||
$table->unsignedBigInteger('flight_time')->nullable()->default(0);
|
||||
$table->boolean('active')->default(true);
|
||||
$table->char('status', 1)->default(AircraftStatus::ACTIVE);
|
||||
$table->unsignedTinyInteger('state')->default(AircraftState::PARKED);
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique('registration');
|
||||
$table->index('airport_id');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use App\Interfaces\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreateFaresTable extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -15,7 +14,7 @@ class CreateFaresTable extends Migration
|
||||
{
|
||||
Schema::create('fares', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('code', 50);
|
||||
$table->string('code', 50)->unique();
|
||||
$table->string('name', 50);
|
||||
$table->unsignedDecimal('price')->nullable()->default(0.00);
|
||||
$table->unsignedDecimal('cost')->nullable()->default(0.00);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use App\Interfaces\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreateAirportsTable extends Migration
|
||||
@@ -8,19 +8,24 @@ class CreateAirportsTable extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::create('airports', function (Blueprint $table) {
|
||||
$table->string('id', 5)->primary();
|
||||
$table->string('iata', 5)->nullable();
|
||||
$table->string('icao', 5);
|
||||
$table->string('id', 4)->primary();
|
||||
$table->string('iata', 4)->nullable();
|
||||
$table->string('icao', 4);
|
||||
$table->string('name', 100);
|
||||
$table->string('location', 100)->nullable();
|
||||
$table->string('country', 64)->nullable();
|
||||
$table->string('timezone', 64)->nullable();
|
||||
$table->boolean('hub')->default(false);
|
||||
$table->float('lat', 7, 4)->nullable()->default(0.0);
|
||||
$table->float('lon', 7, 4)->nullable()->default(0.0);
|
||||
$table->unsignedDecimal('ground_handling_cost')->nullable()->default(0);
|
||||
$table->unsignedDecimal('fuel_100ll_cost')->nullable()->default(0);
|
||||
$table->unsignedDecimal('fuel_jeta_cost')->nullable()->default(0);
|
||||
$table->unsignedDecimal('fuel_mogas_cost')->nullable()->default(0);
|
||||
$table->float('lat', 7, 4)->nullable()->default(0.0);
|
||||
$table->float('lon', 7, 4)->nullable()->default(0.0);
|
||||
|
||||
$table->index('icao');
|
||||
$table->index('iata');
|
||||
$table->index('hub');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
<?php
|
||||
|
||||
use App\Interfaces\Migration;
|
||||
use App\Models\Enums\FlightType;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreateFlightTables extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -15,24 +14,29 @@ class CreateFlightTables extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::create('flights', function (Blueprint $table) {
|
||||
$table->string('id', \App\Models\Flight::ID_MAX_LENGTH);
|
||||
$table->string('id', \App\Interfaces\Model::ID_MAX_LENGTH);
|
||||
$table->unsignedInteger('airline_id');
|
||||
$table->string('flight_number', 10);
|
||||
$table->unsignedInteger('flight_number');
|
||||
$table->string('route_code', 5)->nullable();
|
||||
$table->string('route_leg', 5)->nullable();
|
||||
$table->string('dpt_airport_id', 5);
|
||||
$table->string('arr_airport_id', 5);
|
||||
$table->string('alt_airport_id', 5)->nullable();
|
||||
$table->unsignedInteger('route_leg')->nullable();
|
||||
$table->string('dpt_airport_id', 4);
|
||||
$table->string('arr_airport_id', 4);
|
||||
$table->string('alt_airport_id', 4)->nullable();
|
||||
$table->string('dpt_time', 10)->nullable();
|
||||
$table->string('arr_time', 10)->nullable();
|
||||
$table->unsignedInteger('level')->nullable()->default(0);
|
||||
$table->unsignedDecimal('distance')->nullable()->default(0.0);
|
||||
$table->unsignedInteger('flight_time')->nullable();
|
||||
$table->tinyInteger('flight_type')->default(FlightType::PASSENGER);
|
||||
$table->char('flight_type', 1)->default(FlightType::SCHED_PAX);
|
||||
$table->text('route')->nullable();
|
||||
$table->text('notes')->nullable();
|
||||
$table->boolean('scheduled')->default(false)->nullable();
|
||||
$table->unsignedTinyInteger('days')->nullable();
|
||||
$table->date('start_date')->nullable();
|
||||
$table->date('end_date')->nullable();
|
||||
$table->boolean('has_bid')->default(false);
|
||||
$table->boolean('active')->default(true);
|
||||
$table->boolean('visible')->default(true); // used by the cron
|
||||
$table->timestamps();
|
||||
|
||||
$table->primary('id');
|
||||
@@ -43,7 +47,7 @@ class CreateFlightTables extends Migration
|
||||
});
|
||||
|
||||
Schema::create('flight_fare', function (Blueprint $table) {
|
||||
$table->string('flight_id', \App\Models\Flight::ID_MAX_LENGTH);
|
||||
$table->string('flight_id', \App\Interfaces\Model::ID_MAX_LENGTH);
|
||||
$table->unsignedInteger('fare_id');
|
||||
$table->string('price', 10)->nullable();
|
||||
$table->string('cost', 10)->nullable();
|
||||
@@ -53,15 +57,37 @@ class CreateFlightTables extends Migration
|
||||
$table->primary(['flight_id', 'fare_id']);
|
||||
});
|
||||
|
||||
/*
|
||||
* Hold a master list of fields
|
||||
*/
|
||||
Schema::create('flight_fields', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('flight_id', \App\Models\Flight::ID_MAX_LENGTH);
|
||||
$table->string('name', 50);
|
||||
$table->string('slug', 50)->nullable();
|
||||
});
|
||||
|
||||
/*
|
||||
* The values for the actual fields
|
||||
*/
|
||||
Schema::create('flight_field_values', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('flight_id', \App\Interfaces\Model::ID_MAX_LENGTH);
|
||||
$table->string('name', 50);
|
||||
$table->string('slug', 50)->nullable();
|
||||
$table->text('value');
|
||||
$table->timestamps();
|
||||
|
||||
$table->index('flight_id');
|
||||
});
|
||||
|
||||
Schema::create('flight_subfleet', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->unsignedInteger('subfleet_id');
|
||||
$table->string('flight_id', \App\Interfaces\Model::ID_MAX_LENGTH);
|
||||
|
||||
$table->index(['subfleet_id', 'flight_id']);
|
||||
$table->index(['flight_id', 'subfleet_id']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,6 +99,7 @@ class CreateFlightTables extends Migration
|
||||
{
|
||||
Schema::drop('flight_fields');
|
||||
Schema::drop('flight_fare');
|
||||
Schema::drop('flight_subfleet');
|
||||
Schema::drop('flights');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Migrations\Migration;
|
||||
use App\Interfaces\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreateRanksTable extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -16,11 +15,15 @@ class CreateRanksTable extends Migration
|
||||
Schema::create('ranks', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name', 50);
|
||||
$table->string('image_link')->nullable();
|
||||
$table->string('image_url')->nullable();
|
||||
$table->unsignedInteger('hours')->default(0);
|
||||
$table->unsignedDecimal('acars_base_pay_rate')->nullable()->default(0);
|
||||
$table->unsignedDecimal('manual_base_pay_rate')->nullable()->default(0);
|
||||
$table->boolean('auto_approve_acars')->nullable()->default(false);
|
||||
$table->boolean('auto_approve_manual')->nullable()->default(false);
|
||||
$table->boolean('auto_promote')->nullable()->default(true);
|
||||
$table->boolean('auto_approve_above_score')->nullable()->default(false);
|
||||
$table->smallInteger('auto_approve_score')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique('name');
|
||||
@@ -31,10 +34,12 @@ class CreateRanksTable extends Migration
|
||||
*/
|
||||
$ranks = [
|
||||
[
|
||||
'id' => 1,
|
||||
'name' => 'New Pilot',
|
||||
'hours' => 0,
|
||||
]
|
||||
'id' => 1,
|
||||
'name' => 'New Pilot',
|
||||
'hours' => 0,
|
||||
'acars_base_pay_rate' => 50,
|
||||
'manual_base_pay_rate' => 25,
|
||||
],
|
||||
];
|
||||
|
||||
$this->addData('ranks', $ranks);
|
||||
|
||||
@@ -1,63 +1,47 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use App\Interfaces\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
/**
|
||||
* Class CreateSubfleetTables
|
||||
*/
|
||||
class CreateSubfleetTables extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('subfleets', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->unsignedInteger('airline_id')->nullable();
|
||||
$table->string('type', 50)->unique();
|
||||
$table->string('name', 50);
|
||||
$table->string('type', 50);
|
||||
$table->unsignedDecimal('cost_block_hour')->default(0)->nullable();
|
||||
$table->unsignedDecimal('cost_delay_minute')->default(0)->nullable();
|
||||
$table->unsignedTinyInteger('fuel_type')->nullable();
|
||||
$table->unsignedDecimal('ground_handling_multiplier')->nullable()->default(100);
|
||||
$table->unsignedDecimal('cargo_capacity')->nullable();
|
||||
$table->unsignedDecimal('fuel_capacity')->nullable();
|
||||
$table->unsignedDecimal('gross_weight')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('subfleet_expenses', function(Blueprint $table) {
|
||||
$table->unsignedBigInteger('subfleet_id');
|
||||
$table->string('name', 50);
|
||||
$table->unsignedDecimal('cost');
|
||||
|
||||
$table->primary(['subfleet_id', 'name']);
|
||||
});
|
||||
|
||||
Schema::create('subfleet_fare', function (Blueprint $table) {
|
||||
$table->unsignedInteger('subfleet_id');
|
||||
$table->unsignedInteger('fare_id');
|
||||
$table->unsignedDecimal('price')->nullable();
|
||||
$table->unsignedDecimal('cost')->nullable();
|
||||
$table->unsignedInteger('capacity')->nullable();
|
||||
$table->string('price')->nullable();
|
||||
$table->string('cost')->nullable();
|
||||
$table->string('capacity')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->primary(['subfleet_id', 'fare_id']);
|
||||
$table->index(['fare_id', 'subfleet_id']);
|
||||
});
|
||||
|
||||
Schema::create('subfleet_flight', function(Blueprint $table) {
|
||||
$table->unsignedInteger('subfleet_id');
|
||||
$table->string('flight_id', 12);
|
||||
|
||||
$table->primary(['subfleet_id', 'flight_id']);
|
||||
$table->index(['flight_id', 'subfleet_id']);
|
||||
});
|
||||
|
||||
Schema::create('subfleet_rank', function(Blueprint $table) {
|
||||
Schema::create('subfleet_rank', function (Blueprint $table) {
|
||||
$table->unsignedInteger('rank_id');
|
||||
$table->unsignedInteger('subfleet_id');
|
||||
$table->unsignedDecimal('acars_pay')->nullable();
|
||||
$table->unsignedDecimal('manual_pay')->nullable();
|
||||
$table->string('acars_pay')->nullable();
|
||||
$table->string('manual_pay')->nullable();
|
||||
|
||||
$table->primary(['rank_id', 'subfleet_id']);
|
||||
$table->index(['subfleet_id', 'rank_id']);
|
||||
@@ -72,9 +56,7 @@ class CreateSubfleetTables extends Migration
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('subfleets');
|
||||
Schema::dropIfExists('subfleet_expenses');
|
||||
Schema::dropIfExists('subfleet_fare');
|
||||
Schema::dropIfExists('subfleet_flight');
|
||||
Schema::dropIfExists('subfleet_rank');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
<?php
|
||||
|
||||
use App\Interfaces\Migration;
|
||||
use App\Models\Enums\FlightType;
|
||||
use App\Models\Enums\PirepState;
|
||||
use App\Models\Enums\PirepStatus;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreatePirepTables extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -17,16 +16,17 @@ class CreatePirepTables extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::create('pireps', function (Blueprint $table) {
|
||||
$table->string('id', \App\Models\Pirep::ID_MAX_LENGTH);
|
||||
$table->string('id', \App\Interfaces\Model::ID_MAX_LENGTH);
|
||||
$table->unsignedInteger('user_id');
|
||||
$table->unsignedInteger('airline_id');
|
||||
$table->unsignedInteger('aircraft_id')->nullable();
|
||||
$table->string('flight_id', \App\Models\Flight::ID_MAX_LENGTH)->nullable();
|
||||
$table->string('flight_number', 10)->nullable();
|
||||
$table->string('route_code', 5)->nullable();
|
||||
$table->string('route_leg', 5)->nullable();
|
||||
$table->string('dpt_airport_id', 5);
|
||||
$table->string('arr_airport_id', 5);
|
||||
$table->char('flight_type', 1)->default(FlightType::SCHED_PAX);
|
||||
$table->string('dpt_airport_id', 4);
|
||||
$table->string('arr_airport_id', 4);
|
||||
$table->string('alt_airport_id', 4)->nullable();
|
||||
$table->unsignedInteger('level')->nullable();
|
||||
$table->unsignedDecimal('distance')->nullable();
|
||||
$table->unsignedDecimal('planned_distance')->nullable();
|
||||
@@ -36,56 +36,44 @@ class CreatePirepTables extends Migration
|
||||
$table->unsignedDecimal('block_fuel')->nullable();
|
||||
$table->unsignedDecimal('fuel_used')->nullable();
|
||||
$table->decimal('landing_rate')->nullable();
|
||||
$table->smallInteger('score')->nullable();
|
||||
$table->text('route')->nullable();
|
||||
$table->text('notes')->nullable();
|
||||
$table->unsignedTinyInteger('source')->nullable()->default(0);
|
||||
$table->string('source_name', 25)->nullable();
|
||||
$table->tinyInteger('flight_type')->default(FlightType::PASSENGER);
|
||||
$table->string('source_name', 50)->nullable();
|
||||
$table->tinyInteger('state')->default(PirepState::PENDING);
|
||||
$table->tinyInteger('status')->default(PirepStatus::SCHEDULED);
|
||||
$table->char('status', 3)->default(PirepStatus::SCHEDULED);
|
||||
$table->dateTime('submitted_at')->nullable();
|
||||
$table->dateTime('block_off_time')->nullable();
|
||||
$table->dateTime('block_on_time')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->primary('id');
|
||||
$table->index('user_id');
|
||||
$table->index('flight_id');
|
||||
$table->index('flight_number');
|
||||
$table->index('dpt_airport_id');
|
||||
$table->index('arr_airport_id');
|
||||
});
|
||||
|
||||
Schema::create('pirep_comments', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('pirep_id', \App\Models\Pirep::ID_MAX_LENGTH);
|
||||
$table->string('pirep_id', \App\Interfaces\Model::ID_MAX_LENGTH);
|
||||
$table->unsignedInteger('user_id');
|
||||
$table->text('comment');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
/*
|
||||
* Financial tables/fields
|
||||
*/
|
||||
Schema::create('pirep_expenses', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('pirep_id', \App\Models\Pirep::ID_MAX_LENGTH);
|
||||
$table->string('name');
|
||||
$table->double('value')->nullable();
|
||||
|
||||
$table->index('pirep_id');
|
||||
});
|
||||
|
||||
Schema::create('pirep_fares', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('pirep_id', \App\Models\Pirep::ID_MAX_LENGTH);
|
||||
$table->unsignedBigInteger('fare_id');
|
||||
$table->unsignedInteger('count')->nullable();
|
||||
$table->string('pirep_id', \App\Interfaces\Model::ID_MAX_LENGTH);
|
||||
$table->unsignedInteger('fare_id');
|
||||
$table->unsignedInteger('count')->nullable()->default(0);
|
||||
|
||||
$table->index('pirep_id');
|
||||
});
|
||||
|
||||
/*
|
||||
* Additional PIREP data
|
||||
*/
|
||||
Schema::create('pirep_fields', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->increments('id');
|
||||
$table->string('name', 50);
|
||||
$table->string('slug', 50)->nullable();
|
||||
$table->boolean('required')->nullable()->default(false);
|
||||
@@ -93,10 +81,11 @@ class CreatePirepTables extends Migration
|
||||
|
||||
Schema::create('pirep_field_values', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('pirep_id', \App\Models\Pirep::ID_MAX_LENGTH);
|
||||
$table->string('pirep_id', \App\Interfaces\Model::ID_MAX_LENGTH);
|
||||
$table->string('name', 50);
|
||||
$table->string('slug', 50)->nullable();
|
||||
$table->string('value')->nullable();
|
||||
$table->string('source')->nullable();
|
||||
$table->unsignedTinyInteger('source');
|
||||
$table->timestamps();
|
||||
|
||||
$table->index('pirep_id');
|
||||
@@ -112,7 +101,6 @@ class CreatePirepTables extends Migration
|
||||
{
|
||||
Schema::dropIfExists('pireps');
|
||||
Schema::dropIfExists('pirep_comments');
|
||||
Schema::dropIfExists('pirep_expenses');
|
||||
Schema::dropIfExists('pirep_fares');
|
||||
Schema::dropIfExists('pirep_fields');
|
||||
Schema::dropIfExists('pirep_field_values');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use App\Interfaces\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
@@ -13,10 +13,10 @@ class CreateBidsTable extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('user_bids', function (Blueprint $table) {
|
||||
Schema::create('bids', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->unsignedInteger('user_id');
|
||||
$table->string('flight_id', \App\Models\Flight::ID_MAX_LENGTH);
|
||||
$table->string('flight_id', \App\Interfaces\Model::ID_MAX_LENGTH);
|
||||
$table->timestamps();
|
||||
|
||||
$table->index('user_id');
|
||||
@@ -31,6 +31,6 @@ class CreateBidsTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('user_bids');
|
||||
Schema::dropIfExists('bids');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use App\Interfaces\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use App\Interfaces\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use App\Interfaces\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
@@ -13,7 +13,7 @@ class CreateNavdataTables extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
/**
|
||||
/*
|
||||
* See for defs, modify/update based on this
|
||||
* https://github.com/skiselkov/openfmc/blob/master/airac.h
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use App\Interfaces\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
@@ -15,20 +15,23 @@ class CreateAcarsTables extends Migration
|
||||
{
|
||||
Schema::create('acars', function (Blueprint $table) {
|
||||
$table->string('id', 12);
|
||||
$table->string('pirep_id', \App\Models\Pirep::ID_MAX_LENGTH);
|
||||
$table->string('pirep_id', \App\Interfaces\Model::ID_MAX_LENGTH);
|
||||
$table->unsignedTinyInteger('type');
|
||||
$table->unsignedInteger('nav_type')->nullable();
|
||||
$table->unsignedInteger('order')->default(0);
|
||||
$table->string('name')->nullable();
|
||||
$table->char('status', 3)->default(PirepStatus::SCHEDULED);
|
||||
$table->string('log')->nullable();
|
||||
$table->float('lat', 7, 4)->nullable()->default(0.0);
|
||||
$table->float('lon', 7, 4)->nullable()->default(0.0);
|
||||
$table->unsignedInteger('distance')->nullable();
|
||||
$table->unsignedInteger('heading')->nullable();
|
||||
$table->unsignedInteger('altitude')->nullable();
|
||||
$table->integer('vs')->nullable();
|
||||
$table->unsignedInteger('gs')->nullable();
|
||||
$table->unsignedInteger('transponder')->nullable();
|
||||
$table->string('autopilot')->nullable();
|
||||
$table->decimal('fuel')->nullable();
|
||||
$table->decimal('fuel_flow')->nullable();
|
||||
$table->string('sim_time')->nullable();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Migrations\Migration;
|
||||
use App\Interfaces\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreateStatsTable extends Migration
|
||||
@@ -22,7 +22,6 @@ class CreateStatsTable extends Migration
|
||||
$table->primary('id');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
/*$this->addCounterGroups([
|
||||
'flights' => 1,
|
||||
]);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use App\Interfaces\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
use App\Interfaces\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAwardsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('awards', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->text('description')->nullable();
|
||||
$table->text('image_url')->nullable();
|
||||
|
||||
// ref fields are expenses tied to some model object
|
||||
// EG, the airports has an internal expense for gate costs
|
||||
$table->string('ref_model')->nullable();
|
||||
$table->text('ref_model_params')->nullable();
|
||||
//$table->string('ref_model_id', 36)->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['ref_model']);
|
||||
});
|
||||
|
||||
Schema::create('user_awards', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->unsignedInteger('user_id');
|
||||
$table->unsignedInteger('award_id');
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['user_id', 'award_id']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('awards');
|
||||
Schema::dropIfExists('user_awards');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use App\Interfaces\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExpensesTable extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::create('expenses', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->unsignedInteger('airline_id')->nullable();
|
||||
|
||||
$table->string('name');
|
||||
$table->unsignedInteger('amount');
|
||||
$table->char('type');
|
||||
$table->boolean('charge_to_user')->nullable()->default(false);
|
||||
$table->boolean('multiplier')->nullable()->default(0);
|
||||
$table->boolean('active')->nullable()->default(true);
|
||||
|
||||
// ref fields are expenses tied to some model object
|
||||
// EG, the airports has an internal expense for gate costs
|
||||
$table->string('ref_model')->nullable();
|
||||
$table->string('ref_model_id', 36)->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['ref_model', 'ref_model_id']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('expenses');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use App\Interfaces\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateJournalTransactionsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('journal_transactions', function (Blueprint $table) {
|
||||
$table->char('id', 36)->unique();
|
||||
$table->string('transaction_group')->nullable();
|
||||
$table->integer('journal_id');
|
||||
$table->unsignedBigInteger('credit')->nullable();
|
||||
$table->unsignedBigInteger('debit')->nullable();
|
||||
$table->char('currency', 5);
|
||||
$table->text('memo')->nullable();
|
||||
$table->string('tags')->nullable();
|
||||
$table->string('ref_model', 50)->nullable();
|
||||
$table->string('ref_model_id', 36)->nullable();
|
||||
$table->timestamps();
|
||||
$table->date('post_date');
|
||||
|
||||
$table->primary('id');
|
||||
$table->index('journal_id');
|
||||
$table->index('transaction_group');
|
||||
$table->index(['ref_model', 'ref_model_id']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('journal_transactions');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use App\Interfaces\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateJournalsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('journals', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->unsignedInteger('ledger_id')->nullable();
|
||||
$table->unsignedTinyInteger('type')->default(0);
|
||||
$table->bigInteger('balance')->default(0);
|
||||
$table->string('currency', 5);
|
||||
$table->nullableMorphs('morphed');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('journals');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use App\Interfaces\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateLedgersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('ledgers', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->enum('type', ['asset', 'liability', 'equity', 'income', 'expense']);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('ledgers');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use App\Interfaces\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFilesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Create the files table. Acts as a morphable
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('files', function (Blueprint $table) {
|
||||
$table->string('id', \App\Interfaces\Model::ID_MAX_LENGTH);
|
||||
$table->string('name');
|
||||
$table->string('description')->nullable();
|
||||
$table->string('disk')->nullable();
|
||||
$table->string('path');
|
||||
$table->boolean('public')->default(true);
|
||||
$table->unsignedInteger('download_count')->default(0);
|
||||
$table->string('ref_model', 50)->nullable();
|
||||
$table->string('ref_model_id', 36)->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->primary('id');
|
||||
$table->index(['ref_model', 'ref_model_id']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('files');
|
||||
}
|
||||
}
|
||||
@@ -1,36 +1,40 @@
|
||||
<?php
|
||||
|
||||
use App\Services\DatabaseService;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Map these other environments to a specific seed file
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $seed_mapper = [
|
||||
'local' => 'dev',
|
||||
'qa' => 'dev',
|
||||
'staging' => 'dev',
|
||||
'local' => 'dev',
|
||||
'qa' => 'dev',
|
||||
'staging' => 'dev',
|
||||
];
|
||||
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$env = App::environment();
|
||||
if(array_key_exists($env, self::$seed_mapper)) {
|
||||
if (array_key_exists($env, self::$seed_mapper)) {
|
||||
$env = self::$seed_mapper[$env];
|
||||
}
|
||||
|
||||
$path = database_path('seeds/'.$env.'.yml');
|
||||
|
||||
if(!file_exists($path)) {
|
||||
if (!file_exists($path)) {
|
||||
$path = database_path('seeds/prod.yml');
|
||||
}
|
||||
|
||||
$svc = app('App\Services\DatabaseService');
|
||||
$svc = app(DatabaseService::class);
|
||||
$svc->seed_from_yaml_file($path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,497 +47,3 @@ acars:
|
||||
lon: -74.800344
|
||||
created_at: now
|
||||
updated_at: now
|
||||
- id: 7e5Q5wlxBpxe
|
||||
pirep_id: pirepid_2
|
||||
type: '0'
|
||||
nav_type: ''
|
||||
order: '0'
|
||||
name: ''
|
||||
log: ''
|
||||
lat: '36.4314'
|
||||
lon: '28.1399'
|
||||
heading: '251'
|
||||
altitude: '1040'
|
||||
vs: '-950'
|
||||
gs: '62'
|
||||
transponder: ''
|
||||
autopilot: ''
|
||||
fuel_flow: ''
|
||||
sim_time: ''
|
||||
created_at: '2018-02-21 20:06:36'
|
||||
updated_at: '2018-02-21 20:06:36'
|
||||
- id: 9aAN5XQ7y6Ob
|
||||
pirep_id: pirepid_2
|
||||
type: '0'
|
||||
nav_type: ''
|
||||
order: '0'
|
||||
name: ''
|
||||
log: ''
|
||||
lat: '36.4169'
|
||||
lon: '28.1202'
|
||||
heading: '238'
|
||||
altitude: '350'
|
||||
vs: '-200'
|
||||
gs: '58'
|
||||
transponder: ''
|
||||
autopilot: ''
|
||||
fuel_flow: ''
|
||||
sim_time: ''
|
||||
created_at: '2018-02-21 20:08:06'
|
||||
updated_at: '2018-02-21 20:08:06'
|
||||
- id: aADPEZ6kR81e
|
||||
pirep_id: pirepid_2
|
||||
type: '2'
|
||||
nav_type: ''
|
||||
order: '0'
|
||||
name: ''
|
||||
log: 'Brakes are Released'
|
||||
lat: '36.4004'
|
||||
lon: '28.0689'
|
||||
heading: ''
|
||||
altitude: ''
|
||||
vs: ''
|
||||
gs: ''
|
||||
transponder: ''
|
||||
autopilot: ''
|
||||
fuel_flow: ''
|
||||
sim_time: ''
|
||||
created_at: '2018-02-21 20:02:47'
|
||||
updated_at: '2018-02-21 20:02:47'
|
||||
- id: aOYypxgnx1Nd
|
||||
pirep_id: pirepid_2
|
||||
type: '2'
|
||||
nav_type: ''
|
||||
order: '0'
|
||||
name: ''
|
||||
log: 'Brakes are On'
|
||||
lat: '36.4004'
|
||||
lon: '28.0689'
|
||||
heading: ''
|
||||
altitude: ''
|
||||
vs: ''
|
||||
gs: ''
|
||||
transponder: ''
|
||||
autopilot: ''
|
||||
fuel_flow: ''
|
||||
sim_time: ''
|
||||
created_at: '2018-02-21 20:02:37'
|
||||
updated_at: '2018-02-21 20:02:37'
|
||||
- id: azpKgO7O4r2d
|
||||
pirep_id: pirepid_2
|
||||
type: '0'
|
||||
nav_type: ''
|
||||
order: '0'
|
||||
name: ''
|
||||
log: ''
|
||||
lat: '36.4097'
|
||||
lon: '28.1016'
|
||||
heading: '255'
|
||||
altitude: '120'
|
||||
vs: '-250'
|
||||
gs: '61'
|
||||
transponder: ''
|
||||
autopilot: ''
|
||||
fuel_flow: ''
|
||||
sim_time: ''
|
||||
created_at: '2018-02-21 20:09:06'
|
||||
updated_at: '2018-02-21 20:09:06'
|
||||
- id: b826rZMqoKLe
|
||||
pirep_id: pirepid_2
|
||||
type: '0'
|
||||
nav_type: ''
|
||||
order: '0'
|
||||
name: ''
|
||||
log: ''
|
||||
lat: '36.4159'
|
||||
lon: '28.1218'
|
||||
heading: '70'
|
||||
altitude: '1370'
|
||||
vs: '700'
|
||||
gs: '92'
|
||||
transponder: ''
|
||||
autopilot: ''
|
||||
fuel_flow: ''
|
||||
sim_time: ''
|
||||
created_at: '2018-02-21 20:05:06'
|
||||
updated_at: '2018-02-21 20:05:06'
|
||||
- id: bDk9KjqgQxka
|
||||
pirep_id: pirepid_2
|
||||
type: '0'
|
||||
nav_type: ''
|
||||
order: '0'
|
||||
name: ''
|
||||
log: ''
|
||||
lat: '36.4010'
|
||||
lon: '28.0711'
|
||||
heading: '70'
|
||||
altitude: '20'
|
||||
vs: '0'
|
||||
gs: '52'
|
||||
transponder: ''
|
||||
autopilot: ''
|
||||
fuel_flow: ''
|
||||
sim_time: ''
|
||||
created_at: '2018-02-21 20:03:06'
|
||||
updated_at: '2018-02-21 20:03:06'
|
||||
- id: bmZQWxqo2D0d
|
||||
pirep_id: pirepid_2
|
||||
type: '2'
|
||||
nav_type: ''
|
||||
order: '0'
|
||||
name: ''
|
||||
log: 'Airborne and Beacons are off'
|
||||
lat: '36.4018'
|
||||
lon: '28.0739'
|
||||
heading: ''
|
||||
altitude: ''
|
||||
vs: ''
|
||||
gs: ''
|
||||
transponder: ''
|
||||
autopilot: ''
|
||||
fuel_flow: ''
|
||||
sim_time: ''
|
||||
created_at: '2018-02-21 20:03:15'
|
||||
updated_at: '2018-02-21 20:03:15'
|
||||
- id: bo2QWzjqBg3a
|
||||
pirep_id: pirepid_2
|
||||
type: '2'
|
||||
nav_type: ''
|
||||
order: '0'
|
||||
name: ''
|
||||
log: "Landed @ 59 Knots with -90 Vertical Speed With a heading of 251 and with 1.2416 G Force\nArrival Weather: KJFK 211951Z 19007KT 10SM FEW033 FEW070 FEW270 18/12 A3022 RMK AO2 SLP233 T01780122"
|
||||
lat: '36.4075'
|
||||
lon: '28.0929'
|
||||
heading: ''
|
||||
altitude: ''
|
||||
vs: ''
|
||||
gs: ''
|
||||
transponder: ''
|
||||
autopilot: ''
|
||||
fuel_flow: ''
|
||||
sim_time: ''
|
||||
created_at: '2018-02-21 20:09:33'
|
||||
updated_at: '2018-02-21 20:09:33'
|
||||
- id: bqxYWBQ0yrpa
|
||||
pirep_id: pirepid_2
|
||||
type: '2'
|
||||
nav_type: ''
|
||||
order: '0'
|
||||
name: ''
|
||||
log: 'Engine 1 Started'
|
||||
lat: '36.4004'
|
||||
lon: '28.0689'
|
||||
heading: ''
|
||||
altitude: ''
|
||||
vs: ''
|
||||
gs: ''
|
||||
transponder: ''
|
||||
autopilot: ''
|
||||
fuel_flow: ''
|
||||
sim_time: ''
|
||||
created_at: '2018-02-21 20:02:38'
|
||||
updated_at: '2018-02-21 20:02:38'
|
||||
- id: bW67AJQwJRWa
|
||||
pirep_id: pirepid_2
|
||||
type: '2'
|
||||
nav_type: ''
|
||||
order: '0'
|
||||
name: ''
|
||||
log: 'Flaps 3 Selected at 1360ft and 101kts'
|
||||
lat: '36.4287'
|
||||
lon: '28.1486'
|
||||
heading: ''
|
||||
altitude: ''
|
||||
vs: ''
|
||||
gs: ''
|
||||
transponder: ''
|
||||
autopilot: ''
|
||||
fuel_flow: ''
|
||||
sim_time: ''
|
||||
created_at: '2018-02-21 20:06:10'
|
||||
updated_at: '2018-02-21 20:06:10'
|
||||
- id: bYEvDL73AmMb
|
||||
pirep_id: pirepid_2
|
||||
type: '0'
|
||||
nav_type: ''
|
||||
order: '0'
|
||||
name: ''
|
||||
log: ''
|
||||
lat: '36.4042'
|
||||
lon: '28.0820'
|
||||
heading: '70'
|
||||
altitude: '200'
|
||||
vs: '-50'
|
||||
gs: '78'
|
||||
transponder: ''
|
||||
autopilot: ''
|
||||
fuel_flow: ''
|
||||
sim_time: ''
|
||||
created_at: '2018-02-21 20:03:36'
|
||||
updated_at: '2018-02-21 20:03:36'
|
||||
- id: dG65NmMk1N8b
|
||||
pirep_id: pirepid_2
|
||||
type: '0'
|
||||
nav_type: ''
|
||||
order: '0'
|
||||
name: ''
|
||||
log: ''
|
||||
lat: '36.4124'
|
||||
lon: '28.1113'
|
||||
heading: '241'
|
||||
altitude: '230'
|
||||
vs: '-250'
|
||||
gs: '62'
|
||||
transponder: ''
|
||||
autopilot: ''
|
||||
fuel_flow: ''
|
||||
sim_time: ''
|
||||
created_at: '2018-02-21 20:08:36'
|
||||
updated_at: '2018-02-21 20:08:36'
|
||||
- id: dNk9owOZwGLe
|
||||
pirep_id: pirepid_2
|
||||
type: '0'
|
||||
nav_type: ''
|
||||
order: '0'
|
||||
name: ''
|
||||
log: ''
|
||||
lat: '36.4117'
|
||||
lon: '28.1075'
|
||||
heading: '70'
|
||||
altitude: '990'
|
||||
vs: '650'
|
||||
gs: '88'
|
||||
transponder: ''
|
||||
autopilot: ''
|
||||
fuel_flow: ''
|
||||
sim_time: ''
|
||||
created_at: '2018-02-21 20:04:36'
|
||||
updated_at: '2018-02-21 20:04:36'
|
||||
- id: dR6ovAlxj1Ed
|
||||
pirep_id: pirepid_2
|
||||
type: '2'
|
||||
nav_type: ''
|
||||
order: '0'
|
||||
name: ''
|
||||
log: 'Airborne and Navigation Lights are off'
|
||||
lat: '36.4020'
|
||||
lon: '28.0744'
|
||||
heading: ''
|
||||
altitude: ''
|
||||
vs: ''
|
||||
gs: ''
|
||||
transponder: ''
|
||||
autopilot: ''
|
||||
fuel_flow: ''
|
||||
sim_time: ''
|
||||
created_at: '2018-02-21 20:03:16'
|
||||
updated_at: '2018-02-21 20:03:16'
|
||||
- id: e73LqZ9Z87we
|
||||
pirep_id: pirepid_2
|
||||
type: '2'
|
||||
nav_type: ''
|
||||
order: '0'
|
||||
name: ''
|
||||
log: 'Flaps 2 Selected at 20ft and 0kts'
|
||||
lat: '36.4004'
|
||||
lon: '28.0689'
|
||||
heading: ''
|
||||
altitude: ''
|
||||
vs: ''
|
||||
gs: ''
|
||||
transponder: ''
|
||||
autopilot: ''
|
||||
fuel_flow: ''
|
||||
sim_time: ''
|
||||
created_at: '2018-02-21 20:02:48'
|
||||
updated_at: '2018-02-21 20:02:48'
|
||||
- id: e9rQvZ9095Da
|
||||
pirep_id: pirepid_2
|
||||
type: '2'
|
||||
nav_type: ''
|
||||
order: '0'
|
||||
name: ''
|
||||
log: 'Flaps 0 Selected at 190ft and 69kts'
|
||||
lat: '36.4037'
|
||||
lon: '28.0802'
|
||||
heading: ''
|
||||
altitude: ''
|
||||
vs: ''
|
||||
gs: ''
|
||||
transponder: ''
|
||||
autopilot: ''
|
||||
fuel_flow: ''
|
||||
sim_time: ''
|
||||
created_at: '2018-02-21 20:03:32'
|
||||
updated_at: '2018-02-21 20:03:32'
|
||||
- id: egJLWonpgwZd
|
||||
pirep_id: pirepid_2
|
||||
type: '0'
|
||||
nav_type: ''
|
||||
order: '0'
|
||||
name: ''
|
||||
log: ''
|
||||
lat: '36.4203'
|
||||
lon: '28.1366'
|
||||
heading: '70'
|
||||
altitude: '1500'
|
||||
vs: '-150'
|
||||
gs: '97'
|
||||
transponder: ''
|
||||
autopilot: ''
|
||||
fuel_flow: ''
|
||||
sim_time: ''
|
||||
created_at: '2018-02-21 20:05:36'
|
||||
updated_at: '2018-02-21 20:05:36'
|
||||
- id: egJLWonx6p3d
|
||||
pirep_id: pirepid_2
|
||||
type: '0'
|
||||
nav_type: ''
|
||||
order: '0'
|
||||
name: ''
|
||||
log: ''
|
||||
lat: '36.4274'
|
||||
lon: '28.1487'
|
||||
heading: '6'
|
||||
altitude: '1390'
|
||||
vs: '-450'
|
||||
gs: '102'
|
||||
transponder: ''
|
||||
autopilot: ''
|
||||
fuel_flow: ''
|
||||
sim_time: ''
|
||||
created_at: '2018-02-21 20:06:06'
|
||||
updated_at: '2018-02-21 20:06:06'
|
||||
- id: egJLWopjvKDd
|
||||
pirep_id: pirepid_2
|
||||
type: '2'
|
||||
nav_type: ''
|
||||
order: '0'
|
||||
name: ''
|
||||
log: 'Beacon lights are off and engine is started'
|
||||
lat: '36.4004'
|
||||
lon: '28.0689'
|
||||
heading: ''
|
||||
altitude: ''
|
||||
vs: ''
|
||||
gs: ''
|
||||
transponder: ''
|
||||
autopilot: ''
|
||||
fuel_flow: ''
|
||||
sim_time: ''
|
||||
created_at: '2018-02-21 20:02:39'
|
||||
updated_at: '2018-02-21 20:02:39'
|
||||
- id: ejRqWrYE8Nye
|
||||
pirep_id: pirepid_2
|
||||
type: '0'
|
||||
nav_type: ''
|
||||
order: '0'
|
||||
name: ''
|
||||
log: ''
|
||||
lat: '36.4080'
|
||||
lon: '28.0949'
|
||||
heading: '70'
|
||||
altitude: '640'
|
||||
vs: '400'
|
||||
gs: '81'
|
||||
transponder: ''
|
||||
autopilot: ''
|
||||
fuel_flow: ''
|
||||
sim_time: ''
|
||||
created_at: '2018-02-21 20:04:06'
|
||||
updated_at: '2018-02-21 20:04:06'
|
||||
- id: erkRWD2wROBa
|
||||
pirep_id: pirepid_2
|
||||
type: '2'
|
||||
nav_type: ''
|
||||
order: '0'
|
||||
name: ''
|
||||
log: "Took off @ 68 Knots and Flaps at Position 2 With a heading of 70 Degrees \nDeparture Weather KAUS 211953Z 35018KT 2SM R17L/3500VP6000FT -RA BR OVC010 05/05 A3017 RMK AO2 SFC VIS 2 1/2 SLP216"
|
||||
lat: '36.4018'
|
||||
lon: '28.0736'
|
||||
heading: ''
|
||||
altitude: ''
|
||||
vs: ''
|
||||
gs: ''
|
||||
transponder: ''
|
||||
autopilot: ''
|
||||
fuel_flow: ''
|
||||
sim_time: ''
|
||||
created_at: '2018-02-21 20:03:14'
|
||||
updated_at: '2018-02-21 20:03:14'
|
||||
- id: erkRWDmNz92a
|
||||
pirep_id: pirepid_2
|
||||
type: '0'
|
||||
nav_type: ''
|
||||
order: '0'
|
||||
name: ''
|
||||
log: ''
|
||||
lat: '36.4216'
|
||||
lon: '28.1277'
|
||||
heading: '210'
|
||||
altitude: '440'
|
||||
vs: '-250'
|
||||
gs: '55'
|
||||
transponder: ''
|
||||
autopilot: ''
|
||||
fuel_flow: ''
|
||||
sim_time: ''
|
||||
created_at: '2018-02-21 20:07:36'
|
||||
updated_at: '2018-02-21 20:07:36'
|
||||
- id: kazvG4B4z0Oa
|
||||
pirep_id: pirepid_2
|
||||
type: '2'
|
||||
nav_type: ''
|
||||
order: '0'
|
||||
name: ''
|
||||
log: 'Landing light OFF Below FL100'
|
||||
lat: '36.4022'
|
||||
lon: '28.0750'
|
||||
heading: ''
|
||||
altitude: ''
|
||||
vs: ''
|
||||
gs: ''
|
||||
transponder: ''
|
||||
autopilot: ''
|
||||
fuel_flow: ''
|
||||
sim_time: ''
|
||||
created_at: '2018-02-21 20:03:17'
|
||||
updated_at: '2018-02-21 20:03:17'
|
||||
- id: wdL7o1YlAZjb
|
||||
pirep_id: pirepid_2
|
||||
type: '0'
|
||||
nav_type: ''
|
||||
order: '0'
|
||||
name: ''
|
||||
log: ''
|
||||
lat: '36.4263'
|
||||
lon: '28.1347'
|
||||
heading: '183'
|
||||
altitude: '660'
|
||||
vs: '-500'
|
||||
gs: '56'
|
||||
transponder: ''
|
||||
autopilot: ''
|
||||
fuel_flow: ''
|
||||
sim_time: ''
|
||||
created_at: '2018-02-21 20:07:06'
|
||||
updated_at: '2018-02-21 20:07:06'
|
||||
- id: zbq7vpVrwB2e
|
||||
pirep_id: pirepid_2
|
||||
type: '0'
|
||||
nav_type: ''
|
||||
order: '0'
|
||||
name: ''
|
||||
log: ''
|
||||
lat: '36.4072'
|
||||
lon: '28.0917'
|
||||
heading: '252'
|
||||
altitude: '20'
|
||||
vs: '0'
|
||||
gs: '58'
|
||||
transponder: ''
|
||||
autopilot: ''
|
||||
fuel_flow: ''
|
||||
sim_time: ''
|
||||
created_at: '2018-02-21 20:09:36'
|
||||
updated_at: '2018-02-21 20:09:36'
|
||||
|
||||
723
app/Database/seeds/in_progress.yml
Normal file
723
app/Database/seeds/in_progress.yml
Normal file
@@ -0,0 +1,723 @@
|
||||
acars:
|
||||
- id: aM8QpMPEB15e
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '17.934117958358'
|
||||
lon: '-76.77856721815'
|
||||
heading: '124'
|
||||
altitude: '8.1663703232199'
|
||||
vs: '0'
|
||||
gs: '0.0064996252497234'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: eZ6VJ3xj8vge
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '17.934117498661'
|
||||
lon: '-76.778566516289'
|
||||
heading: '124'
|
||||
altitude: '8.1664622222087'
|
||||
vs: '0'
|
||||
gs: '0'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: bo2QqDLl2lLa
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '17.933884143334'
|
||||
lon: '-76.778210172233'
|
||||
heading: '124'
|
||||
altitude: '8.1707802663933'
|
||||
vs: '0'
|
||||
gs: '14.419195209695'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: aM8QpM4qV2Be
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '17.933705349611'
|
||||
lon: '-76.777936938059'
|
||||
heading: '124'
|
||||
altitude: '8.170089899507'
|
||||
vs: '0'
|
||||
gs: '15.392330039049'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: dR6oxR9qjoOd
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '17.933130691906'
|
||||
lon: '-76.777152737985'
|
||||
heading: '158'
|
||||
altitude: '8.1683570286331'
|
||||
vs: '0'
|
||||
gs: '10.450467475023'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: erkRwJODRvEa
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '17.932580370289'
|
||||
lon: '-76.777450200122'
|
||||
heading: '221'
|
||||
altitude: '8.1695896791822'
|
||||
vs: '0'
|
||||
gs: '12.932334300694'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: b2kv53VMy7Ad
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '17.932012550651'
|
||||
lon: '-76.778009113329'
|
||||
heading: '296'
|
||||
altitude: '8.1683852467213'
|
||||
vs: '0'
|
||||
gs: '10.502719192825'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: eXDoE14JxAve
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '17.932052237309'
|
||||
lon: '-76.778111495187'
|
||||
heading: '290'
|
||||
altitude: '8.1719753739837'
|
||||
vs: '0'
|
||||
gs: '12.643743277153'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: b68R5gZ5YyOe
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '17.932664026837'
|
||||
lon: '-76.779705339967'
|
||||
heading: '293'
|
||||
altitude: '8.2203963962548'
|
||||
vs: '0'
|
||||
gs: '64.870244840054'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: bqxYvGNN5N0a
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '17.934300220408'
|
||||
lon: '-76.783954914814'
|
||||
heading: '293'
|
||||
altitude: '8.3302468103811'
|
||||
vs: '0'
|
||||
gs: '122.78529244208'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: en5rpBKw514d
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '17.935736496556'
|
||||
lon: '-76.78765616448'
|
||||
heading: '293'
|
||||
altitude: '49.554739665916'
|
||||
vs: '21'
|
||||
gs: '146.79677958636'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: erkRwJA29l2a
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '17.976972983585'
|
||||
lon: '-76.896548114872'
|
||||
heading: '297'
|
||||
altitude: '6228.684012199'
|
||||
vs: '62'
|
||||
gs: '281.03976876098'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: dR6oxR3r5nwd
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '18.061360208405'
|
||||
lon: '-77.056156629983'
|
||||
heading: '301'
|
||||
altitude: '12522.331716891'
|
||||
vs: '25'
|
||||
gs: '371.70833265547'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: e1wr82J877Zb
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '18.17373613295'
|
||||
lon: '-77.260347185993'
|
||||
heading: '301'
|
||||
altitude: '16802.15636323'
|
||||
vs: '43'
|
||||
gs: '421.37353688139'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: bqxYvGyExN2a
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '18.193907285814'
|
||||
lon: '-77.29810465405'
|
||||
heading: '297'
|
||||
altitude: '17395.953175647'
|
||||
vs: '40'
|
||||
gs: '425.98105291451'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: aQW0wQDQk5Md
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '18.648921231143'
|
||||
lon: '-78.014696613517'
|
||||
heading: '323'
|
||||
altitude: '37108.124381987'
|
||||
vs: '22'
|
||||
gs: '438.52028383384'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: e9rQ5lk3p63a
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '18.796585259338'
|
||||
lon: '-78.194734005052'
|
||||
heading: '260'
|
||||
altitude: '39718.178225504'
|
||||
vs: '19'
|
||||
gs: '432.41969107334'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: aQW0wQP8vZqd
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '18.660552760063'
|
||||
lon: '-78.407597067994'
|
||||
heading: '242'
|
||||
altitude: '40998.775690971'
|
||||
vs: '-25'
|
||||
gs: '449.51695639627'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: bqxYvGKgp32a
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '18.592775999582'
|
||||
lon: '-78.638711340118'
|
||||
heading: '298'
|
||||
altitude: '41060.297106821'
|
||||
vs: '0'
|
||||
gs: '427.14806185954'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: bqxYvGg2r02a
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '18.718367591656'
|
||||
lon: '-78.840980459275'
|
||||
heading: '284'
|
||||
altitude: '41065.55293844'
|
||||
vs: '1'
|
||||
gs: '424.89060056552'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: e0RV61wPj53b
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '18.77448809677'
|
||||
lon: '-79.082727467209'
|
||||
heading: '283'
|
||||
altitude: '41069.809333539'
|
||||
vs: '0'
|
||||
gs: '425.02780492483'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: dwpmBOo3wWwe
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '18.813031600863'
|
||||
lon: '-79.249543355636'
|
||||
heading: '283'
|
||||
altitude: '41072.545805172'
|
||||
vs: '0'
|
||||
gs: '425.04687332464'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: ejRqlxXoZPle
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '18.840653974635'
|
||||
lon: '-79.370042672541'
|
||||
heading: '283'
|
||||
altitude: '40396.200981621'
|
||||
vs: '-16'
|
||||
gs: '428.08364925851'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: eVOPBYw4q9Xa
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '18.868358744495'
|
||||
lon: '-79.491434926253'
|
||||
heading: '283'
|
||||
altitude: '39399.093383161'
|
||||
vs: '-16'
|
||||
gs: '427.57826037174'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: aOYyrOmVPzEd
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '18.896191929474'
|
||||
lon: '-79.613169477385'
|
||||
heading: '284'
|
||||
altitude: '36491.730092364'
|
||||
vs: '-55'
|
||||
gs: '429.74732238829'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: dL98oLQgyzje
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '18.9242378342'
|
||||
lon: '-79.736368411294'
|
||||
heading: '284'
|
||||
altitude: '32998.644142986'
|
||||
vs: '-61'
|
||||
gs: '434.90864533098'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: e9rQ5lqD2o8a
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '18.952608029755'
|
||||
lon: '-79.861339775352'
|
||||
heading: '284'
|
||||
altitude: '29069.168636089'
|
||||
vs: '-68'
|
||||
gs: '441.90475491564'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: av2oANWY1vma
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '18.981670375928'
|
||||
lon: '-79.987960713131'
|
||||
heading: '283'
|
||||
altitude: '24954.890708875'
|
||||
vs: '-56'
|
||||
gs: '447.81957529674'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: 9aAN4mxlK9zb
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '19.01074931075'
|
||||
lon: '-80.116947122245'
|
||||
heading: '283'
|
||||
altitude: '21483.90439337'
|
||||
vs: '-57'
|
||||
gs: '450.05461228268'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: e1wr82gp8zGb
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '19.039021032617'
|
||||
lon: '-80.242584645189'
|
||||
heading: '283'
|
||||
altitude: '18000.954967422'
|
||||
vs: '-58'
|
||||
gs: '431.5690825604'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: dG65jDL2gK0b
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '19.066116186076'
|
||||
lon: '-80.36338355333'
|
||||
heading: '284'
|
||||
altitude: '14630.153058153'
|
||||
vs: '-55'
|
||||
gs: '414.70845758094'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: epYQ0ENmyvXa
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '19.091238961633'
|
||||
lon: '-80.475901417309'
|
||||
heading: '284'
|
||||
altitude: '11927.379697397'
|
||||
vs: '-17'
|
||||
gs: '381.57664353055'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: erkRwJPrVoEa
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '19.10261633392'
|
||||
lon: '-80.527021151647'
|
||||
heading: '284'
|
||||
altitude: '11424.525210898'
|
||||
vs: '-17'
|
||||
gs: '337.58307680654'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: e1wr82gZXqZb
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '19.112886513796'
|
||||
lon: '-80.57297038027'
|
||||
heading: '284'
|
||||
altitude: '10919.983208888'
|
||||
vs: '-16'
|
||||
gs: '307.28164751381'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: eER95AJ4XLga
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '19.122449020305'
|
||||
lon: '-80.615560002642'
|
||||
heading: '284'
|
||||
altitude: '10418.227268525'
|
||||
vs: '-16'
|
||||
gs: '292.97011599774'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: dPNZvP0O0Gza
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '19.131746364354'
|
||||
lon: '-80.657133675868'
|
||||
heading: '284'
|
||||
altitude: '9921.6695218175'
|
||||
vs: '-16'
|
||||
gs: '293.10586428433'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: aQW0wQYVm2Yd
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '19.141074988147'
|
||||
lon: '-80.698952940579'
|
||||
heading: '284'
|
||||
altitude: '9423.0799985721'
|
||||
vs: '-16'
|
||||
gs: '291.77956791503'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
- id: eXDoE11x32We
|
||||
pirep_id: b68R5gwVzpVe
|
||||
type: '0'
|
||||
nav_type: null
|
||||
order: '0'
|
||||
name: null
|
||||
log: null
|
||||
lat: '19.150291803457'
|
||||
lon: '-80.740363792336'
|
||||
heading: '284'
|
||||
altitude: '8921.7506913567'
|
||||
vs: '-16'
|
||||
gs: '289.03760297791'
|
||||
transponder: null
|
||||
autopilot: null
|
||||
fuel_flow: null
|
||||
sim_time: now
|
||||
created_at: 'now'
|
||||
updated_at: 'now'
|
||||
@@ -25,6 +25,8 @@ users:
|
||||
flight_time: 0
|
||||
timezone: America/Chicago
|
||||
state: 1
|
||||
opt_in: 1
|
||||
toc_accepted: 1
|
||||
created_at: now
|
||||
updated_at: now
|
||||
- id: 2
|
||||
@@ -41,6 +43,8 @@ users:
|
||||
created_at: now
|
||||
updated_at: now
|
||||
state: 0
|
||||
opt_in: 1
|
||||
toc_accepted: 1
|
||||
- id: 3
|
||||
name: Raymond Pearson
|
||||
email: raymond.pearson56@example.com
|
||||
@@ -55,6 +59,8 @@ users:
|
||||
created_at: now
|
||||
updated_at: now
|
||||
state: 1
|
||||
opt_in: 0
|
||||
toc_accepted: 1
|
||||
|
||||
role_user:
|
||||
- user_id: 1
|
||||
@@ -75,18 +81,34 @@ ranks:
|
||||
- id: 2
|
||||
name: Junior First Officer
|
||||
hours: 10
|
||||
acars_base_pay_rate: 100
|
||||
manual_base_pay_rate: 90
|
||||
- id: 3
|
||||
name: First Officer
|
||||
hours: 15
|
||||
acars_base_pay_rate: 250
|
||||
manual_base_pay_rate: 200
|
||||
auto_approve_acars: 1
|
||||
auto_approve_manual: 1
|
||||
- id: 4
|
||||
name: Senior Captain
|
||||
hours: 20
|
||||
acars_base_pay_rate: 500
|
||||
manual_base_pay_rate: 400
|
||||
auto_approve_acars: 1
|
||||
auto_approve_manual: 1
|
||||
auto_promote: 0
|
||||
|
||||
awards:
|
||||
- id: 1
|
||||
name: Pilot 50 flights
|
||||
description: When a pilot has 50 flights, give this award
|
||||
image_url:
|
||||
ref_model: App\Awards\PilotFlightAwards
|
||||
ref_model_params: 50
|
||||
created_at: now
|
||||
updated_at: now
|
||||
|
||||
news:
|
||||
- id: 1
|
||||
user_id: 1
|
||||
@@ -115,6 +137,7 @@ airports:
|
||||
lat: 30.1945278
|
||||
lon: -97.6698889
|
||||
hub: 1
|
||||
ground_handling_cost: 100
|
||||
- id: KJFK
|
||||
iata: JFK
|
||||
icao: KJFK
|
||||
@@ -125,51 +148,27 @@ airports:
|
||||
lat: 40.6399257
|
||||
lon: -73.7786950
|
||||
hub: 1
|
||||
- id: KBWI
|
||||
iata: BWI
|
||||
icao: KBWI
|
||||
name: Baltimore/Washington International Thurgood Marshall Airport
|
||||
location: Baltimore, MD
|
||||
ground_handling_cost: 250
|
||||
- id: KPAE
|
||||
iata: PAE
|
||||
icao: KPAE
|
||||
name: Snohomish County (Paine Field) Airport
|
||||
location: Everett
|
||||
country: United States
|
||||
timezone: America/New_York
|
||||
lat: 39.1754
|
||||
lon: -76.6683
|
||||
- id: KIAH
|
||||
iata: IAH
|
||||
icao: KIAH
|
||||
name: George Bush Intercontinental Houston Airport
|
||||
location: Houston, TX
|
||||
timezone: America/Los_Angeles
|
||||
lat: 47.9063
|
||||
lon: -122.282
|
||||
hub: 0
|
||||
- id: KSEA
|
||||
iata: SEA
|
||||
icao: KSEA
|
||||
name: Seattle Tacoma International Airport
|
||||
location: Seattle
|
||||
country: United States
|
||||
timezone: America/Chicago
|
||||
lat: 29.9844
|
||||
lon: -95.3414
|
||||
- id: KORD
|
||||
iata: ORD
|
||||
icao: KORD
|
||||
name: Chicago O'Hare International Airport
|
||||
location: Chicago, IL
|
||||
country: United States
|
||||
timezone: America/Chicago
|
||||
lat: 41.9786
|
||||
lon: -87.9048
|
||||
- id: KDFW
|
||||
iata: DFW
|
||||
icao: KDFW
|
||||
name: Dallas Fort Worth International Airport
|
||||
location: Dallas, TX
|
||||
country: United States
|
||||
timezone: America/Chicago
|
||||
lat: 32.8968
|
||||
lon: -97.038
|
||||
- id: EFHK
|
||||
iata: HEL
|
||||
icao: EFHK
|
||||
name: Helsinki Vantaa Airport
|
||||
location: Helsinki
|
||||
country: Finland
|
||||
timezone: Europe/Helsinki
|
||||
lat: 60.3172
|
||||
lon: 24.9633
|
||||
timezone: America/Los_Angeles
|
||||
lat: 47.449
|
||||
lon: -122.309
|
||||
hub: 0
|
||||
- id: EGLL
|
||||
iata: LHR
|
||||
icao: EGLL
|
||||
@@ -178,29 +177,118 @@ airports:
|
||||
timezone: Europe/London
|
||||
lat: 51.4775
|
||||
lon: -0.4614
|
||||
- id: LGRP
|
||||
iata: RHO
|
||||
icao: LGRP
|
||||
name: Diagoras Airport
|
||||
location: Rhodos
|
||||
country: Greece
|
||||
timezone: Europe/Athens
|
||||
lat: 36.4054
|
||||
lon: 28.0862
|
||||
ground_handling_cost: 500
|
||||
- id: MKJP
|
||||
iata: KIN
|
||||
icao: MKJP
|
||||
name: Norman Manley International Airport
|
||||
location: Kingston, Jamaica
|
||||
country:
|
||||
timezone: America/Jamaica
|
||||
lat: 17.9357
|
||||
lon: -76.7875
|
||||
ground_handling_cost: 50
|
||||
- id: MWCR
|
||||
iata: GCM
|
||||
icao: MWCR
|
||||
name: Owen Roberts International Airport
|
||||
location: Georgetown
|
||||
country: Cayman
|
||||
timezone: America/Cayman
|
||||
lat: 19.2928
|
||||
lon: -81.3577
|
||||
ground_handling_cost: 50
|
||||
- id: OMDB
|
||||
iata: DXB
|
||||
icao: OMDB
|
||||
name: Dubai International Airport
|
||||
location: Dubai, UAE
|
||||
country:
|
||||
timezone: Asia/Dubai
|
||||
lat: 25.2528
|
||||
lon: 55.3644
|
||||
ground_handling_cost: 50
|
||||
|
||||
#
|
||||
aircraft:
|
||||
- id: 1
|
||||
subfleet_id: 1
|
||||
name: Boeing 747-400
|
||||
airport_id: KJFK
|
||||
name: Boeing 747-438
|
||||
registration: 001Z
|
||||
status: A
|
||||
- id: 2
|
||||
subfleet_id: 2
|
||||
airport_id: LGRP
|
||||
name: Boeing 777-200
|
||||
registration: C202
|
||||
status: A
|
||||
- id: 3
|
||||
subfleet_id: 1
|
||||
airport_id: KAUS
|
||||
name: Boeing 747-412
|
||||
registration: S2333
|
||||
status: A
|
||||
- id: 4
|
||||
subfleet_id: 1
|
||||
airport_id: KAUS
|
||||
name: Boeing 747-436 RETIRED
|
||||
registration:
|
||||
status: R
|
||||
|
||||
expenses:
|
||||
- name: Per-Flight (no muliplier)
|
||||
amount: 100
|
||||
type: F
|
||||
active: 1
|
||||
ref_model: App\Models\Expense
|
||||
- name: Per-Flight (multiplier)
|
||||
amount: 100
|
||||
type: F
|
||||
multiplier: 1
|
||||
active: 1
|
||||
ref_model: App\Models\Expense
|
||||
- name: Per-Flight (multiplier, on airline)
|
||||
airline_id: 1
|
||||
amount: 200
|
||||
type: F
|
||||
multiplier: 1
|
||||
active: 1
|
||||
ref_model: App\Models\Expense
|
||||
- name: A daily fee
|
||||
amount: 800
|
||||
type: D
|
||||
active: 1
|
||||
ref_model: App\Models\Expense
|
||||
- name: A monthly fee
|
||||
amount: 5000
|
||||
type: M
|
||||
active: 1
|
||||
ref_model: App\Models\Expense
|
||||
- name: Catering
|
||||
amount: 1000
|
||||
type: F
|
||||
active: 1
|
||||
ref_model: App\Models\Subfleet
|
||||
ref_model_id: 1
|
||||
created_at: now
|
||||
updated_at: now
|
||||
- name: Catering Staff
|
||||
amount: 1000
|
||||
type: D
|
||||
active: 1
|
||||
ref_model: App\Models\Subfleet
|
||||
ref_model_id: 1
|
||||
created_at: now
|
||||
updated_at: now
|
||||
- name: Maintenance
|
||||
amount: 1000
|
||||
type: D
|
||||
active: 1
|
||||
ref_model: App\Models\Aircraft
|
||||
ref_model_id: 1
|
||||
created_at: now
|
||||
updated_at: now
|
||||
|
||||
fares:
|
||||
- id: 1
|
||||
@@ -222,12 +310,22 @@ fares:
|
||||
subfleets:
|
||||
- id: 1
|
||||
airline_id: 1
|
||||
name: 747-400 Winglets
|
||||
type: 744W
|
||||
name: 747-43X RB211-524G
|
||||
type: 744-3X-RB211
|
||||
cost_block_hour: 1000
|
||||
ground_handling_multiplier: 200
|
||||
- id: 2
|
||||
airline_id: 1
|
||||
name: 777-200 LR
|
||||
type: 772-LR
|
||||
name: 777-222ER GE90-76B
|
||||
type: 772-22ER-GE90-76B
|
||||
cost_block_hour: 500
|
||||
ground_handling_multiplier: 150
|
||||
- id: 3
|
||||
airline_id: 1
|
||||
name: 777-367 ER GE90-115B
|
||||
type: 772-36ER-GE90-115B
|
||||
cost_block_hour: 100
|
||||
ground_handling_multiplier: 150
|
||||
|
||||
# add a few mods to aircraft and fares
|
||||
subfleet_fare:
|
||||
@@ -239,11 +337,11 @@ subfleet_fare:
|
||||
capacity: 400
|
||||
- subfleet_id: 1
|
||||
fare_id: 2
|
||||
capacity: 20
|
||||
price: 120%
|
||||
- subfleet_id: 1
|
||||
fare_id: 3
|
||||
price: 1000
|
||||
capacity: 10
|
||||
capacity: 110%
|
||||
|
||||
# Fare classes on the 777
|
||||
- subfleet_id: 2
|
||||
@@ -252,10 +350,6 @@ subfleet_fare:
|
||||
fare_id: 3
|
||||
capacity: 10
|
||||
|
||||
subfleet_flight:
|
||||
- subfleet_id: 1
|
||||
flight_id: flightid_1
|
||||
|
||||
subfleet_rank:
|
||||
- rank_id: 1
|
||||
subfleet_id: 1
|
||||
@@ -271,17 +365,8 @@ flights:
|
||||
level: 360
|
||||
dpt_time: 6PM CST
|
||||
arr_time: 11PM EST
|
||||
created_at: NOW
|
||||
updated_at: NOW
|
||||
- id: flightid_2
|
||||
airline_id: 1
|
||||
flight_number: 6028
|
||||
route_code: A
|
||||
dpt_airport_id: LGRP
|
||||
arr_airport_id: LGRP
|
||||
dpt_time: 9AM CST
|
||||
arr_time: 1030AM CST
|
||||
route: PITZZ4 MNURE WLEEE4
|
||||
flight_time: 240
|
||||
flight_type: J
|
||||
created_at: NOW
|
||||
updated_at: NOW
|
||||
- id: flightid_3
|
||||
@@ -289,25 +374,59 @@ flights:
|
||||
flight_number: 6028
|
||||
route_code: A
|
||||
route_leg: 1
|
||||
dpt_airport_id: KIAH
|
||||
arr_airport_id: KAUS
|
||||
dpt_airport_id: EGLL
|
||||
arr_airport_id: KJFK
|
||||
flight_time: 480
|
||||
flight_type: J
|
||||
dpt_time: 9AM CST
|
||||
arr_time: 1030AM CST
|
||||
route: PITZZ4 MNURE WLEEE4
|
||||
created_at: NOW
|
||||
updated_at: NOW
|
||||
- id: flightid_4
|
||||
airline_id: 1
|
||||
flight_number: 99
|
||||
route_code:
|
||||
route_leg:
|
||||
dpt_airport_id: MKJP
|
||||
arr_airport_id: MWCR
|
||||
flight_time: 70
|
||||
flight_type: J
|
||||
dpt_time: 0800
|
||||
arr_time: 0900
|
||||
route: MLY5 KEMBO UG442 SIA UG633 OTEKO UR640 NALRO GUBEL3
|
||||
created_at: NOW
|
||||
updated_at: NOW
|
||||
|
||||
flight_fields:
|
||||
- name: Departure Terminal
|
||||
slug: departure-terminal
|
||||
- name: Arrival Terminal
|
||||
slug: arrival-terminal
|
||||
|
||||
flight_field_values:
|
||||
- id: 1
|
||||
flight_id: flightid_1
|
||||
name: cost index
|
||||
slug: cost-index
|
||||
value: 80
|
||||
- id: 2
|
||||
flight_id: flightid_2
|
||||
name: cost index
|
||||
slug: cost-index
|
||||
value: 100
|
||||
|
||||
user_bids:
|
||||
flight_subfleet:
|
||||
- subfleet_id: 1
|
||||
flight_id: flightid_1
|
||||
- subfleet_id: 1
|
||||
flight_id: flightid_2
|
||||
- subfleet_id: 1
|
||||
flight_id: flightid_3
|
||||
- subfleet_id: 1
|
||||
flight_id: flightid_4
|
||||
|
||||
bids:
|
||||
- id: 100
|
||||
user_id: 1
|
||||
flight_id: flightid_1
|
||||
@@ -319,64 +438,141 @@ pireps:
|
||||
- id: pirepid_1
|
||||
user_id: 1
|
||||
airline_id: 1
|
||||
flight_id: flightid_1
|
||||
flight_number: 100
|
||||
aircraft_id: 1
|
||||
dpt_airport_id: KAUS
|
||||
arr_airport_id: KJFK
|
||||
block_off_time: 2018-04-04T12:42:36+00:00
|
||||
block_on_time: 2018-04-04T16:42:36+00:00
|
||||
flight_time: 180 # 6 hours
|
||||
state: 1
|
||||
state: 1 # accepted
|
||||
status: 0
|
||||
source: 1
|
||||
flight_type: J
|
||||
route: KAUS SID TNV J87 IAH J2 LCH J22 MEI J239 ATL J52 AJFEB J14 BYJAC Q60 JAXSN J14 COLIN J61 HUBBS J55 SIE STAR KJFK
|
||||
notes: just a pilot report
|
||||
created_at: NOW
|
||||
updated_at: NOW
|
||||
submitted_at: 2018-04-04T16:50:36+00:00
|
||||
created_at: 2018-04-04T16:50:36+00:00
|
||||
updated_at: 2018-04-04T17:00:36+00:00
|
||||
- id: pirepid_2
|
||||
user_id: 1
|
||||
airline_id: 1
|
||||
flight_id: flightid_2
|
||||
flight_number: 101
|
||||
aircraft_id: 1
|
||||
dpt_airport_id: LGRP
|
||||
arr_airport_id: LGRP
|
||||
flight_number: 300
|
||||
aircraft_id: 3
|
||||
dpt_airport_id: KJFK
|
||||
arr_airport_id: KAUS
|
||||
flight_time: 180 # 6 hours
|
||||
state: 1
|
||||
state: 5 # draft
|
||||
source: 0 # manual
|
||||
flight_type: J
|
||||
route: PLMMR2 SPA Q22 BEARI FAK PHLBO3
|
||||
notes: just a pilot report
|
||||
source: 1
|
||||
source_name: sample
|
||||
submitted_at: NOW
|
||||
created_at: NOW
|
||||
updated_at: NOW
|
||||
- id: pirepid_3
|
||||
- id: b68R5gwVzpVe
|
||||
user_id: '1'
|
||||
airline_id: '1'
|
||||
aircraft_id: '1'
|
||||
flight_number: '13'
|
||||
route_code: null
|
||||
route_leg: null
|
||||
flight_type: J
|
||||
dpt_airport_id: MKJP
|
||||
arr_airport_id: MWCR
|
||||
level: '320'
|
||||
distance: '249.63'
|
||||
planned_distance: '273.09'
|
||||
block_time: null
|
||||
flight_time: '0'
|
||||
planned_flight_time: '0'
|
||||
zfw: null
|
||||
block_fuel: '21500.25390625'
|
||||
fuel_used: null
|
||||
landing_rate: '0'
|
||||
score: '0'
|
||||
route: ''
|
||||
notes: null
|
||||
source: '1'
|
||||
source_name: vmsacars
|
||||
state: 0
|
||||
status: ENR
|
||||
submitted_at: null
|
||||
block_off_time: now
|
||||
block_on_time: null
|
||||
created_at: now
|
||||
updated_at: now
|
||||
- id: pirepid_4
|
||||
user_id: 1
|
||||
airline_id: 1
|
||||
flight_id: flightid_2
|
||||
flight_number: 101
|
||||
aircraft_id: 1
|
||||
dpt_airport_id: KJFK
|
||||
arr_airport_id: KAUS
|
||||
block_off_time: 2018-04-04T12:42:36+00:00
|
||||
block_on_time: 2018-04-04T16:42:36+00:00
|
||||
flight_time: 180 # 6 hours
|
||||
state: 1
|
||||
route: PLMMR2 SPA Q22 BEARI FAK PHLBO3
|
||||
state: 0
|
||||
status: 0
|
||||
source: 1
|
||||
flight_type: J
|
||||
route: KAUS SID TNV J87 IAH J2 LCH J22 MEI J239 ATL J52 AJFEB J14 BYJAC Q60 JAXSN J14 COLIN J61 HUBBS J55 SIE STAR KJFK
|
||||
notes: just a pilot report
|
||||
created_at: NOW
|
||||
updated_at: NOW
|
||||
submitted_at: 2018-04-04T16:50:36+00:00
|
||||
created_at: 2018-04-04T16:50:36+00:00
|
||||
updated_at: 2018-04-04T17:00:36+00:00
|
||||
|
||||
pirep_fares:
|
||||
- id: 1
|
||||
pirep_id: pirepid_1
|
||||
fare_id: 1
|
||||
count: 300
|
||||
- id: 2
|
||||
pirep_id: pirepid_1
|
||||
fare_id: 2
|
||||
count: 25
|
||||
- id: 3
|
||||
pirep_id: pirepid_1
|
||||
fare_id: 3
|
||||
count: 10
|
||||
- id: 4
|
||||
pirep_id: pirepid_2
|
||||
fare_id: 1
|
||||
count: 200
|
||||
- id: 5
|
||||
pirep_id: pirepid_2
|
||||
fare_id: 3
|
||||
count: 15
|
||||
|
||||
pirep_fields:
|
||||
- id: 1
|
||||
name: departure gate
|
||||
slug: departure_gate
|
||||
name: departure terminal
|
||||
slug: departure-terminal
|
||||
required: 1
|
||||
- id: 2
|
||||
name: arrival gate
|
||||
slug: arrival_gate
|
||||
name: arrival terminal
|
||||
slug: arrival-terminal
|
||||
required: 0
|
||||
|
||||
pirep_field_values:
|
||||
- id: 1
|
||||
pirep_id: pirepid_1
|
||||
name: arrival gate
|
||||
value: B14
|
||||
source: manual
|
||||
name: arrival terminal
|
||||
slug: arrival-terminal
|
||||
value: 10
|
||||
source: 0
|
||||
- id: 2
|
||||
pirep_id: pirepid_1
|
||||
name: departure terminal
|
||||
slug: departure-terminal
|
||||
value: 4
|
||||
source: 0
|
||||
- id: 3
|
||||
pirep_id: pirepid_1
|
||||
name: Landing Rate
|
||||
slug: landing-rate
|
||||
value: -225.3
|
||||
source: 1
|
||||
|
||||
pirep_comments:
|
||||
- id: 1
|
||||
@@ -391,3 +587,182 @@ pirep_comments:
|
||||
comment: Another comment
|
||||
created_at: now
|
||||
updated_at: now
|
||||
|
||||
journals:
|
||||
-
|
||||
id: 1
|
||||
ledger_id: null
|
||||
type: 0
|
||||
balance: 7870000
|
||||
currency: USD
|
||||
morphed_type: App\Models\Airline
|
||||
morphed_id: 1
|
||||
created_at: '2018-03-06 12:33:45'
|
||||
updated_at: '2018-03-06 12:34:15'
|
||||
-
|
||||
id: 2
|
||||
ledger_id: null
|
||||
type: 1
|
||||
balance: 15000
|
||||
currency: USD
|
||||
morphed_type: App\Models\User
|
||||
morphed_id: 1
|
||||
created_at: '2018-03-06 12:33:45'
|
||||
updated_at: '2018-03-06 12:34:15'
|
||||
|
||||
journal_transactions:
|
||||
-
|
||||
id: 2cbb5990-c70c-40a8-8381-05b6402a96b4
|
||||
transaction_group: 'Pilot Pay'
|
||||
journal_id: 2
|
||||
credit: 15000
|
||||
debit: null
|
||||
currency: USD
|
||||
memo: 'Pilot Payment @ 50'
|
||||
tags: "pilot_pay"
|
||||
ref_model: App\Models\Pirep
|
||||
ref_model_id: pirepid_1
|
||||
created_at: '2018-03-06 12:34:15'
|
||||
updated_at: '2018-03-06 12:34:15'
|
||||
post_date: '2018-03-06 12:34:15'
|
||||
-
|
||||
id: 3471fb16-0afd-4815-8b0c-f92771274063
|
||||
transaction_group: 'Expense: Per-Flight (no muliplier)'
|
||||
journal_id: 1
|
||||
credit: null
|
||||
debit: 10000
|
||||
currency: USD
|
||||
memo: 'Expense: Per-Flight (no muliplier)'
|
||||
tags: "expense"
|
||||
ref_model: App\Models\Pirep
|
||||
ref_model_id: pirepid_1
|
||||
created_at: '2018-03-06 12:34:15'
|
||||
updated_at: '2018-03-06 12:34:15'
|
||||
post_date: '2018-03-06 12:34:15'
|
||||
-
|
||||
id: 37f21468-ebad-4850-8557-db310ca45eb4
|
||||
transaction_group: Fares
|
||||
journal_id: 1
|
||||
credit: 6000000
|
||||
debit: 0
|
||||
currency: USD
|
||||
memo: 'Fares Y300; price: 200, cost: 0'
|
||||
tags: "fare"
|
||||
ref_model: App\Models\Pirep
|
||||
ref_model_id: pirepid_1
|
||||
created_at: '2018-03-06 12:34:15'
|
||||
updated_at: '2018-03-06 12:34:15'
|
||||
post_date: '2018-03-06 12:34:15'
|
||||
-
|
||||
id: 3e933972-07ef-4bb2-b1e1-90ef7e8871c6
|
||||
transaction_group: 'Expense: Per-Flight (multiplier, on airline)'
|
||||
journal_id: 1
|
||||
credit: null
|
||||
debit: 20000
|
||||
currency: USD
|
||||
memo: 'Expense: Per-Flight (multiplier, on airline)'
|
||||
tags: "expense"
|
||||
ref_model: App\Models\Pirep
|
||||
ref_model_id: pirepid_1
|
||||
created_at: '2018-03-06 12:34:15'
|
||||
updated_at: '2018-03-06 12:34:15'
|
||||
post_date: '2018-03-06 12:34:15'
|
||||
-
|
||||
id: 522d8032-4ca0-4d6d-b7af-613be4bf281c
|
||||
transaction_group: 'Expense: Per-Flight (multiplier)'
|
||||
journal_id: 1
|
||||
credit: null
|
||||
debit: 10000
|
||||
currency: USD
|
||||
memo: 'Expense: Per-Flight (multiplier)'
|
||||
tags: "expense"
|
||||
ref_model: App\Models\Pirep
|
||||
ref_model_id: pirepid_1
|
||||
created_at: '2018-03-06 12:34:15'
|
||||
updated_at: '2018-03-06 12:34:15'
|
||||
post_date: '2018-03-06 12:34:15'
|
||||
-
|
||||
id: a9bca611-c251-4fde-9f28-206d4debeb01
|
||||
transaction_group: 'Subfleet: Catering (747-43X RB211-524G)'
|
||||
journal_id: 1
|
||||
credit: null
|
||||
debit: 100000
|
||||
currency: USD
|
||||
memo: 'Subfleet Expense: Catering (747-43X RB211-524G)'
|
||||
tags: "subfleet"
|
||||
ref_model: App\Models\Pirep
|
||||
ref_model_id: pirepid_1
|
||||
created_at: '2018-03-06 12:34:15'
|
||||
updated_at: '2018-03-06 12:34:15'
|
||||
post_date: '2018-03-06 12:34:15'
|
||||
-
|
||||
id: c3ff6a6d-03d0-4744-8678-e27329462dcb
|
||||
transaction_group: Fares
|
||||
journal_id: 1
|
||||
credit: 1000000
|
||||
debit: 0
|
||||
currency: USD
|
||||
memo: 'Fares F10; price: 1000, cost: 0'
|
||||
tags: "fare"
|
||||
ref_model: App\Models\Pirep
|
||||
ref_model_id: pirepid_1
|
||||
created_at: '2018-03-06 12:34:15'
|
||||
updated_at: '2018-03-06 12:34:15'
|
||||
post_date: '2018-03-06 12:34:15'
|
||||
-
|
||||
id: c4e05ec1-530f-4897-92e8-787bdec8a0a1
|
||||
transaction_group: 'Pilot Pay'
|
||||
journal_id: 1
|
||||
credit: null
|
||||
debit: 15000
|
||||
currency: USD
|
||||
memo: 'Pilot Payment @ 50'
|
||||
tags: "pilot_pay"
|
||||
ref_model: App\Models\Pirep
|
||||
ref_model_id: pirepid_1
|
||||
created_at: now
|
||||
updated_at: now
|
||||
post_date: now
|
||||
-
|
||||
id: ed516367-eeb9-4a09-bfb7-531ec4be2f93
|
||||
transaction_group: Fares
|
||||
journal_id: 1
|
||||
credit: 1100000
|
||||
debit: 0
|
||||
currency: USD
|
||||
memo: 'Fares B10; price: 1100, cost: 0'
|
||||
tags: "fare"
|
||||
ref_model: App\Models\Pirep
|
||||
ref_model_id: pirepid_1
|
||||
created_at: now
|
||||
updated_at: now
|
||||
post_date: now
|
||||
-
|
||||
id: f3f8585e-894c-4491-b19b-d07b6ad20208
|
||||
transaction_group: 'Ground Handling'
|
||||
journal_id: 1
|
||||
credit: null
|
||||
debit: 75000
|
||||
currency: USD
|
||||
memo: 'Ground Handling'
|
||||
tags: "ground_handling"
|
||||
ref_model: App\Models\Pirep
|
||||
ref_model_id: pirepid_1
|
||||
created_at: now
|
||||
updated_at: now
|
||||
post_date: now
|
||||
|
||||
-
|
||||
id: 1bd1616c-eaa4-4ab9-b5c1-441004ceef14
|
||||
transaction_group: 'Subfleet 744-3X-RB211'
|
||||
journal_id: 1
|
||||
credit: null
|
||||
debit: 300000
|
||||
currency: USD
|
||||
memo: 'Subfleet 744-3X-RB211: Block Time Cost'
|
||||
tags: "subfleet"
|
||||
ref_model: App\Models\Pirep
|
||||
ref_model_id: pirepid_1
|
||||
created_at: now
|
||||
updated_at: now
|
||||
post_date: now
|
||||
|
||||
189
app/Database/seeds/settings.yml
Normal file
189
app/Database/seeds/settings.yml
Normal file
@@ -0,0 +1,189 @@
|
||||
- key: general.start_date
|
||||
name: 'Start Date'
|
||||
group: general
|
||||
value: ''
|
||||
options: ''
|
||||
type: date
|
||||
description: 'The date your VA started'
|
||||
- key: general.admin_email
|
||||
name: 'Admin Email'
|
||||
group: general
|
||||
value: ''
|
||||
options: ''
|
||||
type: text
|
||||
description: 'Email where notices, etc are sent'
|
||||
- key: units.distance
|
||||
name: 'Distance Units'
|
||||
group: units
|
||||
value: nmi
|
||||
options: 'km=kilometers,mi=miles,nmi=nautical miles'
|
||||
type: select
|
||||
description: 'The distance unit for display'
|
||||
- key: units.weight
|
||||
name: 'Weight Units'
|
||||
group: units
|
||||
value: lbs
|
||||
options: 'lbs,kg'
|
||||
type: select
|
||||
description: 'The weight unit for display'
|
||||
- key: units.speed
|
||||
name: 'Speed Units'
|
||||
group: units
|
||||
value: knot
|
||||
options: 'km/h,knot'
|
||||
type: select
|
||||
description: 'The speed unit for display'
|
||||
- key: units.altitude
|
||||
name: 'Altitude Units'
|
||||
group: units
|
||||
value: ft
|
||||
options: 'ft=feet,m=meters'
|
||||
type: select
|
||||
description: 'The altitude unit for display'
|
||||
- key: units.fuel
|
||||
name: 'Fuel Units'
|
||||
group: units
|
||||
value: lbs
|
||||
options: 'lbs,kg'
|
||||
type: select
|
||||
description: 'The units for fuel for display'
|
||||
- key: units.volume
|
||||
name: 'Volume Units'
|
||||
group: units
|
||||
value: gallons
|
||||
options: 'gallons,l=liters'
|
||||
type: select
|
||||
description: 'The units for fuel for display'
|
||||
- key: units.temperature
|
||||
name: 'Temperature Units'
|
||||
group: units
|
||||
value: F
|
||||
options: 'F=Fahrenheit,C=Celsius'
|
||||
type: select
|
||||
description: 'The units for temperature'
|
||||
- key: acars.live_time
|
||||
name: 'Live Time'
|
||||
group: acars
|
||||
value: 12
|
||||
options: ''
|
||||
type: int
|
||||
description: 'Age of flights to show on the map in hours. Set to 0 to show only all in-progress flights'
|
||||
- key: acars.center_coords
|
||||
name: 'Center Coords'
|
||||
group: acars
|
||||
value: '30.1945,-97.6699'
|
||||
options: ''
|
||||
type: text
|
||||
description: 'Where to center the map; enter as LAT,LON'
|
||||
- key: acars.default_zoom
|
||||
name: 'Default Zoom'
|
||||
group: acars
|
||||
value: 5
|
||||
options: ''
|
||||
type: int
|
||||
description: 'Initial zoom level on the map'
|
||||
- key: bids.disable_flight_on_bid
|
||||
name: 'Disable flight on bid'
|
||||
group: bids
|
||||
value: true
|
||||
options: ''
|
||||
type: boolean
|
||||
description: 'When a flight is bid on, no one else can bid on it'
|
||||
- key: bids.allow_multiple_bids
|
||||
name: 'Allow multiple bids'
|
||||
group: bids
|
||||
value: true
|
||||
options: ''
|
||||
type: boolean
|
||||
description: 'Whether or not someone can bid on multiple flights'
|
||||
- key: bids.expire_time
|
||||
name: 'Expire Time'
|
||||
group: bids
|
||||
value: 48
|
||||
options: ''
|
||||
type: int
|
||||
description: 'Number of hours to expire bids after'
|
||||
- key: pireps.duplicate_check_time
|
||||
name: 'PIREP duplicate time check'
|
||||
group: pireps
|
||||
value: 10
|
||||
options: ''
|
||||
type: int
|
||||
description: 'The time in minutes to check for a duplicate PIREP'
|
||||
- key: pireps.restrict_aircraft_to_rank
|
||||
name: 'Restrict Aircraft to Ranks'
|
||||
group: pireps
|
||||
value: true
|
||||
options: ''
|
||||
type: boolean
|
||||
description: 'Aircraft that can be flown are restricted to a user''s rank'
|
||||
- key: pireps.only_aircraft_at_dpt_airport
|
||||
name: 'Restrict Aircraft At Departure'
|
||||
group: pireps
|
||||
value: false
|
||||
options: ''
|
||||
type: boolean
|
||||
description: 'Only allow aircraft that are at the departure airport'
|
||||
- key: pireps.remove_bid_on_accept
|
||||
name: 'Remove bid on accept'
|
||||
group: pireps
|
||||
value: false
|
||||
options: ''
|
||||
type: boolean
|
||||
description: 'When a PIREP is accepted, remove the bid, if it exists'
|
||||
- key: pilots.id_length
|
||||
name: 'Pilot ID Length'
|
||||
group: pilots
|
||||
value: 4
|
||||
options: ''
|
||||
type: int
|
||||
description: 'The length of a pilot''s ID'
|
||||
- key: pilots.auto_accept
|
||||
name: 'Auto Accept New Pilot'
|
||||
group: pilots
|
||||
value: true
|
||||
options: ''
|
||||
type: boolean
|
||||
description: 'Automatically accept a pilot when they register'
|
||||
- key: pilots.home_hubs_only
|
||||
name: 'Hubs as home airport'
|
||||
group: pilots
|
||||
value: false
|
||||
options: ''
|
||||
type: boolean
|
||||
description: 'Pilots can only select hubs as their home airport'
|
||||
- key: pilots.only_flights_from_current
|
||||
name: 'Flights from Current'
|
||||
group: pilots
|
||||
value: false
|
||||
options: ''
|
||||
type: boolean
|
||||
description: 'Only show/allow flights from their current location'
|
||||
- key: pilots.auto_leave_days
|
||||
name: 'Pilot to ON LEAVE days'
|
||||
group: pilots
|
||||
value: 30
|
||||
options: ''
|
||||
type: int
|
||||
description: 'Automatically set a pilot to ON LEAVE status after N days of no activity'
|
||||
- key: pilots.hide_inactive
|
||||
name: 'Hide Inactive Pilots'
|
||||
group: pilots
|
||||
value: true
|
||||
options: ''
|
||||
type: boolean
|
||||
description: 'Don''t show inactive pilots in the public view'
|
||||
- key: pilots.restrict_to_company
|
||||
name: 'Restrict the flights to company'
|
||||
group: pilots
|
||||
value: false
|
||||
options: ''
|
||||
type: boolean
|
||||
description: 'Restrict flights to the user''s airline'
|
||||
- key: pilots.allow_transfer_hours
|
||||
name: 'Allow transfer hours'
|
||||
group: pilots
|
||||
value: true
|
||||
options: ''
|
||||
type: boolean
|
||||
description: 'Allow specifying transfer hours on registration page and displayed on profile page'
|
||||
21
app/Events/CronHourly.php
Normal file
21
app/Events/CronHourly.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events;
|
||||
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
* This event is dispatched when the hourly cron is run
|
||||
*/
|
||||
class CronHourly
|
||||
{
|
||||
use Dispatchable, SerializesModels;
|
||||
|
||||
/**
|
||||
* CronHourly constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
}
|
||||
22
app/Events/CronMonthly.php
Normal file
22
app/Events/CronMonthly.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events;
|
||||
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
* This event is dispatched when the monthly cron is run
|
||||
* It happens after all of the default nightly tasks
|
||||
*/
|
||||
class CronMonthly
|
||||
{
|
||||
use Dispatchable, SerializesModels;
|
||||
|
||||
/**
|
||||
* CronMonthly constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
}
|
||||
22
app/Events/CronNightly.php
Normal file
22
app/Events/CronNightly.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events;
|
||||
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
* This event is dispatched when the daily cron is run
|
||||
* It happens after all of the default nightly tasks
|
||||
*/
|
||||
class CronNightly
|
||||
{
|
||||
use Dispatchable, SerializesModels;
|
||||
|
||||
/**
|
||||
* CronNightly constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
}
|
||||
22
app/Events/CronWeekly.php
Normal file
22
app/Events/CronWeekly.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events;
|
||||
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
* This event is dispatched when the weekly cron is run
|
||||
* It happens after all of the default nightly tasks
|
||||
*/
|
||||
class CronWeekly
|
||||
{
|
||||
use Dispatchable, SerializesModels;
|
||||
|
||||
/**
|
||||
* CronWeekly constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
}
|
||||
42
app/Events/Expenses.php
Normal file
42
app/Events/Expenses.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events;
|
||||
|
||||
use App\Models\Pirep;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
* This event is dispatched when the expenses for a flight report
|
||||
* are collected. Your listeners should return a list of Expense
|
||||
* models. Don't call save on the model!
|
||||
*
|
||||
* Example return:
|
||||
*
|
||||
* [
|
||||
* new Expense([
|
||||
* 'airline_id': '', # < optional field
|
||||
* 'name': '',
|
||||
* 'amount': [DECIMAL],
|
||||
* 'type': int from ExpenseType enum class
|
||||
* ]),
|
||||
* ]
|
||||
*
|
||||
* The event caller will check the 'type' to make sure that it
|
||||
* will filter out expenses that only apply to the current process
|
||||
*
|
||||
* The event will have a copy of the PIREP model, if it's applicable
|
||||
*/
|
||||
class Expenses
|
||||
{
|
||||
use Dispatchable, SerializesModels;
|
||||
public $pirep;
|
||||
|
||||
/**
|
||||
* @param Pirep|null $pirep
|
||||
*/
|
||||
public function __construct(Pirep $pirep = null)
|
||||
{
|
||||
$this->pirep = $pirep;
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,9 @@ use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
* Class PirepAccepted
|
||||
*/
|
||||
class PirepAccepted
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
@@ -14,10 +17,12 @@ class PirepAccepted
|
||||
public $pirep;
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
* PirepAccepted constructor.
|
||||
*
|
||||
* @param Pirep $pirep
|
||||
*/
|
||||
public function __construct(Pirep $pirep)
|
||||
{
|
||||
//
|
||||
$this->pirep = $pirep;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ use Illuminate\Queue\SerializesModels;
|
||||
class PirepFiled
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
|
||||
public $pirep;
|
||||
|
||||
public function __construct(Pirep $pirep)
|
||||
|
||||
@@ -7,12 +7,20 @@ use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
* Class PirepRejected
|
||||
*/
|
||||
class PirepRejected
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
|
||||
public $pirep;
|
||||
|
||||
/**
|
||||
* PirepRejected constructor.
|
||||
*
|
||||
* @param Pirep $pirep
|
||||
*/
|
||||
public function __construct(Pirep $pirep)
|
||||
{
|
||||
$this->pirep = $pirep;
|
||||
|
||||
@@ -7,6 +7,9 @@ use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
* Class TestEvent
|
||||
*/
|
||||
class TestEvent
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
@@ -15,6 +18,8 @@ class TestEvent
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param User $user
|
||||
*/
|
||||
public function __construct(User $user)
|
||||
{
|
||||
|
||||
@@ -7,12 +7,20 @@ use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
* Class UserAccepted
|
||||
*/
|
||||
class UserAccepted
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* UserAccepted constructor.
|
||||
*
|
||||
* @param User $user
|
||||
*/
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user