def get(self): parser = reqparse.RequestParser() parser.add_argument('query', type=str, required=True) args = parser.parse_args() query: str = args.get("query") if query: contacts = ContactService.get_contacts_from_query( query=query, uow=current_app.context) else: contacts = ContactService.list_contacts(current_app.context) return { "data": contacts, "message": "success", }, 200
def get(self, uuid: str): return { "data": ContactService.get_by_uuid(uuid, current_app.context), "message": "success" }, 200
def get(self): return { "data": ContactService.list_contacts(current_app.context), "message": "success", }, 200
def create_contact(command: CreateUser, uow: AbstractUnitOfWork): return ContactService.add_contact(data=command.data, uow=uow)
def create_contact_from_user(event: events.UserCreatedEvent, uow: AbstractUnitOfWork): user: UserEntity = event.data ContactService.add_contact_from_user(user=user, uow=uow)