Open iamareebjamal opened 5 years ago
Will create sub-issues one by one and solve it
There are some concerns over current implementation of calculation, hence fixing them and adding tests before integration in frontend
@iamareebjamal So if I am sending an create-order
request with say the following payload:
{
"tickets": [
{"id": "14", "quantity": 2},
{"id": "13", "quantity": 1}
],
"attendee": {
"firstname": "John2",
"lastname": "Doe",
"email": "johndoe@example.com",
"attendee-notes": "example notes"
},
"event_id": "2",
"status": "completed"
}
Then in the complete-order
request payload, the first two attendee info's will be for ticket_id 14, and the last one for ticket_id 13.
For example:
{
"attendees": [
{
"firstname": "John1",
"lastname": "Doe1",
"email": "johndoe1@example.com",
"address": "address1"
},
{
"firstname": "John2",
"lastname": "Doe2",
"email": "johndoe2@example.com",
"address": "address2"
},
{
"firstname": "John3",
"lastname": "Doe3",
"email": "johndoe3@example.com",
"address": "address3"
}
],
"is-billing-enabled": true,
"company": "bill company",
"address": "bill address",
"city": "bill city",
"zipcode": "202001",
"country": "bill country",
"payment-mode": "onsite",
"tax-business-info": "bill info 123"
}
John1, and John2 details would go to ticket holders of ticket_id 14, and John3 will go to ticket holder of ticket_id 13.
Hmm, this needs some better mechanism. Will think of something
@iamareebjamal Hmmm, I also think so.
API Is now stable, so removing high priority
hii! I am new to this repo, but would like to start contributing. Can you tell what is remaining to work on in this issue?
There are a lot of issues in Order API and it does not fit the model of CRUD JSON RESTAPI without forcing clients to do unnecessary and buggy calculations.
Orders with tax and discounts cannot be modeled by just returning DB models and asking clients to create attendee, create order and handle ticket prices and discount code, etc
None of these APIs will be modeled by JSONAPI spec as they are not CRUD APIs with DB models backing them. Once they are finalized, the order and attendee API will be limited to just GET, and POST, PATCH and DELETE will be disabled