-
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.
ATS client push API: New POST API, New backend type for ATSClient, at…
…sController, route, services, validator updated Backend unti test added New ATSClientResource type, ATSUserResponse type, frontend components updated
- Loading branch information
1 parent
b16cd66
commit 19fa94b
Showing
14 changed files
with
440 additions
and
86 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { BasicResponse } from '../utils/enums/application'; | ||
|
||
type AddressResource = { | ||
'@type': 'AddressResource'; | ||
addressLine1: string; | ||
addressLine2: string | null; | ||
city: string; | ||
provinceCode: string; | ||
countryCode: string; | ||
postalCode: string | null; | ||
primaryPhone: string; | ||
email: string; | ||
}; | ||
|
||
export type ATSClientResource = { | ||
'@type': 'ClientResource'; | ||
address: AddressResource; | ||
firstName: string; | ||
surName: string; | ||
regionName: string; | ||
optOutOfBCStatSurveyInd: BasicResponse.YES | BasicResponse.NO; | ||
createdBy: string; | ||
}; |
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,33 @@ | ||
import Joi from 'joi'; | ||
|
||
import { validate } from '../middleware/validation'; | ||
|
||
import { BasicResponse } from '../utils/enums/application'; | ||
|
||
const addressBody = { | ||
'@type': Joi.string().valid('AddressResource'), | ||
addressLine1: Joi.string().max(255).allow(null), | ||
city: Joi.string().max(255).allow(null), | ||
provinceCode: Joi.string().max(255).allow(null), | ||
primaryPhone: Joi.string().max(255).allow(null), | ||
email: Joi.string().max(255).allow(null) | ||
}; | ||
|
||
const clientBody = { | ||
'@type': Joi.string().valid('ClientResource'), | ||
firstName: Joi.string().max(255).required(), | ||
surName: Joi.string().max(255).required(), | ||
regionName: Joi.string().max(255).required(), | ||
optOutOfBCStatSurveyInd: Joi.string().valid(BasicResponse.NO.toUpperCase()), | ||
address: Joi.object(addressBody).allow(null) | ||
}; | ||
|
||
const schema = { | ||
createATSClient: { | ||
body: Joi.object(clientBody) | ||
} | ||
}; | ||
|
||
export default { | ||
createATSClient: validate(schema.createATSClient) | ||
}; |
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
Oops, something went wrong.