contact

package
v1.0.44 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContactService

type ContactService struct {
	CompanyService *company.CompanyService
	// contains filtered or unexported fields
}

func NewContactService

func NewContactService(ctx *context.ERPContext, companyService *company.CompanyService) *ContactService

func (*ContactService) CountContactByTag

func (s *ContactService) CountContactByTag(companyID string) ([]models.CountByTag, error)

CountContactByTagID menghitung jumlah contact berdasarkan ID tag

func (*ContactService) CreateContact

func (s *ContactService) CreateContact(data *models.ContactModel) error

CreateContact membuat contact baru

func (*ContactService) CreateContactFromUser

func (s *ContactService) CreateContactFromUser(user *models.UserModel, code string, isCustomer, isVendor, isSupplier bool, companyID *string) (*models.ContactModel, error)

CreateContactFromUser membuat contact baru dari user jika tidak ada contact yang sama dengan email user

func (*ContactService) DB

func (s *ContactService) DB() *gorm.DB

func (*ContactService) DeleteContact

func (s *ContactService) DeleteContact(id string) error

DeleteContact menghapus contact berdasarkan ID

func (*ContactService) GetContactByID

func (s *ContactService) GetContactByID(id string) (*models.ContactModel, error)

GetContactByID mengambil contact berdasarkan ID

func (*ContactService) GetContactByPhone

func (s *ContactService) GetContactByPhone(phone string, companyID string) (*models.ContactModel, error)

GetContactByPhone mengambil contact berdasarkan phone

func (*ContactService) GetContactByTagIDs

func (s *ContactService) GetContactByTagIDs(tagIDs []string) ([]models.ContactModel, error)

GetContactByTagIDs mengambil semua contact berdasarkan ID tag

func (*ContactService) GetContacts

func (s *ContactService) GetContacts(request http.Request, search string, isCustomer, isVendor, isSupplier *bool) (paginate.Page, error)

GetContacts mengambil semua contact dengan pagination

func (*ContactService) GetContactsByRole

func (s *ContactService) GetContactsByRole(isCustomer, isVendor, isSupplier bool) ([]models.ContactModel, error)

GetContactsByRole mengambil semua contact berdasarkan role (customer, vendor, supplier)

func (*ContactService) GetTotalDebt

func (s *ContactService) GetTotalDebt(contact *models.ContactModel) float64

getTotalDebt menghitung total debt dari contact

func (*ContactService) GetTotalReceivable

func (s *ContactService) GetTotalReceivable(contact *models.ContactModel) float64

func (*ContactService) Migrate

func (s *ContactService) Migrate() error

func (*ContactService) UpdateContact

func (s *ContactService) UpdateContact(id string, data *models.ContactModel) (*models.ContactModel, error)

UpdateContact mengupdate informasi contact

func (*ContactService) UpdateContactRoles

func (s *ContactService) UpdateContactRoles(id string, isCustomer, isVendor, isSupplier bool) (*models.ContactModel, error)

UpdateContactRoles mengupdate roles (is_customer, is_vendor, is_supplier) dari contact

Jump to

Keyboard shortcuts

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