-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into search-page-alerts
- Loading branch information
Showing
47 changed files
with
186 additions
and
3,929 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
packages/api/router/location/lib.formatAddressVisibility.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { PrismaEnums } from '@weareinreach/db' | ||
|
||
export const formatAddressVisiblity = (location: ProvidedAddress) => { | ||
const address: ReformattedAddress = { | ||
street1: location.street1, | ||
street2: location.street2, | ||
city: location.city, | ||
postCode: location.postCode, | ||
govDist: location.govDist, | ||
latitude: location.latitude, | ||
longitude: location.longitude, | ||
} | ||
switch (location.addressVisibility) { | ||
case PrismaEnums.AddressVisibility.FULL: { | ||
return address | ||
} | ||
case PrismaEnums.AddressVisibility.PARTIAL: { | ||
address.street1 = null | ||
address.street2 = null | ||
return address | ||
} | ||
case PrismaEnums.AddressVisibility.HIDDEN: | ||
default: { | ||
address.street1 = null | ||
address.street2 = null | ||
address.city = null | ||
address.postCode = null | ||
address.govDist = null | ||
address.latitude = null | ||
address.longitude = null | ||
return address | ||
} | ||
} | ||
} | ||
|
||
type ReformattedAddress = { | ||
street1: string | null | ||
street2: string | null | ||
city: string | null | ||
postCode: string | null | ||
govDist: { | ||
tsKey: string | ||
tsNs: string | ||
abbrev: string | null | ||
} | null | ||
latitude: number | null | ||
longitude: number | null | ||
} | ||
type ProvidedAddress = Omit<ReformattedAddress, 'city'> & { | ||
city: string | ||
addressVisibility: PrismaEnums.AddressVisibility | ||
} & Record<string, unknown> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 0 additions & 82 deletions
82
packages/db/prisma/data-migrations/2024-01-31_fix-attr-supp-json/index.ts
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
packages/db/prisma/data-migrations/2024-01-31_fix-attr-supp-json/nulls.json
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
packages/db/prisma/data-migrations/2024-01-31_fix-attr-supp-json/serialize.json
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.