This application will read in an input file in the NEM12 format and returns the SQL insert statement for it. It will also ideally throw some errors if the input file did not comply with the NEM12 format.
- Reads NEM12 formatted files.
- Generates SQL insert statements.
- Validates input file format and throws errors for non-compliant files.
- Integrated with springdoc for API documentation accessible via Swagger UI.
The application uses the springdoc library to provide interactive API documentation. You can access the Swagger UI at:
http://localhost:8080/swagger-ui.html
For building and running the application you need:
There are several ways to run this Spring Boot application on your local machine. One way is to execute the main
method in the com.skyplor.meterreader.MeterReaderApplication
class from your IDE.
Alternatively, you can use the Spring Boot Maven plugin like so:
mvn spring-boot:run
To build the project and generate the executable jar, use the following command:
mvn clean install
You can run the tests using the following command:
mvn test
-
Start the application.
-
Use a tool like
curl
or Postman to upload your NEM12 formatted file to the following endpoint:Endpoint:
POST /api/v1/meter-readings/upload
Example using
curl
:curl -F "file=@path/to/your/file.csv" http://localhost:8080/api/v1/meter-readings/upload
Replace path/to/your/file.csv
with the actual path to your NEM12 formatted file.
The response will contain the SQL insert statement or an error message if the file did not comply with the NEM12 format.