init push

This commit is contained in:
2026-07-16 22:16:45 +07:00
commit 8b068bdb10
1021 changed files with 332816 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
package service
import (
"context"
insurancepatientdata "wucher/internal/domain/insurance_patient_data"
)
type InsurancePatientDataService struct {
repo insurancepatientdata.Repository
}
func NewInsurancePatientDataService(repo insurancepatientdata.Repository) *InsurancePatientDataService {
return &InsurancePatientDataService{repo: repo}
}
func (s *InsurancePatientDataService) Create(ctx context.Context, row *insurancepatientdata.InsurancePatientData) error {
return s.repo.Create(ctx, row)
}
func (s *InsurancePatientDataService) Update(ctx context.Context, row *insurancepatientdata.InsurancePatientData) error {
return s.repo.Update(ctx, row)
}
func (s *InsurancePatientDataService) Delete(ctx context.Context, id []byte, deletedBy []byte) error {
return s.repo.Delete(ctx, id, deletedBy)
}
func (s *InsurancePatientDataService) GetByID(ctx context.Context, id []byte) (*insurancepatientdata.InsurancePatientData, error) {
return s.repo.GetByID(ctx, id)
}
func (s *InsurancePatientDataService) List(ctx context.Context, filter, sort string, limit, offset int) ([]insurancepatientdata.InsurancePatientData, int64, error) {
return s.repo.List(ctx, filter, normalizeInsurancePatientDataSort(sort), limit, offset)
}
func normalizeInsurancePatientDataSort(sort string) string {
return normalizeSortByRules(sort,
sortField("created_at"),
sortField("updated_at"),
)
}