---
# System prepended metadata

title: entity

---

# entity
## problem definition:
apa responsibility entity, handler, dan usecase

Is entity the entirety of the process?


Is usecase the entirety of the process?
- why not?
    how to use usecase when we're not allowed to 
    
> e.g. platform chatbot engine
chatbot -> revolve around FSM
Finite state machine

state -> repo 
    > repodoesn't matter
usecase -> read input, match which state is it in, output next state
    -> do something to validate input
    -> validate state
    -> trigger action given entering specific state


## proposed solutions

### rama's proposed solution
- usecase pakai usecase -> gaboleh
- tapi itu dibutuhkan (?!)
- want to have 1to1 relationship between handler and usecase functions, but... (?)
    - backward compatibility
        - why? gaboleh destroy client
        - misal support api v1, v2
        - jadinya 1UC used by multiple handler
- use entity as logic

entity rumah
    validator -> 
    
    -> 
    ventilasi
        keluarmasukangin
        rumahTikus
    pintu
        gagang
        daun
    jendela
    
    attachment -> validator
    question -> validator
    validator 



req
    > entitas
        - !! empty struct doesn't belong here, isinya cuma liat entitas lain
            - getting passed param from other entity
        - question
        - pagination
        - sorting
        ^
        |
    - mutate
    - process
   
resp

framework disini -> ease structuring the pipeline

django 
    MVC
    M -> ?
    V -> ?
    C -> ?

reqs -=> generate sesuatu
respon -> doesn't matter

managing server
    -> server
        job nya handling request
            fetch data, apapun
        response doesn't have to be in http response, bisa jadi email, generate file, mutate sesuatu yang lain 
        
framework
    -> how to decide the shape of the framework
    -> kayanya masih bisa ini dibuat dari sisi req,resp
    -> kalau engga, berarti pengen abstract untuk workflow yang sangat general


#### pros:
- can use auto generated handler
#### cons:
- usecase jadi bloated

### azka's proposed solution
- usecase pake usecase gaboleh, karena basically 
- 1 handler calling multiple usecasefunction, each can be called multipletimes

## summary

bot gitlab -> MR isinya cuma markdown -> auto accept