Skip to content

Commit

Permalink
Refactor findPermit function (#1795)
Browse files Browse the repository at this point in the history
* Refactor findPermit function

https://eaflood.atlassian.net/browse/IWTF-3375

Refactor this function so that it doesn't modify parameters anymore
  • Loading branch information
jaucourt authored Sep 29, 2023
1 parent 49cfa4d commit 0ea605b
Show file tree
Hide file tree
Showing 12 changed files with 402 additions and 251 deletions.
52 changes: 52 additions & 0 deletions packages/gafl-webapp-service/src/__mocks__/data/permits.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ export default [
isForFulfilment: false,
isCounterSales: true,
cost: 6,
newCost: 7,
newCostStartDate: '2023-04-01T00:00:00.000Z',
itemId: '42289'
},
{
Expand Down Expand Up @@ -71,6 +73,8 @@ export default [
isForFulfilment: false,
isCounterSales: true,
cost: 6,
newCost: 7,
newCostStartDate: '2023-04-01T00:00:00.000Z',
itemId: '42290'
},
{
Expand Down Expand Up @@ -108,6 +112,8 @@ export default [
isForFulfilment: true,
isCounterSales: true,
cost: 12,
newCost: 13,
newCostStartDate: '2023-04-01T00:00:00.000Z',
itemId: '42361'
},
{
Expand Down Expand Up @@ -145,6 +151,8 @@ export default [
isForFulfilment: true,
isCounterSales: true,
cost: 12,
newCost: 13,
newCostStartDate: '2023-04-01T00:00:00.000Z',
itemId: '42363'
},
{
Expand Down Expand Up @@ -182,6 +190,8 @@ export default [
isForFulfilment: false,
isCounterSales: true,
cost: 12,
newCost: 13,
newCostStartDate: '2023-04-01T00:00:00.000Z',
itemId: '42305'
},
{
Expand Down Expand Up @@ -219,6 +229,8 @@ export default [
isForFulfilment: false,
isCounterSales: true,
cost: 12,
newCost: 13,
newCostStartDate: '2023-04-01T00:00:00.000Z',
itemId: '42307'
},
{
Expand Down Expand Up @@ -256,6 +268,8 @@ export default [
isForFulfilment: true,
isCounterSales: true,
cost: 27,
newCost: 28,
newCostStartDate: '2023-04-01T00:00:00.000Z',
itemId: '42365'
},
{
Expand Down Expand Up @@ -293,6 +307,8 @@ export default [
isForFulfilment: true,
isCounterSales: true,
cost: 27,
newCost: 28,
newCostStartDate: '2023-04-01T00:00:00.000Z',
itemId: '42370'
},
{
Expand Down Expand Up @@ -330,6 +346,8 @@ export default [
isForFulfilment: false,
isCounterSales: false,
cost: 0,
newCost: 0,
newCostStartDate: '2023-04-01T00:00:00.000Z',
itemId: null
},
{
Expand Down Expand Up @@ -367,6 +385,8 @@ export default [
isForFulfilment: true,
isCounterSales: true,
cost: 30,
newCost: 31,
newCostStartDate: '2023-04-01T00:00:00.000Z',
itemId: '42309'
},
{
Expand Down Expand Up @@ -404,6 +424,8 @@ export default [
isForFulfilment: true,
isCounterSales: true,
cost: 20,
newCost: 21,
newCostStartDate: '2023-04-01T00:00:00.000Z',
itemId: '42335'
},
{
Expand Down Expand Up @@ -441,6 +463,8 @@ export default [
isForFulfilment: false,
isCounterSales: false,
cost: 0,
newCost: 0,
newCostStartDate: '2023-04-01T00:00:00.000Z',
itemId: null
},
{
Expand Down Expand Up @@ -478,6 +502,8 @@ export default [
isForFulfilment: true,
isCounterSales: true,
cost: 20,
newCost: 21,
newCostStartDate: '2023-04-01T00:00:00.000Z',
itemId: '42337'
},
{
Expand Down Expand Up @@ -515,6 +541,8 @@ export default [
isForFulfilment: true,
isCounterSales: true,
cost: 20,
newCost: 21,
newCostStartDate: '2023-04-01T00:00:00.000Z',
itemId: '42339'
},
{
Expand Down Expand Up @@ -552,6 +580,8 @@ export default [
isForFulfilment: false,
isCounterSales: false,
cost: 0,
newCost: 0,
newCostStartDate: '2023-04-01T00:00:00.000Z',
itemId: null
},
{
Expand Down Expand Up @@ -589,6 +619,8 @@ export default [
isForFulfilment: true,
isCounterSales: true,
cost: 45,
newCost: 46,
newCostStartDate: '2023-04-01T00:00:00.000Z',
itemId: '42341'
},
{
Expand Down Expand Up @@ -626,6 +658,8 @@ export default [
isForFulfilment: true,
isCounterSales: true,
cost: 30,
newCost: 31,
newCostStartDate: '2023-04-01T00:00:00.000Z',
itemId: '42343'
},
{
Expand Down Expand Up @@ -663,6 +697,8 @@ export default [
isForFulfilment: false,
isCounterSales: false,
cost: 0,
newCost: 0,
newCostStartDate: '2023-04-01T00:00:00.000Z',
itemId: null
},
{
Expand Down Expand Up @@ -700,6 +736,8 @@ export default [
isForFulfilment: true,
isCounterSales: true,
cost: 30,
newCost: 31,
newCostStartDate: '2023-04-01T00:00:00.000Z',
itemId: '42345'
},
{
Expand Down Expand Up @@ -737,6 +775,8 @@ export default [
isForFulfilment: true,
isCounterSales: true,
cost: 30,
newCost: 31,
newCostStartDate: '2023-04-01T00:00:00.000Z',
itemId: '42347'
},
{
Expand Down Expand Up @@ -774,6 +814,8 @@ export default [
isForFulfilment: true,
isCounterSales: false,
cost: 0,
newCost: 0,
newCostStartDate: '2023-04-01T00:00:00.000Z',
itemId: null
},
{
Expand Down Expand Up @@ -811,6 +853,8 @@ export default [
isForFulfilment: true,
isCounterSales: true,
cost: 82,
newCost: 83,
newCostStartDate: '2023-04-01T00:00:00.000Z',
itemId: '42372'
},
{
Expand Down Expand Up @@ -848,6 +892,8 @@ export default [
isForFulfilment: true,
isCounterSales: true,
cost: 54,
newCost: 55,
newCostStartDate: '2023-04-01T00:00:00.000Z',
itemId: '42374'
},
{
Expand Down Expand Up @@ -885,6 +931,8 @@ export default [
isForFulfilment: true,
isCounterSales: false,
cost: 0,
newCost: 0,
newCostStartDate: '2023-04-01T00:00:00.000Z',
itemId: null
},
{
Expand Down Expand Up @@ -922,6 +970,8 @@ export default [
isForFulfilment: true,
isCounterSales: true,
cost: 54,
newCost: 55,
newCostStartDate: '2023-04-01T00:00:00.000Z',
itemId: '42376'
},
{
Expand Down Expand Up @@ -959,6 +1009,8 @@ export default [
isForFulfilment: true,
isCounterSales: true,
cost: 54,
newCost: 55,
newCostStartDate: '2023-04-01T00:00:00.000Z',
itemId: '42378'
}
]
Loading

0 comments on commit 0ea605b

Please sign in to comment.