Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename RentalReport to HolidayRentalReport for improved clarity and c… #761

Merged
merged 1 commit into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading