Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing data on CSV File layouts #1288

Closed
lesmar54 opened this issue Aug 26, 2021 · 23 comments · Fixed by #1299
Closed

Missing data on CSV File layouts #1288

lesmar54 opened this issue Aug 26, 2021 · 23 comments · Fixed by #1299
Labels
Milestone

Comments

@lesmar54
Copy link
Contributor

lesmar54 commented Aug 26, 2021

PHPVMS V7 has a nice import feature from csv files but it seems there are considerable differences between the csv files and what you would input on the screen. Does anybody know the reason for this such as the Subfleet table has these fields in the csv but you do not input them all on the screen
those marked with BOLD ITALICS are input on the screen
airline,type,name,fuel_type,cost_block_hour,cost_delay_minute,ground_handling_multiplier,cargo_capacity,fuel_capacity,gross_weight,fares

The others are not input when adding a new Subfleet two inputs MAIN HUB and SIMBRIEF TYPE are available for input but do not show on the csv so that's 6 fields that are not accounted for on the CSV that gets exported or imported and when you look at the 'input/maintain fields on the record
2 airline_id.
3 hub_id
4 type.
5 simbrief_type
6 name
7 cost_block_hour
8 cost_delay_minute
9 fuel_type
10 ground_handling_multiplier
11 cargo_capacity
12 fuel_capacity
13 gross_weight
There is not even a field for Fares in the database record.
Similar errors and omissions are seen on other tables , it seems that either some of these fields are redundant because of the mew structure of PHPVMS 7 and have been initially copied over from PHPVMS 5 . However as PHPVMS is in a BETA state at present there is opportunity to get these csv file layouts sorted out and prune any redundant fields from these tables if they have been moved elsewhere.

@nabeelio
Copy link
Owner

So you're saying that these three fields:

11 cargo_capacity
12 fuel_capacity
13 gross_weight

Should be removed from the csv? And yeah, I agree they should be cleaned up.

@nabeelio nabeelio added the bug label Aug 26, 2021
@nabeelio nabeelio added this to the 7.0.0 milestone Aug 26, 2021
@FatihKoz
Copy link
Contributor

11 cargo_capacity
12 fuel_capacity
13 gross_weight

Not used at all 'cause they are handled differently... So personally I think, they can be removed from the table structure to avoid confusion (or at least this can be documented somewhere). Same applies to some other tables as well.

There is not even a field for Fares in the database record.

This is because the fare system has its own tables which use "relationships" to build up the final result. This is the reason you can not see anything related to fares at subfleet table (same applies to some other tables too)

@lesmar54
Copy link
Contributor Author

The Main Hub and Simbrief Name are input on the Screen and saved in the database record but do not appear in the CSV record so you could not really import a Subfleet if you wanted to add these two fields from a CSV

@FatihKoz
Copy link
Contributor

So actually what missing is the "Hub" and the "Simbrief Type" fields ;)

@lesmar54
Copy link
Contributor Author

What part of the system exports the csv data and what part imports the csv data as I could have a look at fixing this as I am building a PHPVMSGEN system that has all the world airports flights and aircraft types and I am going to filter out by a config -file the raw data I do not need to import and set up a set of CSV files to import to PHPVMS so it is a sort of Virtual Airline Builder for PHPVMS which can help set up a working airline in a very short time and just leave some tweaking by the Virtual Airline later it will save a lot of input by hand so that's why I am worried about the csv file layouts

@lesmar54
Copy link
Contributor Author

lesmar54 commented Aug 26, 2021

So actually what missing is the "Hub" and the "Simbrief Type" fields ;) Yes on the Subfleet table and the field Fares should it be removed as well from the csv file if it is built later as a relationship

@FatihKoz
Copy link
Contributor

You should not remove "Fares" field from csv. It works and it is needed.

@FatihKoz
Copy link
Contributor

FatihKoz commented Aug 26, 2021

So to simplify this;

What is missing in csv (needs to be added 'cause effects management import/export);

  • Hub
  • SimBrief Type

What is extra / not being used / non-necessary at SubFleets table (which is harmless and can be forgotten forever)

  • cargo_capacity
  • fuel_capacity
  • gross_weight

Fares and relationships of them with Subfleets and Flights are a different topic :)

@lesmar54
Copy link
Contributor Author

lesmar54 commented Aug 26, 2021

