Skip to content

Commit

Permalink
Type => Model
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikzogg committed Mar 29, 2020
1 parent 03ce3c7 commit 5d5c601
Show file tree
Hide file tree
Showing 39 changed files with 76 additions and 76 deletions.
18 changes: 9 additions & 9 deletions src/ApiClient/Pet.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import BadRequest from '../Type/Error/BadRequest';
import HttpError from '../Type/Error/HttpError';
import InternalServerError from '../Type/Error/InternalServerError';
import NetworkError from '../Type/Error/NetworkError';
import NotFound from '../Type/Error/NotFound';
import PetResponse from '../Type/Pet/PetResponse';
import PetList from '../Type/Pet/PetList';
import UnprocessableEntity from '../Type/Error/UnprocessableEntity';
import PetRequest from '../Type/Pet/PetRequest';
import BadRequest from '../Model/Error/BadRequest';
import HttpError from '../Model/Error/HttpError';
import InternalServerError from '../Model/Error/InternalServerError';
import NetworkError from '../Model/Error/NetworkError';
import NotFound from '../Model/Error/NotFound';
import PetResponse from '../Model/Pet/PetResponse';
import PetList from '../Model/Pet/PetList';
import UnprocessableEntity from '../Model/Error/UnprocessableEntity';
import PetRequest from '../Model/Pet/PetRequest';

const url: string = `${process.env.REACT_APP_PETSTORE_URL}/api/pets`;

Expand Down
4 changes: 2 additions & 2 deletions src/Component/Form/PetFilterForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from 'react';
import { Form, Button } from 'semantic-ui-react';
import { useForm } from 'react-hook-form';
import InvalidParameterByNameDenormalizer from '../../Denormalizer/InvalidParameterByNameDenormalizer';
import PetFilterFormProps from '../../Type/Form/PetFilterFormProps';
import PetFilters from '../../Type/Pet/PetFilters';
import PetFilterFormProps from './PetFilterFormProps';
import PetFilters from '../../Model/Pet/PetFilters';
import TextField from './TextField';

const PetFilterForm: React.FC<PetFilterFormProps> = ({ submitPetFilter, filters, error }: PetFilterFormProps) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BadRequest from "../Error/BadRequest";
import PetFilters from "../Pet/PetFilters";
import BadRequest from "../../Model/Error/BadRequest";
import PetFilters from "../../Model/Pet/PetFilters";

type PetFilterFormProps = {
submitPetFilter: { (filters: PetFilters): void; },
Expand Down
4 changes: 2 additions & 2 deletions src/Component/Form/PetForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from 'react';
import { Button, Form } from 'semantic-ui-react';
import { useForm, useFieldArray } from 'react-hook-form';
import InvalidParameterByNameDenormalizer from '../../Denormalizer/InvalidParameterByNameDenormalizer';
import PetFormProps from '../../Type/Form/PetFormProps';
import PetRequest from '../../Type/Pet/PetRequest';
import PetFormProps from './PetFormProps';
import PetRequest from '../../Model/Pet/PetRequest';
import TextField from './TextField';

const PetForm: React.FC<PetFormProps> = ({ submitPet, pet, error }: PetFormProps) => {
Expand Down
11 changes: 11 additions & 0 deletions src/Component/Form/PetFormProps.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import PetRequest from "../../Model/Pet/PetRequest";
import PetResponse from "../../Model/Pet/PetResponse";
import UnprocessableEntity from "../../Model/Error/UnprocessableEntity";

type PetFormProps = {
submitPet: { (pet: PetRequest): void; },
pet?: PetResponse,
error?: UnprocessableEntity
};

export default PetFormProps;
2 changes: 1 addition & 1 deletion src/Component/Form/TextField.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { Form } from 'semantic-ui-react';
import InvalidParameter from '../../Type/Error/InvalidParameter';
import InvalidParameter from '../../Model/Error/InvalidParameter';

type Props = {
register: any,
Expand Down
6 changes: 3 additions & 3 deletions src/Component/Page/Pet/Create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import React, { useState } from 'react';
import { Button } from 'semantic-ui-react';
import { CreatePet } from '../../../ApiClient/Pet';
import { Link, useHistory } from 'react-router-dom';
import HttpError from '../../../Type/Error/HttpError';
import HttpError from '../../../Model/Error/HttpError';
import HttpErrorPartial from '../../Partial/HttpError';
import PetForm from '../../Form/PetForm';
import UnprocessableEntity from '../../../Type/Error/UnprocessableEntity';
import PetRequest from '../../../Type/Pet/PetRequest';
import UnprocessableEntity from '../../../Model/Error/UnprocessableEntity';
import PetRequest from '../../../Model/Pet/PetRequest';

const Create: React.FC = () => {

Expand Down
8 changes: 4 additions & 4 deletions src/Component/Page/Pet/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { de } from 'date-fns/locale';
import { format } from 'date-fns';
import { Link, useHistory, useLocation } from 'react-router-dom';
import { ListPets, DeletePet } from '../../../ApiClient/Pet';
import BadRequest from '../../../Type/Error/BadRequest';
import HttpError from '../../../Type/Error/HttpError';
import BadRequest from '../../../Model/Error/BadRequest';
import HttpError from '../../../Model/Error/HttpError';
import HttpErrorPartial from '../../Partial/HttpError';
import PetResponse from '../../../Type/Pet/PetResponse';
import PetList from '../../../Type/Pet/PetList';
import PetResponse from '../../../Model/Pet/PetResponse';
import PetList from '../../../Model/Pet/PetList';
import qs from 'qs';
import PetFilterForm from '../../Form/PetFilterForm';

Expand Down
4 changes: 2 additions & 2 deletions src/Component/Page/Pet/Read.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { de } from 'date-fns/locale';
import { format } from 'date-fns';
import { Link, RouteComponentProps } from 'react-router-dom';
import { ReadPet } from '../../../ApiClient/Pet';
import HttpError from '../../../Type/Error/HttpError';
import HttpError from '../../../Model/Error/HttpError';
import HttpErrorPartial from '../../Partial/HttpError';
import PetResponse from '../../../Type/Pet/PetResponse';
import PetResponse from '../../../Model/Pet/PetResponse';

type Props = RouteComponentProps<{ id: string; }>;

Expand Down
8 changes: 4 additions & 4 deletions src/Component/Page/Pet/Update.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import React, { useState, useEffect } from 'react';
import { Button } from 'semantic-ui-react';
import { Link, RouteComponentProps, useHistory } from 'react-router-dom';
import { ReadPet, UpdatePet } from '../../../ApiClient/Pet';
import HttpError from '../../../Type/Error/HttpError';
import HttpError from '../../../Model/Error/HttpError';
import HttpErrorPartial from '../../Partial/HttpError';
import PetResponse from '../../../Type/Pet/PetResponse';
import PetResponse from '../../../Model/Pet/PetResponse';
import PetForm from '../../Form/PetForm';
import UnprocessableEntity from '../../../Type/Error/UnprocessableEntity';
import PetRequest from '../../../Type/Pet/PetRequest';
import UnprocessableEntity from '../../../Model/Error/UnprocessableEntity';
import PetRequest from '../../../Model/Pet/PetRequest';

type Props = RouteComponentProps<{ id: string; }>;

Expand Down
6 changes: 3 additions & 3 deletions src/Component/Partial/HttpError.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import { Message } from 'semantic-ui-react';
import HttpErrorType from '../../Type/Error/HttpError';
import HttpErrorWithInvalidArguments from '../../Type/Error/HttpErrorWithInvalidArguments';
import InvalidParameter from '../../Type/Error/InvalidParameter';
import HttpErrorType from '../../Model/Error/HttpError';
import HttpErrorWithInvalidArguments from '../../Model/Error/HttpErrorWithInvalidArguments';
import InvalidParameter from '../../Model/Error/InvalidParameter';

type Props = {
httpError: HttpErrorType
Expand Down
2 changes: 1 addition & 1 deletion src/Denormalizer/InvalidParameterByNameDenormalizer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import InvalidParameter from '../Type/Error/InvalidParameter';
import InvalidParameter from '../Model/Error/InvalidParameter';

type errorsByFieldsType = { [id: string]: Array<InvalidParameter>; };

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 0 additions & 11 deletions src/Type/Form/PetFormProps.ts

This file was deleted.

12 changes: 6 additions & 6 deletions src/__tests__/ApiClient/Pet.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ListPets, CreatePet, ReadPet, UpdatePet, DeletePet } from '../../ApiClient/Pet';
import BadRequest from '../../Type/Error/BadRequest';
import BadRequest from '../../Model/Error/BadRequest';
import fetchMock from 'fetch-mock';
import InternalServerError from '../../Type/Error/InternalServerError';
import NotFound from '../../Type/Error/NotFound';
import UnprocessableEntity from '../../Type/Error/UnprocessableEntity';
import NetworkError from '../../Type/Error/NetworkError';
import PetRequest from '../../Type/Pet/PetRequest';
import InternalServerError from '../../Model/Error/InternalServerError';
import NotFound from '../../Model/Error/NotFound';
import UnprocessableEntity from '../../Model/Error/UnprocessableEntity';
import NetworkError from '../../Model/Error/NetworkError';
import PetRequest from '../../Model/Pet/PetRequest';

beforeEach(() => {
fetchMock.restore();
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/Component/Form/PetFilterForm.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { fireEvent, render } from '@testing-library/react';
import BadRequest from '../../../Type/Error/BadRequest';
import InvalidParameter from '../../../Type/Error/InvalidParameter';
import BadRequest from '../../../Model/Error/BadRequest';
import InvalidParameter from '../../../Model/Error/InvalidParameter';
import PetFilterForm from '../../../Component/Form/PetFilterForm';

test('without error', () => {
Expand Down
8 changes: 4 additions & 4 deletions src/__tests__/Component/Form/PetForm.test.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import { fireEvent, render } from '@testing-library/react';
import InvalidParameter from '../../../Type/Error/InvalidParameter';
import InvalidParameter from '../../../Model/Error/InvalidParameter';
import PetForm from '../../../Component/Form/PetForm';
import PetRequest from '../../../Type/Pet/PetResponse';
import PetResponse from '../../../Type/Pet/PetResponse';
import UnprocessableEntity from '../../../Type/Error/UnprocessableEntity';
import PetRequest from '../../../Model/Pet/PetResponse';
import PetResponse from '../../../Model/Pet/PetResponse';
import UnprocessableEntity from '../../../Model/Error/UnprocessableEntity';

test('without error', () => {
const submitPet: { (pet: PetRequest): any; } = (pet: PetRequest) => { };
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/Component/Form/TextField.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { render } from '@testing-library/react';
import TextField from '../../../Component/Form/TextField';
import InvalidParameter from '../../../Type/Error/InvalidParameter';
import InvalidParameter from '../../../Model/Error/InvalidParameter';

test('default', () => {
const register = () => {};
Expand Down
8 changes: 4 additions & 4 deletions src/__tests__/Component/Page/Pet/Create.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { fireEvent, render } from '@testing-library/react';
import { Router } from 'react-router-dom';
import * as ApiClientPet from '../../../../ApiClient/Pet';
import Create from '../../../../Component/Page/Pet/Create';
import HttpError from '../../../../Type/Error/HttpError';
import PetFormProps from '../../../../Type/Form/PetFormProps';
import PetResponse from '../../../../Type/Pet/PetResponse';
import UnprocessableEntity from '../../../../Type/Error/UnprocessableEntity';
import HttpError from '../../../../Model/Error/HttpError';
import PetFormProps from '../../../../Component/Form/PetFormProps';
import PetResponse from '../../../../Model/Pet/PetResponse';
import UnprocessableEntity from '../../../../Model/Error/UnprocessableEntity';

jest.mock('../../../../ApiClient/Pet');

Expand Down
10 changes: 5 additions & 5 deletions src/__tests__/Component/Page/Pet/List.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { createMemoryHistory } from 'history';
import { render, fireEvent } from '@testing-library/react';
import { Router } from 'react-router-dom';
import * as ApiClientPet from '../../../../ApiClient/Pet';
import BadRequest from '../../../../Type/Error/BadRequest';
import HttpError from '../../../../Type/Error/HttpError';
import BadRequest from '../../../../Model/Error/BadRequest';
import HttpError from '../../../../Model/Error/HttpError';
import List from '../../../../Component/Page/Pet/List';
import NotFound from '../../../../Type/Error/NotFound';
import PetFilterFormProps from '../../../../Type/Form/PetFilterFormProps';
import PetList from '../../../../Type/Pet/PetList';
import NotFound from '../../../../Model/Error/NotFound';
import PetFilterFormProps from '../../../../Component/Form/PetFilterFormProps';
import PetList from '../../../../Model/Pet/PetList';

jest.mock('../../../../ApiClient/Pet');

Expand Down
6 changes: 3 additions & 3 deletions src/__tests__/Component/Page/Pet/Read.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { createMemoryHistory } from 'history';
import { render } from '@testing-library/react';
import { Router } from 'react-router-dom';
import * as ApiClientPet from '../../../../ApiClient/Pet';
import HttpError from '../../../../Type/Error/HttpError';
import NotFound from '../../../../Type/Error/NotFound';
import PetResponse from '../../../../Type/Pet/PetResponse';
import HttpError from '../../../../Model/Error/HttpError';
import NotFound from '../../../../Model/Error/NotFound';
import PetResponse from '../../../../Model/Pet/PetResponse';
import Read from '../../../../Component/Page/Pet/Read';

jest.mock('../../../../ApiClient/Pet');
Expand Down
10 changes: 5 additions & 5 deletions src/__tests__/Component/Page/Pet/Update.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { createMemoryHistory } from 'history';
import { render, fireEvent } from '@testing-library/react';
import { Router } from 'react-router-dom';
import * as ApiClientPet from '../../../../ApiClient/Pet';
import HttpError from '../../../../Type/Error/HttpError';
import NotFound from '../../../../Type/Error/NotFound';
import PetFormProps from '../../../../Type/Form/PetFormProps';
import PetResponse from '../../../../Type/Pet/PetResponse';
import UnprocessableEntity from '../../../../Type/Error/UnprocessableEntity';
import HttpError from '../../../../Model/Error/HttpError';
import NotFound from '../../../../Model/Error/NotFound';
import PetFormProps from '../../../../Component/Form/PetFormProps';
import PetResponse from '../../../../Model/Pet/PetResponse';
import UnprocessableEntity from '../../../../Model/Error/UnprocessableEntity';
import Update from '../../../../Component/Page/Pet/Update';

jest.mock('../../../../ApiClient/Pet');
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/Component/Partial/HttpError.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { render } from '@testing-library/react';
import HttpErrorWithInvalidArguments from '../../../Type/Error/HttpErrorWithInvalidArguments';
import HttpErrorWithInvalidArguments from '../../../Model/Error/HttpErrorWithInvalidArguments';
import HttpError from '../../../Component/Partial/HttpError';

test('minimal', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import InvalidParameterByNameDenormalizer from '../../Denormalizer/InvalidParameterByNameDenormalizer';
import InvalidParameter from '../../Type/Error/InvalidParameter';
import InvalidParameter from '../../Model/Error/InvalidParameter';

test('default', () => {
const invalidParameters: Array<InvalidParameter> = [
Expand Down

0 comments on commit 5d5c601

Please sign in to comment.