Skip to content

Commit

Permalink
refactor: rename type file
Browse files Browse the repository at this point in the history
  • Loading branch information
solufa committed Jul 27, 2024
1 parent 50cf59e commit df7bd4f
Show file tree
Hide file tree
Showing 13 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion server/domain/task/model/taskMethod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { UserDto } from 'common/types/user';
import { labelValidator } from 'common/validators/task';
import { brandedId } from 'service/brandedId';
import { ulid } from 'ulid';
import type { TaskCreateServerVal, TaskDeleteVal, TaskEntity, TaskSaveVal } from './taskEntity';
import type { TaskCreateServerVal, TaskDeleteVal, TaskEntity, TaskSaveVal } from './taskType';

export const taskMethod = {
create: (user: UserDto, val: TaskCreateServerVal): TaskSaveVal => {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion server/domain/task/repository/taskCommand.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Prisma } from '@prisma/client';
import assert from 'assert';
import { s3 } from 'service/s3Client';
import type { TaskDeleteVal, TaskSaveVal } from '../model/taskEntity';
import type { TaskDeleteVal, TaskSaveVal } from '../model/taskType';

export const taskCommand = {
save: async (tx: Prisma.TransactionClient, val: TaskSaveVal): Promise<void> => {
Expand Down
2 changes: 1 addition & 1 deletion server/domain/task/repository/taskQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Prisma, Task, User } from '@prisma/client';
import type { DtoId, MaybeId } from 'common/types/brandedId';
import { brandedId } from 'service/brandedId';
import { depend } from 'velona';
import type { TaskEntity } from '../model/taskEntity';
import type { TaskEntity } from '../model/taskType';

const toEntity = (prismaTask: Task & { Author: User }): TaskEntity => ({
id: brandedId.task.entity.parse(prismaTask.id),
Expand Down
2 changes: 1 addition & 1 deletion server/domain/task/service/taskValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { multipartFileValidator } from 'api/$relay';
import type { TaskUpdateDoneDto } from 'common/types/task';
import { brandedId } from 'service/brandedId';
import { z } from 'zod';
import type { TaskCreateServerVal } from '../model/taskEntity';
import type { TaskCreateServerVal } from '../model/taskType';

export const taskValidator = {
taskCreate: z.object({
Expand Down
2 changes: 1 addition & 1 deletion server/domain/task/service/toTaskDto.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { TaskDto } from 'common/types/task';
import { brandedId } from 'service/brandedId';
import { s3 } from 'service/s3Client';
import type { TaskEntity } from '../model/taskEntity';
import type { TaskEntity } from '../model/taskType';

export const toTaskDto = async (task: TaskEntity): Promise<TaskDto> => ({
...task,
Expand Down
2 changes: 1 addition & 1 deletion server/domain/task/useCase/taskUseCase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import type { TaskDto, TaskUpdateDoneDto } from 'common/types/task';
import type { UserDto } from 'common/types/user';
import { transaction } from 'service/prismaClient';
import { taskEvent } from '../event/taskEvent';
import type { TaskCreateServerVal } from '../model/taskEntity';
import { taskMethod } from '../model/taskMethod';
import type { TaskCreateServerVal } from '../model/taskType';
import { taskCommand } from '../repository/taskCommand';
import { taskQuery } from '../repository/taskQuery';
import { toTaskDto } from '../service/toTaskDto';
Expand Down
2 changes: 1 addition & 1 deletion server/domain/user/model/userMethod.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { brandedId } from 'service/brandedId';
import type { JwtUser } from 'service/types';
import type { UserEntity } from './userEntity';
import type { UserEntity } from './userType';

export const userMethod = {
create: (jwtUser: JwtUser): UserEntity => ({
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion server/domain/user/repository/userCommand.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Prisma } from '@prisma/client';
import type { UserEntity } from '../model/userEntity';
import type { UserEntity } from '../model/userType';

export const userCommand = {
save: async (tx: Prisma.TransactionClient, user: UserEntity): Promise<void> => {
Expand Down
2 changes: 1 addition & 1 deletion server/domain/user/repository/userQuery.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Prisma, User } from '@prisma/client';
import { brandedId } from 'service/brandedId';
import type { UserEntity } from '../model/userEntity';
import type { UserEntity } from '../model/userType';

const toUserEntity = (prismaUser: User): UserEntity => ({
id: brandedId.user.entity.parse(prismaUser.id),
Expand Down
2 changes: 1 addition & 1 deletion server/domain/user/service/toUserDto.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { UserDto } from 'common/types/user';
import { brandedId } from 'service/brandedId';
import type { UserEntity } from '../model/userEntity';
import type { UserEntity } from '../model/userType';

export const toUserDto = (user: UserEntity): UserDto => ({
...user,
Expand Down
2 changes: 1 addition & 1 deletion server/tests/api/private/di.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Prisma } from '@prisma/client';
import controller from 'api/private/tasks/di/controller';
import type { DtoId } from 'common/types/brandedId';
import type { UserDto } from 'common/types/user';
import type { TaskEntity } from 'domain/task/model/taskEntity';
import type { TaskEntity } from 'domain/task/model/taskType';
import fastify from 'fastify';
import { brandedId } from 'service/brandedId';
import { ulid } from 'ulid';
Expand Down

0 comments on commit df7bd4f

Please sign in to comment.