Skip to content

Commit

Permalink
재고 ãrefactor: 재고 도메인 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
shinheekim committed Apr 9, 2024
1 parent 90119fc commit bcdaba2
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 2 deletions.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
import lombok.NoArgsConstructor;
import net.skhu.tastyinventory_be.domain.inventoryVolume.InventoryVolume;
import net.skhu.tastyinventory_be.domain.recipe.Recipe;
import org.springframework.data.annotation.TypeAlias;

import java.util.HashSet;
import java.util.Set;

@Getter
@NoArgsConstructor
@Table(name = "Inventory")
@Entity
public class Inventory {
@Id
Expand All @@ -24,6 +26,8 @@ public class Inventory {
@Column(length = 45)
private String unit;

private String imageUrl;

@OneToMany(mappedBy = "inventory")
private Set<Recipe> recipes = new HashSet<>();

Expand All @@ -32,9 +36,10 @@ public class Inventory {


@Builder
public Inventory(String name, String unit, Set<InventoryVolume> inventoryVolumes) {
public Inventory(String name, String unit, String imageUrl, Set<InventoryVolume> inventoryVolumes) {
this.name = name;
this.unit = unit;
this.imageUrl = imageUrl;
this.inventoryVolumes = inventoryVolumes != null ? inventoryVolumes : new HashSet<>();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import org.springframework.data.jpa.repository.JpaRepository;

public interface InventoryRepository extends JpaRepository<Inventory, Long> {

//각 엔티티에 대한 crud 작업을 수행할 수 있는 인터페이스 정의
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

@Getter
@NoArgsConstructor
@Table(name = "Menu")
@Entity
public class Menu {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package net.skhu.tastyinventory_be.dto;

public class InventoryDto {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package net.skhu.tastyinventory_be.service.Inventory;

// 엔티티를 처리하는 비즈니스 로직, ex 재고 업데이트, 평균 사용량 계산 등
public class InventoryService {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package net.skhu.tastyinventory_be.service.Menu;

public class MenuService {
}

0 comments on commit bcdaba2

Please sign in to comment.