Skip to content

Commit

Permalink
fix: make period optional
Browse files Browse the repository at this point in the history
  • Loading branch information
hongaar committed Mar 11, 2023
1 parent b97e6ad commit e3f01de
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 9 deletions.
48 changes: 40 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
---

## Table of contents

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

Expand All @@ -20,19 +22,23 @@
- [SDK](#sdk)
- [Installation](#installation-1)
- [Usage](#usage-1)
- [Credits](#credits)
- [Contributing](#contributing)
- [Roadmap](#roadmap)
- [Development](#development)
- [Devcontainer](#devcontainer)
- [Credits](#credits)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## CLI
# CLI

### Installation
## Installation

```bash
yarn|npm add @motorrijtuigenbelasting/cli
```

### Usage
## Usage

Show help:

Expand Down Expand Up @@ -66,9 +72,9 @@ yarn dlx|npx @motorrijtuigenbelasting/cli \
> **Note**: App token can be obtained after registering at the
> [RDW open data portal](https://opendata.rdw.nl/signup).
## SDK
# SDK

### Installation
## Installation

```bash
yarn|npm add @motorrijtuigenbelasting/core @motorrijtuigenbelasting/mrb2023
Expand All @@ -78,7 +84,7 @@ yarn|npm add @motorrijtuigenbelasting/core @motorrijtuigenbelasting/mrb2023
> the corresponding package. See elsewhere in this README to see a list of
> supported revisions.
### Usage
## Usage

```js
import {
Expand All @@ -96,11 +102,37 @@ const params = {
province: Province.Utrecht,
};

const results = run(mrb2023, params, period);
const results = run(mrb2023, params);

console.log({ results });
```

# Contributing

Contributions are very welcome!

## Roadmap

- [ ] implement missing propulsiontypes
- [ ] implement missing vehicletypes
- [ ] implement betalennaargebruik package

Also see [TODO.md](TODO.md).

## Development

To run the `@motorrijtuigenbelasting/cli` package from source, run:

```bash
cd packages/cli
yarn start
```

## Devcontainer

A devcontainer configuration is included in this repo to
[get started quickly](https://code.visualstudio.com/docs/remote/containers#_quick-start-open-an-existing-folder-in-a-container).

## Credits

©️ Copyright 2023 [Joram van den Boezem](https://joram.dev)
Expand Down
6 changes: 5 additions & 1 deletion packages/core/src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ export function calculateTotal(
};
}

export function run(model: Model, params: Params, period: Period) {
export function run(
model: Model,
params: Params,
period: Period = Period.quarter
) {
const components = model(params);
const { mileage } = params;

Expand Down

0 comments on commit e3f01de

Please sign in to comment.