@springtree/eva-core
Version:
The EVA core typings
201 lines (174 loc) • 6.07 kB
TypeScript
declare module EVA.Replenishment {
/**
* Creates a new `ReplenishmentProposal`.
*
* The new proposal is picked up and processed asynchronously and could take a while after creation to complete generating its results, depending on the
* amount of sources, targets, products and the algorithm used. Check the `Status` property in the `GetReplenishmentProposal` response to see if it's completed.
*/
export interface CreateReplenishmentProposal {
SourceOrganizationUnitIDs?: number[];
TargetOrganizationUnitIDs?: number[];
StockLabels?: StockLabelDto[];
}
export interface StockLabelDto {
SequenceID: number;
StockLabelID: number;
}
export interface CreateReplenishmentProposalResponse {
ID: number;
Error: EVA.Core.ServiceError;
}
/**
* Generate an Excel parsed from the debug data exposed by the algorithm, based on the results of a ReplenishmentProposal, identified by its `ID` as only parameter.
*/
export interface GenerateDetailsExcelFromReplenishmentProposal {
ID: number;
}
/**
* Generate an Excel intended to be uploadable to EVA as Purchase Order, based on the results of a ReplenishmentProposal, identified by its `ID` as only parameter.
*/
export interface GeneratePurchaseOrderExcelFromReplenishmentProposal {
ID: number;
}
/**
* Get a `ReplenishmentProposal`.
*
* * To get the possible sources of this proposal, use the 'GetReplenishmentProposalSources`.
* * To get the targets of this proposal, use the 'GetReplenishmentProposalTargets`.
* * To get the stock labels of this proposal, use the 'GetReplenishmentProposalStockLabels`.
* * To get the results of this proposal, use the 'GetReplenishmentProposalResults`.
*/
export interface GetReplenishmentProposal {
ID: number;
}
export interface GetReplenishmentProposalResponse {
Result: ReplenishmentProposalDto;
Error: EVA.Core.ServiceError;
}
export interface ReplenishmentProposalDto {
ID: number;
BlobID?: string;
Status: ReplenishmentProposalStatus;
CreationTime?: string;
Blobs: ReplenishmentProposalBlobDto[];
}
export const enum ReplenishmentProposalStatus {
New = 0,
Processing = 1,
Processed = 2,
Error = 9
}
export interface ReplenishmentProposalBlobDto {
TypeID: string;
BlobID?: string;
}
/**
* Get all Sources for a `ReplenishmentProposal`, identified by its `ID`. Supports filter option for `OrganizationUnitIDs`.
*/
export interface GetReplenishmentProposalSources {
ID: number;
OrganizationUnitIDs?: number[];
}
export interface GetReplenishmentProposalSourcesResponse {
Result: EVA.Core.OrganizationUnitDto[];
Error: EVA.Core.ServiceError;
}
/**
* Get all Stock Labels for a `ReplenishmentProposal`, identified by its `ID`.
*/
export interface GetReplenishmentProposalStockLabels {
ID: number;
}
export interface GetReplenishmentProposalStockLabelsResponse {
Result: StockLabelDto[];
Error: EVA.Core.ServiceError;
}
export interface StockLabelDto {
SequenceID: number;
StockLabelID: number;
}
/**
* Get all Targets for a `ReplenishmentProposal`, identified by its `ID`. Supports filter option for `OrganizationUnitIDs`.
*/
export interface GetReplenishmentProposalTargets {
ID: number;
OrganizationUnitIDs?: number[];
}
export interface GetReplenishmentProposalTargetsResponse {
Result: EVA.Core.OrganizationUnitDto[];
Error: EVA.Core.ServiceError;
}
/**
* Lists all Results for a `ReplenishmentProposal`, identified by its `ID`.
*
* Through the `PageConfig`'s `Filter` parameter, you have the following filter options available:
*
* * `SourceIDs` and/or `TargetIDs` as `OrganizationUnit`.`ID`'s
* * `ProductIDs` as `Product`.`ID`s
* * `CustomID` as `Product`.`CustomID`
* * `BrandName` as `Product`.`Brand`.`Name`
*/
export interface ListReplenishmentProposalResults {
ID: number;
PageConfig?: EVA.Core.PageConfig<ListReplenishmentProposalResultFilters>;
}
export interface ListReplenishmentProposalResultFilters {
SourceIDs: number[];
TargetIDs: number[];
ProductIDs: number[];
CustomID: string;
BrandName: string;
}
export interface ListReplenishmentProposalResultsResponse {
Result: EVA.Core.PagedResult<ReplenishmentProposalResultListDto>;
Error: EVA.Core.ServiceError;
}
export interface ReplenishmentProposalResultListDto {
ID: number;
ReplenishmentProposalID: number;
SourceOrganizationUnitID: number;
TargetOrganizationUnitID: number;
ProductID: number;
StockLabelID: number;
Quantity: number;
SourceOrganizationUnit: EVA.Core.OrganizationUnitDto;
TargetOrganizationUnit: EVA.Core.OrganizationUnitDto;
Product: EVA.Core.ProductDto;
ProductName: string;
UnitCost?: number;
TotalCost?: number;
CurrencyID: string;
}
/**
* List all `ReplenishmentProposal`'s.
*
* Through the `PageConfig`'s `Filter` parameter, you have the following filter options available:
*
* * `ID` for that specific `ReplenishmentProposal` you want
* * `SourceIDs` and/or `TargetIDs` as `OrganizationUnit`.`ID`'s
* * `CreatedAfter` and/or `CreatedBefore`
* * `CreatedByName` (:underage: expensive filter, supports both `FirstName` and `LastName` filtering)
*/
export interface ListReplenishmentProposals {
PageConfig?: EVA.Core.PageConfig<ListReplenishmentProposalFilters>;
}
export interface ListReplenishmentProposalFilters {
ID: number;
SourceIDs: number[];
TargetIDs: number[];
CreatedAfter?: string;
CreatedBefore?: string;
CreatedByName: string;
}
export interface ListReplenishmentProposalsResponse {
Result: EVA.Core.PagedResult<ReplenishmentProposalListDto>;
Error: EVA.Core.ServiceError;
}
export interface ReplenishmentProposalListDto {
ID: number;
StatusID: number;
CreatedByID: number;
CreationTime?: string;
CreatedBy: EVA.Core.UserDto;
}
}