contacts

package
v0.0.0-...-9a5c20e Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: BSD-3-Clause Imports: 4 Imported by: 1

README

contacts

import "github.com/blueprint-uservices/blueprint/examples/train_ticket/workflow/contacts"

Index

Constants

DocumentType enum

const (
    NULL int64 = iota
    ID_CARD
    PASSPORT
    OTHER
)

type Contact

type Contact struct {
    ID             string
    AccountID      string
    Name           string
    DocumentType   int
    DocumentNumber string
    PhoneNumber    string
}

type ContactsService

Contacts Service manages contacts for users

type ContactsService interface {
    // Find a contact using its `id`
    FindContactsById(ctx context.Context, id string) (Contact, error)
    // Find all contacts associated with an account with ID `id`
    FindContactsByAccountId(ctx context.Context, id string) ([]Contact, error)
    // Create a new contact
    CreateContacts(ctx context.Context, c Contact) error
    // Delete an existing contact
    Delete(ctx context.Context, c Contact) error
    // Get all existing contacts
    GetAllContacts(ctx context.Context) ([]Contact, error)
    // Modify an existing contact
    Modify(ctx context.Context, contact Contact) (bool, error)
}

type ContactsServiceImpl

type ContactsServiceImpl struct {
    // contains filtered or unexported fields
}

func NewContactsServiceImpl
func NewContactsServiceImpl(ctx context.Context, db backend.NoSQLDatabase) (*ContactsServiceImpl, error)

func (*ContactsServiceImpl) CreateContacts
func (c *ContactsServiceImpl) CreateContacts(ctx context.Context, contact Contact) error

func (*ContactsServiceImpl) Delete
func (c *ContactsServiceImpl) Delete(ctx context.Context, contact Contact) error

func (*ContactsServiceImpl) FindContactsByAccountId
func (c *ContactsServiceImpl) FindContactsByAccountId(ctx context.Context, id string) ([]Contact, error)

func (*ContactsServiceImpl) FindContactsById
func (c *ContactsServiceImpl) FindContactsById(ctx context.Context, id string) (Contact, error)

func (*ContactsServiceImpl) GetAllContacts
func (c *ContactsServiceImpl) GetAllContacts(ctx context.Context) ([]Contact, error)

func (*ContactsServiceImpl) Modify
func (c *ContactsServiceImpl) Modify(ctx context.Context, contact Contact) (bool, error)

Generated by gomarkdoc

Documentation

Index

Constants

View Source
const (
	NULL int64 = iota
	ID_CARD
	PASSPORT
	OTHER
)

DocumentType enum

Variables

This section is empty.

Functions

This section is empty.

Types

type Contact

type Contact struct {
	ID             string
	AccountID      string
	Name           string
	DocumentType   int
	DocumentNumber string
	PhoneNumber    string
}

type ContactsService

type ContactsService interface {
	// Find a contact using its `id`
	FindContactsById(ctx context.Context, id string) (Contact, error)
	// Find all contacts associated with an account with ID `id`
	FindContactsByAccountId(ctx context.Context, id string) ([]Contact, error)
	// Create a new contact
	CreateContacts(ctx context.Context, c Contact) error
	// Delete an existing contact
	Delete(ctx context.Context, c Contact) error
	// Get all existing contacts
	GetAllContacts(ctx context.Context) ([]Contact, error)
	// Modify an existing contact
	Modify(ctx context.Context, contact Contact) (bool, error)
}

Contacts Service manages contacts for users

type ContactsServiceImpl

type ContactsServiceImpl struct {
	// contains filtered or unexported fields
}

func NewContactsServiceImpl

func NewContactsServiceImpl(ctx context.Context, db backend.NoSQLDatabase) (*ContactsServiceImpl, error)

func (*ContactsServiceImpl) CreateContacts

func (c *ContactsServiceImpl) CreateContacts(ctx context.Context, contact Contact) error

func (*ContactsServiceImpl) Delete

func (c *ContactsServiceImpl) Delete(ctx context.Context, contact Contact) error

func (*ContactsServiceImpl) FindContactsByAccountId

func (c *ContactsServiceImpl) FindContactsByAccountId(ctx context.Context, id string) ([]Contact, error)

func (*ContactsServiceImpl) FindContactsById

func (c *ContactsServiceImpl) FindContactsById(ctx context.Context, id string) (Contact, error)

func (*ContactsServiceImpl) GetAllContacts

func (c *ContactsServiceImpl) GetAllContacts(ctx context.Context) ([]Contact, error)

func (*ContactsServiceImpl) Modify

func (c *ContactsServiceImpl) Modify(ctx context.Context, contact Contact) (bool, error)

Jump to

Keyboard shortcuts

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