https://github.com/pavlusha311245/import-itrnstn
https://github.com/pavlusha311245/import-itrnstn
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pavlusha311245/import-itrnstn
- Owner: Pavlusha311245
- Created: 2025-03-28T10:09:40.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2025-03-30T21:32:58.000Z (2 months ago)
- Last Synced: 2025-03-30T22:26:56.772Z (2 months ago)
- Language: PHP
- Size: 48.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MONSTER IMPORTER
## About the project
This project is console application. Mechanism which reads a file from command line. The file contains a list of
products. The program will read the file and
import the products into a database.### Libraries used
- [Laravel zero](https://laravel-zero.com/)
- [Laravel Excel](https://laravel-excel.com/)#### Example of application execution

Example file is located in `storage` folder.
## Run the project locally using development server
1. Clone the repository
2. Run `composer install`
3. Setup database in `.env` file
4. Run `php artisan migrate`
5. Run `php artisan import:products ` where `` is the path to the file you want to import## Build standalone application
1. Clone the repository
2. Run `composer install`
3. Setup database in `.env` file
4. Run `php artisan migrate`
5. Run `php artisan app:build ` to build the application
6. Run `./build/ import:products ` where `` is the path to the file you want to import## Development
### Linting
```bash
composer lint
```### Testing
```bash
composer test
```## How to import products
#### Supported format
Run the following command:
```bash
php artisan import:products
```_change `` to the path of the file you want to import_
### Rule of importing products
- The file must be a CSV file
- The file must have the following columns:
- Product Code
- Product Name
- Product Description
- Stock
- Cost in GBP
- Discontinued
- Rows with cost in GBP less than 5 will be ignored and stock less than 10 will be ignored
- Any item with cost more than 1000 will be ignored
- Items marked as discontinued will be imported, but will have the discontinued date set as the current date.
- Failed imports will be logged.## Enhancements
- [ ] Add support for other file formats (e.g. XLSX, ODS)
- [ ] Add queue support for importing products for large files
- [ ] Add support for importing products from a URL
- [ ] Add support for exporting products from a database
- [ ] Add a validation service to ensure file integrity before processing, checking headers, encoding, and formatting.
- [ ] Include reporting/logging to capture errors and warnings associated with invalid or suspect entries for later review.## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details