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

Adding CreateClientFunction #50

Closed
wants to merge 4 commits into from
Closed

Adding CreateClientFunction #50

wants to merge 4 commits into from

Conversation

enrique-ayala
Copy link
Collaborator

  • New POST endpoint : /clients
    • inputs: phone_number, name, address, email (optional)
    • outputs: latitude, longitude, errors
  • New CI/CD pipeline

"""
self.clients_db = DynamoDBHandler(
table_name=settings.CLIENTS_TABLE_NAME,
partition_key="Id",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is partition key maped from phone to Id?

message=str(error),
)

def scan_table(self) -> Dict[str, Any]:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont thnk we are going to need this one

data = {
"phone_number": self.client_data["phone_number"],
"name": self.client_data["name"],
"address": self.client_data["address"],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"address": self.client_data["address"],
"first_address": self.client_data["first_address"],

"phone_number": self.client_data["phone_number"],
"name": self.client_data["name"],
"address": self.client_data["address"],
"latitude": latitude,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"latitude": latitude,
"first_latitude": latitude,

"name": self.client_data["name"],
"address": self.client_data["address"],
"latitude": latitude,
"longitude": longitude,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"longitude": longitude,
"first_longitude": longitude,

ReadCapacityUnits: 5
WriteCapacityUnits: 5

HiBerrySearchLocationIndex:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we creating a new index? we could just refference that one

@@ -152,6 +152,7 @@ def build_order(
"driver": driver,
"source": source.value,
"cooler": self.order_data.get("cooler", None),
"discount": self.order_data.get("discount"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you know why this changes appear again?

@@ -45,6 +45,7 @@ class HIBerryOrder(DeliveryDateMixin):
delivery_address: StrictStr
phone_number: StrictStr
cart_items: List[HIBerryProduct]
discount: StrictStr | None = None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you know why this changes appear again?

@@ -57,6 +58,10 @@ def calculate_total_amount(cls, value, values):
calculated_total = sum(
item.price * item.quantity for item in values.get("cart_items", [])
)
if values["discount"] and values["discount"] == "5":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you know why this changes appear again?

@@ -180,6 +180,10 @@ def assign_driver_for_delivery(
if driver_assigned == 0:
return 0

# Saturday is day 5, in sat only one schedule is running, so all sector are available
if day_of_week == 5:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you know why this changes appear again?

@enrique-ayala enrique-ayala deleted the feature/HPDO-55 branch June 22, 2024 17:54
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.

3 participants