CRM Service - rettersoft/rbs-docs GitHub Wiki
CRM Service
UPDATE_EMAIL = 'rbs.profile.request.UPDATE_EMAIL',
UPDATE_MSISDN = 'rbs.profile.request.UPDATE_MSISDN',
GET_USER_PROFILE = 'rbs.profile.request.DATA',
GET_MY_PROFILE = 'rbs.profile.request.USER_DATA',
GET_PROFILE = 'rbs.profile.request.GET',
UPDATE_PROFILE = 'rbs.profile.request.UPDATE',
GET_SEGMENTS = 'rbs.profile.request.GET_SEGMENTS',
UPDATE_COMMUNICATE_CHOICE = 'rbs.profile.request.UPDATE_COMMUNICATE',
VALIDATE = 'rbs.profile.request.VALIDATE'
Models
export enum Gender {
FEMALE = "F",
MALE = "M",
UNKNOWN = "U"
}
export class UserSignedUpEvent {
uid: string
firstName: string
lastName: string
birthDate: string
phoneNumber: string
email: string
}
export class Profile {
uid?: string
firstName?: string
lastName?: string
birthDate?: string
receivePromotionalContent?: boolean
emailConfirmationCode?: string
email?: string
emailConfirmed: boolean
emailConfirmedAt: number
phoneNumber?: string
}
export class UpdatePersonalInfoRequest {
@IsDefined()
@IsString()
@MinLength(2)
firstName?: string
@IsDefined()
@IsString()
@MinLength(2)
lastName?: string
@IsOptional()
@Matches(/^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$/)
birthDate?: string
@IsOptional()
gender?: Gender
@IsDefined()
@IsBoolean()
receivePromotionalContent?: boolean
}
export class UpdateUserEmailRequest {
@IsDefined()
@IsEmail()
email?: string
}
Actions
rbs.profile.request.CREATE
Example Request:
{
"acceptedKvkk": boolean
"acceptedTems": boolean
"firstName": string
"lastName": string
"birthDate": string?
"receivePromotionalContent": boolean
"email": string
"phoneNumber": string => PHONE NUMBER MUST BE START 90... !!!
"communicationByPhone": boolean?
"communicationByEmail": boolean?
"gender": GENDER?
"priceSegment": string?
"tag": [{"tagType": string,
"tagName": string,
"tagValue": string }]?
"userExtraInformation": {"key": "value",...}?
}
rbs.profile.request.USER_DATA
Example Response:
{
"uid": string
"firstName": string
"lastName": string
"birthDate": string?
"gender": Gender?
"receivePromotionalContent": boolean
"emailConfirmationCode": string?
"email": string
"emailConfirmed": boolean
"emailConfirmedAt": number
"phoneNumber": string
"phoneNumberConfirmed": boolean
"phoneNumberConfirmedAt": number
"communicationByPhone": boolean
"communicationByEmail": boolean
"priceSegment": string
"tags": [Tag]
"userExtraInformation": object? -> //key value
}
rbs.profile.request.UPDATE_PROFILE
Example Request:
{
"firstName": string
"lastName": string
"receivePromotionalContent": boolean
"birthDate": string?
"acceptedKvkk": boolean?
"acceptedTerms": boolean?
"gender": GENDER? -> F,M,U
"email": string?
"communicationByEmail": boolean?
"communicationByPhone": boolean?
"userExtraInformation": object?
}
rbs.profile.request.UPDATE_COMMUNICATE
Example Request:
{
"communicationByPhone": boolean,
"communicationByEmail": boolean
}
rbs.profile.request.UPDATE_EMAIL
Example Request:
{
"email": string/email
}
rbs.profile.request.UPDATE_MSISDN
Example Request:
{
"oldMsisdn": string -> "90...",
"newMsisdn": string -> "90..."
}
rbs.profile.request.ADD_TAG
Example Request:
{
"userId": "84495906-823d-4835-a37d-ecb30dc7"
"tag": {
"tagName": "test"
"tagType": "test"
"tagValue": "test"
}
}
rbs.profile.request.REMOVE_TAG
{
"userId": "84495906-823d-4835-a37d-ecb30dc7"
"tagName": "test"
}