github.com/condensat/bank-core@v0.1.0/database/model/withdrawinfo.go (about)

     1  // Copyright 2020 Condensat Tech. All rights reserved.
     2  // Use of this source code is governed by a MIT
     3  // license that can be found in the LICENSE file.
     4  
     5  package model
     6  
     7  import (
     8  	"time"
     9  )
    10  
    11  type WithdrawInfoID ID
    12  type WithdrawStatus String
    13  type WithdrawInfoData String
    14  
    15  const (
    16  	WithdrawStatusCreated    WithdrawStatus = "created"
    17  	WithdrawStatusProcessing WithdrawStatus = "processing"
    18  	WithdrawStatusSettled    WithdrawStatus = "settled"
    19  	WithdrawStatusCanceling  WithdrawStatus = "canceling"
    20  	WithdrawStatusCanceled   WithdrawStatus = "canceled"
    21  )
    22  
    23  type WithdrawInfo struct {
    24  	ID         WithdrawInfoID   `gorm:"primary_key"`
    25  	Timestamp  time.Time        `gorm:"index;not null;type:timestamp"`   // Creation timestamp
    26  	WithdrawID WithdrawID       `gorm:"index;not null"`                  // [FK] Reference to Withdraw table
    27  	Status     WithdrawStatus   `gorm:"index;not null;size:16"`          // WithdrawStatus [created, processing, completed, canceled]
    28  	Data       WithdrawInfoData `gorm:"type:blob;not null;default:'{}'"` // WithdrawInfo data
    29  }