create taxes only ofr booking platform

This commit is contained in:
Ruidy 2024-11-14 23:15:21 +01:00
parent 42764ab6cc
commit 472985351a
No known key found for this signature in database
GPG key ID: E00F51288CB857CC
2 changed files with 5 additions and 2 deletions

View file

@ -58,14 +58,17 @@ func NewHost() *Host {
HasEndDate: true, HasEndDate: true,
Taxes: 1.5, Taxes: 1.5,
}, },
"Airport": { "Airport": {
Name: "Airport", Name: "Airport",
Price: 25.0, Price: 25.0,
}, },
"Port": { "Port": {
Name: "Port", Name: "Port",
Price: 20.0, Price: 20.0,
}, },
"Transport": { "Transport": {
Name: "Transport", Name: "Transport",
Price: 20.0, Price: 20.0,

View file

@ -6,7 +6,7 @@ import (
"github.com/rjNemo/rentease/internal/config" "github.com/rjNemo/rentease/internal/config"
) )
func (bs Service) CreateItem(bookingId int, item config.HostItem, quantity int, price float64, paymentMethod string, customerNumber int) (items []*Item) { func (bs Service) CreateItem(bookingId int, item config.HostItem, quantity int, price float64, paymentMethod string, customerNumber int, platform string) (items []*Item) {
i := &Item{ i := &Item{
BookingId: bookingId, BookingId: bookingId,
Item: item.Name, Item: item.Name,
@ -19,7 +19,7 @@ func (bs Service) CreateItem(bookingId int, item config.HostItem, quantity int,
} }
items = append(items, i) items = append(items, i)
if item.Taxes != 0.0 { if item.Taxes != 0.0 && platform == "Booking" {
ti := &Item{ ti := &Item{
BookingId: bookingId, BookingId: bookingId,
Item: "Taxes", Item: "Taxes",