Documentation ¶
Index ¶
- type Invoice
- type Item
- type ItemRepository
- type MockRepository
- func (_m *MockRepository) CreateInvoice(ctx context.Context, inv *Invoice, opts ...unitofwork.Option) error
- func (_m *MockRepository) DeleteInvoice(ctx context.Context, id uuid.UUID, opts ...unitofwork.Option) error
- func (_m *MockRepository) GetInvoiceByID(ctx context.Context, id uuid.UUID, opts ...unitofwork.Option) (*Invoice, error)
- func (_m *MockRepository) GetInvoiceItems(ctx context.Context, invoiceID uuid.UUID) ([]*Item, error)
- func (_m *MockRepository) ListInvoices(ctx context.Context) ([]*Invoice, error)
- func (_m *MockRepository) UpdateInvoice(ctx context.Context, inv *Invoice, opts ...unitofwork.Option) error
- type Repository
- type Service
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Invoice ¶
type Invoice struct { ID uuid.UUID `json:"id"` Status Status `json:"status"` AskingPrice float64 `json:"asking_price"` IsLocked bool `json:"is_locked"` IsApproved bool `json:"is_approved"` InvoiceNumber string `json:"invoice_number"` InvoiceDate time.Time `json:"invoice_date"` DueDate time.Time `json:"due_date"` AmountDue float64 `json:"amount_due"` CustomerName string `json:"customer_name"` Reference string `json:"reference"` CompanyName string `json:"company_name"` Currency string `json:"currency"` TotalAmount float64 `json:"total_amount"` TotalVAT float64 `json:"total_vat"` IssuerID uuid.UUID `json:"issuer_id"` InvestorIDs []uuid.UUID `json:"investor_ids"` Items []*Item `json:"items"` }
type Item ¶
type ItemRepository ¶
type ItemRepository interface { Get(ctx context.Context, id uuid.UUID) (*Item, error) List(ctx context.Context) ([]*Item, error) Create(ctx context.Context, invoiceItem *Item) (*Item, error) Update(ctx context.Context, invoiceItem *Item) (*Item, error) Delete(ctx context.Context, id uuid.UUID) error }
type MockRepository ¶
MockRepository is an autogenerated mock type for the Repository type
func NewMockRepository ¶
func NewMockRepository(t mockConstructorTestingTNewMockRepository) *MockRepository
NewMockRepository creates a new instance of MockRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockRepository) CreateInvoice ¶
func (_m *MockRepository) CreateInvoice(ctx context.Context, inv *Invoice, opts ...unitofwork.Option) error
CreateInvoice provides a mock function with given fields: ctx, inv, opts
func (*MockRepository) DeleteInvoice ¶
func (_m *MockRepository) DeleteInvoice(ctx context.Context, id uuid.UUID, opts ...unitofwork.Option) error
DeleteInvoice provides a mock function with given fields: ctx, id, opts
func (*MockRepository) GetInvoiceByID ¶
func (_m *MockRepository) GetInvoiceByID(ctx context.Context, id uuid.UUID, opts ...unitofwork.Option) (*Invoice, error)
GetInvoiceByID provides a mock function with given fields: ctx, id, opts
func (*MockRepository) GetInvoiceItems ¶
func (_m *MockRepository) GetInvoiceItems(ctx context.Context, invoiceID uuid.UUID) ([]*Item, error)
GetInvoiceItems provides a mock function with given fields: ctx, invoiceID
func (*MockRepository) ListInvoices ¶
func (_m *MockRepository) ListInvoices(ctx context.Context) ([]*Invoice, error)
ListInvoices provides a mock function with given fields: ctx
func (*MockRepository) UpdateInvoice ¶
func (_m *MockRepository) UpdateInvoice(ctx context.Context, inv *Invoice, opts ...unitofwork.Option) error
UpdateInvoice provides a mock function with given fields: ctx, inv, opts
type Repository ¶
type Repository interface { CreateInvoice(ctx context.Context, inv *Invoice, opts ...unitofwork.Option) error GetInvoiceByID(ctx context.Context, id uuid.UUID, opts ...unitofwork.Option) (*Invoice, error) UpdateInvoice(ctx context.Context, inv *Invoice, opts ...unitofwork.Option) error DeleteInvoice(ctx context.Context, id uuid.UUID, opts ...unitofwork.Option) error ListInvoices(ctx context.Context) ([]*Invoice, error) GetInvoiceItems(ctx context.Context, invoiceID uuid.UUID) ([]*Item, error) }
type Service ¶
type Service interface { CreateInvoice(ctx context.Context, inv *Invoice) (*Invoice, error) GetInvoiceByID(ctx context.Context, id uuid.UUID) (*Invoice, error) UpdateInvoice(ctx context.Context, inv *Invoice) (*Invoice, error) DeleteInvoice(ctx context.Context, id uuid.UUID) error ListInvoices(ctx context.Context) ([]*Invoice, error) ApproveTrade(ctx context.Context, id uuid.UUID) (*Invoice, error) }