예제 #1
0
        public async Task <CustomerInformation> CreateCustomer(CustomerInformation customerInformation)
        {
            FormatData(ref customerInformation);
            await _hrSystemProvider.ValidateOfficialId(customerInformation.OfficialId);

            _customerInformationValidatior.ValidateCustomerInformation(customerInformation, false);

            await _databaseProvider.CreateCustomer(customerInformation);

            await _hrSystemProvider.NotifyAboutChange(customerInformation.OfficialId, ChangeType.Create);

            //There is at the moment no point in returning the actually created object here, but this could be usefull in other cases for example when an internal id of the object is created
            return(await _databaseProvider.GetCustomerInformation(customerInformation.OfficialId));
        }