---
# System prepended metadata

title: Untitled

---

### evm-brand

#### Create Announcement
```plantuml
skinparam responseMessageBelowArrow true

title Create Announcement - Proposed Interaction Diagram

participant "client" as c
participant "evm-brand" as eb
database "brand" as e

c -> eb : create \nannouncement
activate eb
eb -> e : create \nannouncement \n(insert to brand_announcement)
e -> eb : announcement id, recipient_id
eb -> e :insert to brand_announcement_recipients
e -> eb : announcement data
return announcement
```

```plantuml
title Create Announcement - Proposed Activities Diagram

start

:Check user
authorization;

if () then (authorized)
    :Create Announcement;
    stop
else (unauthorized)
    end
endif
```


#### Delete Announcement
```plantuml
skinparam responseMessageBelowArrow true

title Delete Announcement - Proposed Interaction Diagram

participant "client" as c
participant "evm-brand" as eb
database "brand" as e

c -> eb : delete \nannouncement
activate eb
eb -> e : get \nannouncement
eb -> eb : validate announcement data

alt if announcement data invalid
    eb -> c : error announcement data invalid
end

eb -> e !! : delete
return success message
```

```plantuml
title Delete Announcement - Proposed Activities Diagram

start

:Check user
authorization;

if () then (authorized)
    :Get Announcement by Id;
    
    if (Id Exist?) then (Delete announcement)
        :Announcement id;
        stop
    else ()
        end
    endif

else (unauthorized)
    end
endif
```


#### Edit Announcement
```plantuml
skinparam responseMessageBelowArrow true

title Edit Announcement - Proposed Interaction Diagram

participant "client" as c
participant "evm-brand" as eb
database "brand" as e

c -> eb : edit \nannouncement
activate eb
eb -> e : get \nannouncement
eb -> eb : validate announcement data active / deactive

alt if announcement data invalid or active
    eb -> c : error announcement data invalid
end
eb -> eb : validate announcement data exist or not
alt if announcement data not exist
    eb -> c : error announcement data invalid
end
eb -> e : update \nannouncement
e -> eb : announcement data

return announcement
```

```plantuml
title Edit Announcement - Proposed Activities Diagram

start

:Check user
authorization;

if () then (authorized)
    :Get Announcement by Id;
    if (Id Exist?) then (Check active or not)
        if (active?) then (Edit announcement)
            :Announcement;
            stop
        else ()
            end
        endif
    else ()
        end
    endif
else (unauthorized)
    end
endif
```


#### Deactivate / activate Announcement
```plantuml
skinparam responseMessageBelowArrow true

title Deactivate / activate Announcement - Proposed Interaction Diagram

participant "client" as c
participant "evm-brand" as eb
database "brand" as e

c -> eb : update \nannouncement
activate eb
eb -> e : get \nannouncement
eb -> eb : validate announcement data

alt if announcement data invalid
    eb -> c : error announcement data invalid
end
eb -> e : update active/deactive \nannouncement
e -> eb : announcement data
return announcement
```

```plantuml
title Deactivate / activate Announcement - Proposed Activities Diagram

start

:Check user
authorization;

if () then (authorized)
    :Get Announcement by Id;
    
    if (Id Exist?) then (Update active/deactive announcement)
        :Announcement;
        stop
    else ()
        end
    endif

else (unauthorized)
    end
endif
```



#### Get List Announcement
```plantuml
skinparam responseMessageBelowArrow true

title Get List Announcement - Proposed Interaction Diagram

participant "client" as c
participant "evm-brand" as eb
database "brand" as e

c -> eb : get list \nannouncement
activate eb
eb -> e : get list \nannouncement
eb -> eb : validate announcement data

alt if announcement data invalid
    eb -> c : error announcement data invalid
end

e -> eb : announcement data

return announcement
```
```plantuml
title Get List Announcement - Proposed Activities Diagram

start

:Check user
authorization;

if () then (authorized)
    :Get Announcement;
    if (Exist?) then (Get announcement)
        :Announcement;
        stop
    else ()
        end
    endif

else (unauthorized)
    end
endif
```

#### Get Detail Announcement
```plantuml
skinparam responseMessageBelowArrow true

title Get Detail Announcement - Proposed Interaction Diagram

participant "client" as c
participant "evm-brand" as eb
database "brand" as e

c -> eb : get detail \nannouncement
activate eb
eb -> e : get detail \nannouncement
eb -> eb : validate announcement data exist

alt if announcement data invalid or not exist
    eb -> c : error announcement data invalid
end

e -> eb : announcement data

return announcement
```
```plantuml
title Get Detail Announcement - Proposed Activities Diagram

start

:Check user
authorization;

if () then (authorized)
    :Get Detail Announcement;
    if (Id Exist?) then (Get announcement)
        :Announcement;
        stop
    else ()
        end
    endif

else (unauthorized)
    end
endif
```

#### Search Announcement
```plantuml
skinparam responseMessageBelowArrow true

title Search Announcement - Proposed Interaction Diagram

participant "client" as c
participant "evm-brand" as eb
database "brand" as e

c -> eb : search \nannouncement by name
activate eb
eb -> e : get list \nannouncement
e -> eb : announcement list

return announcement list
```
```plantuml
title Search Announcement - Proposed Activities Diagram

start

:Check user
authorization;

if () then (authorized)
    :Get Announcement List;
    stop
else (unauthorized)
    end
endif
```

#### Filter Announcement
```plantuml
skinparam responseMessageBelowArrow true

title Filter Announcement by Kategori - Proposed Interaction Diagram

participant "client" as c
participant "evm-brand" as eb
database "brand" as e

c -> eb : filter \nannouncement by kategori
activate eb
eb -> e : get list \nannouncement
e -> eb : announcement list

return announcement list
```
```plantuml
title Filter Announcement by Kategori - Proposed Activities Diagram

start

:Check user
authorization;

if () then (authorized)
    :Get Announcement List;
    stop
else (unauthorized)
    end
endif
```
```plantuml
skinparam responseMessageBelowArrow true

title Filter Announcement by Status - Proposed Interaction Diagram

participant "client" as c
participant "evm-brand" as eb
database "brand" as e

c -> eb : filter \nannouncement by Status
activate eb
eb -> e : get list \nannouncement
e -> eb : announcement list

return announcement list
```
```plantuml
title Filter Announcement by Status - Proposed Activities Diagram

start

:Check user
authorization;

if () then (authorized)
    :Get Announcement List;
    stop
else (unauthorized)
    end
endif
```
#### Create Announcement Reader
```plantuml
skinparam responseMessageBelowArrow true

title Create Announcement Reader - Proposed Interaction Diagram

participant "client" as c
participant "evm-brand" as eb
database "brand" as e

c -> eb : create \nannouncement reader
activate eb
eb -> e : create \nannouncement \n(insert to brand_announcement_reader)
e -> eb : announcement data
return announcement data
```

```plantuml
title Create Announcement Reader - Proposed Activities Diagram

start

:Check user
authorization;

if () then (authorized)
    :Create Announcement Reader;
    stop
else (unauthorized)
    end
endif
```