VMI API handler
Describes the VMI handler.
AddVmiBinCollectionHandler – HandlerBase<AddVmiBinCollectionParameter, AddVmiBinCollectionResult>
Order | Handler | Description |
---|---|---|
500 | ValidateContext | Checks if EnableVMI is enabled and returns an error if not. |
600 | GetVmiLocation | Sets the VmiLocation in the result if it finds the Location ID in the parameter or returns an error. |
700 | GetProducts | Sets the ProductDtos in the result if it finds the products from the VmiBinDtos parameter or returns an error. |
800 | AddVmiBins | Validates the MinimumQty, MaximumQty, and binNumber for duplicates and adds all products from the previous handler. If there is an error, it rolls back and returns an error code. |
900 | CreateGetVmiBinResults | Calls the CreateGetVmiBinResult pipeline and fills the GetVmiBinResults object. Returns an error if anything fails. |
AddVmiBinHandler – HandlerBase\<AddVmiBinParameter, AddVmiBinResult>
Order | Handler | Description |
---|---|---|
400 | ValidateContext | Checks if EnableVMI is enabled and returns an error if not. |
500 | GetVmiLocation | Sets the VmiLocation in the result if it finds the Location ID in the parameter or returns an error. |
600 | GetProduct | Sets the ProductDto in the result if it finds the product or returns an error. |
700 | AddVmiBin | Validates the MinimumQty, MaximumQty, and binNumber, and checks for duplicates. If all checks pass, it adds the product. Any error returns an error code. |
800 | AddVmiBinResult | Sets the GetVmiBinResult result using the CreateGetVmiBinResult pipeline. Returns an error if anything fails. |
AddVmiCountCollectionHandler – HandlerBase\<AddVmiCountCollectionParameter, AddVmiCountCollectionResult>
Order | Handler | Description |
---|---|---|
500 | ValidateContext | Checks if EnableVMI is enabled and returns an error if not. |
600 | GetVmiBins | Sets the VmiBins result using the VmiBinId from the VmiCountModels parameter. Returns an error if something is missing. |
700 | AddVmiCounts | Validates the Count and VmiBinId and adds the VmiCounts to the result and database. Returns an error and rolls back any changes if something is not valid. |
800 | UpdateVmiBinsLastAndPreviousCounts | Updates VmiBins using VmiCounts, including the following properties: PreviousCountQty, PreviousCountDate, PreviousCountUserName, LastCountQty, LastCountDate, and LastCountUserName. |
900 | CreateGetVmiCountResults | Populates GetVmiCountResults using the CreateGetVmiCountResult pipeline. Returns an error if something goes wrong. |
AddVmiCountHandler – HandlerBase\<AddVmiCountParameter, AddVmiCountResult>
Order | Handler | Description |
---|---|---|
500 | ValidateContext | Checks if EnableVMI is enabled and returns an error if not. |
600 | GetVmiBin | Sets the VmiBinresult using the VmiBinId parameter. Returns an error if something is missing. |
700 | AddVmiCount | Validates Count and adds the VmiCount to result and database. Returns an error if something is not valid. |
800 | UpdateVmiBinsLastAndPreviousCounts | Updates the VmiBin using the VmiCount from the previous handler, including the following properties: PreviousCountQty, PreviousCountDate, PreviousCountUserName, LastCountQty, LastCountDate, and LastCountUserName. |
900 | CreateGetVmiCountResult | Populates GetVmiCountResult using the CreateGetVmiCountResult pipeline. Returns an error if something goes wrong. |
AddVmiLocationCollectionHandler – HandlerBase\<AddVmiLocationCollectionParameter, AddVmiLocationCollectionResult>
Order | Handler | Description |
---|---|---|
500 | ValidateContext | Returns an error if the AddVmiLocationCollection parameter is null. Otherwise, moves to the next handler. |
600 | ValidateLocations | If ValidationOnly, iterates over all AddVmiLocationCollection and checks for collisions. It fills Collisions and CollisionsDetected for the result. |
700 | AddVmiLocations | If not ValidationOnly, populates AddVmiLocationResultCollection result with all saved locations. |
AddVmiLocationHandler – HandlerBase\<AddVmiLocationParameter, AddVmiLocationResult>
Order | Handler | Description |
---|---|---|
400 | ValidateContext | Checks if EnableVMI is enabled and returns an error if not. |
500 | GetCustomer | Gets the ShipToId customer if set. Otherwise, sets the Customer result parameter if BillTo is found and the service call does not return an error. Returns an error if anything fails. |
600 | AddVmiLocation | Checks the Name and ensures it is not bigger than 255 characters. Returns error if invalid. If IsPrimaryLocation is set to true, marks all other locations as not primary. If there is a duplicate location, returns an error. Otherwise, saves it and sets VmiLocation result. |
700 | CreateGetVmiLocationResult | Calls CreateGetVmiLocationResult pipeline and sets GetVmiLocationResult result. Returns an error if it fails. |
AddVmiNoteHandler – HandlerBase\<AddVmiNoteParameter, AddVmiNoteResult>
Order | Handler | Description |
---|---|---|
500 | ValidateContext | Checks if EnableVMI is enabled and returns an error if not. |
600 | GetVmiBin | Sets the VmiBin result if found. Otherwise, returns an error. |
700 | AddVmiNote | Returns an error if Note was not set. Otherwise, sets the VmiNote result with the saved VmiNote. |
800 | CreateGetVmiNoteResult | Sets the GetVmiNoteResult result using the CreateGetVmiNoteResult pipeline. Returns an error if it fails. |
GetVmiBinCollectionHandler – HandlerBase\<GetVmiBinCollectionParameter, GetVmiBinCollectionResult>
Order | Handler | Description |
---|---|---|
400 | ValidateContext | Checks if EnableVMI is enabled. Returns an error if not or skips the whole chain if NumberOfVisits <=0. |
500 | GetVmiBinQuery | Sets the VmiBinQuery result and expands the product relation if ExpandProduct is true. |
600 | ApplyFiltering | Filters by IsActive, VmiBinIds, or VmiLocationId. If Filter is set, filters product using Elasticsearch. If not, checks for visible products using Elasticsearch. You can add extra filtering by one of these parameters: BinNumberFrom, BinNumberTo, PreviousCountFromDate, PreviousCountToDate, IsBelowMinimum, NumberOfTimesMinQtyReached or NumberOfPreviousOrders. NumberOfTimesMinQtyReached and NumberOfPreviousOrders are used only when NumberOfVisits is set. SearchCriteria parameter is used for exact match. |
700 | ApplySort | Sorts result or BinNumber, if a parameter was not provided. |
800 | ApplyPaging | Applies pagination on VmiBinQuery. |
900 | ExecuteQuery | Gets data from the database and puts it into the VmiBins result. |
1000 | GetVmiLocation | Sets the VmiLocation result. If VmiBinIds has any value, gets location from VmiBins. Otherwise, uses the VmiLocationId parameter, or returns an error if it fails. |
1100 | CreateGetVmiBinResults | Fills GetVmiBinResults using CreateGetVmiBinResult. Returns an error if it fails. |
GetVmiBinCountHandler – HandlerBase\<GetVmiBinCountParameter, GetVmiBinCountResult>
Order | Handler | Description |
---|---|---|
500 | ValidateContext | Checks if EnableVMI is enabled and returns an error if not. |
600 | GetVmiBinQuery | Creates the VmiBinQuery result parameter. |
700 | GetCount | Filters by IsActive and sets the Count result based on IsBelowMinimum or by using NumberOfVisits and one of two properties: NumberOfTimesMinQtyReached or NumberOfPreviousOrders. |
GetVmiBinHandler – HandlerBase\<GetVmiBinParameter, GetVmiBinResult>
Order | Handler | Description |
---|---|---|
400 | ValidateContext | Checks if EnableVMI is enabled and returns an error if not. |
500 | GetVmiBin | Gets the vmiBin using the VmiBinId parameter, or returns an error if it fails. |
GetVmiCountCollectionHandler – HandlerBase\<GetVmiCountCollectionParameter, GetVmiCountCollectionResult>
Order | Handler | Description |
---|---|---|
500 | ValidateContext | Checks if EnableVMI is enabled and returns an error if not. |
600 | GetVmiBin | Gets the vmiBin using the VmiBinId parameter, or returns an error if it fails. |
700 | GetVmiCountQuery | Creates the VmiBinQuery result parameter. |
800 | ApplyFiltering | Filters by the VmiBinId, GetUniqueByUser, Username, VmiCountId, PreviousCountFromDate, and PreviousCountToDate parameter properties. |
900 | ApplySort | Sorts query. If the Sort parameter is not set, uses CreatedOn DESC and sets Sort result. |
1000 | ApplyPaging | Applies pagination. |
1100 | ExecuteQuery | Sets VmiCounts result with executed query. |
1200 | CreateGetVmiCountResults | Uses the CreateGetVmiCountResult pipeline to fill the GetVmiCountResults result. Returns an error if anything fails. |
GetVmiCountHandler – HandlerBase\<GetVmiCountParameter, GetVmiCountResult>
Order | Handler | Description |
---|---|---|
500 | ValidateContext | Checks if EnableVMI is enabled and returns an error if not. |
600 | GetVmiCount | Sets the VmiCount result using the VmiBinId and VmiCountId parameter properties. Returns an error if it fails. |
GetVmiLocationCollectionHandler – HandlerBase\<GetVmiLocationCollectionParameter, GetVmiLocationCollectionResult>
Order | Handler | Description |
---|---|---|
400 | ValidateContext | Checks if the UserProfileDto has a value and that EnableVmi is enabled. Returns an error if not. |
500 | GetVmiLocationQuery | Creates the VmiLocationQuery result. Expands customer if the GetCustomerLabel or GetCustomer parameter is true. |
600 | ApplyFiltering | Filters by available ShipTos, VmiLocationIds or LocationNames, if provided. Uses the Filter parameter to search by customer fields and the IsPrimaryLocation parameter to filter by IsPrimaryLocation. |
650 | ApplyFilteringByUser | Skips handler if UserId parameter is not set. Otherwise, applies filtering by user. |
700 | ApplySort | Applies Sort parameter. If not set, uses the Name as the default and sets the Sort result parameter. |
800 | ApplyPaging | Applies pagination. |
900 | ExecuteQuery | Sets the VmiLocations result with executed database query. |
1000 | CreateGetVmiLocationResults | Uses the CreateGetVmiLocationResult pipeline to fill the GetVmiLocationResults result. Returns an error if anything fails. |
GetVmiLocationHandler – HandlerBase\<GetVmiLocationParameter, GetVmiLocationResult>
Order | Handler | Description |
---|---|---|
400 | ValidateContext | Checks if EnableVMI is enabled and returns an error if not. |
500 | GetVmiLocation | Gets the vmiLocation using the VmiLocationId parameter. Returns an error if it fails. |
GetVmiNoteCollectionHandler – HandlerBase\<GetVmiNoteCollectionParameter, GetVmiNoteCollectionResult>
Order | Handler | Description |
---|---|---|
500 | ValidateContext | Checks if EnableVMI is enabled and returns an error if not. |
550 | GetVmiLocation | Skips the handler if there is a GetAllBinNotesForLocation parameter. Otherwise, sets the VmiLocation result using the VmiLocationId parameter. Returns an error if it fails. |
600 | GetVmiBin | Skips the handler if there is a GetAllBinNotesForLocation parameter. Otherwise, uses the VmiBinId parameter to get the vmiBin. Returns an error if it fails. |
700 | GetVmiNoteQuery | Sets the VmiNoteQuery result query. |
800 | ApplyFiltering | If there is a GetAllBinNotesForLocation parameter, filters by the VmiLocationIdparameter. Otherwise, filters by the VmiBinId parameter. When VmiNoteId parameter is provided, the user is, too. |
900 | ApplySort | Sorts by CreatedOn descending. |
1000 | ApplyPaging | Applies pagination. |
1100 | ExecuteQuery | Sets the VmiNotes result with executed database query. |
1200 | CreateGetVmiNoteResults | Uses the CreateGetVmiNoteResult pipeline to populate the GetVmiNoteResults result. Returns an error if it fails. |
GetVmiNoteHandler – HandlerBase\<GetVmiNoteParameter, GetVmiNoteResult>
Order | Handler | Description |
---|---|---|
500 | ValidateContext | Checks if EnableVMI is enabled and returns an error if not. |
600 | GetVmiNote | Sets the VmiNote result using the service result, or returns an error. |
RemoveVmiBinHandler – HandlerBase\<RemoveVmiBinParameter, RemoveVmiBinResult>
Order | Handler | Description |
---|---|---|
500 | ValidateContext | Checks if EnableVMI is enabled and returns an error if not. |
600 | GetVmiBin | Sets the VmiBin result using the VmiBinId parameter. Otherwise, returns an error. |
700 | RemoveVmiBin | Archives the vmiBin from previous step. |
RemoveVmiBinsHandler – HandlerBase\<BatchRemoveVmiBinParameter, BatchRemoveVmiBinResult>
Order | Handler | Description |
---|---|---|
500 | ValidateContext | Checks if EnableVMI is enabled and returns an error if not. |
600 | GetVmiBins | Sets the VmiBins results using the VmiBinIds parameter. Returns an error if VmiBinIds is empty or fails to populate the result. |
700 | RemoveVmiBins | Iterates over all VmiBins from the previous step and archives them. |
RemoveVmiCountHandler– HandlerBase\<RemoveVmiCountParameter, RemoveVmiCountResult>
Order | Handler | Description |
---|---|---|
500 | ValidateContext | Checks if EnableVMI is enabled and returns an error if not. |
600 | GetVmiBin | Sets the VmiBin result using the VmiBinId parameter. Returns an error if it fails. |
700 | GetVmiCount | Sets the VmiCount result using the VmiCountId parameter. Returns an error if it fails. |
800 | RemoveVmiCount | Removes VmiCount using result. |
900 | UpdateVmiBinLastAndPreviousCounts | Recalculates the next properties: PreviousCountQty, PreviousCountDate, PreviousCountUserName, LastCountQty, LastCountDate. and LastCountUserName. |
RemoveVmiLocationHandler – HandlerBase\<RemoveVmiLocationParameter, RemoveVmiLocationResult>
Order | Handler | Description |
---|---|---|
500 | ValidateContext | Checks if EnableVMI is enabled and returns an error if not. |
600 | GetVmiLocation | Sets the VmiLocation result using the VmiLocationId parameter. Returns it if there is an error. |
700 | RemoveVmiLocation | Archives the vmiLocation from previous step. |
RemoveVmiLocationsHandler – HandlerBase\<BatchRemoveVmiLocationParameter, BatchRemoveVmiLocationResult>
Order | Handler | Description |
---|---|---|
500 | ValidateContext | Checks if EnableVMI is enabled and returns an error if not. |
600 | GetVmiLocations | Sets the VmiLocations result using the VmiLocationIds parameter. Returns it in case of error. |
700 | RemoveVmiLocations | Archives the vmiLocations from previous step. |
RemoveVmiNoteHandler – HandlerBase\<RemoveVmiNoteParameter, RemoveVmiNoteResult>
Order | Handler | Description |
---|---|---|
500 | ValidateContext | Checks if EnableVMI is enabled and returns an error if not. |
600 | GetVmiBin | Sets the VmiBin result using the VmiBinId parameter. Returns it if there is an error. |
700 | GetVmiNote | Sets the VmiNote result using the VmiNoteId parameter. Returns an error if it fails. |
800 | RemoveVmiNote | Deletes the vmiNote from previous step. |
UpdateVmiBinHandler – HandlerBase\<UpdateVmiBinParameter, UpdateVmiBinResult>
Order | Handler | Description |
---|---|---|
400 | ValidateContext | Checks if EnableVMI is enabled and returns an error if not. |
500 | GetVmiBin | Sets the VmiBin result using the VmiBinId parameter. Returns it if there is an error. |
600 | GetProduct | Sets the ProductDto result using the ProductId parameter. Returns an error if it fails. |
700 | UpdateVmiBin | Validates the MinimumQty and MaximumQty and updates the entity. Returns an error if it fails or gets duplicate records after updating. |
800 | CreateGetVmiBinResult | Populates the GetVmiBinResult result using the CreateGetVmiBinResult. Returns an error if it fails. |
UpdateVmiCountHandler – HandlerBase\<UpdateVmiCountParameter, UpdateVmiCountResult>
Order | Handler | Description |
---|---|---|
500 | ValidateContext | Checks if EnableVMI is enabled and returns an error if not. |
600 | GetVmiBin | Sets the VmiBin result using the VmiBinId parameter. Returns it if there is an error. |
700 | GetVmiCount | Sets the VmiCount result using the VmiCountId parameter. Returns an error if it fails. |
800 | UpdateVmiCount | Updates VmiCount.Count. Returns an error if the value is negative. |
900 | UpdateVmiBinLastAndPreviousCounts | Updates the next properties: PreviousCountQty, PreviousCountDate, PreviousCountUserName, LastCountQty, LastCountDate, and LastCountUserName. |
1000 | CreateGetVmiCountResult | Populates the GetVmiCountResult result using the CreateGetVmiCountResult pipeline. Returns an error if it fails. |
UpdateVmiLocationHandler – HandlerBase\<UpdateVmiLocationParameter, UpdateVmiLocationResult>
Order | Handler | Description |
---|---|---|
400 | ValidateContext | Checks if EnableVMI is enabled and returns an error if not. |
500 | GetVmiLocation | Sets the VmiLocation result using the VmiLocationId parameter. Returns if if there is an error. |
600 | UpdateVmiLocation | Checks for duplicates after updating, and returns an error if found or if the length is bigger than 255 characters. If the IsPrimaryLocation parameter is true, marks all other locations as not primary. It also updates the Name, UseBins, IsPrimaryLocation, and Note properties. |
700 | CreateGetVmiLocationResult | Sets the GetVmiLocationResult result using the CreateGetVmiLocationResult pipeline. Returns an error if it fails. |
UpdateVmiNoteHandler – HandlerBase\<UpdateVmiNoteParameter, UpdateVmiNoteResult>
Order | Handler | Description |
---|---|---|
500 | ValidateContext | Checks if EnableVMI is enabled and returns an error if not. |
600 | GetVmiBin | Sets the VmiBin result using the VmiBinId parameter. Returns it if there is an error. |
700 | GetVmiNote | Sets the VmiNote result using the VmiNoteId parameter. Returns an error if it fails. |
800 | UpdateVmiNote | Returns an error if the Note parameter is blank. Otherwise, sets the Note and IncludeOnOrder properties. |
900 | CreateGetVmiNoteResult | Sets the GetVmiNoteResult result using the CreateGetVmiNoteResult pipeline. Returns an error if it fails. |
Updated over 1 year ago