Skip to content

Commit

Permalink
Develop (#34)
Browse files Browse the repository at this point in the history
* Merge master in develop (#27)

* Develop into master (#26)

* Task/#257 controller skeleton

* Task/#263 koppeling pakket service

* cors (#5)

* dockerfile added local file

* Add license (#6)

* Update README.md

* Create LICENSE

* Update README.md

Co-authored-by: Heesakkers,Aron A.P.H.M <aron.heesakkers@student.fontys.nl>

* Build (#11)

Co-authored-by: Aron Heesakkers <aron.heesakkers@via.nl>

* Hardcoded values to appsettings (#12)

Co-authored-by: Aron Heesakkers <aron.heesakkers@via.nl>

* Update README.md (#13)

* Develop (#7)

* Task/#257 controller skeleton

* Task/#263 koppeling pakket service

* cors (#5)

* dockerfile added local file

* Add license (#6)

* Update README.md

* Create LICENSE

* Update README.md

Co-authored-by: Heesakkers,Aron A.P.H.M <aron.heesakkers@student.fontys.nl>

Co-authored-by: Wieling,Kevin C.F.J <k.wieling@student.fontys.nl>
Co-authored-by: Gompel,Sverre S. van <sverre.vangompel@student.fontys.nl>
Co-authored-by: Heesakkers,Aron A.P.H.M <aron.heesakkers@student.fontys.nl>
Co-authored-by: EGKangaroo <EGKangaroo@yahoo.com>

* Update README.md

Co-authored-by: Wieling,Kevin C.F.J <k.wieling@student.fontys.nl>
Co-authored-by: Gompel,Sverre S. van <sverre.vangompel@student.fontys.nl>
Co-authored-by: Heesakkers,Aron A.P.H.M <aron.heesakkers@student.fontys.nl>
Co-authored-by: EGKangaroo <EGKangaroo@yahoo.com>

* Update README.md

* Gateway fix (#16)

* Changes

* gateway fix, same request model as package service

* created at action bug fixed

Co-authored-by: Aron Heesakkers <aron.heesakkers@via.nl>
Co-authored-by: EGKangaroo <EGKangaroo@yahoo.com>

* Task/#264 koppeling locatieservice (#18)

* added locationservice url

* added models

* location controller

* fixed room requestmodel

* fix endpoints and constants

* more model fixes

* getpackage conversion fix

* Story/#333 pakketgegevens (#20)

* personeel-service toegevoegd

* start error handling. persoon toegevoegd aan GetPackage(id)

* sender is receiverid bugfix

* collectionpoint ophalen bij GetPackage{id}

* 400 - 404 errors allowed. getpackages haalt nu ook locatie en ontvanger op

* merge fix

* Story/#16 edit locations (#23)

* Docker Local Appsettings

* README update

* Update methods finished

* Changed name

Co-authored-by: Aron Heesakkers <aron.heesakkers@via.nl>

* #358 delete endpoints (#24)

* all calls make use of flurl extension and return ObjectResults

* Delete endpoints toegevoegd aan locatiecontroller

* Error handling voor delete endpoints

* conflict httpstatus added

* Small formatting fix in locatiecontroller

Co-authored-by: JaapvanderMeer <43168682+JeapfromtheLake@users.noreply.github.com>

Co-authored-by: Wieling,Kevin C.F.J <k.wieling@student.fontys.nl>
Co-authored-by: Gompel,Sverre S. van <sverre.vangompel@student.fontys.nl>
Co-authored-by: Heesakkers,Aron A.P.H.M <aron.heesakkers@student.fontys.nl>
Co-authored-by: EGKangaroo <EGKangaroo@yahoo.com>
Co-authored-by: Shady^ <36726909+ShadyDL@users.noreply.github.com>
Co-authored-by: Aron Heesakkers <aron.heesakkers@via.nl>
Co-authored-by: Sverre <43172180+Sverrevg@users.noreply.github.com>

* Update docker-publish.yml

* Update appsettings.json

* Update appsettings.json

* Rename appsettings.Docker.json to tmp

* Rename tmp to appsettings.Docker.json

* Add kestral

* gethealth call

Co-authored-by: Jaap van der Meer <43168682+JeapfromtheLake@users.noreply.github.com>
Co-authored-by: Wieling,Kevin C.F.J <k.wieling@student.fontys.nl>
Co-authored-by: Gompel,Sverre S. van <sverre.vangompel@student.fontys.nl>
Co-authored-by: Heesakkers,Aron A.P.H.M <aron.heesakkers@student.fontys.nl>
Co-authored-by: EGKangaroo <EGKangaroo@yahoo.com>
Co-authored-by: Shady^ <36726909+ShadyDL@users.noreply.github.com>
Co-authored-by: Aron Heesakkers <aron.heesakkers@via.nl>

* #433 api call url refactor (#29)

* Develop into master (#26)

* Task/#257 controller skeleton

* Task/#263 koppeling pakket service

* cors (#5)

* dockerfile added local file

* Add license (#6)

* Update README.md

* Create LICENSE

* Update README.md

Co-authored-by: Heesakkers,Aron A.P.H.M <aron.heesakkers@student.fontys.nl>

* Build (#11)

Co-authored-by: Aron Heesakkers <aron.heesakkers@via.nl>

* Hardcoded values to appsettings (#12)

Co-authored-by: Aron Heesakkers <aron.heesakkers@via.nl>

* Update README.md (#13)

* Develop (#7)

* Task/#257 controller skeleton

* Task/#263 koppeling pakket service

* cors (#5)

* dockerfile added local file

* Add license (#6)

* Update README.md

* Create LICENSE

* Update README.md

Co-authored-by: Heesakkers,Aron A.P.H.M <aron.heesakkers@student.fontys.nl>

Co-authored-by: Wieling,Kevin C.F.J <k.wieling@student.fontys.nl>
Co-authored-by: Gompel,Sverre S. van <sverre.vangompel@student.fontys.nl>
Co-authored-by: Heesakkers,Aron A.P.H.M <aron.heesakkers@student.fontys.nl>
Co-authored-by: EGKangaroo <EGKangaroo@yahoo.com>

* Update README.md

Co-authored-by: Wieling,Kevin C.F.J <k.wieling@student.fontys.nl>
Co-authored-by: Gompel,Sverre S. van <sverre.vangompel@student.fontys.nl>
Co-authored-by: Heesakkers,Aron A.P.H.M <aron.heesakkers@student.fontys.nl>
Co-authored-by: EGKangaroo <EGKangaroo@yahoo.com>

* Update README.md

* Gateway fix (#16)

* Changes

* gateway fix, same request model as package service

* created at action bug fixed

Co-authored-by: Aron Heesakkers <aron.heesakkers@via.nl>
Co-authored-by: EGKangaroo <EGKangaroo@yahoo.com>

* Task/#264 koppeling locatieservice (#18)

* added locationservice url

* added models

* location controller

* fixed room requestmodel

* fix endpoints and constants

* more model fixes

* getpackage conversion fix

* Story/#333 pakketgegevens (#20)

* personeel-service toegevoegd

* start error handling. persoon toegevoegd aan GetPackage(id)

* sender is receiverid bugfix

* collectionpoint ophalen bij GetPackage{id}

* 400 - 404 errors allowed. getpackages haalt nu ook locatie en ontvanger op

* merge fix

* Story/#16 edit locations (#23)

* Docker Local Appsettings

* README update

* Update methods finished

* Changed name

Co-authored-by: Aron Heesakkers <aron.heesakkers@via.nl>

* #358 delete endpoints (#24)

* all calls make use of flurl extension and return ObjectResults

* Delete endpoints toegevoegd aan locatiecontroller

* Error handling voor delete endpoints

* conflict httpstatus added

* Small formatting fix in locatiecontroller

Co-authored-by: JaapvanderMeer <43168682+JeapfromtheLake@users.noreply.github.com>

Co-authored-by: Wieling,Kevin C.F.J <k.wieling@student.fontys.nl>
Co-authored-by: Gompel,Sverre S. van <sverre.vangompel@student.fontys.nl>
Co-authored-by: Heesakkers,Aron A.P.H.M <aron.heesakkers@student.fontys.nl>
Co-authored-by: EGKangaroo <EGKangaroo@yahoo.com>
Co-authored-by: Shady^ <36726909+ShadyDL@users.noreply.github.com>
Co-authored-by: Aron Heesakkers <aron.heesakkers@via.nl>
Co-authored-by: Sverre <43172180+Sverrevg@users.noreply.github.com>

* Update docker-publish.yml

* Update appsettings.json

* Update appsettings.json

* Rename appsettings.Docker.json to tmp

* Rename tmp to appsettings.Docker.json

* Add kestral

* gethealth call

* Updated urls in location controller and refactored a little but for clarity

* Refactored packagecontroller and fixed urls

Co-authored-by: Jaap van der Meer <43168682+JeapfromtheLake@users.noreply.github.com>
Co-authored-by: Wieling,Kevin C.F.J <k.wieling@student.fontys.nl>
Co-authored-by: Gompel,Sverre S. van <sverre.vangompel@student.fontys.nl>
Co-authored-by: Heesakkers,Aron A.P.H.M <aron.heesakkers@student.fontys.nl>
Co-authored-by: EGKangaroo <EGKangaroo@yahoo.com>
Co-authored-by: Shady^ <36726909+ShadyDL@users.noreply.github.com>
Co-authored-by: Aron Heesakkers <aron.heesakkers@via.nl>

* merge fix

* #436 sonarcloud integration (#30)

* Develop into master (#26)

* Task/#257 controller skeleton

* Task/#263 koppeling pakket service

* cors (#5)

* dockerfile added local file

* Add license (#6)

* Update README.md

* Create LICENSE

* Update README.md

Co-authored-by: Heesakkers,Aron A.P.H.M <aron.heesakkers@student.fontys.nl>

* Build (#11)

Co-authored-by: Aron Heesakkers <aron.heesakkers@via.nl>

* Hardcoded values to appsettings (#12)

Co-authored-by: Aron Heesakkers <aron.heesakkers@via.nl>

* Update README.md (#13)

* Develop (#7)

* Task/#257 controller skeleton

* Task/#263 koppeling pakket service

* cors (#5)

* dockerfile added local file

* Add license (#6)

* Update README.md

* Create LICENSE

* Update README.md

Co-authored-by: Heesakkers,Aron A.P.H.M <aron.heesakkers@student.fontys.nl>

Co-authored-by: Wieling,Kevin C.F.J <k.wieling@student.fontys.nl>
Co-authored-by: Gompel,Sverre S. van <sverre.vangompel@student.fontys.nl>
Co-authored-by: Heesakkers,Aron A.P.H.M <aron.heesakkers@student.fontys.nl>
Co-authored-by: EGKangaroo <EGKangaroo@yahoo.com>

* Update README.md

Co-authored-by: Wieling,Kevin C.F.J <k.wieling@student.fontys.nl>
Co-authored-by: Gompel,Sverre S. van <sverre.vangompel@student.fontys.nl>
Co-authored-by: Heesakkers,Aron A.P.H.M <aron.heesakkers@student.fontys.nl>
Co-authored-by: EGKangaroo <EGKangaroo@yahoo.com>

* Update README.md

* Gateway fix (#16)

* Changes

* gateway fix, same request model as package service

* created at action bug fixed

Co-authored-by: Aron Heesakkers <aron.heesakkers@via.nl>
Co-authored-by: EGKangaroo <EGKangaroo@yahoo.com>

* Task/#264 koppeling locatieservice (#18)

* added locationservice url

* added models

* location controller

* fixed room requestmodel

* fix endpoints and constants

* more model fixes

* getpackage conversion fix

* Story/#333 pakketgegevens (#20)

* personeel-service toegevoegd

* start error handling. persoon toegevoegd aan GetPackage(id)

* sender is receiverid bugfix

* collectionpoint ophalen bij GetPackage{id}

* 400 - 404 errors allowed. getpackages haalt nu ook locatie en ontvanger op

* merge fix

* Story/#16 edit locations (#23)

* Docker Local Appsettings

* README update

* Update methods finished

* Changed name

Co-authored-by: Aron Heesakkers <aron.heesakkers@via.nl>

* #358 delete endpoints (#24)

* all calls make use of flurl extension and return ObjectResults

* Delete endpoints toegevoegd aan locatiecontroller

* Error handling voor delete endpoints

* conflict httpstatus added

* Small formatting fix in locatiecontroller

Co-authored-by: JaapvanderMeer <43168682+JeapfromtheLake@users.noreply.github.com>

Co-authored-by: Wieling,Kevin C.F.J <k.wieling@student.fontys.nl>
Co-authored-by: Gompel,Sverre S. van <sverre.vangompel@student.fontys.nl>
Co-authored-by: Heesakkers,Aron A.P.H.M <aron.heesakkers@student.fontys.nl>
Co-authored-by: EGKangaroo <EGKangaroo@yahoo.com>
Co-authored-by: Shady^ <36726909+ShadyDL@users.noreply.github.com>
Co-authored-by: Aron Heesakkers <aron.heesakkers@via.nl>
Co-authored-by: Sverre <43172180+Sverrevg@users.noreply.github.com>

* Update docker-publish.yml

* Update appsettings.json

* Update appsettings.json

* Rename appsettings.Docker.json to tmp

* Rename tmp to appsettings.Docker.json

* Add kestral

* gethealth call

* Create sonarcloud.yml

* Updated name of workflow

* Fixed indentation

* Updated pull request triggers

Co-authored-by: Jaap van der Meer <43168682+JeapfromtheLake@users.noreply.github.com>
Co-authored-by: Wieling,Kevin C.F.J <k.wieling@student.fontys.nl>
Co-authored-by: Gompel,Sverre S. van <sverre.vangompel@student.fontys.nl>
Co-authored-by: Heesakkers,Aron A.P.H.M <aron.heesakkers@student.fontys.nl>
Co-authored-by: EGKangaroo <EGKangaroo@yahoo.com>
Co-authored-by: Shady^ <36726909+ShadyDL@users.noreply.github.com>
Co-authored-by: Aron Heesakkers <aron.heesakkers@via.nl>
Co-authored-by: Sverre <43172180+Sverrevg@users.noreply.github.com>
Co-authored-by: Sverre van Gompel <sverrevangompel@hotmail.com>

* #20 pakket levering (#31)

* package/ticket response and requests updated. added to converter and changed controller logic

* postticket added and ticketresponse update

* ticketmodel now has complete location model

* duplicate code fix

* Task/#423 mail service calls (#33)

* Update PackageController.cs

* get persons and rooms when posting

* fixed exception error by correctly awaiting response

* GetAllpersons and GetAllRooms added to packageresponsemodel

Co-authored-by: Sverre <43172180+Sverrevg@users.noreply.github.com>
Co-authored-by: Wieling,Kevin C.F.J <k.wieling@student.fontys.nl>
Co-authored-by: Gompel,Sverre S. van <sverre.vangompel@student.fontys.nl>
Co-authored-by: Heesakkers,Aron A.P.H.M <aron.heesakkers@student.fontys.nl>
Co-authored-by: EGKangaroo <EGKangaroo@yahoo.com>
Co-authored-by: Shady^ <36726909+ShadyDL@users.noreply.github.com>
Co-authored-by: Aron Heesakkers <aron.heesakkers@via.nl>
Co-authored-by: FIPostAdmin <82575254+FIPostAdmin@users.noreply.github.com>
Co-authored-by: Sverre van Gompel <sverrevangompel@hotmail.com>
  • Loading branch information
10 people authored Jun 4, 2021
1 parent 23daed0 commit b333f98
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion Controllers/PackageController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ public async Task<ActionResult<PackageResponseModel>> PostPackage(PackageRequest
}

PackageServiceModel model = await flurlPostResponse.GetJsonAsync<PackageServiceModel>();
PackageResponseModel responseModel = ServiceToResponseModelConverter.ConvertPackage(model);
PackageResponseModel responseModel = ServiceToResponseModelConverter.ConvertPackage(model, await GetAllPersons(), await GetAllRooms());

//send registration mail
await "https://mailservice20210603092014.azurewebsites.net/api/TrackAndTraceMail?code=bTMCXQQGWaQycYLfbP/Vq749V03PPkSbmwRyfQlBXlVQq9WZyR4U7Q==".PostJsonAsync(responseModel);

return CreatedAtAction("PostPackage", responseModel);
}

Expand Down Expand Up @@ -135,9 +139,26 @@ public async Task<ActionResult<TicketResponseModel>> PostTicket(TicketRequestMod

TicketServiceModel model = await flurlPostResponse.GetJsonAsync<TicketServiceModel>();
TicketResponseModel responseModel = ServiceToResponseModelConverter.ConvertTicket(model);

//check if package is finished and then send arrival email
IFlurlResponse flurlPackageResponse = await $"{ Constants.PackageApiUrl}/api/packages/{request.PackageId}".GetAsync();

PackageServiceModel pkgService = await flurlPackageResponse.GetJsonAsync<PackageServiceModel>();
PackageResponseModel pkg = ServiceToResponseModelConverter.ConvertPackage(pkgService, await GetAllPersons(), await GetAllRooms());

Console.WriteLine("package route finished is " + pkg.RouteFinished);

if (pkg.RouteFinished)
{
//send email
await "https://mailservice20210603092014.azurewebsites.net/api/ArrivalMail?code=gYOUs9FO7WwwNXz2eSGtZM0AFxQl/RQvOJ4RF0uotwYLe7l/AIGGKg==".PostJsonAsync(pkg);
}

return CreatedAtAction("PostTicket", responseModel);
}
#endregion

#region Put methods.
// PUT api/packages/5
[HttpPut("{id}")]
[ProducesResponseType(StatusCodes.Status204NoContent)]
Expand Down

0 comments on commit b333f98

Please sign in to comment.