refac: move domain to <module>
This commit is contained in:
parent
7e723cd0d4
commit
18eda9bb5d
19 changed files with 15 additions and 31 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
1
src/app/contacts/domain/index.ts
Normal file
1
src/app/contacts/domain/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
export type { Contact } from "./contact";
|
|
@ -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[]);
|
||||
|
|
|
@ -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>;
|
||||
|
|
1
src/app/files/domain/index.ts
Normal file
1
src/app/files/domain/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
export type { AppFile } from "./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[]);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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>;
|
||||
|
|
|
@ -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>;
|
||||
|
|
1
src/app/lists/domain/index.ts
Normal file
1
src/app/lists/domain/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
export type { List } from "./list";
|
|
@ -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[]);
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue