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

Refactor Order/Slot models #1407

Merged
merged 2 commits into from
Sep 10, 2024
Merged

Refactor Order/Slot models #1407

merged 2 commits into from
Sep 10, 2024

Conversation

KoalaSat
Copy link
Member

@KoalaSat KoalaSat commented Aug 15, 2024

What does this PR do?

Changes on this PR:

  1. Clear differentiation between CurrentOrder (visited order on the order page) and ActiveOrder/LastOrder (orders associated to the slot)
  2. Creation of the Order class. Any interaction with an order now happens through it.
  3. Creation of the Robot class. Any interaction with a robot now happens through it.
  4. Garage now is fully responsible of Orders and Robots.
  5. Fixes the iterative code to check and notify about an active order
  6. Federation and Garage Contexts now are fully decoupled and independent
  7. Several bugs related to orders fixed. Probably some new introduced :)
  8. A lot of simplification of code
  9. Remove all different ...UpdatedAt variables and keep only slotUpdatedAt and federationUpdatedAt

Checklist before merging

  • Install pre-commit and initialize it: pip install pre-commit, then pre-commit install. Pre-commit installs git hooks that automatically check the codebase. If pre-commit fails when you commit your changes, please fix the problems it points out.

@KoalaSat KoalaSat force-pushed the refactor-order-model branch 4 times, most recently from 70b9b9f to 9008e98 Compare August 15, 2024 18:15
@@ -102,9 +98,6 @@ const BookPage = (): JSX.Element => {
>
<Box sx={{ maxWidth: '18em', padding: '0.5em' }}>
<MakerForm
onOrderCreated={(id) => {
navigate(`/order/${id}`);
}}
Copy link
Member Author

Choose a reason for hiding this comment

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

Reported bug

onOrderCreated={(shortAlias, id) => {
setCurrentOrderId({ id, shortAlias });
navigate(`/order/${shortAlias}/${id}`);
}}
disableRequest={matches.length > 0 && !showMatches}
collapseAll={showMatches}
onSubmit={() => {
Copy link
Member Author

Choose a reason for hiding this comment

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

clean up

export type { Book, PublicOrder } from './Book.model';
export type { Slot } from './Garage.model';
export type { Language } from './Settings.model';
export type { Favorites } from './Favorites.model';
export type { Contact, Info, Version, Origin } from './Coordinator.model';
Copy link
Member Author

Choose a reason for hiding this comment

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

clean up

@@ -1,7 +1,5 @@
import React, { useState, useEffect, useContext } from 'react';
Copy link
Member Author

Choose a reason for hiding this comment

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

clean up

@@ -20,7 +20,6 @@ interface ChatPromptProps {
loadingReceived: boolean;
Copy link
Member Author

Choose a reason for hiding this comment

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

clean up

@@ -7,7 +7,6 @@ interface Props {
order: Order;
Copy link
Member Author

Choose a reason for hiding this comment

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

clean up

@@ -36,7 +36,6 @@ interface Props {
makerHashId: string;
Copy link
Member Author

Choose a reason for hiding this comment

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

clean up

@KoalaSat KoalaSat marked this pull request as ready for review August 21, 2024 09:25
@Reckless-Satoshi Reckless-Satoshi force-pushed the main branch 2 times, most recently from 9054b87 to f9244e1 Compare September 10, 2024 01:28
@KoalaSat KoalaSat force-pushed the refactor-order-model branch from afe699a to a92ca62 Compare September 10, 2024 10:57
@KoalaSat
Copy link
Member Author

Tested and working. And several minor bugs fixed!

@KoalaSat KoalaSat merged commit a390254 into main Sep 10, 2024
@KoalaSat KoalaSat deleted the refactor-order-model branch September 10, 2024 16:18
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