bcgov / bcgov/entity

Edit UI: change to a more flexible way of updating filing fees

Open
#15,664 0 comments 0 reactions 0 assignees View on GitHub
ENTITY - DO NOT USE techdebt
Dominant language
JavaScript
Stars
23
Forks
62
Avg merge
24m
Merged PRs (30d)
1

Description

## TODO
- [ ] Only applies to alterations
- [ ] Modify to use store instead of logic in the component

## What is the problem?
The current system of calculating and updating filing fees is being stretched with new requirements. Here's a snippet of code that we use for restoration filings:

```javascript
// initialize Fee Summary data
const filingData = [this.alterationResource.filingData]
filingData.forEach(fd => {
fd.futureEffective = this.getEffectiveDateTime.isFutureEffective
})

this.setFilingData(filingData)

// update the current fees for this filing
await this.setCurrentFeesFromFilingData()

// update the fee prices for the notice changes
await this.setFeePricesFromFilingData(true)
```

## What is the impact?
The view must be aware of each and every filing fee and update as changes are made to the form.

## Proposed solution
Use the store to keep track filing fees. When users click an option that has fees attached, mutate the store. Similarly, when user deselect an option that has fees attached we remove the item and the associated cost from the store. This approach decouples logic and gives us more flexibility.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.