Skip to content

Series sales form: buyer and seller must be different #503

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

Closed
php-coder opened this issue Nov 20, 2016 · 14 comments
Closed

Series sales form: buyer and seller must be different #503

php-coder opened this issue Nov 20, 2016 · 14 comments
Assignees
Milestone

Comments

@php-coder
Copy link
Owner

php-coder commented Nov 20, 2016

Steps to reproduce:

  • login as admin
  • open page with series info
  • fill series sales form with similar seller/buyer

Expected result:

  • error should be shown

Actual result:

  • form submitted successfully

Tech debt for: fe9f30d (#198)

@php-coder
Copy link
Owner Author

@Smetanin I'm suggesting you to work on this issue. If you're agree then assign it to yourself and add label in-progress.

The first step will be to reproduce validation issue. After that you need to write a validator to fix the issue. Actually, looks like that we already have similar validator that could be re-used. Look at FieldsMismatch and FieldsMismatchValidator

This is work flow instruction: https://github.com/php-coder/mystamps/wiki/dev_quick_start_continue

If you want some theory about validation, here are the links to documentation:

@php-coder
Copy link
Owner Author

Here is also example for how to use FieldsMismatch validator:

@FieldsMismatch(
first = "login",
second = "password",
message = "{password.login.match}",
groups = ActivateAccountForm.FormChecks.class
)
@FieldsMatch(
first = "password",
second = "passwordConfirmation",
message = "{password.mismatch}",
groups = ActivateAccountForm.FormChecks.class
)
public class ActivateAccountForm implements ActivateAccountDto {

@KrivenkoAlexander
Copy link
Contributor

KrivenkoAlexander commented Feb 18, 2019

@php-coder could you advise me where i can find this page * open page with series info ?
Do i right understand that this is the form
image

And we can't have the similar sales, right ? The example of bad case is : I created the two similar sales with Eicca Toppinen and John Conor with the same sum of selling .

@php-coder
Copy link
Owner Author

could you advise me where i can find this page * open page with series info ?

It's /series/1 for example.

Do i right understand that this is the form

Yes, it is.

And we can't have the similar sales, right ? The example of bad case is : I created the two similar sales with Eicca Toppinen and John Conor with the same sum of selling .

We can't have a series sale where a buyer is the same as a seller. Example: we can't create a sale with Eicca Toppinen as a seller and Eicca Toppinen as a buyer at the same time.

@KrivenkoAlexander
Copy link
Contributor

KrivenkoAlexander commented Feb 19, 2019 via email

@php-coder
Copy link
Owner Author

Could you say me , if i need to get the project with last changes, i need to start mvn spring-boot:run and this command fetch the last changes , right?

Yes, that command should be enough. It doesn't "fetch" anything because you already have it in a working directory. It will compile everything and run the project. In some cases, you may have to clean old compiled code first (mvn clean spring-boot:run) but it shouldn't be your case.

If so, then i did something wrong and have to re-make my solving :) I create new Annotation + but i don't Validator and apply this to the whole class see the error message.

There could be many different reasons for that.

Need to investigate more.

I'm sorry but I can't help you without seeing the code...

@KrivenkoAlexander
Copy link
Contributor

KrivenkoAlexander commented Feb 20, 2019 via email

@php-coder
Copy link
Owner Author

@KrivenkoAlexander I don't see the images on github. Also, why not just create a branch and push it? :)

@php-coder
Copy link
Owner Author

And i wanted to ask also where i can get the seller/buyer names?

The names don't matter, you can use mine, for example :)

@php-coder
Copy link
Owner Author

I created the Validator

By the way, most likely you don't need your own validator. See #503 (comment) :

Actually, looks like that we already have similar validator that could be re-used. Look at FieldsMismatch and FieldsMismatchValidator

@KrivenkoAlexander
Copy link
Contributor

KrivenkoAlexander commented Feb 21, 2019 via email

@KrivenkoAlexander
Copy link
Contributor

KrivenkoAlexander commented Feb 21, 2019 via email

@0pdd
Copy link

0pdd commented Feb 24, 2019

@php-coder the puzzle #1008 is still not solved.

@0pdd
Copy link

0pdd commented May 25, 2019

@php-coder the only puzzle #1008 is solved here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants