Documentation
¶
Index ¶
- Constants
- Variables
- func ParseDDMMYYYY(layout, s string) (yyyymmdd, error)
- type AggregateByBankCode
- type AggregateQuantity
- type CIBFile
- type CIBFileReq
- type CalculateReq
- type Calculation
- type CalculationQuery
- type Contract
- type Customer
- type ListCalculationsResult
- type Service
- func (s *Service) CalculateCIB(ctx context.Context, in *CalculateReq) (*Calculation, error)
- func (s *Service) GetCIBFile(ctx context.Context, fileName string, signature string) (*CIBFile, error)
- func (s *Service) GetCalculationByNumber(ctx context.Context, number string) (*Calculation, error)
- func (s *Service) ListCalculations(ctx context.Context, in *CalculationQuery) (*ListCalculationsResult, error)
- func (s *Service) SignedURL(ctx context.Context, in *CIBFile) string
- func (s *Service) UploadCIB(ctx context.Context, in *CIBFileReq) (*CIBFile, error)
Constants ¶
View Source
const ( TermTypeUnSpecified termType = iota TermTypeCL TermTypeL TermTypePL TermTypeOD TermTypeCC TermTypeRL TermTypeOther )
View Source
const ( StatusUnSpecified status = iota StatusActive StatusClosed )
Variables ¶
View Source
var ErrCIBFileNotFound = errors.New("cib file not found")
View Source
var ErrCalculationNotFound = errors.New("calculation not found")
View Source
var ErrUnsupportedFileType = errors.New("unsupported file type")
ErrUnsupportedFileType is returned when the file type is not supported.
Functions ¶
func ParseDDMMYYYY ¶
Types ¶
type AggregateByBankCode ¶
type AggregateQuantity ¶
type CIBFile ¶
type CIBFile struct { ID int64 `json:"-"` Location string `json:"-"` OriginalName string `json:"originalName"` Name string `json:"name"` CreatedBy string `json:"createdBy"` CreatedAt time.Time `json:"createdAt"` // Public URL is the signed url to download the file. // For output at first time only, not save to DB. PublicURL string `json:"publicUrl,omitempty"` }
type CIBFileReq ¶
type CIBFileReq struct { OriginalName string ReadSeeker io.ReadSeeker }
type CalculateReq ¶
type CalculateReq struct { Number string `json:"number"` CIBFileName string `json:"cibFileName"` // contains filtered or unexported fields }
func (*CalculateReq) Validate ¶
func (r *CalculateReq) Validate() error
type Calculation ¶
type Calculation struct { ID int64 `json:"id"` CIBFileName string `json:"cibFileName"` Number string `json:"number"` Customer Customer `json:"customer"` TotalInstallmentInLAK decimal.Decimal `json:"totalInstallmentInLAK"` AggregateQuantity AggregateQuantity `json:"aggregateQuantity"` AggregateByBankCode []AggregateByBankCode `json:"aggregateByBankCode"` Contracts []Contract `json:"contracts"` CreatedBy string `json:"createdBy"` UpdatedBy string `json:"updatedBy"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
func (Calculation) BytesFromAggregateByBankCode ¶
func (c Calculation) BytesFromAggregateByBankCode() []byte
func (Calculation) BytesFromContracts ¶
func (c Calculation) BytesFromContracts() []byte
type CalculationQuery ¶
type CalculationQuery struct { ID int64 `query:"id"` Number string `query:"number"` CustomerDisplayName string `query:"customerDisplayName"` CreatedAfter time.Time `query:"createdAfter"` CreatedBefore time.Time `query:"createdBefore"` PageSize uint64 `query:"pageSize"` PageToken string `query:"pageToken"` }
type Contract ¶
type Contract struct { Number string `json:"number"` BankCode string `json:"bankCode"` Type string `json:"type"` Currency string `json:"currency"` GradeCIB string `json:"gradeCIB"` Term string `json:"term"` GradeCIBLast12Months []string `json:"gradeCIBLast12months"` Status status `json:"status"` TermType string `json:"termType"` LastedAt yyyymmdd `json:"lastedAt"` FirstInstallment yyyymmdd `json:"firstInstallment"` LastInstallment yyyymmdd `json:"lastInstallment"` InterestRate decimal.Decimal `json:"interestRate"` FinanceAmount decimal.Decimal `json:"financeAmount"` OutstandingBalance decimal.Decimal `json:"outstandingBalance"` OverdueInDay decimal.Decimal `json:"overdueInDay"` Period decimal.Decimal `json:"period"` Installment decimal.Decimal `json:"installment"` InstallmentInLAK decimal.Decimal `json:"installmentInLAK"` ExchangeRate decimal.Decimal `json:"exchangeRate"` // contains filtered or unexported fields }
type ListCalculationsResult ¶
type ListCalculationsResult struct { Calculations []*Calculation `json:"calculations"` NextPageToken string `json:"nextPageToken"` }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) CalculateCIB ¶
func (s *Service) CalculateCIB(ctx context.Context, in *CalculateReq) (*Calculation, error)
func (*Service) GetCIBFile ¶
func (*Service) GetCalculationByNumber ¶
func (*Service) ListCalculations ¶
func (s *Service) ListCalculations(ctx context.Context, in *CalculationQuery) (*ListCalculationsResult, error)
Click to show internal directories.
Click to hide internal directories.