Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Tier Pricing with Postgres DB #1974

Open
inluxc opened this issue Oct 1, 2024 · 3 comments
Open

Adding Tier Pricing with Postgres DB #1974

inluxc opened this issue Oct 1, 2024 · 3 comments
Labels
bug Something isn't working unconfirmed

Comments

@inluxc
Copy link

inluxc commented Oct 1, 2024

  • Lunar version: 1.x latest
  • Laravel Version: 11.9
  • PHP Version: 8.3.12
  • Database Driver & Version: Postgres v17

Expected Behaviour:

Add Tier Price to Product

Actual Behaviour:

SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for type bigint: "9.99" CONTEXT: unnamed portal parameter $1 = '...' (Connection: pgsql, SQL: select count(*) as aggregate from "lunar_prices" where "price" = 9.99 and "customer_group_id" = 1 and "min_quantity" = 1 and "currency_id" = 1 and "priceable_type" = product_variant and "priceable_id" = 1)

Steps To Reproduce:

@inluxc inluxc added bug Something isn't working unconfirmed labels Oct 1, 2024
@glennjacobs
Copy link
Contributor

It looks like it's trying to compare a decimal price to an integer field and naturally Postgres is not happy about that.

@glennjacobs
Copy link
Contributor

Do you have the stack trace we could take a look at?

@inluxc
Copy link
Author

inluxc commented Oct 1, 2024

[previous exception] [object] (PDOException(code: 22P02): SQLSTATE[22P02]: Invalid text representation: 7 ERROR:  invalid input syntax for type bigint: \"9.99\"
CONTEXT:  unnamed portal parameter $1 = '...' at /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Database/Connection.php:412)
[stacktrace]
#0 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Database/Connection.php(412): PDOStatement->execute()
#1 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Database/Connection.php(812): Illuminate\\Database\\Connection->Illuminate\\Database\\{closure}()
#2 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Database/Connection.php(779): Illuminate\\Database\\Connection->runQueryCallback()
#3 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Database/Connection.php(398): Illuminate\\Database\\Connection->run()
#4 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3130): Illuminate\\Database\\Connection->select()
#5 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3115): Illuminate\\Database\\Query\\Builder->runSelect()
#6 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3703): Illuminate\\Database\\Query\\Builder->Illuminate\\Database\\Query\\{closure}()
#7 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3114): Illuminate\\Database\\Query\\Builder->onceWithColumns()
#8 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3630): Illuminate\\Database\\Query\\Builder->get()
#9 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3558): Illuminate\\Database\\Query\\Builder->aggregate()
#10 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Validation/DatabasePresenceVerifier.php(54): Illuminate\\Database\\Query\\Builder->count()
#11 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Validation/Concerns/ValidatesAttributes.php(1026): Illuminate\\Validation\\DatabasePresenceVerifier->getCount()
#12 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Validation/Validator.php(664): Illuminate\\Validation\\Validator->validateUnique()
#13 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Validation/Validator.php(459): Illuminate\\Validation\\Validator->validateAttribute()
#14 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Validation/Validator.php(494): Illuminate\\Validation\\Validator->passes()
#15 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Validation/Validator.php(536): Illuminate\\Validation\\Validator->fails()
#16 /home/fulvio/Projects/PromoMechanics/lunar/vendor/livewire/livewire/src/Features/SupportValidation/HandlesValidation.php(265): Illuminate\\Validation\\Validator->validate()
#17 /home/fulvio/Projects/PromoMechanics/lunar/vendor/filament/forms/src/Concerns/InteractsWithForms.php(217): Livewire\\Component->validate()
#18 /home/fulvio/Projects/PromoMechanics/lunar/vendor/filament/forms/src/Concerns/CanBeValidated.php(121): Filament\\Resources\\RelationManagers\\RelationManager->validate()
#19 /home/fulvio/Projects/PromoMechanics/lunar/vendor/filament/forms/src/Concerns/HasState.php(226): Filament\\Forms\\ComponentContainer->validate()
#20 /home/fulvio/Projects/PromoMechanics/lunar/vendor/filament/tables/src/Concerns/HasActions.php(100): Filament\\Forms\\ComponentContainer->getState()
#21 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Filament\\Resources\\RelationManagers\\RelationManager->callMountedTableAction()
#22 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Container/Util.php(43): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#23 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(95): Illuminate\\Container\\Util::unwrapIfClosure()
#24 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod()
#25 /home/fulvio/Projects/PromoMechanics/lunar/vendor/livewire/livewire/src/Wrapped.php(23): Illuminate\\Container\\BoundMethod::call()
#26 /home/fulvio/Projects/PromoMechanics/lunar/vendor/livewire/livewire/src/Mechanisms/HandleComponents/HandleComponents.php(474): Livewire\\Wrapped->__call()
#27 /home/fulvio/Projects/PromoMechanics/lunar/vendor/livewire/livewire/src/Mechanisms/HandleComponents/HandleComponents.php(101): Livewire\\Mechanisms\\HandleComponents\\HandleComponents->callMethods()
#28 /home/fulvio/Projects/PromoMechanics/lunar/vendor/livewire/livewire/src/LivewireManager.php(97): Livewire\\Mechanisms\\HandleComponents\\HandleComponents->update()
#29 /home/fulvio/Projects/PromoMechanics/lunar/vendor/livewire/livewire/src/Mechanisms/HandleRequests/HandleRequests.php(94): Livewire\\LivewireManager->update()
#30 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(46): Livewire\\Mechanisms\\HandleRequests\\HandleRequests->handleUpdate()
#31 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Routing/Route.php(262): Illuminate\\Routing\\ControllerDispatcher->dispatch()
#32 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Routing/Route.php(208): Illuminate\\Routing\\Route->runController()
#33 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Routing/Router.php(808): Illuminate\\Routing\\Route->run()
#34 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#35 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(51): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#36 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()
#37 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(88): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#38 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle()
#39 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#40 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle()
#41 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#42 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest()
#43 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Session\\Middleware\\StartSession->handle()
#44 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#45 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle()
#46 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(75): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#47 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle()
#48 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#49 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Routing/Router.php(807): Illuminate\\Pipeline\\Pipeline->then()
#50 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Routing/Router.php(786): Illuminate\\Routing\\Router->runRouteWithinStack()
#51 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Routing/Router.php(750): Illuminate\\Routing\\Router->runRoute()
#52 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Routing/Router.php(739): Illuminate\\Routing\\Router->dispatchToRoute()
#53 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(201): Illuminate\\Routing\\Router->dispatch()
#54 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
#55 /home/fulvio/Projects/PromoMechanics/lunar/vendor/livewire/livewire/src/Features/SupportDisablingBackButtonCache/DisableBackButtonCacheMiddleware.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#56 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Livewire\\Features\\SupportDisablingBackButtonCache\\DisableBackButtonCacheMiddleware->handle()
#57 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#58 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle()
#59 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(47): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#60 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle()
#61 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#62 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Http\\Middleware\\ValidatePostSize->handle()
#63 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(110): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#64 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle()
#65 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#66 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Http\\Middleware\\HandleCors->handle()
#67 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(58): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#68 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Http\\Middleware\\TrustProxies->handle()
#69 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/InvokeDeferredCallbacks.php(22): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#70 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\InvokeDeferredCallbacks->handle()
#71 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#72 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(176): Illuminate\\Pipeline\\Pipeline->then()
#73 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(145): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#74 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1188): Illuminate\\Foundation\\Http\\Kernel->handle()
#75 /home/fulvio/Projects/PromoMechanics/lunar/public/index.php(17): Illuminate\\Foundation\\Application->handleRequest()
#76 /home/fulvio/Projects/PromoMechanics/lunar/vendor/laravel/framework/src/Illuminate/Foundation/resources/server.php(23): require_once('...')
#77 {main}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unconfirmed
Projects
None yet
Development

No branches or pull requests

2 participants