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

feat(location): location-startfree-maxmin-distance #70

Merged
merged 9 commits into from
Nov 3, 2023

Conversation

jamalsoueidan
Copy link
Owner

No description provided.

…etLocationObject helper function

chore(lookup.service.spec.ts): refactor test data creation to use getLocationObject helper function
- Add `CustomerLocationBody` definition in `openapi.yaml`
- Create `location-body.yaml` with properties for location body
- Update `location.yaml` and `create/body.yaml` to reference `location-body.yaml`
- Update `update/body.yaml` to reference `location-body.yaml`
@jamalsoueidan jamalsoueidan changed the title push old stuff up feat(location): location-startfree-maxmin-distance Oct 30, 2023
feat(shipping): add create controller
feat(shipping): remove get controller
feat(shipping): add rates controller
feat(shipping): add calculate-cost service
feat(shipping): add calculate-cost tests
feat(shipping): add calculate service
feat(shipping): add calculate tests

The changes in this commit include:
- Added a new calculate service and controller for shipping calculations.
- Added a new create controller for shipping.
- Removed the get controller for shipping.
- Added a new rates controller for shipping.
- Added a new calculate-cost service for shipping calculations.
- Added tests for the calculate-cost service.
- Added a new calculate service for shipping calculations.
- Added tests for the calculate service.

feat(shipping): add create service and tests
feat(shipping): add get service and tests
feat(shipping): add rates service and tests
feat(shipping): add shipping model

feat(shipping): add shipping schema and types

- Add shipping.schema.ts file to define the mongoose schema for the shipping model.
- Define the IShipping and IShippingDocument interfaces to represent the shape of the shipping document in the database.
- Create the ShippingMongooseSchema using mongoose.Schema to define the fields and their types for the shipping model.
- Add the necessary fields and their types to the ShippingMongooseSchema.
- Add timestamps to the ShippingMongooseSchema to automatically track the creation and update timestamps.

refactor(shipping): remove shipping service and types

- Remove the shipping.service.ts file as it is no longer needed.
- Remove the shipping.types.ts file as it is no longer needed.
feat(location): add get-travel-time service
feat(location): add validate-address service
feat(location): add create service
feat(location): add get service

chore(location): remove unused location service files
feat(location): add update service for locations
test(location): add tests for location update service

feat(location): add LocationServiceUpdate function

This commit adds the `LocationServiceUpdate` function to the location service in order to update a location in the database. The function takes in a filter object containing the locationId and customerId, and a body object containing the updated location data. If the `fullAddress` property is included in the body, the function checks if the location exists and if the address has changed. If the address has changed, the function calls the `LocationServiceValidateAddress` function to validate the new address and update the `fullAddress`, `geoLocation`, and `handle` properties of the location. The function then updates the location in the database and returns the updated location.

feat(location): add LocationServiceValidateAddress function

This commit adds the `LocationServiceValidateAddress` function to the location service in order to validate an address and check if it already exists in the database. The function takes in a `fullAddress` string and an optional `
…ping ID

fix(availability.spec.ts): remove unused imports and mock ShippingServiceGet function
fix(availability.spec.ts): create and use mocked shipping object in test case
fix(availability.spec.ts): remove unused imports and mock ShippingServiceGet function
fix(availability.spec.ts): create and use mocked shipping object in test case
fix(availability.spec.ts): remove unused imports and mock ShippingServiceGet function
fix(availability.spec.ts): create and use mocked shipping object in test case
fix(availability.spec.ts): remove unused imports and mock ShippingServiceGet function
fix(availability.spec.ts): create and use mocked shipping object in test case
fix(availability.spec.ts): remove unused imports and mock ShippingServiceGet function
fix(availability.spec.ts): create and use mocked shipping object in test case
fix(availability.spec.ts): remove unused imports and mock ShippingServiceGet function
fix(availability.spec.ts):

fix(location.spec.ts): update import statement for LocationServiceCreate
fix(location.spec.ts): update import statement for LocationServiceCreate
fix(location.spec.ts): update import statement for LocationServiceCreate
fix(location.spec.ts): update import statement for LocationServiceCreate
fix(location.spec.ts): update import statement for LocationServiceCreate
fix(location.spec.ts): update import statement for LocationServiceCreate
fix(location.spec.ts): update import statement for LocationServiceCreate
fix(location.spec.ts): update import statement for LocationServiceCreate
fix(location.spec.ts): update import statement for LocationServiceCreate
fix(location.spec.ts): update import statement for LocationServiceCreate
fix(location.spec.ts): update import statement for LocationServiceCreate
fix(location.spec.ts): update import statement for LocationServiceCreate
fix(location.spec.ts): update import statement for LocationServiceCreate
fix(location.spec.ts): update import statement for LocationServiceCreate
fix(location.spec.ts): update import statement for LocationServiceCreate
fix
feat(openapi): add ShippingCreate endpoint to openapi.yaml
feat(openapi): add ShippingBody and ShippingCreateResponse types to openapi.yaml
feat(openapi): add shippingId property to customer availability get body
feat(openapi): add ShippingBody type to shipping calculate endpoint in openapi.yaml
feat(openapi): add ShippingCreate endpoint to openapi.yaml
feat(openapi): add ShippingCreateResponse type to openapi.yaml
feat(openapi): add NumberOrString type to openapi.yaml
fix(server.ts): change port variable case from lowercase port to uppercase PORT
feat(server.ts): add support for process.env.PORT environment variable
fix(shipping/controllers/calculate.ts): add customerId property to ShippingControllerCalculateRequest
fix(shipping/services/calculate.ts): add comment about using customerId to find locationId
@jamalsoueidan jamalsoueidan merged commit 6409ec3 into main Nov 3, 2023
2 checks passed
@jamalsoueidan jamalsoueidan deleted the 44-location-startfree-maxmindistance branch November 3, 2023 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant