59 lines
2.1 KiB
Go
59 lines
2.1 KiB
Go
package order
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gorm.io/datatypes"
|
|
)
|
|
|
|
type OrderDTO struct {
|
|
ID uint64 `json:"id"`
|
|
OrderNo string `json:"order_no"`
|
|
ListingID uint64 `json:"listing_id"`
|
|
AccountID uint64 `json:"account_id"`
|
|
OwnerID uint64 `json:"owner_id"`
|
|
RenterID uint64 `json:"renter_id"`
|
|
OwnerPhone string `json:"owner_phone,omitempty"`
|
|
RenterPhone string `json:"renter_phone,omitempty"`
|
|
Title string `json:"title"`
|
|
ServerRegion string `json:"server_region"`
|
|
LoginPlatform string `json:"login_platform"`
|
|
RentStartAt *time.Time `json:"rent_start_at"`
|
|
RentEndAt *time.Time `json:"rent_end_at"`
|
|
RentHours int `json:"rent_hours"`
|
|
RentAmount float64 `json:"rent_amount"`
|
|
DepositAmount float64 `json:"deposit_amount"`
|
|
PlatformFee float64 `json:"platform_fee"`
|
|
AccountSnapshot datatypes.JSON `json:"account_snapshot"`
|
|
Status string `json:"status"`
|
|
HandoffStatus string `json:"handoff_status"`
|
|
SettlementStatus string `json:"settlement_status"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
type CreateRequest struct {
|
|
ListingID uint64 `json:"listing_id" binding:"required"`
|
|
RentHours int `json:"rent_hours" binding:"required"`
|
|
}
|
|
|
|
type SubmitHandoffRequest struct {
|
|
Content string `json:"content" binding:"required"`
|
|
}
|
|
|
|
type SubmitReturnRequest struct {
|
|
Content string `json:"content" binding:"required"`
|
|
}
|
|
|
|
type HandoffRecordDTO struct {
|
|
ID uint64 `json:"id"`
|
|
OrderID uint64 `json:"order_id"`
|
|
FromUserID uint64 `json:"from_user_id"`
|
|
ToUserID uint64 `json:"to_user_id"`
|
|
Type string `json:"type"`
|
|
Content string `json:"content"`
|
|
ConfirmedByRenterAt *time.Time `json:"confirmed_by_renter_at"`
|
|
ConfirmedByOwnerAt *time.Time `json:"confirmed_by_owner_at"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
}
|