v1

package
v0.0.0-...-f2a8491 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2024 License: MIT Imports: 5 Imported by: 0

README

Payment domain

@startuml
!theme spacelab

NEW : initial a new payment
PENDING: wait approve/reject
APPROVE: approve payment
REJECT: not valid payment
CLOSE: close payment

[*] --> NEW

NEW -> PENDING

PENDING --[#green]> APPROVE
PENDING --[#red]> REJECT
PENDING --[#yellow]> CLOSE

APPROVE -> CLOSE
REJECT -> CLOSE

CLOSE --> [*]

@enduml

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Command_name = map[int32]string{
		0: "COMMAND_UNSPECIFIED",
		1: "COMMAND_PAYMENT_CREATE",
		2: "COMMAND_PAYMENT_APPROVE",
		3: "COMMAND_PAYMENT_CLOSE",
		4: "COMMAND_PAYMENT_REJECT",
		5: "COMMAND_BALANCE_UPDATE",
	}
	Command_value = map[string]int32{
		"COMMAND_UNSPECIFIED":     0,
		"COMMAND_PAYMENT_CREATE":  1,
		"COMMAND_PAYMENT_APPROVE": 2,
		"COMMAND_PAYMENT_CLOSE":   3,
		"COMMAND_PAYMENT_REJECT":  4,
		"COMMAND_BALANCE_UPDATE":  5,
	}
)

Enum value maps for Command.

View Source
var (
	Event_name = map[int32]string{
		0: "EVENT_UNSPECIFIED",
		1: "EVENT_PAYMENT_CREATED",
		2: "EVENT_PAYMENT_APPROVED",
		3: "EVENT_PAYMENT_CLOSED",
		4: "EVENT_PAYMENT_REJECTED",
		5: "EVENT_BALANCE_UPDATED",
	}
	Event_value = map[string]int32{
		"EVENT_UNSPECIFIED":      0,
		"EVENT_PAYMENT_CREATED":  1,
		"EVENT_PAYMENT_APPROVED": 2,
		"EVENT_PAYMENT_CLOSED":   3,
		"EVENT_PAYMENT_REJECTED": 4,
		"EVENT_BALANCE_UPDATED":  5,
	}
)

Enum value maps for Event.

View Source
var (
	StatusPayment_name = map[int32]string{
		0: "STATUS_PAYMENT_UNSPECIFIED",
		1: "STATUS_PAYMENT_NEW",
		2: "STATUS_PAYMENT_PENDING",
		3: "STATUS_PAYMENT_APPROVE",
		4: "STATUS_PAYMENT_CLOSE",
		5: "STATUS_PAYMENT_REJECT",
	}
	StatusPayment_value = map[string]int32{
		"STATUS_PAYMENT_UNSPECIFIED": 0,
		"STATUS_PAYMENT_NEW":         1,
		"STATUS_PAYMENT_PENDING":     2,
		"STATUS_PAYMENT_APPROVE":     3,
		"STATUS_PAYMENT_CLOSE":       4,
		"STATUS_PAYMENT_REJECT":      5,
	}
)

Enum value maps for StatusPayment.

View Source
var File_domain_billing_payment_v1_command_proto protoreflect.FileDescriptor
View Source
var File_domain_billing_payment_v1_event_proto protoreflect.FileDescriptor
View Source
var File_domain_billing_payment_v1_payment_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Command

type Command int32

Command is a command to be executed by the payment service.

const (
	// unspecified command
	Command_COMMAND_UNSPECIFIED Command = 0
	// create a new payment
	Command_COMMAND_PAYMENT_CREATE Command = 1
	// approve a payment
	Command_COMMAND_PAYMENT_APPROVE Command = 2
	// close a payment
	Command_COMMAND_PAYMENT_CLOSE Command = 3
	// reject a payment
	Command_COMMAND_PAYMENT_REJECT Command = 4
	// update balance
	Command_COMMAND_BALANCE_UPDATE Command = 5
)

func (Command) Descriptor

func (Command) Descriptor() protoreflect.EnumDescriptor

func (Command) Enum

func (x Command) Enum() *Command

func (Command) EnumDescriptor deprecated

func (Command) EnumDescriptor() ([]byte, []int)

Deprecated: Use Command.Descriptor instead.

func (Command) Number

func (x Command) Number() protoreflect.EnumNumber

func (Command) String

func (x Command) String() string

func (Command) Type

func (Command) Type() protoreflect.EnumType

type Event

type Event int32

Event

const (
	// Unspecified event
	Event_EVENT_UNSPECIFIED Event = 0
	// created event
	Event_EVENT_PAYMENT_CREATED Event = 1
	// approved event
	Event_EVENT_PAYMENT_APPROVED Event = 2
	// closed event
	Event_EVENT_PAYMENT_CLOSED Event = 3
	// rejected event
	Event_EVENT_PAYMENT_REJECTED Event = 4
	// balance updated event
	Event_EVENT_BALANCE_UPDATED Event = 5
)

func (Event) Descriptor

func (Event) Descriptor() protoreflect.EnumDescriptor

func (Event) Enum

func (x Event) Enum() *Event

func (Event) EnumDescriptor deprecated

func (Event) EnumDescriptor() ([]byte, []int)

Deprecated: Use Event.Descriptor instead.

func (Event) Number

func (x Event) Number() protoreflect.EnumNumber

func (Event) String

func (x Event) String() string

func (Event) Type

func (Event) Type() protoreflect.EnumType

type EventBalanceUpdated

type EventBalanceUpdated struct {

	// id of the balance
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// amount of the balance
	Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"`
	// contains filtered or unexported fields
}

EventBalanceUpdated is published when a balance is updated

func (*EventBalanceUpdated) Descriptor deprecated

func (*EventBalanceUpdated) Descriptor() ([]byte, []int)

Deprecated: Use EventBalanceUpdated.ProtoReflect.Descriptor instead.

func (*EventBalanceUpdated) GetAmount

func (x *EventBalanceUpdated) GetAmount() int64

func (*EventBalanceUpdated) GetId

func (x *EventBalanceUpdated) GetId() string

func (*EventBalanceUpdated) ProtoMessage

func (*EventBalanceUpdated) ProtoMessage()

func (*EventBalanceUpdated) ProtoReflect

func (x *EventBalanceUpdated) ProtoReflect() protoreflect.Message

func (*EventBalanceUpdated) Reset

func (x *EventBalanceUpdated) Reset()

func (*EventBalanceUpdated) String

func (x *EventBalanceUpdated) String() string

type EventPaymentApproved

type EventPaymentApproved struct {

	// id of the payment
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// status of the payment
	Status StatusPayment `protobuf:"varint,2,opt,name=status,proto3,enum=domain.billing.payment.v1.StatusPayment" json:"status,omitempty"`
	// contains filtered or unexported fields
}

EventPaymentApproved is published when a payment is approved

func (*EventPaymentApproved) Descriptor deprecated

func (*EventPaymentApproved) Descriptor() ([]byte, []int)

Deprecated: Use EventPaymentApproved.ProtoReflect.Descriptor instead.

func (*EventPaymentApproved) GetId

func (x *EventPaymentApproved) GetId() string

func (*EventPaymentApproved) GetStatus

func (x *EventPaymentApproved) GetStatus() StatusPayment

func (*EventPaymentApproved) ProtoMessage

func (*EventPaymentApproved) ProtoMessage()

func (*EventPaymentApproved) ProtoReflect

func (x *EventPaymentApproved) ProtoReflect() protoreflect.Message

func (*EventPaymentApproved) Reset

func (x *EventPaymentApproved) Reset()

func (*EventPaymentApproved) String

func (x *EventPaymentApproved) String() string

type EventPaymentClosed

type EventPaymentClosed struct {

	// id of the payment
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// status of the payment
	Status StatusPayment `protobuf:"varint,2,opt,name=status,proto3,enum=domain.billing.payment.v1.StatusPayment" json:"status,omitempty"`
	// contains filtered or unexported fields
}

EventPaymentClosed is published when a payment is closed

func (*EventPaymentClosed) Descriptor deprecated

func (*EventPaymentClosed) Descriptor() ([]byte, []int)

Deprecated: Use EventPaymentClosed.ProtoReflect.Descriptor instead.

func (*EventPaymentClosed) GetId

func (x *EventPaymentClosed) GetId() string

func (*EventPaymentClosed) GetStatus

func (x *EventPaymentClosed) GetStatus() StatusPayment

func (*EventPaymentClosed) ProtoMessage

func (*EventPaymentClosed) ProtoMessage()

func (*EventPaymentClosed) ProtoReflect

func (x *EventPaymentClosed) ProtoReflect() protoreflect.Message

func (*EventPaymentClosed) Reset

func (x *EventPaymentClosed) Reset()

func (*EventPaymentClosed) String

func (x *EventPaymentClosed) String() string

type EventPaymentCreated

type EventPaymentCreated struct {

	// id of the payment
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// name of the payment
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// status of the payment
	Status StatusPayment `protobuf:"varint,3,opt,name=status,proto3,enum=domain.billing.payment.v1.StatusPayment" json:"status,omitempty"`
	// owner of the payment
	UserId string `protobuf:"bytes,4,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// contains filtered or unexported fields
}

EventPaymentCreated is published when a payment is created

func (*EventPaymentCreated) Descriptor deprecated

func (*EventPaymentCreated) Descriptor() ([]byte, []int)

Deprecated: Use EventPaymentCreated.ProtoReflect.Descriptor instead.

func (*EventPaymentCreated) GetId

func (x *EventPaymentCreated) GetId() string

func (*EventPaymentCreated) GetName

func (x *EventPaymentCreated) GetName() string

func (*EventPaymentCreated) GetStatus

func (x *EventPaymentCreated) GetStatus() StatusPayment

func (*EventPaymentCreated) GetUserId

func (x *EventPaymentCreated) GetUserId() string

func (*EventPaymentCreated) ProtoMessage

func (*EventPaymentCreated) ProtoMessage()

func (*EventPaymentCreated) ProtoReflect

func (x *EventPaymentCreated) ProtoReflect() protoreflect.Message

func (*EventPaymentCreated) Reset

func (x *EventPaymentCreated) Reset()

func (*EventPaymentCreated) String

func (x *EventPaymentCreated) String() string

type EventPaymentRejected

type EventPaymentRejected struct {

	// id of the payment
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// status of the payment
	Status StatusPayment `protobuf:"varint,2,opt,name=status,proto3,enum=domain.billing.payment.v1.StatusPayment" json:"status,omitempty"`
	// contains filtered or unexported fields
}

EventPaymentRejected is published when a payment is rejected

func (*EventPaymentRejected) Descriptor deprecated

func (*EventPaymentRejected) Descriptor() ([]byte, []int)

Deprecated: Use EventPaymentRejected.ProtoReflect.Descriptor instead.

func (*EventPaymentRejected) GetId

func (x *EventPaymentRejected) GetId() string

func (*EventPaymentRejected) GetStatus

func (x *EventPaymentRejected) GetStatus() StatusPayment

func (*EventPaymentRejected) ProtoMessage

func (*EventPaymentRejected) ProtoMessage()

func (*EventPaymentRejected) ProtoReflect

func (x *EventPaymentRejected) ProtoReflect() protoreflect.Message

func (*EventPaymentRejected) Reset

func (x *EventPaymentRejected) Reset()

func (*EventPaymentRejected) String

func (x *EventPaymentRejected) String() string

type Payment

type Payment struct {

	// FieldMask
	FieldMask *fieldmaskpb.FieldMask `protobuf:"bytes,6,opt,name=field_mask,json=fieldMask,proto3" json:"field_mask,omitempty"`
	// ID payment
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Name payment
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// Status payment
	Status StatusPayment `protobuf:"varint,3,opt,name=status,proto3,enum=domain.billing.payment.v1.StatusPayment" json:"status,omitempty"`
	// User ID
	UserId string `protobuf:"bytes,4,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// Amount payment
	Amount int64 `protobuf:"varint,5,opt,name=amount,proto3" json:"amount,omitempty"`
	// contains filtered or unexported fields
}

Payment - information about payment

func (*Payment) Descriptor deprecated

func (*Payment) Descriptor() ([]byte, []int)

Deprecated: Use Payment.ProtoReflect.Descriptor instead.

func (*Payment) GetAmount

func (x *Payment) GetAmount() int64

func (*Payment) GetFieldMask

func (x *Payment) GetFieldMask() *fieldmaskpb.FieldMask

func (*Payment) GetId

func (x *Payment) GetId() string

func (*Payment) GetName

func (x *Payment) GetName() string

func (*Payment) GetStatus

func (x *Payment) GetStatus() StatusPayment

func (*Payment) GetUserId

func (x *Payment) GetUserId() string

func (*Payment) ProtoMessage

func (*Payment) ProtoMessage()

func (*Payment) ProtoReflect

func (x *Payment) ProtoReflect() protoreflect.Message

func (*Payment) Reset

func (x *Payment) Reset()

func (*Payment) String

func (x *Payment) String() string

type Payments

type Payments struct {

	// List of payments
	List []*Payment `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"`
	// contains filtered or unexported fields
}

Payments - list payments

func (*Payments) Descriptor deprecated

func (*Payments) Descriptor() ([]byte, []int)

Deprecated: Use Payments.ProtoReflect.Descriptor instead.

func (*Payments) GetList

func (x *Payments) GetList() []*Payment

func (*Payments) Len

func (p *Payments) Len() int

func (*Payments) Less

func (p *Payments) Less(i, j int) bool

func (*Payments) ProtoMessage

func (*Payments) ProtoMessage()

func (*Payments) ProtoReflect

func (x *Payments) ProtoReflect() protoreflect.Message

func (*Payments) Reset

func (x *Payments) Reset()

func (*Payments) String

func (x *Payments) String() string

func (*Payments) Swap

func (p *Payments) Swap(i, j int)

type StatusPayment

type StatusPayment int32

StatusPayment status payment

const (
	// Unspecified
	StatusPayment_STATUS_PAYMENT_UNSPECIFIED StatusPayment = 0
	// New payment
	StatusPayment_STATUS_PAYMENT_NEW StatusPayment = 1
	// Pending payment
	StatusPayment_STATUS_PAYMENT_PENDING StatusPayment = 2
	// Approve payment
	StatusPayment_STATUS_PAYMENT_APPROVE StatusPayment = 3
	// Close payment
	StatusPayment_STATUS_PAYMENT_CLOSE StatusPayment = 4
	// Reject payment
	StatusPayment_STATUS_PAYMENT_REJECT StatusPayment = 5
)

func (StatusPayment) Descriptor

func (StatusPayment) Enum

func (x StatusPayment) Enum() *StatusPayment

func (StatusPayment) EnumDescriptor deprecated

func (StatusPayment) EnumDescriptor() ([]byte, []int)

Deprecated: Use StatusPayment.Descriptor instead.

func (StatusPayment) Number

func (StatusPayment) String

func (x StatusPayment) String() string

func (StatusPayment) Type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL