Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

Commit

Permalink
Add sample application core structure for business
Browse files Browse the repository at this point in the history
  • Loading branch information
HamzaRabah committed Nov 27, 2023
1 parent a6de651 commit 3317982
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/entities/business.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from dataclasses import dataclass


@dataclass
class Business:
ar_name: str = None
en_name: str = None
10 changes: 10 additions & 0 deletions core/interfaces/repositories/business_repository.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from abc import ABC, abstractmethod
from typing import List

from core.entities.business import Business


class BusinessRepository(ABC):
@abstractmethod
def list(self) -> List[Business]:
raise NotImplementedError
14 changes: 14 additions & 0 deletions core/services/business_service.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from typing import List

from core.entities.business import Business
from core.interfaces.repositories.business_repository import BusinessRepository


class BusinessService:
business_repository: BusinessRepository

def __init__(self, business_repository: BusinessRepository):
self.business_repository = business_repository

def list(self) -> List[Business]:
return self.business_repository.list()
3 changes: 3 additions & 0 deletions tests/test_sample.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class TestSample:
def test_true(self):
assert 1 == 1

0 comments on commit 3317982

Please sign in to comment.