Skip to content

Commit

Permalink
reestruturando arquivos novamente #52
Browse files Browse the repository at this point in the history
  • Loading branch information
M3L4O committed Mar 24, 2023
1 parent fab0eaf commit ab60f1f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 79 deletions.
59 changes: 0 additions & 59 deletions src/framework/application/ComponentSugestor/sugestor.py

This file was deleted.

15 changes: 0 additions & 15 deletions src/framework/domain/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from typing import List

from .entity import Entity
from .exception import KnapsackBurst

__all__ = [
"Component",
Expand Down Expand Up @@ -221,20 +220,6 @@ class PSUComponent(Component):
modularity: EPSUModularity


@dataclass
class Knapsack(Entity):
components: list[Component]
max_price: Money
current_price: Money

def push(self, component: Component, price: Money):
if self.current_price + price > self.max_price:
raise KnapsackBurst()

# TODO checar restrições
self.components.append(component)


component_cls_idx = [
Component,
MotherboardComponent,
Expand Down
5 changes: 0 additions & 5 deletions src/framework/domain/exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ def __repr__(self):
return f"{self.__class__.__name__}: {self._message}"


@dataclass
class KnapsackBurst(DomainException):
_message: str = "A bolsa atingiu o limite de preço."


@dataclass
class CurrencyNotEqual(DomainException):
_message: str = "As moedas são diferentes"

0 comments on commit ab60f1f

Please sign in to comment.