---
# System prepended metadata

title: Replace Bulk Order Get Location with gss

---

# Replace Bulk Order Get Location with gss

## Validate Excel 

### Current Flow

```plantuml
participant "frontend" as fe
participant "everpro-logistic-client" as elc
participant "everpro-user" as eu
database "popaket_logistic" as db

fe -> elc : send the data from excel file
activate elc
elc -> eu : get user data
activate eu
eu -> elc : return user data
deactivate eu
elc -> db : validate unique reference id
loop the orders
    group #LightBlue  we will replace this to using evm-gss
        elc -> db : get the origin location by postal code and subdistrict name
        db --> elc
        elc -> db : get the destination location by postal code and subdistrict name
        db --> elc
    end
    elc -> elc :
    note right
        the existing flow
    endnote
end
elc -> fe : return the valid and invalid data
deactivate elc
```

### New Flow

```plantuml
participant "frontend" as fe
participant "everpro-logistic-client" as elc
participant "everpro-user" as eu
database "popaket_logistic" as db
participant "evm-gss" as gss

fe -> elc : send the data from excel file
activate elc
elc -> eu : get user data
activate eu
eu -> elc : return user data
deactivate eu
elc -> db : validate unique reference id
loop the orders
    group #LightBlue get location using evm-gss to improve the speed and typo handling
        elc -> gss : get the origin location by city name and district name
        gss --> elc
        elc -> gss : get the destination location by city name and district name
        gss --> elc
    end
    elc -> elc :
    note right
        the existing flow
    endnote
end
elc -> fe : return the valid and invalid data
deactivate elc
```

## Create Bulk Order

### Current Flow

```plantuml
participant "frontend" as fe
participant "everpro-logistic-client" as elc
participant "everpro-user" as eu
database "popaket_logistic" as db

fe -> elc : send the request data from excel file
activate elc
elc -> elc : (existing flow)
note right
the existing flow, including : 
get user data, 
validating is user eligible, 
get popcash balance, 
get internal logistic services, 
get some settings, 
etc ...
endnote
loop the orders
    group #LightBlue  we will replace this to using evm-gss
        elc -> db : get the origin location by postal code and subdistrict name
        db --> elc
        elc -> db : get the destination location by postal code and subdistrict name
        db --> elc
    end
end
elc -> elc : (existing flow)
note right
creating orders, etc...
endnote
elc -> fe : give a response which valid and invalid data
deactivate elc
```

### New Flow

```plantuml
participant "frontend" as fe
participant "everpro-logistic-client" as elc
participant "everpro-user" as eu
database "popaket_logistic" as db

fe -> elc : send the request data from excel file
activate elc
elc -> elc : (existing flow)
note right
the existing flow, including : 
get user data, 
validating is user eligible, 
get popcash balance, 
get internal logistic services, 
get some settings, 
etc ...
endnote
elc -> db : save the template name
note right
because we will have 2 templates, 
we need an identifier which template is used to make the orders
endnote
loop the orders
    group #LightBlue get location using evm-gss to improve the speed and typo handling
        elc -> gss : get the origin location by city name and district name
        gss --> elc
        elc -> gss : get the destination location by city name and district name
        gss --> elc
    end
end
elc -> elc : (existing flow)
note right
creating orders, etc...
endnote
elc -> fe : give a response which valid and invalid data
deactivate elc
```