feat(agent-assignment): 에이전트 크리에이터 소속 관리 기능을 추가한다
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package kr.co.vividnext.sodalive.partner.agent.assignment
|
||||
|
||||
import kr.co.vividnext.sodalive.common.BaseEntity
|
||||
import kr.co.vividnext.sodalive.member.Member
|
||||
import java.time.LocalDateTime
|
||||
import javax.persistence.Column
|
||||
import javax.persistence.Entity
|
||||
import javax.persistence.FetchType
|
||||
import javax.persistence.JoinColumn
|
||||
import javax.persistence.ManyToOne
|
||||
|
||||
@Entity
|
||||
class AgentCreatorRelation : BaseEntity() {
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "agent_id", nullable = false)
|
||||
var agent: Member? = null
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "creator_id", nullable = false)
|
||||
var creator: Member? = null
|
||||
|
||||
@Column(nullable = false)
|
||||
var assignedAt: LocalDateTime? = null
|
||||
|
||||
@Column(nullable = true)
|
||||
var unassignedAt: LocalDateTime? = null
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package kr.co.vividnext.sodalive.partner.agent.assignment
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository
|
||||
|
||||
interface AgentCreatorRelationRepository : JpaRepository<AgentCreatorRelation, Long> {
|
||||
fun findAllByCreatorIdOrderByAssignedAtAsc(creatorId: Long): List<AgentCreatorRelation>
|
||||
|
||||
fun findFirstByCreatorIdAndUnassignedAtIsNull(creatorId: Long): AgentCreatorRelation?
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package kr.co.vividnext.sodalive.partner.agent.assignment
|
||||
|
||||
import java.time.LocalDateTime
|
||||
|
||||
data class AssignAgentCreatorRequest(
|
||||
val agentId: Long,
|
||||
val creatorId: Long,
|
||||
val assignedAt: LocalDateTime
|
||||
)
|
||||
@@ -0,0 +1,8 @@
|
||||
package kr.co.vividnext.sodalive.partner.agent.assignment
|
||||
|
||||
import java.time.LocalDateTime
|
||||
|
||||
data class RemoveAgentCreatorRequest(
|
||||
val creatorId: Long,
|
||||
val unassignedAt: LocalDateTime
|
||||
)
|
||||
Reference in New Issue
Block a user