Skip to content

Commit

Permalink
Remove the holiday table and related code
Browse files Browse the repository at this point in the history
  • Loading branch information
akheron committed Nov 13, 2024
1 parent 5002342 commit 5537b74
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 128 deletions.
20 changes: 3 additions & 17 deletions frontend/src/e2e-test/dev-api/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ import {
createEmployeePins,
createFeeThresholds,
createFridgeChild,
createHoliday,
createHolidayPeriod,
createHolidayQuestionnaire,
createIncome,
Expand Down Expand Up @@ -128,7 +127,6 @@ import {
DevEmployee,
DevEmployeePin,
DevFridgeChild,
DevHoliday,
DevIncome,
DevInvoice,
DevParentship,
Expand Down Expand Up @@ -872,14 +870,6 @@ export class Fixture {
})
}

static holiday(initial?: Partial<DevHoliday>): HolidayBuilder {
return new HolidayBuilder({
date: LocalDate.todayInHelsinkiTz(),
description: 'Holiday description',
...initial
})
}

static guardian(child: DevPerson, guardian: DevPerson) {
return new GuardianBuilder({
childId: child.id,
Expand Down Expand Up @@ -1647,13 +1637,6 @@ export class HolidayQuestionnaireBuilder extends FixtureBuilder<FixedPeriodQuest
}
}

export class HolidayBuilder extends FixtureBuilder<DevHoliday> {
async save() {
await createHoliday({ body: this.data })
return this.data
}
}

export class GuardianBuilder extends FixtureBuilder<{
guardianId: string
childId: string
Expand Down Expand Up @@ -3073,6 +3056,9 @@ export const testDaycareGroup: DevDaycareGroup = {
jamixCustomerNumber: null
}

/**
* @deprecated Use `Fixture.placement()` instead
**/
export function createDaycarePlacementFixture(
id: string,
childId: string,
Expand Down
22 changes: 0 additions & 22 deletions frontend/src/e2e-test/generated/api-clients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ import { DevFosterParent } from './api-types'
import { DevFridgeChild } from './api-types'
import { DevFridgePartner } from './api-types'
import { DevGuardian } from './api-types'
import { DevHoliday } from './api-types'
import { DevIncome } from './api-types'
import { DevInvoice } from './api-types'
import { DevMobileDevice } from './api-types'
Expand Down Expand Up @@ -1044,27 +1043,6 @@ export async function createFridgePartner(
}


/**
* Generated from fi.espoo.evaka.shared.dev.DevApi.createHoliday
*/
export async function createHoliday(
request: {
body: DevHoliday
}
): Promise<void> {
try {
const { data: json } = await devClient.request<JsonOf<void>>({
url: uri`/holiday`.toString(),
method: 'POST',
data: request.body satisfies JsonCompatible<DevHoliday>
})
return json
} catch (e) {
throw new DevApiError(e)
}
}


/**
* Generated from fi.espoo.evaka.shared.dev.DevApi.createHolidayPeriod
*/
Expand Down
16 changes: 0 additions & 16 deletions frontend/src/e2e-test/generated/api-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -610,14 +610,6 @@ export interface DevGuardian {
guardianId: UUID
}

/**
* Generated from fi.espoo.evaka.shared.dev.DevHoliday
*/
export interface DevHoliday {
date: LocalDate
description: string
}

/**
* Generated from fi.espoo.evaka.shared.dev.DevIncome
*/
Expand Down Expand Up @@ -1382,14 +1374,6 @@ export function deserializeJsonDevFridgePartner(json: JsonOf<DevFridgePartner>):
}


export function deserializeJsonDevHoliday(json: JsonOf<DevHoliday>): DevHoliday {
return {
...json,
date: LocalDate.parseIso(json.date)
}
}


export function deserializeJsonDevIncome(json: JsonOf<DevIncome>): DevIncome {
return {
...json,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ fun Database.Transaction.ensureDevData() {
"employees.sql",
"preschool-terms.sql",
"club-terms.sql",
"holidays.sql",
)
.forEach { runDevScript(it) }
}
Expand All @@ -151,18 +150,6 @@ RETURNING id
.executeAndReturnGeneratedKeys()
.exactlyOne()

fun Database.Transaction.insert(holiday: DevHoliday) {
createUpdate {
sql(
"""
INSERT INTO holiday (date, description)
VALUES (${bind(holiday.date)}, ${bind(holiday.description)})
"""
)
}
.execute()
}

fun Database.Transaction.insert(holidayPeriod: DevHolidayPeriod) {
createUpdate {
sql(
Expand Down
7 changes: 0 additions & 7 deletions service/src/main/kotlin/fi/espoo/evaka/shared/dev/DevApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -952,11 +952,6 @@ UPDATE placement SET end_date = ${bind(req.endDate)}, termination_requested_date
}
}

@PostMapping("/holiday")
fun createHoliday(db: Database, @RequestBody holiday: DevHoliday) {
db.connect { dbc -> dbc.transaction { tx -> tx.insert(holiday) } }
}

@PostMapping("/holiday-period/questionnaire/{id}")
fun createHolidayQuestionnaire(
db: Database,
Expand Down Expand Up @@ -1835,8 +1830,6 @@ data class DevChild(
val mealTextureId: Int? = null,
)

data class DevHoliday(val date: LocalDate, val description: String = "Test Holiday")

data class DevHolidayPeriod(
val id: HolidayPeriodId = HolidayPeriodId(UUID.randomUUID()),
val period: FiniteDateRange =
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE holiday;
53 changes: 0 additions & 53 deletions service/src/main/resources/dev-data/holidays.sql

This file was deleted.

1 change: 1 addition & 0 deletions service/src/main/resources/migrations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -457,3 +457,4 @@ V458__income_adjustments_modified_metadata.sql
V459__modified_for_message_draft.sql
V460__modification_metadata.sql
V461__replacement_invoices.sql
V462__drop_table_holiday.sql

0 comments on commit 5537b74

Please sign in to comment.