domain/order.go

go-pos · internal/core/domain/order.go · go · MIT
pos

Go struct representing an e‑commerce order entity with relationships.

// Source: https://github.com/bagashiz/go-pos | License: MIT | Copyright 2023 Bagas Hizbullah
// Provided via justclaw.it.com; keep this notice with the code.
package domain

import (
	"time"

	"github.com/google/uuid"
)

// Order is an entity that represents an order
type Order struct {
	ID           uint64
	UserID       uint64
	PaymentID    uint64
	CustomerName string
	TotalPrice   float64
	TotalPaid    float64
	TotalReturn  float64
	ReceiptCode  uuid.UUID
	CreatedAt    time.Time
	UpdatedAt    time.Time
	User         *User
	Payment      *Payment
	Products     []OrderProduct
}

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key