Documentation
¶
Index ¶
- func NewAccountService(accountRepo domain.AccountRepository, userRepo domain.UserRepository, ...) domain.AccountService
- func NewAdminService(tenantRepo domain.AdminTenantRepository, userRepo domain.AdminUserRepository, ...) domain.AdminService
- func NewAuthService(authRepo domain.AuthRepository, userRepo domain.UserRepository, ...) domain.AuthService
- func NewCategoryService(categoryRepo domain.CategoryRepository, auditRepo domain.AuditRepository) domain.CategoryService
- func NewMasterPurchaseService(mpRepo domain.MasterPurchaseRepository, accountRepo domain.AccountRepository, ...) domain.MasterPurchaseService
- func NewTenantService(tenantRepo domain.TenantRepository, userRepo domain.UserRepository, ...) domain.TenantService
- func NewTransactionService(txRepo domain.TransactionRepository, accountRepo domain.AccountRepository, ...) domain.TransactionService
- type InvoiceCloser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAccountService ¶
func NewAccountService( accountRepo domain.AccountRepository, userRepo domain.UserRepository, auditRepo domain.AuditRepository, ) domain.AccountService
NewAccountService creates a new instance of AccountService.
func NewAdminService ¶
func NewAdminService( tenantRepo domain.AdminTenantRepository, userRepo domain.AdminUserRepository, adminAudit domain.AdminAuditRepository, auditRepo domain.AuditRepository, ) domain.AdminService
NewAdminService creates a new system-wide administrative service.
func NewAuthService ¶
func NewAuthService( authRepo domain.AuthRepository, userRepo domain.UserRepository, auditRepo domain.AuditRepository, mailer domain.Mailer, pasetoKey paseto.V4SymmetricKey, ) domain.AuthService
NewAuthService creates a new authentication service.
func NewCategoryService ¶
func NewCategoryService(categoryRepo domain.CategoryRepository, auditRepo domain.AuditRepository) domain.CategoryService
NewCategoryService creates a new instance of CategoryService.
func NewMasterPurchaseService ¶ added in v1.10.0
func NewMasterPurchaseService( mpRepo domain.MasterPurchaseRepository, accountRepo domain.AccountRepository, catRepo domain.CategoryRepository, ) domain.MasterPurchaseService
NewMasterPurchaseService creates a new MasterPurchaseService implementation.
func NewTenantService ¶
func NewTenantService( tenantRepo domain.TenantRepository, userRepo domain.UserRepository, auditRepo domain.AuditRepository, ) domain.TenantService
NewTenantService creates a new instance of TenantService.
func NewTransactionService ¶
func NewTransactionService( txRepo domain.TransactionRepository, accountRepo domain.AccountRepository, categoryRepo domain.CategoryRepository, auditRepo domain.AuditRepository, ) domain.TransactionService
NewTransactionService creates a new instance of TransactionService.
Types ¶
type InvoiceCloser ¶ added in v1.10.0
type InvoiceCloser struct {
// contains filtered or unexported fields
}
InvoiceCloser materializes installment transactions at invoice-close time.
func NewInvoiceCloser ¶ added in v1.10.0
func NewInvoiceCloser( mpRepo domain.MasterPurchaseRepository, txRepo domain.TransactionRepository, auditRepo domain.AuditRepository, accRepo domain.AccountRepository, mpSvc domain.MasterPurchaseService, db *pgxpool.Pool, logger *slog.Logger, ) *InvoiceCloser
NewInvoiceCloser creates a new InvoiceCloser.
func (*InvoiceCloser) CloseInvoice ¶ added in v1.10.0
func (c *InvoiceCloser) CloseInvoice( ctx context.Context, tenantID string, accountID string, closingDate time.Time, ) (domain.CloseInvoiceResult, error)
CloseInvoice finds all open master purchases for the account due on or before closingDate, materializes the current installment as a transaction, and advances paid_installments. Runs each master purchase in its own DB transaction.