Skip to content

Commit

Permalink
rename CommentedDateRange -> DateRange
Browse files Browse the repository at this point in the history
  • Loading branch information
fsimonjetz committed Feb 1, 2024
1 parent 3544c36 commit 7b6657e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
5 changes: 3 additions & 2 deletions src/fragmentarium/domain/archaeology.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class PartialDate {
: `${Math.abs(this.year)} BCE`
}
}
export type CommentedDateRange = {
export type DateRange = {
start: PartialDate
end?: PartialDate | null
notes?: string | null
Expand All @@ -72,7 +72,7 @@ export class Findspot {
readonly building: string = '',
readonly buildingType: BuildingType | null = null,
readonly levelLayerPhase: string = '',
readonly dateRange: CommentedDateRange | null = null,
readonly dateRange: DateRange | null = null,
readonly plans: readonly ExcavationPlan[] = [],
readonly room: string = '',
readonly context: string = '',
Expand Down Expand Up @@ -109,6 +109,7 @@ export interface Archaeology {
readonly excavationNumber?: string
readonly site?: ExcavationSite
readonly isRegularExcavation?: boolean
readonly excavationDate?: DateRange | null
readonly findspotId?: number | null
readonly findspot?: Findspot | null
}
9 changes: 2 additions & 7 deletions src/fragmentarium/domain/archaeologyDtos.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import createReference from 'bibliography/application/createReference'
import { ReferenceDto } from 'bibliography/domain/referenceDto'
import _ from 'lodash'
import {
Findspot,
ExcavationPlan,
PartialDate,
CommentedDateRange,
} from './archaeology'
import { Findspot, ExcavationPlan, PartialDate, DateRange } from './archaeology'
import { Archaeology, excavationSites, SiteKey } from './archaeology'

import MuseumNumber, { museumNumberToString } from './MuseumNumber'
Expand Down Expand Up @@ -91,7 +86,7 @@ function createPartialDate(dto): PartialDate {
return new PartialDate(dto.year, dto.month, dto.day)
}

function fromDateRangeDto(dto: CommentedDateRangeDto): CommentedDateRange {
function fromDateRangeDto(dto: CommentedDateRangeDto): DateRange {
return {
...dto,
start: createPartialDate(dto.start),
Expand Down
4 changes: 2 additions & 2 deletions src/test-support/fragment-fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { MesopotamianDate } from 'chronology/domain/Date'
import { mesopotamianDateFactory } from './date-fixtures'
import {
Archaeology,
CommentedDateRange,
DateRange,
ExcavationPlan,
Findspot,
PartialDate,
Expand Down Expand Up @@ -185,7 +185,7 @@ const partialDateFactory = Factory.define<PartialDate>(
}
)

export const dateRangeFactory = Factory.define<CommentedDateRange>(
export const dateRangeFactory = Factory.define<DateRange>(
({ transientParams }) => {
const chance = transientParams.chance ?? defaultChance
return {
Expand Down

0 comments on commit 7b6657e

Please sign in to comment.