service backend
This commit is contained in:
30
api/pkg/model/invoice.go
Normal file
30
api/pkg/model/invoice.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/tech/sendico/pkg/db/storable"
|
||||
"github.com/tech/sendico/pkg/mservice"
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
)
|
||||
|
||||
// InvoiceStatus represents the status of an invoice.
|
||||
type InvoiceStatus string
|
||||
|
||||
const (
|
||||
InvoiceStatusPending InvoiceStatus = "pending" // Invoice is created but not paid
|
||||
InvoiceStatusPaid InvoiceStatus = "paid" // Invoice has been fully paid
|
||||
InvoiceStatusCancelled InvoiceStatus = "cancelled" // Invoice has been cancelled
|
||||
)
|
||||
|
||||
type Invoice struct {
|
||||
storable.Base `bson:",inline" json:",inline"`
|
||||
Note string `bson:"note" json:"note"`
|
||||
Link *Link `bson:"link,omitempty" json:"link,omitempty"`
|
||||
OrganizationRef primitive.ObjectID `bson:"organizationRef" json:"organizationRef"`
|
||||
RecipientRef primitive.ObjectID `bson:"recipientRef" json:"recipientRef"`
|
||||
Amount Amount `bson:"amount" json:"amount"`
|
||||
Status InvoiceStatus `bson:"status" json:"status"` // Invoice status
|
||||
}
|
||||
|
||||
func (*Invoice) Collection() string {
|
||||
return mservice.Invoices
|
||||
}
|
||||
Reference in New Issue
Block a user