nvnamsss / streetlity-api

api server
0 stars 0 forks source link

Enhancement Adding Service #14

Closed nvnamsss closed 4 years ago

nvnamsss commented 4 years ago

adding service just working and still missing some features for ensuring they are working well

nvnamsss commented 4 years ago

following the solution, gorm return a clone DB when doing transaction, in DB has field Error determine the error happened thus we can use it to know if the transaction is failure

    if dbc := Db.Create(&s); dbc.Error != nil {
        return dbc.Error
    }

    return nil
nvnamsss commented 4 years ago

Adding service now will not add service directly, the additional service must be approved by the users first.

Thus we need to change the work of add service request, the approval request must be added for user to approve the service

nvnamsss commented 4 years ago

The services now contain a sub-table called unconfirmed service which is described by the prefix Ucf. unconfirmed service has a confident value for determining if unconfirmed service could become service.

confident of unconfirmed service increase via request upvote in each service. When confident reach the capability, unconfirmed service will become service