This commit is contained in:
2025-08-02 02:54:21 +08:00
parent 934dce2776
commit 66845d3fe0
74 changed files with 8686 additions and 212 deletions

View File

@@ -0,0 +1,26 @@
package repositories
import (
"context"
"time"
"tyapi-server/internal/domains/finance/entities"
)
// InvoiceApplicationRepository 发票申请仓储接口
type InvoiceApplicationRepository interface {
Create(ctx context.Context, application *entities.InvoiceApplication) error
Update(ctx context.Context, application *entities.InvoiceApplication) error
Save(ctx context.Context, application *entities.InvoiceApplication) error
FindByID(ctx context.Context, id string) (*entities.InvoiceApplication, error)
FindByUserID(ctx context.Context, userID string, page, pageSize int) ([]*entities.InvoiceApplication, int64, error)
FindPendingApplications(ctx context.Context, page, pageSize int) ([]*entities.InvoiceApplication, int64, error)
FindByStatus(ctx context.Context, status entities.ApplicationStatus) ([]*entities.InvoiceApplication, error)
FindByUserIDAndStatus(ctx context.Context, userID string, status entities.ApplicationStatus, page, pageSize int) ([]*entities.InvoiceApplication, int64, error)
FindByUserIDAndStatusWithTimeRange(ctx context.Context, userID string, status entities.ApplicationStatus, startTime, endTime *time.Time, page, pageSize int) ([]*entities.InvoiceApplication, int64, error)
FindByStatusWithTimeRange(ctx context.Context, status entities.ApplicationStatus, startTime, endTime *time.Time, page, pageSize int) ([]*entities.InvoiceApplication, int64, error)
FindAllWithTimeRange(ctx context.Context, startTime, endTime *time.Time, page, pageSize int) ([]*entities.InvoiceApplication, int64, error)
GetUserTotalInvoicedAmount(ctx context.Context, userID string) (string, error)
GetUserTotalAppliedAmount(ctx context.Context, userID string) (string, error)
}