Documentation
¶
Index ¶
- type ContactService
- func (s *ContactService) CountContactByTag(companyID string) ([]models.CountByTag, error)
- func (s *ContactService) CreateContact(data *models.ContactModel) error
- func (s *ContactService) CreateContactFromUser(user *models.UserModel, code string, isCustomer, isVendor, isSupplier bool, ...) (*models.ContactModel, error)
- func (s *ContactService) DB() *gorm.DB
- func (s *ContactService) DeleteContact(id string) error
- func (s *ContactService) GetContactByID(id string) (*models.ContactModel, error)
- func (s *ContactService) GetContactByPhone(phone string, companyID string) (*models.ContactModel, error)
- func (s *ContactService) GetContactByTagIDs(tagIDs []string) ([]models.ContactModel, error)
- func (s *ContactService) GetContacts(request http.Request, search string, isCustomer, isVendor, isSupplier *bool) (paginate.Page, error)
- func (s *ContactService) GetContactsByRole(isCustomer, isVendor, isSupplier bool) ([]models.ContactModel, error)
- func (s *ContactService) GetTotalDebt(contact *models.ContactModel) float64
- func (s *ContactService) GetTotalReceivable(contact *models.ContactModel) float64
- func (s *ContactService) Migrate() error
- func (s *ContactService) UpdateContact(id string, data *models.ContactModel) (*models.ContactModel, error)
- func (s *ContactService) UpdateContactRoles(id string, isCustomer, isVendor, isSupplier bool) (*models.ContactModel, error)
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