Skip to content

Commit

Permalink
Merge pull request #761 from Amsterdam/improvement/HolidayRentalRepor…
Browse files Browse the repository at this point in the history
…t-type

Rename RentalReport to HolidayRentalReport for improved clarity and c…
  • Loading branch information
remyvdwereld authored Jan 2, 2025
2 parents 7cb706d + 2ce4679 commit b0d8fdb
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/components/HolidayRentalReports/HolidayRentalReports.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from "react"
import { Spinner } from "@amsterdam/asc-ui"
import type { RentalReport } from "./types"
import type { HolidayRentalReport } from "./types"
import ReportsPerYear from "./components/ReportsPerYear"
import Report from "./components/Report"
import { Placeholder, LoadingRows } from "../Data/components"

type Props = {
data: RentalReport[]
data: HolidayRentalReport[]
horizontalBordered?: boolean
loading?: boolean
loadingRows?: number
Expand Down
4 changes: 2 additions & 2 deletions src/components/HolidayRentalReports/components/Report.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import styled from "styled-components"
import { themeSpacing } from "@amsterdam/asc-ui"
import useReportValues from "./hooks/useReportValues"
import DefinitionList from "../../Data/DefinitionList/DefinitionList"
import type { RentalReport } from "../types"
import type { HolidayRentalReport } from "../types"

type Props = {
report: RentalReport
report: HolidayRentalReport
horizontalBordered: boolean
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import React from "react"
import styled from "styled-components"
import { themeSpacing } from "@amsterdam/asc-ui"
import DefinitionList from "../../Data/DefinitionList/DefinitionList"
import type { RentalReport } from "../types"
import type { HolidayRentalReport } from "../types"
import useReportsPerYearValues from "./hooks/useReportsPerYearValues"

type Props = {
data: RentalReport[]
data: HolidayRentalReport[]
}

export const TITLE = "Vakantieverhuur meldingen"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react"
import DateDisplay from "../../../DateDisplay/DateDisplay"
import type { RentalReport } from "../../types"
import type { HolidayRentalReport } from "../../types"

export default (report: RentalReport) => ({
export default (report: HolidayRentalReport) => ({
"Check in": <DateDisplay date={ report?.startDatum } />,
"Check out": <DateDisplay date={ report?.eindDatum } />,
"Gasten": report?.gasten,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dayjs from "dayjs"
import type { RentalReport } from "../../types"
import type { HolidayRentalReport } from "../../types"

export default (data: RentalReport[]) => {
export default (data: HolidayRentalReport[]) => {
let totals: { [key: string]: number } = {}
data.forEach((item) => {
// Don't count removed items
Expand Down
2 changes: 1 addition & 1 deletion src/components/HolidayRentalReports/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export type RentalReport = {
export type HolidayRentalReport = {
startDatum: string // date-time
eindDatum: string // date-time
nachten: number
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type CaseEvent from "./components/EventsTimeline/CaseEvent"
import type Permit from "./components/PermitsOverview/Permit"
import type PermitType from "./components/PermitsSynopsis/PermitType"
import type { HolidayRentalRegistration } from "./components/HolidayRentalRegistrations/types"
import type { RentalReport } from "./components/HolidayRentalReports/types"
import type { HolidayRentalReport } from "./components/HolidayRentalReports/types"
import type { DefinitionListData } from "./components/Data/DefinitionList/DefinitionList"
import type { ColumnType, Sorting } from "./components/Data/Table/types"

Expand Down Expand Up @@ -34,7 +34,7 @@ export type {
HolidayRentalRegistration,
Permit,
PermitType,
RentalReport,
HolidayRentalReport,
DefinitionListData,
ColumnType,
Sorting
Expand Down
4 changes: 2 additions & 2 deletions src/stories/mockedData/holidayRentalReportsData.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RentalReport } from "../../components/HolidayRentalReports/types"
import { HolidayRentalReport } from "../../components/HolidayRentalReports/types"

const holidayRentalData: RentalReport[] = [
const holidayRentalData: HolidayRentalReport[] = [
{
"startDatum": "2023-04-01T00:00:00Z",
"eindDatum": "2023-04-04T00:00:00Z",
Expand Down

0 comments on commit b0d8fdb

Please sign in to comment.