@connect-plus-online/ogabai-integrations 0.0.87 → 0.0.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +105 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +38 -1
- package/dist/index.d.ts +38 -1
- package/dist/index.esm.js +105 -2
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -347,7 +347,12 @@ interface Expense {
|
|
|
347
347
|
description: string;
|
|
348
348
|
expenseCategoryId: string;
|
|
349
349
|
repeatedEvery: "day" | "week" | "month" | "year";
|
|
350
|
+
dispenseStaffIds: string[];
|
|
350
351
|
createdAt: string;
|
|
352
|
+
expenseType: "none" | "operation" | "staffRequest" | "staffRequestFulfilled";
|
|
353
|
+
amount: number;
|
|
354
|
+
narration: string;
|
|
355
|
+
createdById: string;
|
|
351
356
|
}
|
|
352
357
|
type DateFilter = {
|
|
353
358
|
startDate: string;
|
|
@@ -389,6 +394,8 @@ type Transaction = {
|
|
|
389
394
|
customerId: string;
|
|
390
395
|
transactionType: TransactionType;
|
|
391
396
|
createdById: string;
|
|
397
|
+
expenseId: string;
|
|
398
|
+
narration: string;
|
|
392
399
|
};
|
|
393
400
|
type OrderStatus = "pending" | "processing" | "routing" | "delivered";
|
|
394
401
|
type Order = {
|
|
@@ -2074,9 +2081,39 @@ declare const createExpenseService: (client: GraphQLClient) => {
|
|
|
2074
2081
|
features: ExpenseFields;
|
|
2075
2082
|
}) | undefined;
|
|
2076
2083
|
} | undefined, option?: RequestOption) => Promise<ListEntityResponse<Expense, "expense"> | undefined>;
|
|
2084
|
+
getExpensesByStaffId(req: {
|
|
2085
|
+
staffId: string;
|
|
2086
|
+
limit: number;
|
|
2087
|
+
skip: number;
|
|
2088
|
+
filter?: Partial<Omit<Expense, "dispenseStaffIds">>;
|
|
2089
|
+
}): Promise<ListEntityResponse<Expense, "expense"> | undefined>;
|
|
2090
|
+
requestExpenseDispense(req: CreateEntityRequest<Expense, "expense">): Promise<EntityResponse<Expense, "expense"> | undefined>;
|
|
2077
2091
|
};
|
|
2078
2092
|
type ExpenseService = ReturnType<typeof createExpenseService>;
|
|
2079
2093
|
|
|
2094
|
+
declare const createExpenseDispenseService: (client: GraphQLClient) => {
|
|
2095
|
+
getExpensesDispensedByStore: (req: {
|
|
2096
|
+
storeId: string;
|
|
2097
|
+
filter?: Partial<Omit<Transaction, "storeId" | "transactionType" | "id">>;
|
|
2098
|
+
limit: number;
|
|
2099
|
+
skip?: number;
|
|
2100
|
+
}) => Promise<EntityResponse<Transaction[], "transactions"> | null>;
|
|
2101
|
+
getExpensesDispensedByStaff: (req: {
|
|
2102
|
+
staffId: string;
|
|
2103
|
+
filter: Partial<Omit<Transaction, "createdById" | "transactionType" | "id">>;
|
|
2104
|
+
limit: number;
|
|
2105
|
+
skip?: number;
|
|
2106
|
+
}) => Promise<EntityResponse<Transaction[], "transactions"> | null>;
|
|
2107
|
+
dispenseExpense: (req: {
|
|
2108
|
+
expenseDispense: Pick<Transaction, "expenseId" | "amountPaid" | "narration" | "createdById">;
|
|
2109
|
+
}) => Promise<EntityResponse<Transaction, "transaction"> | undefined>;
|
|
2110
|
+
approveExpenseDispense(req: {
|
|
2111
|
+
expenseId: string;
|
|
2112
|
+
addToExpenseList?: boolean;
|
|
2113
|
+
}): Promise<EntityResponse<Transaction, "transaction"> | null>;
|
|
2114
|
+
};
|
|
2115
|
+
type ExpenseDispenseService = ReturnType<typeof createExpenseDispenseService>;
|
|
2116
|
+
|
|
2080
2117
|
interface PaystackInitializePaymentRequest {
|
|
2081
2118
|
userId: string;
|
|
2082
2119
|
}
|
|
@@ -2395,4 +2432,4 @@ declare const createSubscriptionTrialService: (client: GraphQLClient) => {
|
|
|
2395
2432
|
};
|
|
2396
2433
|
type SubscriptionTrialService = ReturnType<typeof createSubscriptionTrialService>;
|
|
2397
2434
|
|
|
2398
|
-
export { APPLICATION_FEATURES, type Account, type AccountStatus, type AddPackageRequest, type AddPackageResponse, type AddPackageResponseFields, type AddPackagesRequest, type AddPackagesResponse, type AddPackagesResponseFields, type AddPriceRequest, type AddPriceResponse, type AddPriceResponseFields, type AddProductRequest, type AddProductResponse, type AddProductResponseNestedFields, type AddProductsRequest, type AddProductsResponse, type AddProductsResponseNestedFields, type AddStockRequest, type AddStockResponse, type AddStockResponseNestedFields, type AddStoreRequest, type AddStoreResponse, type AddStoreResponseNestedFields, type AddSubscriptionRequest, type AddSubscriptionResponse, type AddSubscriptionResponseNestedFields, type AddTransactionRequest, type AddTransactionResponse, type AddTransactionResponseNestedFields, type Address, type Admin, type ApplicationFeature, type Auth, type AuthService, type AuthTokenProvider, AuthenticationError, type Bank, type CategoryStatus, type ClientOptions, type CreateStockService, type CreateStoreCategoryProductRequest, type CreateStoreCategoryProductResponse, type CreateStoreCategoryProductResponseNestedFields, type CreateStoreCategoryRequest, type CreateStoreCategoryResponse, type CreateStoreCategoryResponseNestedFields, type Customer, type CustomerService, type CustomerStoreBalance, type CustomersProductCount, type DateFilter, type Distributor, type Expense, type ExpenseCRUD, type ExpenseCategory, type ExpenseCategoryCRUD, type ExpenseCategoryFields, type ExpenseCategoryService, type ExpenseFields, type ExpenseService, type GetCustomerProductCountsByIdsRequest, type GetCustomerProductCountsByIdsResponse, type GetCustomerProductCountsByIdsResponseNestedFields, type GetOrderRequest, type GetOrderResponse, type GetOrderResponseNestedFields, type GetOrdersRequest, type GetOrdersResponse, type GetOrdersResponseNestedFields, type GetPackageRequest, type GetPackageResponse, type GetPackageResponseFields, type GetPackagesRequest, type GetPackagesResponse, type GetPackagesResponseFields, type GetPriceRequest, type GetPriceResponse, type GetPriceResponseFields, type GetPricesRequest, type GetPricesResponse, type GetPricesResponseFields, type GetProductByBarcodeRequest, type GetProductByBarcodeResponse, type GetProductByBarcodeResponseNestedFields, type GetProductRequest, type GetProductResponse, type GetProductResponseNestedFields, type GetProductsRequest, type GetProductsResponse, type GetProductsResponseNestedFields, type GetSaleResponseNestedFields, type GetSalesRequest, type GetSalesResponse, type GetSalesResponseNestedFields, type GetStockRequest, type GetStockResponse, type GetStockResponseNestedFields, type GetStocksRequest, type GetStocksResponse, type GetStocksResponseNestedFields, type GetStoreCategoriesRequest, type GetStoreCategoriesResponse, type GetStoreCategoriesResponseNestedFields, type GetStoreCategoryProductRequest, type GetStoreCategoryProductResponse, type GetStoreCategoryProductResponseNestedFields, type GetStoreCategoryProductsRequest, type GetStoreCategoryProductsResponse, type GetStoreCategoryProductsResponseNestedFields, type GetStoreCategoryRequest, type GetStoreCategoryResponse, type GetStoreCategoryResponseNestedFields, type GetStoreCountRequest, type GetStoreCountResponse, type GetStoreRequest, type GetStoreResponse, type GetStoreResponseNestedFields, type GetStoresRequest, type GetStoresResponse, type GetStoresResponseNestedFields, type GetSubscriptionRequest, type GetSubscriptionResponse, type GetSubscriptionResponseNestedFields, type GetSubscriptionsRequest, type GetSubscriptionsResponse, type GetSubscriptionsResponseNestedFields, type GetTransactionRequest, type GetTransactionResponse, type GetTransactionResponseNestedFields, type GetTransactionsRequest, type GetTransactionsResponse, type GetTransactionsResponseNestedFields, GraphQLClient, type GraphQLError, type GraphQLRequest, type GraphQLResponse, type GraphQLVariables, type HeadersFactory, type Manufacturer, type Middleware, type MonthlyUserStat, NetworkError, type Next, type Notification, type NotificationChannels, type OTP, type Order, type OrderFields, type OrderStatus, type PackageService, type PaymentType, type PaystackInitializePaymentRequest, type PaystackInitializePaymentResponse, type PaystackInitializeSubscriptionRequest, type PaystackInitializeSubscriptionResponse, type PaystackService, type Platform, type Price, type Privilege, type PrivilegeAction, type Product, type ProductAttribute, type ProductCategory, type ProductCounts, type ProductLight, type ProductName, type ProductPackage, type ProductPackageService, type ProductService, type RemovePackageRequest, type RemovePackageResponse, type RemovePriceRequest, type RemovePriceResponse, type RemoveProductRequest, type RemoveProductResponse, type RemoveStockRequest, type RemoveStockResponse, type RemoveStoreCategoryProductRequest, type RemoveStoreCategoryProductResponse, type RemoveStoreCategoryRequest, type RemoveStoreCategoryResponse, type RemoveStoreRequest, type RemoveStoreResponse, type RemoveSubscriptionRequest, type RemoveSubscriptionResponse, type RequestContext, type RequestOption, type ResponseContext, type RestockCounts, type Sale, type SaleCounts, type SaleFields, type SaleService, type SaleStatus, SdkError, type SearchCategoriesAndTemplateRequest, type SearchCategoriesAndTemplateResponse, type SearchCategoriesAndTemplateResponseNestedFields, type SearchProductNamesRequest, type SearchProductNamesResponse, type SearchProductNamesResponseNestedFields, type ServiceUpdate, type Stock, type Store, type StoreCategory, type StoreCategoryProduct, type StoreCategoryProductService, type StoreCategoryService, type StoreService, type StoreSetting, type Subscription, type SubscriptionPlan, type SubscriptionPlanCRUD, type SubscriptionPlanFeature, type SubscriptionPlanFeatureAccess, type SubscriptionPlanFeatureAccessValue, type SubscriptionPlanFeatureBehaviour, type SubscriptionPlanFeatureBehaviourCRUD, type SubscriptionPlanFeatureBehaviourService, type SubscriptionPlanFeatureBehaviourValue, type SubscriptionPlanFeatureDefinition, type SubscriptionPlanFeatureDefinitionCRUD, type SubscriptionPlanFeatureDefinitionService, type SubscriptionPlanFeatureKey, SubscriptionPlanFeatureKeyLabels, type SubscriptionPlanFeatureLimitValue, type SubscriptionPlanFeatureStatus, type SubscriptionPlanService, type SubscriptionService, type SubscriptionTrial, type SubscriptionTrialCRUD, type SubscriptionTrialService, type Transaction, type TransactionCounts, type TransactionFields, type TransactionPin, type TransactionService, type TransactionType, type TransportOptions, type TxStatus, type UpdatePackageRequest, type UpdatePackageResponse, type UpdatePackageResponseFields, type UpdatePackagesRequest, type UpdatePackagesResponse, type UpdatePriceRequest, type UpdatePriceResponse, type UpdatePriceResponseFields, type UpdateProductRequest, type UpdateProductResponse, type UpdateProductResponseNestedFields, type UpdateSaleRequest, UpdateSaleResponse, type UpdateSaleResponseNestedFields, type UpdateStockRequest, type UpdateStockResponse, type UpdateStockResponseNestedFields, type UpdateStoreCategoryProductRequest, type UpdateStoreCategoryProductResponse, type UpdateStoreCategoryProductResponseNestedFields, type UpdateStoreCategoryRequest, type UpdateStoreCategoryResponse, type UpdateStoreCategoryResponseNestedFields, type UpdateStoreRequest, type UpdateStoreResponse, type UpdateStoreResponseNestedFields, type UpdateSubscriptionRequest, type UpdateSubscriptionResponse, type UpdateSubscriptionResponseNestedFields, type UpdateTransactionRequest, type UpdateTransactionResponse, type UpdateTransactionResponseNestedFields, type UploadImageResponse, type User, type UserAccount, type UserAccountService, type UserDevice, type UserNotification, type UserNotificationService, type UserNotificationSettings, type UserProductCounts, type UserRole, type UserRoleService, type UserSaleCounts, type UserService, type UserSetting, type UserStatus, type UserTxAmounts, type UserType, type UserTypeCounts, type VirtualAccount, type Wallet, type WalletCurrency, type WalletStatus, _getPackageResponseNestedFields, _getProductResponseNestedFields, _getSaleResponseNestedFields, _getStoreResponseNestedFields, _getSubscriptionResponseNestedFields, _getTransactionResponseNestedFields, _getTransactionsResponseNestedFields, addPackageResponseFields, addPackageResponseNestedFields, addPackagesResponseFields, addPackagesResponseNestedFields, addPriceResponseFields, addPriceResponseNestedFields, addProductResponseFields, addProductResponseNestedFields, addProductsResponseFields, addProductsResponseNestedFields, addStockResponse, addStockResponseNestedFields, addStoreResponse, addStoreResponseNestedFields, addSubscriptionResponse, addSubscriptionResponseNestedFields, addTransactionResponse, addTransactionResponseNestedFields, compose, createAuthService, createCustomerService, createExpenseCategoryService, createExpenseService, createOrderService, createPackageService, createPaystackService, createPriceService, createProductService, createSaleService, createStockService, createStoreCategoryProductResponseFields, createStoreCategoryProductResponseNestedFields, createStoreCategoryProductService, createStoreCategoryResponseFields, createStoreCategoryResponseNestedFields, createStoreCategoryService, createStoreService, createSubscriptionPlanFeatureBehaviourService, createSubscriptionPlanFeatureDefinitionService, createSubscriptionPlanService, createSubscriptionService, createSubscriptionTrialService, createTransactionService, createTransport, createUserAccountService, createUserNotificationService, createUserRoleService, createUserService, expenseCategoryDeleteIntegration, expenseCategoryIntegration, expenseCategoryListIntegration, expenseCategoryQuery, expenseDeleteIntegration, expenseIntegration, expenseListIntegration, expenseQuery, getCustomerProductCountsByIdsResponse, getCustomerProductCountsByIdsResponseNestedFields, getOrderResponse, getOrderResponseNestedFields, getOrdersResponse, getOrdersResponseNestedFields, getPackageResponseFields, getPackageResponseNestedFields, getPackagesResponseFields, getPackagesResponseNestedFields, getPriceResponseFields, getPriceResponseNestedFields, getPricesResponseFields, getPricesResponseNestedFields, getProductByBarcodeResponse, getProductByBarcodeResponseNestedFields, getProductResponseFields, getProductResponseNestedFields, getProductsResponseFields, getProductsResponseNestedFields, getSaleResponse, getSaleResponseNestedFields, getSalesResponse, getSalesResponseNestedFields, getStockResponse, getStockResponseNestedFields, getStocksResponse, getStocksResponseNestedFields, getStoreCategoriesResponseFields, getStoreCategoriesResponseNestedFields, getStoreCategoryProductResponseFields, getStoreCategoryProductResponseNestedFields, getStoreCategoryProductsResponseFields, getStoreCategoryProductsResponseNestedFields, getStoreCategoryResponseFields, getStoreCategoryResponseNestedFields, getStoreCountResponse, getStoreResponse, getStoreResponseNestedFields, getStoresResponse, getStoresResponseNestedFields, getSubscriptionResponse, getSubscriptionResponseNestedFields, getSubscriptionsResponse, getSubscriptionsResponseNestedFields, getTransactionResponse, getTransactionResponseNestedFields, getTransactionsResponse, getTransactionsResponseNestedFields, orderQuery, paystackInitializePaymentResponse, paystackInitializeSubscriptionResponse, removePackageResponseFields, removePriceResponseFields, removeProductResponseFields, removeStockResponse, removeStoreCategoryProductResponseFields, removeStoreCategoryResponseFields, removeStoreResponse, removeSubscriptionResponse, saleQuery, searchCategoriesAndTemplateResponse, searchCategoriesAndTemplateResponseNestedFields, searchProductNamesResponse, searchProductNamesResponseNestedFields, subscriptionPlanDeleteIntegration, subscriptionPlanFeatureBehaviourDeleteIntegration, subscriptionPlanFeatureBehaviourIntegration, subscriptionPlanFeatureBehaviourListIntegration, subscriptionPlanFeatureDefinitionDeleteIntegration, subscriptionPlanFeatureDefinitionIntegration, subscriptionPlanFeatureDefinitionListIntegration, subscriptionPlanIntegration, subscriptionPlanListIntegration, subscriptionTrialDeleteIntegration, subscriptionTrialIntegration, subscriptionTrialListIntegration, toAsyncHeadersFactory, toAsyncTokenProvider, transactionQuery, updatePackageResponseFields, updatePackageResponseNestedFields, updatePriceResponseFields, updatePriceResponseNestedFields, updateProductResponseFields, updateProductResponseNestedFields, updateSaleResponseNestedFields, updateStockResponse, updateStockResponseNestedFields, updateStoreCategoryProductResponseFields, updateStoreCategoryProductResponseNestedFields, updateStoreCategoryResponseFields, updateStoreCategoryResponseNestedFields, updateStoreResponse, updateStoreResponseNestedFields, updateSubscriptionResponse, updateSubscriptionResponseNestedFields, updateTransactionResponse, updateTransactionResponseNestedFields, userRoleExample };
|
|
2435
|
+
export { APPLICATION_FEATURES, type Account, type AccountStatus, type AddPackageRequest, type AddPackageResponse, type AddPackageResponseFields, type AddPackagesRequest, type AddPackagesResponse, type AddPackagesResponseFields, type AddPriceRequest, type AddPriceResponse, type AddPriceResponseFields, type AddProductRequest, type AddProductResponse, type AddProductResponseNestedFields, type AddProductsRequest, type AddProductsResponse, type AddProductsResponseNestedFields, type AddStockRequest, type AddStockResponse, type AddStockResponseNestedFields, type AddStoreRequest, type AddStoreResponse, type AddStoreResponseNestedFields, type AddSubscriptionRequest, type AddSubscriptionResponse, type AddSubscriptionResponseNestedFields, type AddTransactionRequest, type AddTransactionResponse, type AddTransactionResponseNestedFields, type Address, type Admin, type ApplicationFeature, type Auth, type AuthService, type AuthTokenProvider, AuthenticationError, type Bank, type CategoryStatus, type ClientOptions, type CreateStockService, type CreateStoreCategoryProductRequest, type CreateStoreCategoryProductResponse, type CreateStoreCategoryProductResponseNestedFields, type CreateStoreCategoryRequest, type CreateStoreCategoryResponse, type CreateStoreCategoryResponseNestedFields, type Customer, type CustomerService, type CustomerStoreBalance, type CustomersProductCount, type DateFilter, type Distributor, type Expense, type ExpenseCRUD, type ExpenseCategory, type ExpenseCategoryCRUD, type ExpenseCategoryFields, type ExpenseCategoryService, type ExpenseDispenseService, type ExpenseFields, type ExpenseService, type GetCustomerProductCountsByIdsRequest, type GetCustomerProductCountsByIdsResponse, type GetCustomerProductCountsByIdsResponseNestedFields, type GetOrderRequest, type GetOrderResponse, type GetOrderResponseNestedFields, type GetOrdersRequest, type GetOrdersResponse, type GetOrdersResponseNestedFields, type GetPackageRequest, type GetPackageResponse, type GetPackageResponseFields, type GetPackagesRequest, type GetPackagesResponse, type GetPackagesResponseFields, type GetPriceRequest, type GetPriceResponse, type GetPriceResponseFields, type GetPricesRequest, type GetPricesResponse, type GetPricesResponseFields, type GetProductByBarcodeRequest, type GetProductByBarcodeResponse, type GetProductByBarcodeResponseNestedFields, type GetProductRequest, type GetProductResponse, type GetProductResponseNestedFields, type GetProductsRequest, type GetProductsResponse, type GetProductsResponseNestedFields, type GetSaleResponseNestedFields, type GetSalesRequest, type GetSalesResponse, type GetSalesResponseNestedFields, type GetStockRequest, type GetStockResponse, type GetStockResponseNestedFields, type GetStocksRequest, type GetStocksResponse, type GetStocksResponseNestedFields, type GetStoreCategoriesRequest, type GetStoreCategoriesResponse, type GetStoreCategoriesResponseNestedFields, type GetStoreCategoryProductRequest, type GetStoreCategoryProductResponse, type GetStoreCategoryProductResponseNestedFields, type GetStoreCategoryProductsRequest, type GetStoreCategoryProductsResponse, type GetStoreCategoryProductsResponseNestedFields, type GetStoreCategoryRequest, type GetStoreCategoryResponse, type GetStoreCategoryResponseNestedFields, type GetStoreCountRequest, type GetStoreCountResponse, type GetStoreRequest, type GetStoreResponse, type GetStoreResponseNestedFields, type GetStoresRequest, type GetStoresResponse, type GetStoresResponseNestedFields, type GetSubscriptionRequest, type GetSubscriptionResponse, type GetSubscriptionResponseNestedFields, type GetSubscriptionsRequest, type GetSubscriptionsResponse, type GetSubscriptionsResponseNestedFields, type GetTransactionRequest, type GetTransactionResponse, type GetTransactionResponseNestedFields, type GetTransactionsRequest, type GetTransactionsResponse, type GetTransactionsResponseNestedFields, GraphQLClient, type GraphQLError, type GraphQLRequest, type GraphQLResponse, type GraphQLVariables, type HeadersFactory, type Manufacturer, type Middleware, type MonthlyUserStat, NetworkError, type Next, type Notification, type NotificationChannels, type OTP, type Order, type OrderFields, type OrderStatus, type PackageService, type PaymentType, type PaystackInitializePaymentRequest, type PaystackInitializePaymentResponse, type PaystackInitializeSubscriptionRequest, type PaystackInitializeSubscriptionResponse, type PaystackService, type Platform, type Price, type Privilege, type PrivilegeAction, type Product, type ProductAttribute, type ProductCategory, type ProductCounts, type ProductLight, type ProductName, type ProductPackage, type ProductPackageService, type ProductService, type RemovePackageRequest, type RemovePackageResponse, type RemovePriceRequest, type RemovePriceResponse, type RemoveProductRequest, type RemoveProductResponse, type RemoveStockRequest, type RemoveStockResponse, type RemoveStoreCategoryProductRequest, type RemoveStoreCategoryProductResponse, type RemoveStoreCategoryRequest, type RemoveStoreCategoryResponse, type RemoveStoreRequest, type RemoveStoreResponse, type RemoveSubscriptionRequest, type RemoveSubscriptionResponse, type RequestContext, type RequestOption, type ResponseContext, type RestockCounts, type Sale, type SaleCounts, type SaleFields, type SaleService, type SaleStatus, SdkError, type SearchCategoriesAndTemplateRequest, type SearchCategoriesAndTemplateResponse, type SearchCategoriesAndTemplateResponseNestedFields, type SearchProductNamesRequest, type SearchProductNamesResponse, type SearchProductNamesResponseNestedFields, type ServiceUpdate, type Stock, type Store, type StoreCategory, type StoreCategoryProduct, type StoreCategoryProductService, type StoreCategoryService, type StoreService, type StoreSetting, type Subscription, type SubscriptionPlan, type SubscriptionPlanCRUD, type SubscriptionPlanFeature, type SubscriptionPlanFeatureAccess, type SubscriptionPlanFeatureAccessValue, type SubscriptionPlanFeatureBehaviour, type SubscriptionPlanFeatureBehaviourCRUD, type SubscriptionPlanFeatureBehaviourService, type SubscriptionPlanFeatureBehaviourValue, type SubscriptionPlanFeatureDefinition, type SubscriptionPlanFeatureDefinitionCRUD, type SubscriptionPlanFeatureDefinitionService, type SubscriptionPlanFeatureKey, SubscriptionPlanFeatureKeyLabels, type SubscriptionPlanFeatureLimitValue, type SubscriptionPlanFeatureStatus, type SubscriptionPlanService, type SubscriptionService, type SubscriptionTrial, type SubscriptionTrialCRUD, type SubscriptionTrialService, type Transaction, type TransactionCounts, type TransactionFields, type TransactionPin, type TransactionService, type TransactionType, type TransportOptions, type TxStatus, type UpdatePackageRequest, type UpdatePackageResponse, type UpdatePackageResponseFields, type UpdatePackagesRequest, type UpdatePackagesResponse, type UpdatePriceRequest, type UpdatePriceResponse, type UpdatePriceResponseFields, type UpdateProductRequest, type UpdateProductResponse, type UpdateProductResponseNestedFields, type UpdateSaleRequest, UpdateSaleResponse, type UpdateSaleResponseNestedFields, type UpdateStockRequest, type UpdateStockResponse, type UpdateStockResponseNestedFields, type UpdateStoreCategoryProductRequest, type UpdateStoreCategoryProductResponse, type UpdateStoreCategoryProductResponseNestedFields, type UpdateStoreCategoryRequest, type UpdateStoreCategoryResponse, type UpdateStoreCategoryResponseNestedFields, type UpdateStoreRequest, type UpdateStoreResponse, type UpdateStoreResponseNestedFields, type UpdateSubscriptionRequest, type UpdateSubscriptionResponse, type UpdateSubscriptionResponseNestedFields, type UpdateTransactionRequest, type UpdateTransactionResponse, type UpdateTransactionResponseNestedFields, type UploadImageResponse, type User, type UserAccount, type UserAccountService, type UserDevice, type UserNotification, type UserNotificationService, type UserNotificationSettings, type UserProductCounts, type UserRole, type UserRoleService, type UserSaleCounts, type UserService, type UserSetting, type UserStatus, type UserTxAmounts, type UserType, type UserTypeCounts, type VirtualAccount, type Wallet, type WalletCurrency, type WalletStatus, _getPackageResponseNestedFields, _getProductResponseNestedFields, _getSaleResponseNestedFields, _getStoreResponseNestedFields, _getSubscriptionResponseNestedFields, _getTransactionResponseNestedFields, _getTransactionsResponseNestedFields, addPackageResponseFields, addPackageResponseNestedFields, addPackagesResponseFields, addPackagesResponseNestedFields, addPriceResponseFields, addPriceResponseNestedFields, addProductResponseFields, addProductResponseNestedFields, addProductsResponseFields, addProductsResponseNestedFields, addStockResponse, addStockResponseNestedFields, addStoreResponse, addStoreResponseNestedFields, addSubscriptionResponse, addSubscriptionResponseNestedFields, addTransactionResponse, addTransactionResponseNestedFields, compose, createAuthService, createCustomerService, createExpenseCategoryService, createExpenseDispenseService, createExpenseService, createOrderService, createPackageService, createPaystackService, createPriceService, createProductService, createSaleService, createStockService, createStoreCategoryProductResponseFields, createStoreCategoryProductResponseNestedFields, createStoreCategoryProductService, createStoreCategoryResponseFields, createStoreCategoryResponseNestedFields, createStoreCategoryService, createStoreService, createSubscriptionPlanFeatureBehaviourService, createSubscriptionPlanFeatureDefinitionService, createSubscriptionPlanService, createSubscriptionService, createSubscriptionTrialService, createTransactionService, createTransport, createUserAccountService, createUserNotificationService, createUserRoleService, createUserService, expenseCategoryDeleteIntegration, expenseCategoryIntegration, expenseCategoryListIntegration, expenseCategoryQuery, expenseDeleteIntegration, expenseIntegration, expenseListIntegration, expenseQuery, getCustomerProductCountsByIdsResponse, getCustomerProductCountsByIdsResponseNestedFields, getOrderResponse, getOrderResponseNestedFields, getOrdersResponse, getOrdersResponseNestedFields, getPackageResponseFields, getPackageResponseNestedFields, getPackagesResponseFields, getPackagesResponseNestedFields, getPriceResponseFields, getPriceResponseNestedFields, getPricesResponseFields, getPricesResponseNestedFields, getProductByBarcodeResponse, getProductByBarcodeResponseNestedFields, getProductResponseFields, getProductResponseNestedFields, getProductsResponseFields, getProductsResponseNestedFields, getSaleResponse, getSaleResponseNestedFields, getSalesResponse, getSalesResponseNestedFields, getStockResponse, getStockResponseNestedFields, getStocksResponse, getStocksResponseNestedFields, getStoreCategoriesResponseFields, getStoreCategoriesResponseNestedFields, getStoreCategoryProductResponseFields, getStoreCategoryProductResponseNestedFields, getStoreCategoryProductsResponseFields, getStoreCategoryProductsResponseNestedFields, getStoreCategoryResponseFields, getStoreCategoryResponseNestedFields, getStoreCountResponse, getStoreResponse, getStoreResponseNestedFields, getStoresResponse, getStoresResponseNestedFields, getSubscriptionResponse, getSubscriptionResponseNestedFields, getSubscriptionsResponse, getSubscriptionsResponseNestedFields, getTransactionResponse, getTransactionResponseNestedFields, getTransactionsResponse, getTransactionsResponseNestedFields, orderQuery, paystackInitializePaymentResponse, paystackInitializeSubscriptionResponse, removePackageResponseFields, removePriceResponseFields, removeProductResponseFields, removeStockResponse, removeStoreCategoryProductResponseFields, removeStoreCategoryResponseFields, removeStoreResponse, removeSubscriptionResponse, saleQuery, searchCategoriesAndTemplateResponse, searchCategoriesAndTemplateResponseNestedFields, searchProductNamesResponse, searchProductNamesResponseNestedFields, subscriptionPlanDeleteIntegration, subscriptionPlanFeatureBehaviourDeleteIntegration, subscriptionPlanFeatureBehaviourIntegration, subscriptionPlanFeatureBehaviourListIntegration, subscriptionPlanFeatureDefinitionDeleteIntegration, subscriptionPlanFeatureDefinitionIntegration, subscriptionPlanFeatureDefinitionListIntegration, subscriptionPlanIntegration, subscriptionPlanListIntegration, subscriptionTrialDeleteIntegration, subscriptionTrialIntegration, subscriptionTrialListIntegration, toAsyncHeadersFactory, toAsyncTokenProvider, transactionQuery, updatePackageResponseFields, updatePackageResponseNestedFields, updatePriceResponseFields, updatePriceResponseNestedFields, updateProductResponseFields, updateProductResponseNestedFields, updateSaleResponseNestedFields, updateStockResponse, updateStockResponseNestedFields, updateStoreCategoryProductResponseFields, updateStoreCategoryProductResponseNestedFields, updateStoreCategoryResponseFields, updateStoreCategoryResponseNestedFields, updateStoreResponse, updateStoreResponseNestedFields, updateSubscriptionResponse, updateSubscriptionResponseNestedFields, updateTransactionResponse, updateTransactionResponseNestedFields, userRoleExample };
|
package/dist/index.d.ts
CHANGED
|
@@ -347,7 +347,12 @@ interface Expense {
|
|
|
347
347
|
description: string;
|
|
348
348
|
expenseCategoryId: string;
|
|
349
349
|
repeatedEvery: "day" | "week" | "month" | "year";
|
|
350
|
+
dispenseStaffIds: string[];
|
|
350
351
|
createdAt: string;
|
|
352
|
+
expenseType: "none" | "operation" | "staffRequest" | "staffRequestFulfilled";
|
|
353
|
+
amount: number;
|
|
354
|
+
narration: string;
|
|
355
|
+
createdById: string;
|
|
351
356
|
}
|
|
352
357
|
type DateFilter = {
|
|
353
358
|
startDate: string;
|
|
@@ -389,6 +394,8 @@ type Transaction = {
|
|
|
389
394
|
customerId: string;
|
|
390
395
|
transactionType: TransactionType;
|
|
391
396
|
createdById: string;
|
|
397
|
+
expenseId: string;
|
|
398
|
+
narration: string;
|
|
392
399
|
};
|
|
393
400
|
type OrderStatus = "pending" | "processing" | "routing" | "delivered";
|
|
394
401
|
type Order = {
|
|
@@ -2074,9 +2081,39 @@ declare const createExpenseService: (client: GraphQLClient) => {
|
|
|
2074
2081
|
features: ExpenseFields;
|
|
2075
2082
|
}) | undefined;
|
|
2076
2083
|
} | undefined, option?: RequestOption) => Promise<ListEntityResponse<Expense, "expense"> | undefined>;
|
|
2084
|
+
getExpensesByStaffId(req: {
|
|
2085
|
+
staffId: string;
|
|
2086
|
+
limit: number;
|
|
2087
|
+
skip: number;
|
|
2088
|
+
filter?: Partial<Omit<Expense, "dispenseStaffIds">>;
|
|
2089
|
+
}): Promise<ListEntityResponse<Expense, "expense"> | undefined>;
|
|
2090
|
+
requestExpenseDispense(req: CreateEntityRequest<Expense, "expense">): Promise<EntityResponse<Expense, "expense"> | undefined>;
|
|
2077
2091
|
};
|
|
2078
2092
|
type ExpenseService = ReturnType<typeof createExpenseService>;
|
|
2079
2093
|
|
|
2094
|
+
declare const createExpenseDispenseService: (client: GraphQLClient) => {
|
|
2095
|
+
getExpensesDispensedByStore: (req: {
|
|
2096
|
+
storeId: string;
|
|
2097
|
+
filter?: Partial<Omit<Transaction, "storeId" | "transactionType" | "id">>;
|
|
2098
|
+
limit: number;
|
|
2099
|
+
skip?: number;
|
|
2100
|
+
}) => Promise<EntityResponse<Transaction[], "transactions"> | null>;
|
|
2101
|
+
getExpensesDispensedByStaff: (req: {
|
|
2102
|
+
staffId: string;
|
|
2103
|
+
filter: Partial<Omit<Transaction, "createdById" | "transactionType" | "id">>;
|
|
2104
|
+
limit: number;
|
|
2105
|
+
skip?: number;
|
|
2106
|
+
}) => Promise<EntityResponse<Transaction[], "transactions"> | null>;
|
|
2107
|
+
dispenseExpense: (req: {
|
|
2108
|
+
expenseDispense: Pick<Transaction, "expenseId" | "amountPaid" | "narration" | "createdById">;
|
|
2109
|
+
}) => Promise<EntityResponse<Transaction, "transaction"> | undefined>;
|
|
2110
|
+
approveExpenseDispense(req: {
|
|
2111
|
+
expenseId: string;
|
|
2112
|
+
addToExpenseList?: boolean;
|
|
2113
|
+
}): Promise<EntityResponse<Transaction, "transaction"> | null>;
|
|
2114
|
+
};
|
|
2115
|
+
type ExpenseDispenseService = ReturnType<typeof createExpenseDispenseService>;
|
|
2116
|
+
|
|
2080
2117
|
interface PaystackInitializePaymentRequest {
|
|
2081
2118
|
userId: string;
|
|
2082
2119
|
}
|
|
@@ -2395,4 +2432,4 @@ declare const createSubscriptionTrialService: (client: GraphQLClient) => {
|
|
|
2395
2432
|
};
|
|
2396
2433
|
type SubscriptionTrialService = ReturnType<typeof createSubscriptionTrialService>;
|
|
2397
2434
|
|
|
2398
|
-
export { APPLICATION_FEATURES, type Account, type AccountStatus, type AddPackageRequest, type AddPackageResponse, type AddPackageResponseFields, type AddPackagesRequest, type AddPackagesResponse, type AddPackagesResponseFields, type AddPriceRequest, type AddPriceResponse, type AddPriceResponseFields, type AddProductRequest, type AddProductResponse, type AddProductResponseNestedFields, type AddProductsRequest, type AddProductsResponse, type AddProductsResponseNestedFields, type AddStockRequest, type AddStockResponse, type AddStockResponseNestedFields, type AddStoreRequest, type AddStoreResponse, type AddStoreResponseNestedFields, type AddSubscriptionRequest, type AddSubscriptionResponse, type AddSubscriptionResponseNestedFields, type AddTransactionRequest, type AddTransactionResponse, type AddTransactionResponseNestedFields, type Address, type Admin, type ApplicationFeature, type Auth, type AuthService, type AuthTokenProvider, AuthenticationError, type Bank, type CategoryStatus, type ClientOptions, type CreateStockService, type CreateStoreCategoryProductRequest, type CreateStoreCategoryProductResponse, type CreateStoreCategoryProductResponseNestedFields, type CreateStoreCategoryRequest, type CreateStoreCategoryResponse, type CreateStoreCategoryResponseNestedFields, type Customer, type CustomerService, type CustomerStoreBalance, type CustomersProductCount, type DateFilter, type Distributor, type Expense, type ExpenseCRUD, type ExpenseCategory, type ExpenseCategoryCRUD, type ExpenseCategoryFields, type ExpenseCategoryService, type ExpenseFields, type ExpenseService, type GetCustomerProductCountsByIdsRequest, type GetCustomerProductCountsByIdsResponse, type GetCustomerProductCountsByIdsResponseNestedFields, type GetOrderRequest, type GetOrderResponse, type GetOrderResponseNestedFields, type GetOrdersRequest, type GetOrdersResponse, type GetOrdersResponseNestedFields, type GetPackageRequest, type GetPackageResponse, type GetPackageResponseFields, type GetPackagesRequest, type GetPackagesResponse, type GetPackagesResponseFields, type GetPriceRequest, type GetPriceResponse, type GetPriceResponseFields, type GetPricesRequest, type GetPricesResponse, type GetPricesResponseFields, type GetProductByBarcodeRequest, type GetProductByBarcodeResponse, type GetProductByBarcodeResponseNestedFields, type GetProductRequest, type GetProductResponse, type GetProductResponseNestedFields, type GetProductsRequest, type GetProductsResponse, type GetProductsResponseNestedFields, type GetSaleResponseNestedFields, type GetSalesRequest, type GetSalesResponse, type GetSalesResponseNestedFields, type GetStockRequest, type GetStockResponse, type GetStockResponseNestedFields, type GetStocksRequest, type GetStocksResponse, type GetStocksResponseNestedFields, type GetStoreCategoriesRequest, type GetStoreCategoriesResponse, type GetStoreCategoriesResponseNestedFields, type GetStoreCategoryProductRequest, type GetStoreCategoryProductResponse, type GetStoreCategoryProductResponseNestedFields, type GetStoreCategoryProductsRequest, type GetStoreCategoryProductsResponse, type GetStoreCategoryProductsResponseNestedFields, type GetStoreCategoryRequest, type GetStoreCategoryResponse, type GetStoreCategoryResponseNestedFields, type GetStoreCountRequest, type GetStoreCountResponse, type GetStoreRequest, type GetStoreResponse, type GetStoreResponseNestedFields, type GetStoresRequest, type GetStoresResponse, type GetStoresResponseNestedFields, type GetSubscriptionRequest, type GetSubscriptionResponse, type GetSubscriptionResponseNestedFields, type GetSubscriptionsRequest, type GetSubscriptionsResponse, type GetSubscriptionsResponseNestedFields, type GetTransactionRequest, type GetTransactionResponse, type GetTransactionResponseNestedFields, type GetTransactionsRequest, type GetTransactionsResponse, type GetTransactionsResponseNestedFields, GraphQLClient, type GraphQLError, type GraphQLRequest, type GraphQLResponse, type GraphQLVariables, type HeadersFactory, type Manufacturer, type Middleware, type MonthlyUserStat, NetworkError, type Next, type Notification, type NotificationChannels, type OTP, type Order, type OrderFields, type OrderStatus, type PackageService, type PaymentType, type PaystackInitializePaymentRequest, type PaystackInitializePaymentResponse, type PaystackInitializeSubscriptionRequest, type PaystackInitializeSubscriptionResponse, type PaystackService, type Platform, type Price, type Privilege, type PrivilegeAction, type Product, type ProductAttribute, type ProductCategory, type ProductCounts, type ProductLight, type ProductName, type ProductPackage, type ProductPackageService, type ProductService, type RemovePackageRequest, type RemovePackageResponse, type RemovePriceRequest, type RemovePriceResponse, type RemoveProductRequest, type RemoveProductResponse, type RemoveStockRequest, type RemoveStockResponse, type RemoveStoreCategoryProductRequest, type RemoveStoreCategoryProductResponse, type RemoveStoreCategoryRequest, type RemoveStoreCategoryResponse, type RemoveStoreRequest, type RemoveStoreResponse, type RemoveSubscriptionRequest, type RemoveSubscriptionResponse, type RequestContext, type RequestOption, type ResponseContext, type RestockCounts, type Sale, type SaleCounts, type SaleFields, type SaleService, type SaleStatus, SdkError, type SearchCategoriesAndTemplateRequest, type SearchCategoriesAndTemplateResponse, type SearchCategoriesAndTemplateResponseNestedFields, type SearchProductNamesRequest, type SearchProductNamesResponse, type SearchProductNamesResponseNestedFields, type ServiceUpdate, type Stock, type Store, type StoreCategory, type StoreCategoryProduct, type StoreCategoryProductService, type StoreCategoryService, type StoreService, type StoreSetting, type Subscription, type SubscriptionPlan, type SubscriptionPlanCRUD, type SubscriptionPlanFeature, type SubscriptionPlanFeatureAccess, type SubscriptionPlanFeatureAccessValue, type SubscriptionPlanFeatureBehaviour, type SubscriptionPlanFeatureBehaviourCRUD, type SubscriptionPlanFeatureBehaviourService, type SubscriptionPlanFeatureBehaviourValue, type SubscriptionPlanFeatureDefinition, type SubscriptionPlanFeatureDefinitionCRUD, type SubscriptionPlanFeatureDefinitionService, type SubscriptionPlanFeatureKey, SubscriptionPlanFeatureKeyLabels, type SubscriptionPlanFeatureLimitValue, type SubscriptionPlanFeatureStatus, type SubscriptionPlanService, type SubscriptionService, type SubscriptionTrial, type SubscriptionTrialCRUD, type SubscriptionTrialService, type Transaction, type TransactionCounts, type TransactionFields, type TransactionPin, type TransactionService, type TransactionType, type TransportOptions, type TxStatus, type UpdatePackageRequest, type UpdatePackageResponse, type UpdatePackageResponseFields, type UpdatePackagesRequest, type UpdatePackagesResponse, type UpdatePriceRequest, type UpdatePriceResponse, type UpdatePriceResponseFields, type UpdateProductRequest, type UpdateProductResponse, type UpdateProductResponseNestedFields, type UpdateSaleRequest, UpdateSaleResponse, type UpdateSaleResponseNestedFields, type UpdateStockRequest, type UpdateStockResponse, type UpdateStockResponseNestedFields, type UpdateStoreCategoryProductRequest, type UpdateStoreCategoryProductResponse, type UpdateStoreCategoryProductResponseNestedFields, type UpdateStoreCategoryRequest, type UpdateStoreCategoryResponse, type UpdateStoreCategoryResponseNestedFields, type UpdateStoreRequest, type UpdateStoreResponse, type UpdateStoreResponseNestedFields, type UpdateSubscriptionRequest, type UpdateSubscriptionResponse, type UpdateSubscriptionResponseNestedFields, type UpdateTransactionRequest, type UpdateTransactionResponse, type UpdateTransactionResponseNestedFields, type UploadImageResponse, type User, type UserAccount, type UserAccountService, type UserDevice, type UserNotification, type UserNotificationService, type UserNotificationSettings, type UserProductCounts, type UserRole, type UserRoleService, type UserSaleCounts, type UserService, type UserSetting, type UserStatus, type UserTxAmounts, type UserType, type UserTypeCounts, type VirtualAccount, type Wallet, type WalletCurrency, type WalletStatus, _getPackageResponseNestedFields, _getProductResponseNestedFields, _getSaleResponseNestedFields, _getStoreResponseNestedFields, _getSubscriptionResponseNestedFields, _getTransactionResponseNestedFields, _getTransactionsResponseNestedFields, addPackageResponseFields, addPackageResponseNestedFields, addPackagesResponseFields, addPackagesResponseNestedFields, addPriceResponseFields, addPriceResponseNestedFields, addProductResponseFields, addProductResponseNestedFields, addProductsResponseFields, addProductsResponseNestedFields, addStockResponse, addStockResponseNestedFields, addStoreResponse, addStoreResponseNestedFields, addSubscriptionResponse, addSubscriptionResponseNestedFields, addTransactionResponse, addTransactionResponseNestedFields, compose, createAuthService, createCustomerService, createExpenseCategoryService, createExpenseService, createOrderService, createPackageService, createPaystackService, createPriceService, createProductService, createSaleService, createStockService, createStoreCategoryProductResponseFields, createStoreCategoryProductResponseNestedFields, createStoreCategoryProductService, createStoreCategoryResponseFields, createStoreCategoryResponseNestedFields, createStoreCategoryService, createStoreService, createSubscriptionPlanFeatureBehaviourService, createSubscriptionPlanFeatureDefinitionService, createSubscriptionPlanService, createSubscriptionService, createSubscriptionTrialService, createTransactionService, createTransport, createUserAccountService, createUserNotificationService, createUserRoleService, createUserService, expenseCategoryDeleteIntegration, expenseCategoryIntegration, expenseCategoryListIntegration, expenseCategoryQuery, expenseDeleteIntegration, expenseIntegration, expenseListIntegration, expenseQuery, getCustomerProductCountsByIdsResponse, getCustomerProductCountsByIdsResponseNestedFields, getOrderResponse, getOrderResponseNestedFields, getOrdersResponse, getOrdersResponseNestedFields, getPackageResponseFields, getPackageResponseNestedFields, getPackagesResponseFields, getPackagesResponseNestedFields, getPriceResponseFields, getPriceResponseNestedFields, getPricesResponseFields, getPricesResponseNestedFields, getProductByBarcodeResponse, getProductByBarcodeResponseNestedFields, getProductResponseFields, getProductResponseNestedFields, getProductsResponseFields, getProductsResponseNestedFields, getSaleResponse, getSaleResponseNestedFields, getSalesResponse, getSalesResponseNestedFields, getStockResponse, getStockResponseNestedFields, getStocksResponse, getStocksResponseNestedFields, getStoreCategoriesResponseFields, getStoreCategoriesResponseNestedFields, getStoreCategoryProductResponseFields, getStoreCategoryProductResponseNestedFields, getStoreCategoryProductsResponseFields, getStoreCategoryProductsResponseNestedFields, getStoreCategoryResponseFields, getStoreCategoryResponseNestedFields, getStoreCountResponse, getStoreResponse, getStoreResponseNestedFields, getStoresResponse, getStoresResponseNestedFields, getSubscriptionResponse, getSubscriptionResponseNestedFields, getSubscriptionsResponse, getSubscriptionsResponseNestedFields, getTransactionResponse, getTransactionResponseNestedFields, getTransactionsResponse, getTransactionsResponseNestedFields, orderQuery, paystackInitializePaymentResponse, paystackInitializeSubscriptionResponse, removePackageResponseFields, removePriceResponseFields, removeProductResponseFields, removeStockResponse, removeStoreCategoryProductResponseFields, removeStoreCategoryResponseFields, removeStoreResponse, removeSubscriptionResponse, saleQuery, searchCategoriesAndTemplateResponse, searchCategoriesAndTemplateResponseNestedFields, searchProductNamesResponse, searchProductNamesResponseNestedFields, subscriptionPlanDeleteIntegration, subscriptionPlanFeatureBehaviourDeleteIntegration, subscriptionPlanFeatureBehaviourIntegration, subscriptionPlanFeatureBehaviourListIntegration, subscriptionPlanFeatureDefinitionDeleteIntegration, subscriptionPlanFeatureDefinitionIntegration, subscriptionPlanFeatureDefinitionListIntegration, subscriptionPlanIntegration, subscriptionPlanListIntegration, subscriptionTrialDeleteIntegration, subscriptionTrialIntegration, subscriptionTrialListIntegration, toAsyncHeadersFactory, toAsyncTokenProvider, transactionQuery, updatePackageResponseFields, updatePackageResponseNestedFields, updatePriceResponseFields, updatePriceResponseNestedFields, updateProductResponseFields, updateProductResponseNestedFields, updateSaleResponseNestedFields, updateStockResponse, updateStockResponseNestedFields, updateStoreCategoryProductResponseFields, updateStoreCategoryProductResponseNestedFields, updateStoreCategoryResponseFields, updateStoreCategoryResponseNestedFields, updateStoreResponse, updateStoreResponseNestedFields, updateSubscriptionResponse, updateSubscriptionResponseNestedFields, updateTransactionResponse, updateTransactionResponseNestedFields, userRoleExample };
|
|
2435
|
+
export { APPLICATION_FEATURES, type Account, type AccountStatus, type AddPackageRequest, type AddPackageResponse, type AddPackageResponseFields, type AddPackagesRequest, type AddPackagesResponse, type AddPackagesResponseFields, type AddPriceRequest, type AddPriceResponse, type AddPriceResponseFields, type AddProductRequest, type AddProductResponse, type AddProductResponseNestedFields, type AddProductsRequest, type AddProductsResponse, type AddProductsResponseNestedFields, type AddStockRequest, type AddStockResponse, type AddStockResponseNestedFields, type AddStoreRequest, type AddStoreResponse, type AddStoreResponseNestedFields, type AddSubscriptionRequest, type AddSubscriptionResponse, type AddSubscriptionResponseNestedFields, type AddTransactionRequest, type AddTransactionResponse, type AddTransactionResponseNestedFields, type Address, type Admin, type ApplicationFeature, type Auth, type AuthService, type AuthTokenProvider, AuthenticationError, type Bank, type CategoryStatus, type ClientOptions, type CreateStockService, type CreateStoreCategoryProductRequest, type CreateStoreCategoryProductResponse, type CreateStoreCategoryProductResponseNestedFields, type CreateStoreCategoryRequest, type CreateStoreCategoryResponse, type CreateStoreCategoryResponseNestedFields, type Customer, type CustomerService, type CustomerStoreBalance, type CustomersProductCount, type DateFilter, type Distributor, type Expense, type ExpenseCRUD, type ExpenseCategory, type ExpenseCategoryCRUD, type ExpenseCategoryFields, type ExpenseCategoryService, type ExpenseDispenseService, type ExpenseFields, type ExpenseService, type GetCustomerProductCountsByIdsRequest, type GetCustomerProductCountsByIdsResponse, type GetCustomerProductCountsByIdsResponseNestedFields, type GetOrderRequest, type GetOrderResponse, type GetOrderResponseNestedFields, type GetOrdersRequest, type GetOrdersResponse, type GetOrdersResponseNestedFields, type GetPackageRequest, type GetPackageResponse, type GetPackageResponseFields, type GetPackagesRequest, type GetPackagesResponse, type GetPackagesResponseFields, type GetPriceRequest, type GetPriceResponse, type GetPriceResponseFields, type GetPricesRequest, type GetPricesResponse, type GetPricesResponseFields, type GetProductByBarcodeRequest, type GetProductByBarcodeResponse, type GetProductByBarcodeResponseNestedFields, type GetProductRequest, type GetProductResponse, type GetProductResponseNestedFields, type GetProductsRequest, type GetProductsResponse, type GetProductsResponseNestedFields, type GetSaleResponseNestedFields, type GetSalesRequest, type GetSalesResponse, type GetSalesResponseNestedFields, type GetStockRequest, type GetStockResponse, type GetStockResponseNestedFields, type GetStocksRequest, type GetStocksResponse, type GetStocksResponseNestedFields, type GetStoreCategoriesRequest, type GetStoreCategoriesResponse, type GetStoreCategoriesResponseNestedFields, type GetStoreCategoryProductRequest, type GetStoreCategoryProductResponse, type GetStoreCategoryProductResponseNestedFields, type GetStoreCategoryProductsRequest, type GetStoreCategoryProductsResponse, type GetStoreCategoryProductsResponseNestedFields, type GetStoreCategoryRequest, type GetStoreCategoryResponse, type GetStoreCategoryResponseNestedFields, type GetStoreCountRequest, type GetStoreCountResponse, type GetStoreRequest, type GetStoreResponse, type GetStoreResponseNestedFields, type GetStoresRequest, type GetStoresResponse, type GetStoresResponseNestedFields, type GetSubscriptionRequest, type GetSubscriptionResponse, type GetSubscriptionResponseNestedFields, type GetSubscriptionsRequest, type GetSubscriptionsResponse, type GetSubscriptionsResponseNestedFields, type GetTransactionRequest, type GetTransactionResponse, type GetTransactionResponseNestedFields, type GetTransactionsRequest, type GetTransactionsResponse, type GetTransactionsResponseNestedFields, GraphQLClient, type GraphQLError, type GraphQLRequest, type GraphQLResponse, type GraphQLVariables, type HeadersFactory, type Manufacturer, type Middleware, type MonthlyUserStat, NetworkError, type Next, type Notification, type NotificationChannels, type OTP, type Order, type OrderFields, type OrderStatus, type PackageService, type PaymentType, type PaystackInitializePaymentRequest, type PaystackInitializePaymentResponse, type PaystackInitializeSubscriptionRequest, type PaystackInitializeSubscriptionResponse, type PaystackService, type Platform, type Price, type Privilege, type PrivilegeAction, type Product, type ProductAttribute, type ProductCategory, type ProductCounts, type ProductLight, type ProductName, type ProductPackage, type ProductPackageService, type ProductService, type RemovePackageRequest, type RemovePackageResponse, type RemovePriceRequest, type RemovePriceResponse, type RemoveProductRequest, type RemoveProductResponse, type RemoveStockRequest, type RemoveStockResponse, type RemoveStoreCategoryProductRequest, type RemoveStoreCategoryProductResponse, type RemoveStoreCategoryRequest, type RemoveStoreCategoryResponse, type RemoveStoreRequest, type RemoveStoreResponse, type RemoveSubscriptionRequest, type RemoveSubscriptionResponse, type RequestContext, type RequestOption, type ResponseContext, type RestockCounts, type Sale, type SaleCounts, type SaleFields, type SaleService, type SaleStatus, SdkError, type SearchCategoriesAndTemplateRequest, type SearchCategoriesAndTemplateResponse, type SearchCategoriesAndTemplateResponseNestedFields, type SearchProductNamesRequest, type SearchProductNamesResponse, type SearchProductNamesResponseNestedFields, type ServiceUpdate, type Stock, type Store, type StoreCategory, type StoreCategoryProduct, type StoreCategoryProductService, type StoreCategoryService, type StoreService, type StoreSetting, type Subscription, type SubscriptionPlan, type SubscriptionPlanCRUD, type SubscriptionPlanFeature, type SubscriptionPlanFeatureAccess, type SubscriptionPlanFeatureAccessValue, type SubscriptionPlanFeatureBehaviour, type SubscriptionPlanFeatureBehaviourCRUD, type SubscriptionPlanFeatureBehaviourService, type SubscriptionPlanFeatureBehaviourValue, type SubscriptionPlanFeatureDefinition, type SubscriptionPlanFeatureDefinitionCRUD, type SubscriptionPlanFeatureDefinitionService, type SubscriptionPlanFeatureKey, SubscriptionPlanFeatureKeyLabels, type SubscriptionPlanFeatureLimitValue, type SubscriptionPlanFeatureStatus, type SubscriptionPlanService, type SubscriptionService, type SubscriptionTrial, type SubscriptionTrialCRUD, type SubscriptionTrialService, type Transaction, type TransactionCounts, type TransactionFields, type TransactionPin, type TransactionService, type TransactionType, type TransportOptions, type TxStatus, type UpdatePackageRequest, type UpdatePackageResponse, type UpdatePackageResponseFields, type UpdatePackagesRequest, type UpdatePackagesResponse, type UpdatePriceRequest, type UpdatePriceResponse, type UpdatePriceResponseFields, type UpdateProductRequest, type UpdateProductResponse, type UpdateProductResponseNestedFields, type UpdateSaleRequest, UpdateSaleResponse, type UpdateSaleResponseNestedFields, type UpdateStockRequest, type UpdateStockResponse, type UpdateStockResponseNestedFields, type UpdateStoreCategoryProductRequest, type UpdateStoreCategoryProductResponse, type UpdateStoreCategoryProductResponseNestedFields, type UpdateStoreCategoryRequest, type UpdateStoreCategoryResponse, type UpdateStoreCategoryResponseNestedFields, type UpdateStoreRequest, type UpdateStoreResponse, type UpdateStoreResponseNestedFields, type UpdateSubscriptionRequest, type UpdateSubscriptionResponse, type UpdateSubscriptionResponseNestedFields, type UpdateTransactionRequest, type UpdateTransactionResponse, type UpdateTransactionResponseNestedFields, type UploadImageResponse, type User, type UserAccount, type UserAccountService, type UserDevice, type UserNotification, type UserNotificationService, type UserNotificationSettings, type UserProductCounts, type UserRole, type UserRoleService, type UserSaleCounts, type UserService, type UserSetting, type UserStatus, type UserTxAmounts, type UserType, type UserTypeCounts, type VirtualAccount, type Wallet, type WalletCurrency, type WalletStatus, _getPackageResponseNestedFields, _getProductResponseNestedFields, _getSaleResponseNestedFields, _getStoreResponseNestedFields, _getSubscriptionResponseNestedFields, _getTransactionResponseNestedFields, _getTransactionsResponseNestedFields, addPackageResponseFields, addPackageResponseNestedFields, addPackagesResponseFields, addPackagesResponseNestedFields, addPriceResponseFields, addPriceResponseNestedFields, addProductResponseFields, addProductResponseNestedFields, addProductsResponseFields, addProductsResponseNestedFields, addStockResponse, addStockResponseNestedFields, addStoreResponse, addStoreResponseNestedFields, addSubscriptionResponse, addSubscriptionResponseNestedFields, addTransactionResponse, addTransactionResponseNestedFields, compose, createAuthService, createCustomerService, createExpenseCategoryService, createExpenseDispenseService, createExpenseService, createOrderService, createPackageService, createPaystackService, createPriceService, createProductService, createSaleService, createStockService, createStoreCategoryProductResponseFields, createStoreCategoryProductResponseNestedFields, createStoreCategoryProductService, createStoreCategoryResponseFields, createStoreCategoryResponseNestedFields, createStoreCategoryService, createStoreService, createSubscriptionPlanFeatureBehaviourService, createSubscriptionPlanFeatureDefinitionService, createSubscriptionPlanService, createSubscriptionService, createSubscriptionTrialService, createTransactionService, createTransport, createUserAccountService, createUserNotificationService, createUserRoleService, createUserService, expenseCategoryDeleteIntegration, expenseCategoryIntegration, expenseCategoryListIntegration, expenseCategoryQuery, expenseDeleteIntegration, expenseIntegration, expenseListIntegration, expenseQuery, getCustomerProductCountsByIdsResponse, getCustomerProductCountsByIdsResponseNestedFields, getOrderResponse, getOrderResponseNestedFields, getOrdersResponse, getOrdersResponseNestedFields, getPackageResponseFields, getPackageResponseNestedFields, getPackagesResponseFields, getPackagesResponseNestedFields, getPriceResponseFields, getPriceResponseNestedFields, getPricesResponseFields, getPricesResponseNestedFields, getProductByBarcodeResponse, getProductByBarcodeResponseNestedFields, getProductResponseFields, getProductResponseNestedFields, getProductsResponseFields, getProductsResponseNestedFields, getSaleResponse, getSaleResponseNestedFields, getSalesResponse, getSalesResponseNestedFields, getStockResponse, getStockResponseNestedFields, getStocksResponse, getStocksResponseNestedFields, getStoreCategoriesResponseFields, getStoreCategoriesResponseNestedFields, getStoreCategoryProductResponseFields, getStoreCategoryProductResponseNestedFields, getStoreCategoryProductsResponseFields, getStoreCategoryProductsResponseNestedFields, getStoreCategoryResponseFields, getStoreCategoryResponseNestedFields, getStoreCountResponse, getStoreResponse, getStoreResponseNestedFields, getStoresResponse, getStoresResponseNestedFields, getSubscriptionResponse, getSubscriptionResponseNestedFields, getSubscriptionsResponse, getSubscriptionsResponseNestedFields, getTransactionResponse, getTransactionResponseNestedFields, getTransactionsResponse, getTransactionsResponseNestedFields, orderQuery, paystackInitializePaymentResponse, paystackInitializeSubscriptionResponse, removePackageResponseFields, removePriceResponseFields, removeProductResponseFields, removeStockResponse, removeStoreCategoryProductResponseFields, removeStoreCategoryResponseFields, removeStoreResponse, removeSubscriptionResponse, saleQuery, searchCategoriesAndTemplateResponse, searchCategoriesAndTemplateResponseNestedFields, searchProductNamesResponse, searchProductNamesResponseNestedFields, subscriptionPlanDeleteIntegration, subscriptionPlanFeatureBehaviourDeleteIntegration, subscriptionPlanFeatureBehaviourIntegration, subscriptionPlanFeatureBehaviourListIntegration, subscriptionPlanFeatureDefinitionDeleteIntegration, subscriptionPlanFeatureDefinitionIntegration, subscriptionPlanFeatureDefinitionListIntegration, subscriptionPlanIntegration, subscriptionPlanListIntegration, subscriptionTrialDeleteIntegration, subscriptionTrialIntegration, subscriptionTrialListIntegration, toAsyncHeadersFactory, toAsyncTokenProvider, transactionQuery, updatePackageResponseFields, updatePackageResponseNestedFields, updatePriceResponseFields, updatePriceResponseNestedFields, updateProductResponseFields, updateProductResponseNestedFields, updateSaleResponseNestedFields, updateStockResponse, updateStockResponseNestedFields, updateStoreCategoryProductResponseFields, updateStoreCategoryProductResponseNestedFields, updateStoreCategoryResponseFields, updateStoreCategoryResponseNestedFields, updateStoreResponse, updateStoreResponseNestedFields, updateSubscriptionResponse, updateSubscriptionResponseNestedFields, updateTransactionResponse, updateTransactionResponseNestedFields, userRoleExample };
|
package/dist/index.esm.js
CHANGED
|
@@ -3716,9 +3716,112 @@ var createExpenseService = (client) => ({
|
|
|
3716
3716
|
defaultRootFields: [...expenseListIntegration.responseFields],
|
|
3717
3717
|
defaultNestedFields: expenseListIntegration.nestedFields
|
|
3718
3718
|
}
|
|
3719
|
-
)
|
|
3719
|
+
),
|
|
3720
|
+
getExpensesByStaffId(req) {
|
|
3721
|
+
return this.getExpenses({
|
|
3722
|
+
expense: {
|
|
3723
|
+
...req.filter,
|
|
3724
|
+
dispenseStaffIds: [req.staffId]
|
|
3725
|
+
},
|
|
3726
|
+
limit: req.limit,
|
|
3727
|
+
skip: req.limit
|
|
3728
|
+
});
|
|
3729
|
+
},
|
|
3730
|
+
requestExpenseDispense(req) {
|
|
3731
|
+
return this.createExpense({
|
|
3732
|
+
expense: {
|
|
3733
|
+
...req.expense,
|
|
3734
|
+
expenseType: "staffRequest"
|
|
3735
|
+
}
|
|
3736
|
+
});
|
|
3737
|
+
}
|
|
3720
3738
|
});
|
|
3721
3739
|
|
|
3722
|
-
|
|
3740
|
+
// src/services/sales/expense-dispense.service.ts
|
|
3741
|
+
var createExpenseDispenseService = (client) => {
|
|
3742
|
+
const expenseService = createExpenseService(client);
|
|
3743
|
+
const transactionService = createTransactionService(client);
|
|
3744
|
+
return {
|
|
3745
|
+
getExpensesDispensedByStore: async (req) => {
|
|
3746
|
+
return await transactionService.getTransactions({
|
|
3747
|
+
transaction: {
|
|
3748
|
+
...req.filter,
|
|
3749
|
+
storeId: req.storeId,
|
|
3750
|
+
transactionType: "expense"
|
|
3751
|
+
},
|
|
3752
|
+
limit: req.limit,
|
|
3753
|
+
skip: req.skip || 0
|
|
3754
|
+
});
|
|
3755
|
+
},
|
|
3756
|
+
getExpensesDispensedByStaff: async (req) => {
|
|
3757
|
+
return await transactionService.getTransactions({
|
|
3758
|
+
transaction: {
|
|
3759
|
+
...req.filter,
|
|
3760
|
+
createdById: req.staffId,
|
|
3761
|
+
transactionType: "expense"
|
|
3762
|
+
},
|
|
3763
|
+
limit: req.limit,
|
|
3764
|
+
skip: req.skip || 0
|
|
3765
|
+
});
|
|
3766
|
+
},
|
|
3767
|
+
dispenseExpense: async (req) => {
|
|
3768
|
+
const { amountPaid, narration, createdById, expenseId } = req.expenseDispense;
|
|
3769
|
+
const expenseRes = await expenseService.getExpense({
|
|
3770
|
+
expense: {
|
|
3771
|
+
id: expenseId
|
|
3772
|
+
}
|
|
3773
|
+
});
|
|
3774
|
+
if (!expenseRes || !expenseRes.expense) {
|
|
3775
|
+
throw new Error("Expense not found");
|
|
3776
|
+
}
|
|
3777
|
+
const expense = expenseRes.expense;
|
|
3778
|
+
if (expense && !expense.dispenseStaffIds.includes(createdById)) {
|
|
3779
|
+
throw new Error("Staff not authorized to dispense this expense");
|
|
3780
|
+
}
|
|
3781
|
+
const transaction = await transactionService.addTransaction({
|
|
3782
|
+
transaction: {
|
|
3783
|
+
transactionType: "expense",
|
|
3784
|
+
amountPaid,
|
|
3785
|
+
narration,
|
|
3786
|
+
createdById,
|
|
3787
|
+
expenseId
|
|
3788
|
+
}
|
|
3789
|
+
});
|
|
3790
|
+
return transaction || void 0;
|
|
3791
|
+
},
|
|
3792
|
+
async approveExpenseDispense(req) {
|
|
3793
|
+
const { expenseId, addToExpenseList = false } = req;
|
|
3794
|
+
const expenseRes = await expenseService.getExpense({
|
|
3795
|
+
expense: {
|
|
3796
|
+
id: expenseId
|
|
3797
|
+
}
|
|
3798
|
+
});
|
|
3799
|
+
if (!expenseRes || !expenseRes.expense) {
|
|
3800
|
+
throw new Error("Expense not found");
|
|
3801
|
+
}
|
|
3802
|
+
const expense = expenseRes.expense;
|
|
3803
|
+
if (expense.expenseType !== "staffRequest") {
|
|
3804
|
+
throw new Error("Only staff requested expenses can be approved for dispense");
|
|
3805
|
+
}
|
|
3806
|
+
const transaction = await this.dispenseExpense({
|
|
3807
|
+
expenseDispense: {
|
|
3808
|
+
expenseId,
|
|
3809
|
+
amountPaid: expense.amount,
|
|
3810
|
+
narration: expense.narration || "Approved expense dispense",
|
|
3811
|
+
createdById: expense.createdById
|
|
3812
|
+
}
|
|
3813
|
+
});
|
|
3814
|
+
await expenseService.updateExpense({
|
|
3815
|
+
expenseId,
|
|
3816
|
+
expense: {
|
|
3817
|
+
expenseType: addToExpenseList ? "operation" : "staffRequestFulfilled"
|
|
3818
|
+
}
|
|
3819
|
+
});
|
|
3820
|
+
return transaction || null;
|
|
3821
|
+
}
|
|
3822
|
+
};
|
|
3823
|
+
};
|
|
3824
|
+
|
|
3825
|
+
export { APPLICATION_FEATURES, AuthenticationError, GraphQLClient, NetworkError, SdkError, SubscriptionPlanFeatureKeyLabels, UpdateSaleResponse, _getPackageResponseNestedFields, _getProductResponseNestedFields, _getSaleResponseNestedFields, _getStoreResponseNestedFields, _getSubscriptionResponseNestedFields, _getTransactionResponseNestedFields, _getTransactionsResponseNestedFields, addPackageResponseFields, addPackageResponseNestedFields, addPackagesResponseFields, addPackagesResponseNestedFields, addPriceResponseFields, addPriceResponseNestedFields, addProductResponseFields, addProductResponseNestedFields, addProductsResponseFields, addProductsResponseNestedFields, addStockResponse, addStockResponseNestedFields, addStoreResponse, addStoreResponseNestedFields, addSubscriptionResponse, addSubscriptionResponseNestedFields, addTransactionResponse, addTransactionResponseNestedFields, compose, createAuthService, createCustomerService, createExpenseCategoryService, createExpenseDispenseService, createExpenseService, createOrderService, createPackageService, createPaystackService, createPriceService, createProductService, createSaleService, createStockService, createStoreCategoryProductResponseFields, createStoreCategoryProductResponseNestedFields, createStoreCategoryProductService, createStoreCategoryResponseFields, createStoreCategoryResponseNestedFields, createStoreCategoryService, createStoreService, createSubscriptionPlanFeatureBehaviourService, createSubscriptionPlanFeatureDefinitionService, createSubscriptionPlanService, createSubscriptionService, createSubscriptionTrialService, createTransactionService, createTransport, createUserAccountService, createUserNotificationService, createUserRoleService, createUserService, expenseCategoryDeleteIntegration, expenseCategoryIntegration, expenseCategoryListIntegration, expenseCategoryQuery, expenseDeleteIntegration, expenseIntegration, expenseListIntegration, expenseQuery, getCustomerProductCountsByIdsResponse, getCustomerProductCountsByIdsResponseNestedFields, getOrderResponse, getOrderResponseNestedFields, getOrdersResponse, getOrdersResponseNestedFields, getPackageResponseFields, getPackageResponseNestedFields, getPackagesResponseFields, getPackagesResponseNestedFields, getPriceResponseFields, getPriceResponseNestedFields, getPricesResponseFields, getPricesResponseNestedFields, getProductByBarcodeResponse, getProductByBarcodeResponseNestedFields, getProductResponseFields, getProductResponseNestedFields, getProductsResponseFields, getProductsResponseNestedFields, getSaleResponse, getSaleResponseNestedFields, getSalesResponse, getSalesResponseNestedFields, getStockResponse, getStockResponseNestedFields, getStocksResponse, getStocksResponseNestedFields, getStoreCategoriesResponseFields, getStoreCategoriesResponseNestedFields, getStoreCategoryProductResponseFields, getStoreCategoryProductResponseNestedFields, getStoreCategoryProductsResponseFields, getStoreCategoryProductsResponseNestedFields, getStoreCategoryResponseFields, getStoreCategoryResponseNestedFields, getStoreCountResponse, getStoreResponse, getStoreResponseNestedFields, getStoresResponse, getStoresResponseNestedFields, getSubscriptionResponse, getSubscriptionResponseNestedFields, getSubscriptionsResponse, getSubscriptionsResponseNestedFields, getTransactionResponse, getTransactionResponseNestedFields, getTransactionsResponse, getTransactionsResponseNestedFields, orderQuery, paystackInitializePaymentResponse, paystackInitializeSubscriptionResponse, removePackageResponseFields, removePriceResponseFields, removeProductResponseFields, removeStockResponse, removeStoreCategoryProductResponseFields, removeStoreCategoryResponseFields, removeStoreResponse, removeSubscriptionResponse, saleQuery, searchCategoriesAndTemplateResponse, searchCategoriesAndTemplateResponseNestedFields, searchProductNamesResponse, searchProductNamesResponseNestedFields, subscriptionPlanDeleteIntegration, subscriptionPlanFeatureBehaviourDeleteIntegration, subscriptionPlanFeatureBehaviourIntegration, subscriptionPlanFeatureBehaviourListIntegration, subscriptionPlanFeatureDefinitionDeleteIntegration, subscriptionPlanFeatureDefinitionIntegration, subscriptionPlanFeatureDefinitionListIntegration, subscriptionPlanIntegration, subscriptionPlanListIntegration, subscriptionTrialDeleteIntegration, subscriptionTrialIntegration, subscriptionTrialListIntegration, toAsyncHeadersFactory, toAsyncTokenProvider, transactionQuery, updatePackageResponseFields, updatePackageResponseNestedFields, updatePriceResponseFields, updatePriceResponseNestedFields, updateProductResponseFields, updateProductResponseNestedFields, updateSaleResponseNestedFields, updateStockResponse, updateStockResponseNestedFields, updateStoreCategoryProductResponseFields, updateStoreCategoryProductResponseNestedFields, updateStoreCategoryResponseFields, updateStoreCategoryResponseNestedFields, updateStoreResponse, updateStoreResponseNestedFields, updateSubscriptionResponse, updateSubscriptionResponseNestedFields, updateTransactionResponse, updateTransactionResponseNestedFields, userRoleExample };
|
|
3723
3826
|
//# sourceMappingURL=index.esm.js.map
|
|
3724
3827
|
//# sourceMappingURL=index.esm.js.map
|