gdegas / supa-store

e-commerce style web app
1 stars 0 forks source link

Create project endpoint #43

Open gdegas opened 4 years ago

gdegas commented 4 years ago

TODO to replicate whats done

  1. add following to base.yaml
    dosa:
    namePrefix: kiosk.grouprides

/entity/product.go

package entity

import (
    "time"
    "github.com/gofrs/uuid"
)

type Product struct {
    UUID         uuid.UUID    `json:"uuid"`
    Name         string             `json:"name"`
    ImageURL     string             `json:"imageUrl"`
    CreatedAt    time.Time    `json:"createdAt"`
    UpdatedAt    time.Time    `json:"updatedAt"`
}

/entity/productdetail.go

package entity

import (
    "time"

    "github.com/gofrs/uuid"
)

type ProductDetail struct {
    UUID                                     uuid.UUID    `json:"uuid"`
    ProductUUID                      uuid.UUID      `json:"name"`
    CityID                                   int32              `json:"cityID"`
    UsdRateAdditionalHourLow   int32        `json:"UsdRateAdditionalHourLow"`
    UsdRateAdditionalHourHigh  int32        `json:"UsdRateAdditionalHourHigh"`
    UsdRateBaseLow                       int32        `json:"UsdRateBaseLow"`
    Enabled                                      bool         `json:"enabled"`

    CreatedAt                                time.Time    `json:"createdAt"`
    UpdatedAt                                time.Time    `json:"updatedAt"`
}
dep ensure -add github.com/uber-go/dosa
dep ensure -add github.com/gofrs/uuid

The rest of models are in scaffold 1-23 under /models

gdegas commented 4 years ago

Suggested ways to mitigate wrong scaffold

Delete repo way:

  1. delete phab repository.
  2. delete local project
  3. rescaffold under same name
  4. push code

Port over all scaffoled folders under repo:

  1. scaffold new service
  2. change all naming schemes in the scaffold to group-rides-api
  3. Delete all folders in the current repo
  4. copy all folder from new scaffold repo into previous repo
  5. push code