-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from bcgov/feat/post-in-person-visits
POST In Person Visits
- Loading branch information
Showing
19 changed files
with
521 additions
and
9 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,23 @@ | ||
const baseUrlEnvVarName = 'UPSTREAM_BASE_URL'; | ||
const supportNetworkEndpointEnvVarName = 'SUPPORT_NETWORK_ENDPOINT'; | ||
const inPersonVisitsEndpointEnvVarName = 'IN_PERSON_VISITS_ENDPOINT'; | ||
const postInPersonVisitsEndpointEnvVarName = 'IN_PERSON_VISITS_POST_ENDPOINT'; | ||
const attachmentsEndpointEnvVarName = 'ATTACHMENTS_ENDPOINT'; | ||
const idirUsernameHeaderField = 'x-idir-username'; | ||
const upstreamDateFormat = 'MM/dd/yyyy HH:mm:ss'; | ||
const childVisitType = 'In Person Child Youth'; | ||
const childVisitIdirFieldName = 'Login Name'; | ||
const childVisitEntityIdFieldName = 'Parent Id'; | ||
|
||
export { | ||
baseUrlEnvVarName, | ||
supportNetworkEndpointEnvVarName, | ||
inPersonVisitsEndpointEnvVarName, | ||
postInPersonVisitsEndpointEnvVarName, | ||
attachmentsEndpointEnvVarName, | ||
idirUsernameHeaderField, | ||
upstreamDateFormat, | ||
childVisitType, | ||
childVisitIdirFieldName, | ||
childVisitEntityIdFieldName, | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { plainToInstance } from 'class-transformer'; | ||
import { PostInPersonVisitDto } from './post-in-person-visit.dto'; | ||
import { VisitDetails } from '../common/constants/enumerations'; | ||
|
||
describe('PostInPersonVisitDto transform tests', () => { | ||
it.each([ | ||
['2024-10-24T22:16:24+0000', '10/24/2024 22:16:24'], | ||
['2020-12-31', '12/31/2020 00:00:00'], | ||
])( | ||
`should transform the date when given good, past ISO-8601 input`, | ||
(date, expected) => { | ||
const postInPersonVisit = { | ||
'Date of visit': date, | ||
'Visit Description': 'comment', | ||
'Visit Details Value': VisitDetails.ExemptionVisitOther, | ||
}; | ||
const postInPersonVisitDto = plainToInstance( | ||
PostInPersonVisitDto, | ||
postInPersonVisit, | ||
); | ||
expect(postInPersonVisitDto['Date of visit']).toBe(expected); | ||
}, | ||
); | ||
}); |
Oops, something went wrong.