github.com/s7techlab/cckit@v0.10.5/examples/insurance/dto.go (about)

     1  package insurance
     2  
     3  import (
     4  	"time"
     5  
     6  	"github.com/s7techlab/cckit/examples/insurance/app"
     7  )
     8  
     9  // ContractTypesDTO type used in in "Init" func (arg) in main.go and in "listContractTypes" (return) in "invoke_insurance.go"
    10  type ContractTypesDTO []ContractTypeDTO
    11  
    12  type ContractTypeDTO struct {
    13  	UUID string `json:"uuid"`
    14  	*app.ContractType
    15  }
    16  
    17  type ContractTypeActiveDTO struct {
    18  	UUID   string `json:"uuid"`
    19  	Active bool   `json:"active"`
    20  }
    21  
    22  type ShopTypeDTO struct {
    23  	ShopType string `json:"shop_type"`
    24  }
    25  
    26  // CreateContractDTO type used in in "createContract" func (arg) in invoke_shop.go
    27  type CreateContractDTO struct {
    28  	UUID             string    `json:"uuid"`
    29  	ContractTypeUUID string    `json:"contract_type_uuid"`
    30  	Username         string    `json:"username"`
    31  	Password         string    `json:"password"`
    32  	FirstName        string    `json:"first_name"`
    33  	LastName         string    `json:"last_name"`
    34  	Item             app.Item  `json:"item"`
    35  	StartDate        time.Time `json:"start_date"`
    36  	EndDate          time.Time `json:"end_date"`
    37  }
    38  
    39  // ContractCreateResponse type used in in "createContract" func in invoke_shop.go
    40  type ContractCreateResponse struct {
    41  	Username string `json:"username"`
    42  	Password string `json:"password"`
    43  }
    44  
    45  // LsContractTypeDTO type used in "listContractTypes" in invoke_insurance.go
    46  type LsContractTypeDTO struct {
    47  	ShopType string `json:"shop_type"`
    48  }
    49  
    50  // type used in in "getUser" func in invoke_insurance.go
    51  type GetUserDTO struct {
    52  	Username string `json:"username"`
    53  }
    54  
    55  // named type, from anonymous type used in in "getUser" func in invoke_insurance.go
    56  type ResponseUserDTO struct {
    57  	Username  string `json:"username"`
    58  	FirstName string `json:"first_name"`
    59  	LastName  string `json:"last_name"`
    60  }