That is correct , what are the PHP files for the Subfleet import and export , I am good with PHP and once I get the hang of this I can offer to fix the other CSV file code as and when I find something missing (of course it would be noted on here first as some fields are there for a specific reason . So it would be that for now you experts will state like above what needs to be added and what can be removed . I would not remove the fields myself from the database as that can be done prior to the main release as an upgrade to these beta-versions

@nabeelio
Copy link
Owner

It's all in https://github.com/nabeelio/phpvms/tree/dev/app/Services/ImportExport

You should also be using the latest dev version, some of the import/export bugs have been fixed.

@nabeelio
Copy link
Owner

Fares should be getting exported from the subfleet, are they not?

@FatihKoz
Copy link
Contributor

They are being exported and imported, nothing wrong with fares

@FatihKoz
Copy link
Contributor

Only problem is we still have an open issue ( #974 ) about them @nabeelio

airline,type,name,fuel_type,cost_block_hour,cost_delay_minute,ground_handling_multiplier,cargo_capacity,fuel_capacity,gross_weight,fares
TKC,B777F-TKC,"Boeing B777 Freighter",1,2250,0,175,,,,CGO?capacity=102000
THY,B777-THY,"Boeing B777",1,2250,0,175,,,,Y?capacity=300;J?capacity=40;F?capacity=9;CGO?capacity=18000
OHY,A320-OHY,"Airbus A320",1,1100,0,90,,,,Y?capacity=180
OHY,A321-OHY,"Airbus A321",1,1000,0,90,,,,Y?capacity=219;CGO?capacity=5000
KKK,CRJ7-KKK,"Bombardier CRJ-700",1,575,,50,,,,Y?capacity=64;J?capacity=6;CGO?capacity=2000

This generates problems when being imported back

Y?capacity=219;CGO?capacity=5000

@lesmar54
Copy link
Contributor Author

so this is the code to amend
public static $columns = [
'airline' => 'required',
'type' => 'required',
'name' => 'required',
'fuel_type' => 'nullable',
'cost_block_hour' => 'nullable',
'cost_delay_minute' => 'nullable',
'ground_handling_multiplier' => 'nullable',
'cargo_capacity' => 'nullable',
'fuel_capacity' => 'nullable',
'gross_weight' => 'nullable',
'fares' => 'nullable',

I would remove the fuel capacity gross weight and cargo capacity and add in the Basehub and Simbrief Base-HUB is required type and simbrief is nullable as you do not have to input it

@lesmar54
Copy link
Contributor Author

The other issue has not yet been assigned , so could I not fix this one first and then comment in the other 974 that other fields in this csv have been fixed

@lesmar54
Copy link
Contributor Author

airline,hub_id,type,simbrief_type,name,fuel_type,cost_block_hour,cost_delay_minute,ground_handling_multiplier,fares
AVC,TEST,B737,B737-200,"Boeing 737 200",1,10,10,1,

Fixed it locally on my dev copy as my airline is not live yet

@lesmar54
Copy link
Contributor Author

the code was as follows -:
/**
* All of the columns that are in the CSV import
* Should match the database fields, for the most part
/
/
*
* Leslie Jarrett Fix for redundant fields and
* missing fields [1288] 26/08/21
*/
public static $columns = [
'airline' => 'required',
'hub_id' => 'required',
'type' => 'required',
'simbrief_type' => 'nullable',
'name' => 'required',
'fuel_type' => 'nullable',
'cost_block_hour' => 'nullable',
'cost_delay_minute' => 'nullable',
'ground_handling_multiplier' => 'nullable',
'fares' => 'nullable',
];
that seems to work

@FatihKoz
Copy link
Contributor

What about export ?

You should add/remove fields from the export code, so the exported csv has new fields you added and does not contain the fields you removed otherwise the importer will not like the csv :(

Also you can send in those changes are "pull requests", posting here as plain text makes following the changes harder.

@lesmar54
Copy link
Contributor Author

What about export ?

You should add/remove fields from the export code, so the exported csv has new fields you added and does not contain the fields you removed otherwise the importer will not like the csv :(

Also you can send in those changes are "pull requests", posting here as plain text makes following the changes harder.

The csv file I showed above was the EXPORT from the system so it had the amendments .
do I not need to be assigned to the problem 1288 to make a pull request to add the code to this pulled version. Also what is the standard for commenting changes should I put my name date and fix number against my changes

@FatihKoz
Copy link
Contributor

FatihKoz commented Aug 26, 2021

I do not know, I never inserted my name or date in the code as comments. Saw no one doing that too when they send in pull requests. Github offers a nice history (or commits) so you can track your changes (also the owner of the project can see who did what and when etc) if needed.

@nabeelio
Copy link
Owner

The export code references those same fields, so changing in one automatically changes it in the other. You don't need to be assigned anything to send in a pull request, I'll tie it to this issue automatically. You don't need to comment name/date/time or anything, that's automatically tracked by git.

@lesmar54
Copy link
Contributor Author

lesmar54 commented Aug 26, 2021 via email

@nabeelio
Copy link
Owner

In Github, you can edit the file directly, and then it will ask you if you want to create a pull request.

@nabeelio nabeelio linked a pull request Sep 7, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants