mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-28 20:53:24 +10:00
Update line item code keywords
This commit is contained in:
parent
a0cf294748
commit
47e9adb85b
9 changed files with 32 additions and 32 deletions
|
|
@ -10,7 +10,7 @@ export const Checkout = {
|
|||
userRole: 'customer',
|
||||
lineItems: [
|
||||
{
|
||||
code: 'line-item.purchase/night',
|
||||
code: 'line-item/night',
|
||||
quantity: new Decimal(2),
|
||||
unitPrice: new types.Money(4500, 'USD'),
|
||||
lineTotal: new types.Money(9000, 'USD'),
|
||||
|
|
@ -28,7 +28,7 @@ export const CustomerOrder = {
|
|||
userRole: 'customer',
|
||||
lineItems: [
|
||||
{
|
||||
code: 'line-item.purchase/night',
|
||||
code: 'line-item/night',
|
||||
quantity: new Decimal(2),
|
||||
unitPrice: new types.Money(4500, 'USD'),
|
||||
lineTotal: new types.Money(9000, 'USD'),
|
||||
|
|
@ -46,13 +46,13 @@ export const ProviderSale = {
|
|||
userRole: 'provider',
|
||||
lineItems: [
|
||||
{
|
||||
code: 'line-item.purchase/night',
|
||||
code: 'line-item/night',
|
||||
quantity: new Decimal(2),
|
||||
unitPrice: new types.Money(4500, 'USD'),
|
||||
lineTotal: new types.Money(9000, 'USD'),
|
||||
},
|
||||
{
|
||||
code: 'line-item.commission/provider',
|
||||
code: 'line-item/provider-commission',
|
||||
unitPrice: new types.Money(-2000, 'USD'),
|
||||
lineTotal: new types.Money(-2000, 'USD'),
|
||||
},
|
||||
|
|
@ -69,13 +69,13 @@ export const ProviderSaleZeroCommission = {
|
|||
userRole: 'provider',
|
||||
lineItems: [
|
||||
{
|
||||
code: 'line-item.purchase/night',
|
||||
code: 'line-item/night',
|
||||
quantity: new Decimal(2),
|
||||
unitPrice: new types.Money(4500, 'USD'),
|
||||
lineTotal: new types.Money(9000, 'USD'),
|
||||
},
|
||||
{
|
||||
code: 'line-item.commission/provider',
|
||||
code: 'line-item/provider-commission',
|
||||
unitPrice: new types.Money(0, 'USD'),
|
||||
lineTotal: new types.Money(0, 'USD'),
|
||||
},
|
||||
|
|
@ -92,13 +92,13 @@ export const ProviderSaleSingleNight = {
|
|||
userRole: 'provider',
|
||||
lineItems: [
|
||||
{
|
||||
code: 'line-item.purchase/night',
|
||||
code: 'line-item/night',
|
||||
quantity: new Decimal(1),
|
||||
unitPrice: new types.Money(4500, 'USD'),
|
||||
lineTotal: new types.Money(4500, 'USD'),
|
||||
},
|
||||
{
|
||||
code: 'line-item.commission/provider',
|
||||
code: 'line-item/provider-commission',
|
||||
unitPrice: new types.Money(-2000, 'USD'),
|
||||
lineTotal: new types.Money(-2000, 'USD'),
|
||||
},
|
||||
|
|
|
|||
|
|
@ -58,8 +58,8 @@ export const BookingBreakdownComponent = props => {
|
|||
/>
|
||||
);
|
||||
|
||||
const nightPurchase = lineItems.find(item => item.code === 'line-item.purchase/night');
|
||||
const providerCommission = lineItems.find(item => item.code === 'line-item.commission/provider');
|
||||
const nightPurchase = lineItems.find(item => item.code === 'line-item/night');
|
||||
const providerCommission = lineItems.find(item => item.code === 'line-item/provider-commission');
|
||||
|
||||
const nightCount = nightPurchase.quantity.toFixed();
|
||||
const nightCountMessage = (
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ describe('BookingBreakdown', () => {
|
|||
userRole="customer"
|
||||
lineItems={[
|
||||
{
|
||||
code: 'line-item.purchase/night',
|
||||
code: 'line-item/night',
|
||||
quantity: new Decimal(2),
|
||||
lineTotal: new types.Money(2000, 'USD'),
|
||||
unitPrice: new types.Money(1000, 'USD'),
|
||||
|
|
@ -36,7 +36,7 @@ describe('BookingBreakdown', () => {
|
|||
payinTotal={new types.Money(2000, 'USD')}
|
||||
lineItems={[
|
||||
{
|
||||
code: 'line-item.purchase/night',
|
||||
code: 'line-item/night',
|
||||
quantity: new Decimal(2),
|
||||
lineTotal: new types.Money(2000, 'USD'),
|
||||
unitPrice: new types.Money(1000, 'USD'),
|
||||
|
|
@ -58,13 +58,13 @@ describe('BookingBreakdown', () => {
|
|||
userRole="provider"
|
||||
lineItems={[
|
||||
{
|
||||
code: 'line-item.purchase/night',
|
||||
code: 'line-item/night',
|
||||
quantity: new Decimal(2),
|
||||
lineTotal: new types.Money(2000, 'USD'),
|
||||
unitPrice: new types.Money(1000, 'USD'),
|
||||
},
|
||||
{
|
||||
code: 'line-item.commission/provider',
|
||||
code: 'line-item/provider-commission',
|
||||
lineTotal: new types.Money(-200, 'USD'),
|
||||
unitPrice: new types.Money(-200, 'USD'),
|
||||
},
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ exports[`OrderDetailsPanel matches snapshot 1`] = `
|
|||
lineItems={
|
||||
Array [
|
||||
Object {
|
||||
"code": "line-item.purchase/night",
|
||||
"code": "line-item/night",
|
||||
"lineTotal": Money {
|
||||
"amount": 16500,
|
||||
"currency": "USD",
|
||||
|
|
@ -62,7 +62,7 @@ exports[`OrderDetailsPanel matches snapshot 1`] = `
|
|||
},
|
||||
},
|
||||
Object {
|
||||
"code": "line-item.commission/provider",
|
||||
"code": "line-item/provider-commission",
|
||||
"lineTotal": Money {
|
||||
"amount": -100,
|
||||
"currency": "USD",
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ exports[`SaleDetailsPanel matches snapshot 1`] = `
|
|||
lineItems={
|
||||
Array [
|
||||
Object {
|
||||
"code": "line-item.purchase/night",
|
||||
"code": "line-item/night",
|
||||
"lineTotal": Money {
|
||||
"amount": 16500,
|
||||
"currency": "USD",
|
||||
|
|
@ -61,7 +61,7 @@ exports[`SaleDetailsPanel matches snapshot 1`] = `
|
|||
},
|
||||
},
|
||||
Object {
|
||||
"code": "line-item.commission/provider",
|
||||
"code": "line-item/provider-commission",
|
||||
"lineTotal": Money {
|
||||
"amount": -1000,
|
||||
"currency": "USD",
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ exports[`InboxPage matches snapshot 1`] = `
|
|||
"lastTransitionedAt": 2017-01-15T00:00:00.000Z,
|
||||
"lineItems": Array [
|
||||
Object {
|
||||
"code": "line-item.purchase/night",
|
||||
"code": "line-item/night",
|
||||
"lineTotal": Money {
|
||||
"amount": 1000,
|
||||
"currency": "USD",
|
||||
|
|
@ -66,7 +66,7 @@ exports[`InboxPage matches snapshot 1`] = `
|
|||
},
|
||||
},
|
||||
Object {
|
||||
"code": "line-item.commission/provider",
|
||||
"code": "line-item/provider-commission",
|
||||
"lineTotal": Money {
|
||||
"amount": -100,
|
||||
"currency": "USD",
|
||||
|
|
@ -131,7 +131,7 @@ exports[`InboxPage matches snapshot 1`] = `
|
|||
"lastTransitionedAt": 2016-01-15T00:00:00.000Z,
|
||||
"lineItems": Array [
|
||||
Object {
|
||||
"code": "line-item.purchase/night",
|
||||
"code": "line-item/night",
|
||||
"lineTotal": Money {
|
||||
"amount": 1000,
|
||||
"currency": "USD",
|
||||
|
|
@ -143,7 +143,7 @@ exports[`InboxPage matches snapshot 1`] = `
|
|||
},
|
||||
},
|
||||
Object {
|
||||
"code": "line-item.commission/provider",
|
||||
"code": "line-item/provider-commission",
|
||||
"lineTotal": Money {
|
||||
"amount": -100,
|
||||
"currency": "USD",
|
||||
|
|
@ -285,7 +285,7 @@ exports[`InboxPage matches snapshot 3`] = `
|
|||
"lastTransitionedAt": 2017-01-15T00:00:00.000Z,
|
||||
"lineItems": Array [
|
||||
Object {
|
||||
"code": "line-item.purchase/night",
|
||||
"code": "line-item/night",
|
||||
"lineTotal": Money {
|
||||
"amount": 1000,
|
||||
"currency": "USD",
|
||||
|
|
@ -297,7 +297,7 @@ exports[`InboxPage matches snapshot 3`] = `
|
|||
},
|
||||
},
|
||||
Object {
|
||||
"code": "line-item.commission/provider",
|
||||
"code": "line-item/provider-commission",
|
||||
"lineTotal": Money {
|
||||
"amount": -100,
|
||||
"currency": "USD",
|
||||
|
|
@ -362,7 +362,7 @@ exports[`InboxPage matches snapshot 3`] = `
|
|||
"lastTransitionedAt": 2016-01-15T00:00:00.000Z,
|
||||
"lineItems": Array [
|
||||
Object {
|
||||
"code": "line-item.purchase/night",
|
||||
"code": "line-item/night",
|
||||
"lineTotal": Money {
|
||||
"amount": 1000,
|
||||
"currency": "USD",
|
||||
|
|
@ -374,7 +374,7 @@ exports[`InboxPage matches snapshot 3`] = `
|
|||
},
|
||||
},
|
||||
Object {
|
||||
"code": "line-item.commission/provider",
|
||||
"code": "line-item/provider-commission",
|
||||
"lineTotal": Money {
|
||||
"amount": -100,
|
||||
"currency": "USD",
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ exports[`OrderPage matches snapshot 1`] = `
|
|||
"lastTransitionedAt": 2017-06-01T00:00:00.000Z,
|
||||
"lineItems": Array [
|
||||
Object {
|
||||
"code": "line-item.purchase/night",
|
||||
"code": "line-item/night",
|
||||
"lineTotal": Money {
|
||||
"amount": 1000,
|
||||
"currency": "USD",
|
||||
|
|
@ -24,7 +24,7 @@ exports[`OrderPage matches snapshot 1`] = `
|
|||
},
|
||||
},
|
||||
Object {
|
||||
"code": "line-item.commission/provider",
|
||||
"code": "line-item/provider-commission",
|
||||
"lineTotal": Money {
|
||||
"amount": -100,
|
||||
"currency": "USD",
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ exports[`SalePage matches snapshot 1`] = `
|
|||
"lastTransitionedAt": 2017-06-01T00:00:00.000Z,
|
||||
"lineItems": Array [
|
||||
Object {
|
||||
"code": "line-item.purchase/night",
|
||||
"code": "line-item/night",
|
||||
"lineTotal": Money {
|
||||
"amount": 1000,
|
||||
"currency": "USD",
|
||||
|
|
@ -25,7 +25,7 @@ exports[`SalePage matches snapshot 1`] = `
|
|||
},
|
||||
},
|
||||
Object {
|
||||
"code": "line-item.commission/provider",
|
||||
"code": "line-item/provider-commission",
|
||||
"lineTotal": Money {
|
||||
"amount": -100,
|
||||
"currency": "USD",
|
||||
|
|
|
|||
|
|
@ -94,13 +94,13 @@ export const createTransaction = options => {
|
|||
payoutTotal: new Money(total.amount - commission.amount, total.currency),
|
||||
lineItems: [
|
||||
{
|
||||
code: 'line-item.purchase/night',
|
||||
code: 'line-item/night',
|
||||
quantity: new Decimal(nightCount),
|
||||
unitPrice: new Money(total.amount / nightCount, total.currency),
|
||||
lineTotal: total,
|
||||
},
|
||||
{
|
||||
code: 'line-item.commission/provider',
|
||||
code: 'line-item/provider-commission',
|
||||
unitPrice: new Money(commission.amount * -1, commission.currency),
|
||||
lineTotal: new Money(commission.amount * -1, commission.currency),
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue