refac: move domain to <module>

This commit is contained in:
Dmitriy Pleshevskiy 2023-01-31 18:43:10 +03:00
parent 7e723cd0d4
commit 18eda9bb5d
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215
19 changed files with 15 additions and 31 deletions

View file

@ -1,5 +1,5 @@
import type { Contact } from "@/domain/entities/contact";
import type { BaseCreateApiPort } from "@/shared/lib/ports";
import type { Contact } from "../domain";
export interface ContactFormApiCreateProps {
email: string;

View file

@ -1,6 +1,6 @@
import type { Contact } from "@/domain/entities/contact";
import type { EntityId } from "@/shared/lib/entity";
import type { BaseFetchManyApiPort } from "@/shared/lib/ports";
import type { Contact } from "../domain";
export interface ContactsTableApiFetchManyProps {
listId?: EntityId;

View file

@ -0,0 +1 @@
export type { Contact } from "./contact";

View file

@ -1,6 +1,6 @@
import type { Contact } from "@/domain/entities/contact";
import { defineStore } from "pinia";
import { ref } from "vue";
import type { Contact } from "./domain";
export const useContactsStore = defineStore("contacts", () => {
const data = ref([] as Contact[]);

View file

@ -1,4 +1,4 @@
import type { AppFile } from "@/domain/entities/file";
import type { BaseFetchManyApiPort } from "@/shared/lib/ports";
import type { AppFile } from "../domain";
export type FilesTableApiPort = BaseFetchManyApiPort<AppFile>;

View file

@ -0,0 +1 @@
export type { AppFile } from "./file";

View file

@ -1,6 +1,6 @@
import type { AppFile } from "@/domain/entities/file";
import { defineStore } from "pinia";
import { ref } from "vue";
import type { AppFile } from "./domain";
export const useFilesStore = defineStore("files", () => {
const data = ref([] as AppFile[]);

View file

@ -1,5 +1,5 @@
import type { List } from "@/domain/entities/list";
import type { BaseCreateApiPort } from "@/shared/lib/ports";
import type { List } from "../domain";
export interface ListFormApiCreateProps {
displayName: string;

View file

@ -1,4 +1,4 @@
import type { List } from "@/domain/entities/list";
import type { BaseFetchManyApiPort } from "@/shared/lib/ports";
import type { List } from "../domain";
export type ListsSelectApiPort = BaseFetchManyApiPort<List>;

View file

@ -1,4 +1,4 @@
import type { List } from "@/domain/entities/list";
import type { BaseFetchManyApiPort } from "@/shared/lib/ports";
import type { List } from "../domain";
export type ListsTableApiPort = BaseFetchManyApiPort<List>;

View file

@ -0,0 +1 @@
export type { List } from "./list";

View file

@ -1,6 +1,6 @@
import type { List } from "@/domain/entities/list";
import { defineStore } from "pinia";
import { ref } from "vue";
import type { List } from "./domain";
export const useListsStore = defineStore("lists", () => {
const data = ref([] as List[]);

View file

@ -3,7 +3,7 @@ import type {
ContactFormApiCreateProps,
ContactsTableApiFetchManyProps,
} from "@/app/contacts";
import type { Contact } from "@/domain/entities/contact";
import type { Contact } from "@/app/contacts/domain";
import type { EntityId } from "@/shared/lib/entity";
import { delay } from "@/shared/lib/utils/promise";
import { faker } from "@faker-js/faker";

View file

@ -1,5 +1,5 @@
import type { FileApiPort } from "@/app/files";
import type { AppFile } from "@/domain/entities/file";
import type { AppFile } from "@/app/files/domain";
import { delay } from "@/shared/lib/utils/promise";
import { faker } from "@faker-js/faker";

View file

@ -1,5 +1,5 @@
import type { ListApiPort, ListFormApiCreateProps } from "@/app/lists";
import type { List } from "@/domain/entities/list";
import type { List } from "@/app/lists/domain";
import { delay } from "@/shared/lib/utils/promise";
import { faker } from "@faker-js/faker";

View file

@ -1,19 +0,0 @@
import { faker } from "@faker-js/faker";
export class MockTemplateApi implements TemplateApiPort {
#templates: Template[];
constructor() {
this.#templates = Array.from(new Array(20).keys()).map((_) => {
const id = faker.datatype.uuid();
const displayName = faker.lorem.words(3);
const createdAt = faker.date.birthdate();
return { id, displayName, createdAt };
});
}
async fetchMany(): Promise<Template[]> {
await delay(1000);
return this.#templates.concat();
}
}