Skip to content

Commit

Permalink
feat: refactor price calculation to provider calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
aldy505 committed Jan 1, 2023
1 parent 413bb3e commit 68058d6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
8 changes: 0 additions & 8 deletions repository/price_calculation.go

This file was deleted.

10 changes: 10 additions & 0 deletions repository/provider_calculation.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package repository

import "mock-shipping-provider/primitive"

type ProviderCalculation interface {
// CalculateTimeOfArrival calculates the time of arrival (in hours) based on distance.
CalculateTimeOfArrival(distance float64) int64
// CalculatePrice price from distance, dimension, and weight combination.
CalculatePrice(distance float64, dimension primitive.Dimension, weight float64) int64
}

0 comments on commit 68058d6

Please sign in to comment.