@connect-plus-online/ogabai-integrations 0.0.105 → 0.0.106
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 -94
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +45 -27
- package/dist/index.d.ts +45 -27
- package/dist/index.esm.js +105 -94
- package/dist/index.esm.js.map +1 -1
- package/package.json +4 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import * as _chijioke_graphql_client from '@chijioke/graphql-client';
|
|
2
|
+
import { EntityCRUD as EntityCRUD$1 } from '@chijioke/graphql-client';
|
|
3
|
+
|
|
1
4
|
interface StoreCategory {
|
|
2
5
|
_id: string;
|
|
3
6
|
name: string;
|
|
@@ -103,6 +106,7 @@ interface Stock {
|
|
|
103
106
|
storeId: string;
|
|
104
107
|
createdAt: string;
|
|
105
108
|
expirationDate: string;
|
|
109
|
+
stockType: "market" | "saleReturn";
|
|
106
110
|
}
|
|
107
111
|
interface StoreSetting {
|
|
108
112
|
_id: string;
|
|
@@ -378,7 +382,7 @@ type SaleStatus = "paid" | "credit";
|
|
|
378
382
|
type PaymentType = "cash" | "card" | "transfer" | "wallet";
|
|
379
383
|
type Platform = "pos" | "commerce" | "wallet";
|
|
380
384
|
type TxStatus = "pending" | "processing" | "completed" | "failed";
|
|
381
|
-
type TransactionType = "sale" | "
|
|
385
|
+
type TransactionType = "sale" | "saleReturn" | "deposit" | "withdrawal" | "customerRefund" | "customerDeposit" | "expense";
|
|
382
386
|
type Transaction = {
|
|
383
387
|
_id: string;
|
|
384
388
|
from: string;
|
|
@@ -1959,7 +1963,21 @@ declare const updateTransactionResponse: "transaction"[];
|
|
|
1959
1963
|
type UpdateTransactionResponseNestedFields = GetTransactionResponseNestedFields;
|
|
1960
1964
|
declare const updateTransactionResponseNestedFields: GetTransactionResponseNestedFields;
|
|
1961
1965
|
|
|
1966
|
+
type SelectFields<T, R extends keyof T, O extends keyof T = never> = Required<Pick<T, R>> & Partial<Pick<T, O>>;
|
|
1962
1967
|
declare const createTransactionService: (client: GraphQLClient) => {
|
|
1968
|
+
/**
|
|
1969
|
+
*
|
|
1970
|
+
* @param input transactionRequest
|
|
1971
|
+
* @param fetchFields filter what is returned (fields)
|
|
1972
|
+
* @param option call options - cache
|
|
1973
|
+
* @returns TransactionResponse
|
|
1974
|
+
*/
|
|
1975
|
+
returnSales(input: {
|
|
1976
|
+
transaction: SelectFields<Transaction, "amountPaid" | "sales", "customerId" | "narration">;
|
|
1977
|
+
}, fetchFields?: {
|
|
1978
|
+
root?: (keyof UpdateTransactionResponse)[];
|
|
1979
|
+
nestedFields?: UpdateTransactionResponseNestedFields;
|
|
1980
|
+
}, option?: RequestOption): Promise<UpdateTransactionResponse | null>;
|
|
1963
1981
|
/**
|
|
1964
1982
|
* Uploads a transaction receipt
|
|
1965
1983
|
* @param form {
|
|
@@ -1974,10 +1992,10 @@ declare const createTransactionService: (client: GraphQLClient) => {
|
|
|
1974
1992
|
root?: (keyof UpdateTransactionResponse)[];
|
|
1975
1993
|
nestedFields?: UpdateTransactionResponseNestedFields;
|
|
1976
1994
|
}, option?: RequestOption): Promise<UpdateTransactionResponse | null>;
|
|
1977
|
-
addTransaction(input: AddTransactionRequest, fetchFields?: {
|
|
1995
|
+
addTransaction: (input: AddTransactionRequest, fetchFields?: {
|
|
1978
1996
|
root?: (keyof AddTransactionResponse)[];
|
|
1979
1997
|
nestedFields?: AddTransactionResponseNestedFields;
|
|
1980
|
-
}, option?: RequestOption)
|
|
1998
|
+
}, option?: RequestOption) => Promise<AddTransactionResponse | null>;
|
|
1981
1999
|
addCustomerDeposit(input: Pick<Transaction, "customerId" | "amountPaid" | "createdById">, fetchFields?: {
|
|
1982
2000
|
root?: (keyof AddTransactionResponse)[];
|
|
1983
2001
|
nestedFields?: AddTransactionResponseNestedFields;
|
|
@@ -1998,7 +2016,7 @@ declare const createTransactionService: (client: GraphQLClient) => {
|
|
|
1998
2016
|
type TransactionService = ReturnType<typeof createTransactionService>;
|
|
1999
2017
|
|
|
2000
2018
|
declare const ENTITY$5: "expenseCategory";
|
|
2001
|
-
type ExpenseCategoryCRUD = EntityCRUD<ExpenseCategory, typeof ENTITY$5>;
|
|
2019
|
+
type ExpenseCategoryCRUD = EntityCRUD$1<ExpenseCategory, typeof ENTITY$5>;
|
|
2002
2020
|
declare const expenseCategoryIntegration: {
|
|
2003
2021
|
get: {
|
|
2004
2022
|
responseFields: ["expenseCategory"];
|
|
@@ -2030,7 +2048,7 @@ declare const expenseCategoryDeleteIntegration: {
|
|
|
2030
2048
|
};
|
|
2031
2049
|
|
|
2032
2050
|
declare const ENTITY$4: "expense";
|
|
2033
|
-
type ExpenseCRUD = EntityCRUD<Expense, typeof ENTITY$4>;
|
|
2051
|
+
type ExpenseCRUD = EntityCRUD$1<Expense, typeof ENTITY$4>;
|
|
2034
2052
|
declare const expenseIntegration: {
|
|
2035
2053
|
get: {
|
|
2036
2054
|
responseFields: ["expense"];
|
|
@@ -2062,73 +2080,73 @@ declare const expenseDeleteIntegration: {
|
|
|
2062
2080
|
};
|
|
2063
2081
|
|
|
2064
2082
|
declare const createExpenseCategoryService: (client: GraphQLClient) => {
|
|
2065
|
-
createExpenseCategory: (input: CreateEntityRequest<ExpenseCategory, "expenseCategory">, fetchFields?: {
|
|
2083
|
+
createExpenseCategory: (input: _chijioke_graphql_client.CreateEntityRequest<ExpenseCategory, "expenseCategory">, fetchFields?: {
|
|
2066
2084
|
root?: "expenseCategory"[] | undefined;
|
|
2067
2085
|
nestedFields?: (Record<"expenseCategory", ExpenseCategoryFields> & {
|
|
2068
2086
|
features: ExpenseCategoryFields;
|
|
2069
2087
|
}) | undefined;
|
|
2070
|
-
} | undefined, option?: RequestOption) => Promise<EntityResponse<ExpenseCategory, "expenseCategory"> | undefined>;
|
|
2071
|
-
updateExpenseCategory: (input: UpdateEntityRequest<ExpenseCategory, "expenseCategory">, fetchFields?: {
|
|
2088
|
+
} | undefined, option?: RequestOption) => Promise<_chijioke_graphql_client.EntityResponse<ExpenseCategory, "expenseCategory"> | undefined>;
|
|
2089
|
+
updateExpenseCategory: (input: _chijioke_graphql_client.UpdateEntityRequest<ExpenseCategory, "expenseCategory">, fetchFields?: {
|
|
2072
2090
|
root?: "expenseCategory"[] | undefined;
|
|
2073
2091
|
nestedFields?: (Record<"expenseCategory", ExpenseCategoryFields> & {
|
|
2074
2092
|
features: ExpenseCategoryFields;
|
|
2075
2093
|
}) | undefined;
|
|
2076
|
-
} | undefined, option?: RequestOption) => Promise<EntityResponse<ExpenseCategory, "expenseCategory"> | undefined>;
|
|
2077
|
-
getExpenseCategory: (input: GetEntityRequest<ExpenseCategory, "expenseCategory">, fetchFields?: {
|
|
2094
|
+
} | undefined, option?: RequestOption) => Promise<_chijioke_graphql_client.EntityResponse<ExpenseCategory, "expenseCategory"> | undefined>;
|
|
2095
|
+
getExpenseCategory: (input: _chijioke_graphql_client.GetEntityRequest<ExpenseCategory, "expenseCategory">, fetchFields?: {
|
|
2078
2096
|
root?: "expenseCategory"[] | undefined;
|
|
2079
2097
|
nestedFields?: (Record<"expenseCategory", ExpenseCategoryFields> & {
|
|
2080
2098
|
features: ExpenseCategoryFields;
|
|
2081
2099
|
}) | undefined;
|
|
2082
|
-
} | undefined, option?: RequestOption) => Promise<EntityResponse<ExpenseCategory, "expenseCategory"> | undefined>;
|
|
2083
|
-
deleteExpenseCategory: (input: DeleteEntityRequest<"expenseCategory">, fetchFields?: {
|
|
2100
|
+
} | undefined, option?: RequestOption) => Promise<_chijioke_graphql_client.EntityResponse<ExpenseCategory, "expenseCategory"> | undefined>;
|
|
2101
|
+
deleteExpenseCategory: (input: _chijioke_graphql_client.DeleteEntityRequest<"expenseCategory">, fetchFields?: {
|
|
2084
2102
|
root?: "expenseCategoryId"[] | undefined;
|
|
2085
2103
|
nestedFields?: {} | undefined;
|
|
2086
|
-
} | undefined, option?: RequestOption) => Promise<DeleteEntityResponse<"expenseCategory"> | undefined>;
|
|
2087
|
-
getExpenseCategories: (input: ListEntityRequest<ExpenseCategory, "expenseCategory">, fetchFields?: {
|
|
2104
|
+
} | undefined, option?: RequestOption) => Promise<_chijioke_graphql_client.DeleteEntityResponse<"expenseCategory"> | undefined>;
|
|
2105
|
+
getExpenseCategories: (input: _chijioke_graphql_client.ListEntityRequest<ExpenseCategory, "expenseCategory">, fetchFields?: {
|
|
2088
2106
|
root?: ("total" | "expenseCategories")[] | undefined;
|
|
2089
2107
|
nestedFields?: (Record<"expenseCategories", ExpenseCategoryFields> & {
|
|
2090
2108
|
features: ExpenseCategoryFields;
|
|
2091
2109
|
}) | undefined;
|
|
2092
|
-
} | undefined, option?: RequestOption) => Promise<ListEntityResponse<ExpenseCategory, "expenseCategory"> | undefined>;
|
|
2110
|
+
} | undefined, option?: RequestOption) => Promise<_chijioke_graphql_client.ListEntityResponse<ExpenseCategory, "expenseCategory"> | undefined>;
|
|
2093
2111
|
};
|
|
2094
2112
|
type ExpenseCategoryService = ReturnType<typeof createExpenseCategoryService>;
|
|
2095
2113
|
|
|
2096
2114
|
declare const createExpenseService: (client: GraphQLClient) => {
|
|
2097
|
-
createExpense: (input: CreateEntityRequest<Expense, "expense">, fetchFields?: {
|
|
2115
|
+
createExpense: (input: _chijioke_graphql_client.CreateEntityRequest<Expense, "expense">, fetchFields?: {
|
|
2098
2116
|
root?: "expense"[] | undefined;
|
|
2099
2117
|
nestedFields?: (Record<"expense", ExpenseFields> & {
|
|
2100
2118
|
features: ExpenseFields;
|
|
2101
2119
|
}) | undefined;
|
|
2102
|
-
} | undefined, option?: RequestOption) => Promise<EntityResponse<Expense, "expense"> | undefined>;
|
|
2103
|
-
updateExpense: (input: UpdateEntityRequest<Expense, "expense">, fetchFields?: {
|
|
2120
|
+
} | undefined, option?: RequestOption) => Promise<_chijioke_graphql_client.EntityResponse<Expense, "expense"> | undefined>;
|
|
2121
|
+
updateExpense: (input: _chijioke_graphql_client.UpdateEntityRequest<Expense, "expense">, fetchFields?: {
|
|
2104
2122
|
root?: "expense"[] | undefined;
|
|
2105
2123
|
nestedFields?: (Record<"expense", ExpenseFields> & {
|
|
2106
2124
|
features: ExpenseFields;
|
|
2107
2125
|
}) | undefined;
|
|
2108
|
-
} | undefined, option?: RequestOption) => Promise<EntityResponse<Expense, "expense"> | undefined>;
|
|
2109
|
-
getExpense: (input: GetEntityRequest<Expense, "expense">, fetchFields?: {
|
|
2126
|
+
} | undefined, option?: RequestOption) => Promise<_chijioke_graphql_client.EntityResponse<Expense, "expense"> | undefined>;
|
|
2127
|
+
getExpense: (input: _chijioke_graphql_client.GetEntityRequest<Expense, "expense">, fetchFields?: {
|
|
2110
2128
|
root?: "expense"[] | undefined;
|
|
2111
2129
|
nestedFields?: (Record<"expense", ExpenseFields> & {
|
|
2112
2130
|
features: ExpenseFields;
|
|
2113
2131
|
}) | undefined;
|
|
2114
|
-
} | undefined, option?: RequestOption) => Promise<EntityResponse<Expense, "expense"> | undefined>;
|
|
2115
|
-
deleteExpense: (input: DeleteEntityRequest<"expense">, fetchFields?: {
|
|
2132
|
+
} | undefined, option?: RequestOption) => Promise<_chijioke_graphql_client.EntityResponse<Expense, "expense"> | undefined>;
|
|
2133
|
+
deleteExpense: (input: _chijioke_graphql_client.DeleteEntityRequest<"expense">, fetchFields?: {
|
|
2116
2134
|
root?: "expenseId"[] | undefined;
|
|
2117
2135
|
nestedFields?: {} | undefined;
|
|
2118
|
-
} | undefined, option?: RequestOption) => Promise<DeleteEntityResponse<"expense"> | undefined>;
|
|
2119
|
-
getExpenses: (input: ListEntityRequest<Expense, "expense">, fetchFields?: {
|
|
2136
|
+
} | undefined, option?: RequestOption) => Promise<_chijioke_graphql_client.DeleteEntityResponse<"expense"> | undefined>;
|
|
2137
|
+
getExpenses: (input: _chijioke_graphql_client.ListEntityRequest<Expense, "expense">, fetchFields?: {
|
|
2120
2138
|
root?: ("total" | "expenses")[] | undefined;
|
|
2121
2139
|
nestedFields?: (Record<"expenses", ExpenseFields> & {
|
|
2122
2140
|
features: ExpenseFields;
|
|
2123
2141
|
}) | undefined;
|
|
2124
|
-
} | undefined, option?: RequestOption) => Promise<ListEntityResponse<Expense, "expense"> | undefined>;
|
|
2142
|
+
} | undefined, option?: RequestOption) => Promise<_chijioke_graphql_client.ListEntityResponse<Expense, "expense"> | undefined>;
|
|
2125
2143
|
getExpensesByStaffId(req: {
|
|
2126
2144
|
staffId: string;
|
|
2127
2145
|
limit: number;
|
|
2128
2146
|
skip: number;
|
|
2129
2147
|
filter?: Partial<Omit<Expense, "dispenseStaffIds">>;
|
|
2130
|
-
}): Promise<ListEntityResponse<Expense, "expense"> | undefined>;
|
|
2131
|
-
requestExpenseDispense(req: CreateEntityRequest<Expense, "expense">): Promise<EntityResponse<Expense, "expense"> | undefined>;
|
|
2148
|
+
}): Promise<_chijioke_graphql_client.ListEntityResponse<Expense, "expense"> | undefined>;
|
|
2149
|
+
requestExpenseDispense(req: CreateEntityRequest<Expense, "expense">): Promise<_chijioke_graphql_client.EntityResponse<Expense, "expense"> | undefined>;
|
|
2132
2150
|
};
|
|
2133
2151
|
type ExpenseService = ReturnType<typeof createExpenseService>;
|
|
2134
2152
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import * as _chijioke_graphql_client from '@chijioke/graphql-client';
|
|
2
|
+
import { EntityCRUD as EntityCRUD$1 } from '@chijioke/graphql-client';
|
|
3
|
+
|
|
1
4
|
interface StoreCategory {
|
|
2
5
|
_id: string;
|
|
3
6
|
name: string;
|
|
@@ -103,6 +106,7 @@ interface Stock {
|
|
|
103
106
|
storeId: string;
|
|
104
107
|
createdAt: string;
|
|
105
108
|
expirationDate: string;
|
|
109
|
+
stockType: "market" | "saleReturn";
|
|
106
110
|
}
|
|
107
111
|
interface StoreSetting {
|
|
108
112
|
_id: string;
|
|
@@ -378,7 +382,7 @@ type SaleStatus = "paid" | "credit";
|
|
|
378
382
|
type PaymentType = "cash" | "card" | "transfer" | "wallet";
|
|
379
383
|
type Platform = "pos" | "commerce" | "wallet";
|
|
380
384
|
type TxStatus = "pending" | "processing" | "completed" | "failed";
|
|
381
|
-
type TransactionType = "sale" | "
|
|
385
|
+
type TransactionType = "sale" | "saleReturn" | "deposit" | "withdrawal" | "customerRefund" | "customerDeposit" | "expense";
|
|
382
386
|
type Transaction = {
|
|
383
387
|
_id: string;
|
|
384
388
|
from: string;
|
|
@@ -1959,7 +1963,21 @@ declare const updateTransactionResponse: "transaction"[];
|
|
|
1959
1963
|
type UpdateTransactionResponseNestedFields = GetTransactionResponseNestedFields;
|
|
1960
1964
|
declare const updateTransactionResponseNestedFields: GetTransactionResponseNestedFields;
|
|
1961
1965
|
|
|
1966
|
+
type SelectFields<T, R extends keyof T, O extends keyof T = never> = Required<Pick<T, R>> & Partial<Pick<T, O>>;
|
|
1962
1967
|
declare const createTransactionService: (client: GraphQLClient) => {
|
|
1968
|
+
/**
|
|
1969
|
+
*
|
|
1970
|
+
* @param input transactionRequest
|
|
1971
|
+
* @param fetchFields filter what is returned (fields)
|
|
1972
|
+
* @param option call options - cache
|
|
1973
|
+
* @returns TransactionResponse
|
|
1974
|
+
*/
|
|
1975
|
+
returnSales(input: {
|
|
1976
|
+
transaction: SelectFields<Transaction, "amountPaid" | "sales", "customerId" | "narration">;
|
|
1977
|
+
}, fetchFields?: {
|
|
1978
|
+
root?: (keyof UpdateTransactionResponse)[];
|
|
1979
|
+
nestedFields?: UpdateTransactionResponseNestedFields;
|
|
1980
|
+
}, option?: RequestOption): Promise<UpdateTransactionResponse | null>;
|
|
1963
1981
|
/**
|
|
1964
1982
|
* Uploads a transaction receipt
|
|
1965
1983
|
* @param form {
|
|
@@ -1974,10 +1992,10 @@ declare const createTransactionService: (client: GraphQLClient) => {
|
|
|
1974
1992
|
root?: (keyof UpdateTransactionResponse)[];
|
|
1975
1993
|
nestedFields?: UpdateTransactionResponseNestedFields;
|
|
1976
1994
|
}, option?: RequestOption): Promise<UpdateTransactionResponse | null>;
|
|
1977
|
-
addTransaction(input: AddTransactionRequest, fetchFields?: {
|
|
1995
|
+
addTransaction: (input: AddTransactionRequest, fetchFields?: {
|
|
1978
1996
|
root?: (keyof AddTransactionResponse)[];
|
|
1979
1997
|
nestedFields?: AddTransactionResponseNestedFields;
|
|
1980
|
-
}, option?: RequestOption)
|
|
1998
|
+
}, option?: RequestOption) => Promise<AddTransactionResponse | null>;
|
|
1981
1999
|
addCustomerDeposit(input: Pick<Transaction, "customerId" | "amountPaid" | "createdById">, fetchFields?: {
|
|
1982
2000
|
root?: (keyof AddTransactionResponse)[];
|
|
1983
2001
|
nestedFields?: AddTransactionResponseNestedFields;
|
|
@@ -1998,7 +2016,7 @@ declare const createTransactionService: (client: GraphQLClient) => {
|
|
|
1998
2016
|
type TransactionService = ReturnType<typeof createTransactionService>;
|
|
1999
2017
|
|
|
2000
2018
|
declare const ENTITY$5: "expenseCategory";
|
|
2001
|
-
type ExpenseCategoryCRUD = EntityCRUD<ExpenseCategory, typeof ENTITY$5>;
|
|
2019
|
+
type ExpenseCategoryCRUD = EntityCRUD$1<ExpenseCategory, typeof ENTITY$5>;
|
|
2002
2020
|
declare const expenseCategoryIntegration: {
|
|
2003
2021
|
get: {
|
|
2004
2022
|
responseFields: ["expenseCategory"];
|
|
@@ -2030,7 +2048,7 @@ declare const expenseCategoryDeleteIntegration: {
|
|
|
2030
2048
|
};
|
|
2031
2049
|
|
|
2032
2050
|
declare const ENTITY$4: "expense";
|
|
2033
|
-
type ExpenseCRUD = EntityCRUD<Expense, typeof ENTITY$4>;
|
|
2051
|
+
type ExpenseCRUD = EntityCRUD$1<Expense, typeof ENTITY$4>;
|
|
2034
2052
|
declare const expenseIntegration: {
|
|
2035
2053
|
get: {
|
|
2036
2054
|
responseFields: ["expense"];
|
|
@@ -2062,73 +2080,73 @@ declare const expenseDeleteIntegration: {
|
|
|
2062
2080
|
};
|
|
2063
2081
|
|
|
2064
2082
|
declare const createExpenseCategoryService: (client: GraphQLClient) => {
|
|
2065
|
-
createExpenseCategory: (input: CreateEntityRequest<ExpenseCategory, "expenseCategory">, fetchFields?: {
|
|
2083
|
+
createExpenseCategory: (input: _chijioke_graphql_client.CreateEntityRequest<ExpenseCategory, "expenseCategory">, fetchFields?: {
|
|
2066
2084
|
root?: "expenseCategory"[] | undefined;
|
|
2067
2085
|
nestedFields?: (Record<"expenseCategory", ExpenseCategoryFields> & {
|
|
2068
2086
|
features: ExpenseCategoryFields;
|
|
2069
2087
|
}) | undefined;
|
|
2070
|
-
} | undefined, option?: RequestOption) => Promise<EntityResponse<ExpenseCategory, "expenseCategory"> | undefined>;
|
|
2071
|
-
updateExpenseCategory: (input: UpdateEntityRequest<ExpenseCategory, "expenseCategory">, fetchFields?: {
|
|
2088
|
+
} | undefined, option?: RequestOption) => Promise<_chijioke_graphql_client.EntityResponse<ExpenseCategory, "expenseCategory"> | undefined>;
|
|
2089
|
+
updateExpenseCategory: (input: _chijioke_graphql_client.UpdateEntityRequest<ExpenseCategory, "expenseCategory">, fetchFields?: {
|
|
2072
2090
|
root?: "expenseCategory"[] | undefined;
|
|
2073
2091
|
nestedFields?: (Record<"expenseCategory", ExpenseCategoryFields> & {
|
|
2074
2092
|
features: ExpenseCategoryFields;
|
|
2075
2093
|
}) | undefined;
|
|
2076
|
-
} | undefined, option?: RequestOption) => Promise<EntityResponse<ExpenseCategory, "expenseCategory"> | undefined>;
|
|
2077
|
-
getExpenseCategory: (input: GetEntityRequest<ExpenseCategory, "expenseCategory">, fetchFields?: {
|
|
2094
|
+
} | undefined, option?: RequestOption) => Promise<_chijioke_graphql_client.EntityResponse<ExpenseCategory, "expenseCategory"> | undefined>;
|
|
2095
|
+
getExpenseCategory: (input: _chijioke_graphql_client.GetEntityRequest<ExpenseCategory, "expenseCategory">, fetchFields?: {
|
|
2078
2096
|
root?: "expenseCategory"[] | undefined;
|
|
2079
2097
|
nestedFields?: (Record<"expenseCategory", ExpenseCategoryFields> & {
|
|
2080
2098
|
features: ExpenseCategoryFields;
|
|
2081
2099
|
}) | undefined;
|
|
2082
|
-
} | undefined, option?: RequestOption) => Promise<EntityResponse<ExpenseCategory, "expenseCategory"> | undefined>;
|
|
2083
|
-
deleteExpenseCategory: (input: DeleteEntityRequest<"expenseCategory">, fetchFields?: {
|
|
2100
|
+
} | undefined, option?: RequestOption) => Promise<_chijioke_graphql_client.EntityResponse<ExpenseCategory, "expenseCategory"> | undefined>;
|
|
2101
|
+
deleteExpenseCategory: (input: _chijioke_graphql_client.DeleteEntityRequest<"expenseCategory">, fetchFields?: {
|
|
2084
2102
|
root?: "expenseCategoryId"[] | undefined;
|
|
2085
2103
|
nestedFields?: {} | undefined;
|
|
2086
|
-
} | undefined, option?: RequestOption) => Promise<DeleteEntityResponse<"expenseCategory"> | undefined>;
|
|
2087
|
-
getExpenseCategories: (input: ListEntityRequest<ExpenseCategory, "expenseCategory">, fetchFields?: {
|
|
2104
|
+
} | undefined, option?: RequestOption) => Promise<_chijioke_graphql_client.DeleteEntityResponse<"expenseCategory"> | undefined>;
|
|
2105
|
+
getExpenseCategories: (input: _chijioke_graphql_client.ListEntityRequest<ExpenseCategory, "expenseCategory">, fetchFields?: {
|
|
2088
2106
|
root?: ("total" | "expenseCategories")[] | undefined;
|
|
2089
2107
|
nestedFields?: (Record<"expenseCategories", ExpenseCategoryFields> & {
|
|
2090
2108
|
features: ExpenseCategoryFields;
|
|
2091
2109
|
}) | undefined;
|
|
2092
|
-
} | undefined, option?: RequestOption) => Promise<ListEntityResponse<ExpenseCategory, "expenseCategory"> | undefined>;
|
|
2110
|
+
} | undefined, option?: RequestOption) => Promise<_chijioke_graphql_client.ListEntityResponse<ExpenseCategory, "expenseCategory"> | undefined>;
|
|
2093
2111
|
};
|
|
2094
2112
|
type ExpenseCategoryService = ReturnType<typeof createExpenseCategoryService>;
|
|
2095
2113
|
|
|
2096
2114
|
declare const createExpenseService: (client: GraphQLClient) => {
|
|
2097
|
-
createExpense: (input: CreateEntityRequest<Expense, "expense">, fetchFields?: {
|
|
2115
|
+
createExpense: (input: _chijioke_graphql_client.CreateEntityRequest<Expense, "expense">, fetchFields?: {
|
|
2098
2116
|
root?: "expense"[] | undefined;
|
|
2099
2117
|
nestedFields?: (Record<"expense", ExpenseFields> & {
|
|
2100
2118
|
features: ExpenseFields;
|
|
2101
2119
|
}) | undefined;
|
|
2102
|
-
} | undefined, option?: RequestOption) => Promise<EntityResponse<Expense, "expense"> | undefined>;
|
|
2103
|
-
updateExpense: (input: UpdateEntityRequest<Expense, "expense">, fetchFields?: {
|
|
2120
|
+
} | undefined, option?: RequestOption) => Promise<_chijioke_graphql_client.EntityResponse<Expense, "expense"> | undefined>;
|
|
2121
|
+
updateExpense: (input: _chijioke_graphql_client.UpdateEntityRequest<Expense, "expense">, fetchFields?: {
|
|
2104
2122
|
root?: "expense"[] | undefined;
|
|
2105
2123
|
nestedFields?: (Record<"expense", ExpenseFields> & {
|
|
2106
2124
|
features: ExpenseFields;
|
|
2107
2125
|
}) | undefined;
|
|
2108
|
-
} | undefined, option?: RequestOption) => Promise<EntityResponse<Expense, "expense"> | undefined>;
|
|
2109
|
-
getExpense: (input: GetEntityRequest<Expense, "expense">, fetchFields?: {
|
|
2126
|
+
} | undefined, option?: RequestOption) => Promise<_chijioke_graphql_client.EntityResponse<Expense, "expense"> | undefined>;
|
|
2127
|
+
getExpense: (input: _chijioke_graphql_client.GetEntityRequest<Expense, "expense">, fetchFields?: {
|
|
2110
2128
|
root?: "expense"[] | undefined;
|
|
2111
2129
|
nestedFields?: (Record<"expense", ExpenseFields> & {
|
|
2112
2130
|
features: ExpenseFields;
|
|
2113
2131
|
}) | undefined;
|
|
2114
|
-
} | undefined, option?: RequestOption) => Promise<EntityResponse<Expense, "expense"> | undefined>;
|
|
2115
|
-
deleteExpense: (input: DeleteEntityRequest<"expense">, fetchFields?: {
|
|
2132
|
+
} | undefined, option?: RequestOption) => Promise<_chijioke_graphql_client.EntityResponse<Expense, "expense"> | undefined>;
|
|
2133
|
+
deleteExpense: (input: _chijioke_graphql_client.DeleteEntityRequest<"expense">, fetchFields?: {
|
|
2116
2134
|
root?: "expenseId"[] | undefined;
|
|
2117
2135
|
nestedFields?: {} | undefined;
|
|
2118
|
-
} | undefined, option?: RequestOption) => Promise<DeleteEntityResponse<"expense"> | undefined>;
|
|
2119
|
-
getExpenses: (input: ListEntityRequest<Expense, "expense">, fetchFields?: {
|
|
2136
|
+
} | undefined, option?: RequestOption) => Promise<_chijioke_graphql_client.DeleteEntityResponse<"expense"> | undefined>;
|
|
2137
|
+
getExpenses: (input: _chijioke_graphql_client.ListEntityRequest<Expense, "expense">, fetchFields?: {
|
|
2120
2138
|
root?: ("total" | "expenses")[] | undefined;
|
|
2121
2139
|
nestedFields?: (Record<"expenses", ExpenseFields> & {
|
|
2122
2140
|
features: ExpenseFields;
|
|
2123
2141
|
}) | undefined;
|
|
2124
|
-
} | undefined, option?: RequestOption) => Promise<ListEntityResponse<Expense, "expense"> | undefined>;
|
|
2142
|
+
} | undefined, option?: RequestOption) => Promise<_chijioke_graphql_client.ListEntityResponse<Expense, "expense"> | undefined>;
|
|
2125
2143
|
getExpensesByStaffId(req: {
|
|
2126
2144
|
staffId: string;
|
|
2127
2145
|
limit: number;
|
|
2128
2146
|
skip: number;
|
|
2129
2147
|
filter?: Partial<Omit<Expense, "dispenseStaffIds">>;
|
|
2130
|
-
}): Promise<ListEntityResponse<Expense, "expense"> | undefined>;
|
|
2131
|
-
requestExpenseDispense(req: CreateEntityRequest<Expense, "expense">): Promise<EntityResponse<Expense, "expense"> | undefined>;
|
|
2148
|
+
}): Promise<_chijioke_graphql_client.ListEntityResponse<Expense, "expense"> | undefined>;
|
|
2149
|
+
requestExpenseDispense(req: CreateEntityRequest<Expense, "expense">): Promise<_chijioke_graphql_client.EntityResponse<Expense, "expense"> | undefined>;
|
|
2132
2150
|
};
|
|
2133
2151
|
type ExpenseService = ReturnType<typeof createExpenseService>;
|
|
2134
2152
|
|
package/dist/index.esm.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { createStandardEntityIntegration as createStandardEntityIntegration$1, createListIntegration as createListIntegration$1, createDeleteIntegration as createDeleteIntegration$1 } from '@chijioke/graphql-client';
|
|
2
|
+
|
|
1
3
|
// src/types/user.ts
|
|
2
4
|
var AppNewFeatures = /* @__PURE__ */ ((AppNewFeatures2) => {
|
|
3
5
|
AppNewFeatures2["ExpenseTracker"] = "expenseTracker";
|
|
@@ -3526,35 +3528,8 @@ var updateTransactionResponse = getTransactionResponse;
|
|
|
3526
3528
|
var updateTransactionResponseNestedFields = getTransactionResponseNestedFields;
|
|
3527
3529
|
|
|
3528
3530
|
// src/services/sales/transaction.service.ts
|
|
3529
|
-
var createTransactionService = (client) =>
|
|
3530
|
-
|
|
3531
|
-
* Uploads a transaction receipt
|
|
3532
|
-
* @param form {
|
|
3533
|
-
* file: File;
|
|
3534
|
-
* transactionId: string;
|
|
3535
|
-
* storeId: string;
|
|
3536
|
-
* }
|
|
3537
|
-
* @returns Transaction with updated receipt URL
|
|
3538
|
-
*/
|
|
3539
|
-
async uploadExpenseReceipt(form) {
|
|
3540
|
-
const fileClient = createFileService(client);
|
|
3541
|
-
return (await fileClient.uploadTxReceipt(form)).transaction;
|
|
3542
|
-
},
|
|
3543
|
-
async updateTransaction(input, fetchFields, option) {
|
|
3544
|
-
var _a, _b, _c, _d;
|
|
3545
|
-
const res = await client.request(
|
|
3546
|
-
transactionSchema.updateTransaction(
|
|
3547
|
-
gqlQueryStringBuilder(
|
|
3548
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : updateTransactionResponse,
|
|
3549
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : updateTransactionResponseNestedFields
|
|
3550
|
-
)
|
|
3551
|
-
),
|
|
3552
|
-
input,
|
|
3553
|
-
option
|
|
3554
|
-
);
|
|
3555
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.updateTransaction) != null ? _d : null;
|
|
3556
|
-
},
|
|
3557
|
-
async addTransaction(input, fetchFields, option) {
|
|
3531
|
+
var createTransactionService = (client) => {
|
|
3532
|
+
async function addTransaction(input, fetchFields, option) {
|
|
3558
3533
|
var _a, _b, _c, _d;
|
|
3559
3534
|
const res = await client.request(
|
|
3560
3535
|
transactionSchema.addTransaction(
|
|
@@ -3567,98 +3542,134 @@ var createTransactionService = (client) => ({
|
|
|
3567
3542
|
option
|
|
3568
3543
|
);
|
|
3569
3544
|
return (_d = (_c = res.data) == null ? void 0 : _c.addTransaction) != null ? _d : null;
|
|
3570
|
-
},
|
|
3571
|
-
async addCustomerDeposit(input, fetchFields, option) {
|
|
3572
|
-
return this.addTransaction(
|
|
3573
|
-
{
|
|
3574
|
-
transaction: {
|
|
3575
|
-
...input,
|
|
3576
|
-
transactionType: "customerDeposit",
|
|
3577
|
-
platform: "pos"
|
|
3578
|
-
}
|
|
3579
|
-
},
|
|
3580
|
-
fetchFields,
|
|
3581
|
-
option
|
|
3582
|
-
);
|
|
3583
|
-
},
|
|
3584
|
-
async addCustomerRefund(input, fetchFields, option) {
|
|
3585
|
-
return this.addTransaction(
|
|
3586
|
-
{
|
|
3587
|
-
transaction: {
|
|
3588
|
-
...input,
|
|
3589
|
-
transactionType: "customerRefund",
|
|
3590
|
-
platform: "pos"
|
|
3591
|
-
}
|
|
3592
|
-
},
|
|
3593
|
-
fetchFields,
|
|
3594
|
-
option
|
|
3595
|
-
);
|
|
3596
|
-
},
|
|
3597
|
-
async getTransaction(input, fetchFields, option) {
|
|
3598
|
-
var _a, _b, _c, _d;
|
|
3599
|
-
const res = await client.request(
|
|
3600
|
-
transactionSchema.getTransaction(
|
|
3601
|
-
gqlQueryStringBuilder(
|
|
3602
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getTransactionResponse,
|
|
3603
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getTransactionResponseNestedFields
|
|
3604
|
-
)
|
|
3605
|
-
),
|
|
3606
|
-
input,
|
|
3607
|
-
option
|
|
3608
|
-
);
|
|
3609
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.getTransaction) != null ? _d : null;
|
|
3610
|
-
},
|
|
3611
|
-
async getTransactions(input, fetchFields, option) {
|
|
3612
|
-
var _a, _b, _c, _d;
|
|
3613
|
-
const res = await client.request(
|
|
3614
|
-
transactionSchema.getTransactions(
|
|
3615
|
-
gqlQueryStringBuilder(
|
|
3616
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getTransactionsResponse,
|
|
3617
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getTransactionsResponseNestedFields
|
|
3618
|
-
)
|
|
3619
|
-
),
|
|
3620
|
-
input,
|
|
3621
|
-
option
|
|
3622
|
-
);
|
|
3623
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.getTransactions) != null ? _d : null;
|
|
3624
3545
|
}
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3546
|
+
return {
|
|
3547
|
+
/**
|
|
3548
|
+
*
|
|
3549
|
+
* @param input transactionRequest
|
|
3550
|
+
* @param fetchFields filter what is returned (fields)
|
|
3551
|
+
* @param option call options - cache
|
|
3552
|
+
* @returns TransactionResponse
|
|
3553
|
+
*/
|
|
3554
|
+
async returnSales(input, fetchFields, option) {
|
|
3555
|
+
return addTransaction(input, fetchFields, option);
|
|
3556
|
+
},
|
|
3557
|
+
/**
|
|
3558
|
+
* Uploads a transaction receipt
|
|
3559
|
+
* @param form {
|
|
3560
|
+
* file: File;
|
|
3561
|
+
* transactionId: string;
|
|
3562
|
+
* storeId: string;
|
|
3563
|
+
* }
|
|
3564
|
+
* @returns Transaction with updated receipt URL
|
|
3565
|
+
*/
|
|
3566
|
+
async uploadExpenseReceipt(form) {
|
|
3567
|
+
const fileClient = createFileService(client);
|
|
3568
|
+
return (await fileClient.uploadTxReceipt(form)).transaction;
|
|
3569
|
+
},
|
|
3570
|
+
async updateTransaction(input, fetchFields, option) {
|
|
3571
|
+
var _a, _b, _c, _d;
|
|
3572
|
+
const res = await client.request(
|
|
3573
|
+
transactionSchema.updateTransaction(
|
|
3574
|
+
gqlQueryStringBuilder(
|
|
3575
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : updateTransactionResponse,
|
|
3576
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : updateTransactionResponseNestedFields
|
|
3577
|
+
)
|
|
3578
|
+
),
|
|
3579
|
+
input,
|
|
3580
|
+
option
|
|
3581
|
+
);
|
|
3582
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.updateTransaction) != null ? _d : null;
|
|
3583
|
+
},
|
|
3584
|
+
addTransaction,
|
|
3585
|
+
async addCustomerDeposit(input, fetchFields, option) {
|
|
3586
|
+
return this.addTransaction(
|
|
3587
|
+
{
|
|
3588
|
+
transaction: {
|
|
3589
|
+
...input,
|
|
3590
|
+
transactionType: "customerDeposit",
|
|
3591
|
+
platform: "pos"
|
|
3592
|
+
}
|
|
3593
|
+
},
|
|
3594
|
+
fetchFields,
|
|
3595
|
+
option
|
|
3596
|
+
);
|
|
3597
|
+
},
|
|
3598
|
+
async addCustomerRefund(input, fetchFields, option) {
|
|
3599
|
+
return this.addTransaction(
|
|
3600
|
+
{
|
|
3601
|
+
transaction: {
|
|
3602
|
+
...input,
|
|
3603
|
+
transactionType: "customerRefund",
|
|
3604
|
+
platform: "pos"
|
|
3605
|
+
}
|
|
3606
|
+
},
|
|
3607
|
+
fetchFields,
|
|
3608
|
+
option
|
|
3609
|
+
);
|
|
3610
|
+
},
|
|
3611
|
+
async getTransaction(input, fetchFields, option) {
|
|
3612
|
+
var _a, _b, _c, _d;
|
|
3613
|
+
const res = await client.request(
|
|
3614
|
+
transactionSchema.getTransaction(
|
|
3615
|
+
gqlQueryStringBuilder(
|
|
3616
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getTransactionResponse,
|
|
3617
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getTransactionResponseNestedFields
|
|
3618
|
+
)
|
|
3619
|
+
),
|
|
3620
|
+
input,
|
|
3621
|
+
option
|
|
3622
|
+
);
|
|
3623
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.getTransaction) != null ? _d : null;
|
|
3624
|
+
},
|
|
3625
|
+
async getTransactions(input, fetchFields, option) {
|
|
3626
|
+
var _a, _b, _c, _d;
|
|
3627
|
+
const res = await client.request(
|
|
3628
|
+
transactionSchema.getTransactions(
|
|
3629
|
+
gqlQueryStringBuilder(
|
|
3630
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getTransactionsResponse,
|
|
3631
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getTransactionsResponseNestedFields
|
|
3632
|
+
)
|
|
3633
|
+
),
|
|
3634
|
+
input,
|
|
3635
|
+
option
|
|
3636
|
+
);
|
|
3637
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.getTransactions) != null ? _d : null;
|
|
3638
|
+
}
|
|
3639
|
+
};
|
|
3640
|
+
};
|
|
3628
3641
|
var ENTITY8 = "expenseCategory";
|
|
3629
|
-
var expenseCategoryIntegration = createStandardEntityIntegration({
|
|
3642
|
+
var expenseCategoryIntegration = createStandardEntityIntegration$1({
|
|
3630
3643
|
key: ENTITY8,
|
|
3631
3644
|
fields: expenseCategoryQuery,
|
|
3632
3645
|
nested: {
|
|
3633
3646
|
features: expenseCategoryQuery
|
|
3634
3647
|
}
|
|
3635
3648
|
});
|
|
3636
|
-
var expenseCategoryListIntegration = createListIntegration({
|
|
3649
|
+
var expenseCategoryListIntegration = createListIntegration$1({
|
|
3637
3650
|
key: ENTITY8,
|
|
3638
3651
|
fields: expenseCategoryQuery,
|
|
3639
3652
|
nested: {
|
|
3640
3653
|
features: expenseCategoryQuery
|
|
3641
3654
|
}
|
|
3642
3655
|
});
|
|
3643
|
-
var expenseCategoryDeleteIntegration = createDeleteIntegration(ENTITY8);
|
|
3644
|
-
|
|
3645
|
-
// src/services/sales/types/expense.type.ts
|
|
3656
|
+
var expenseCategoryDeleteIntegration = createDeleteIntegration$1(ENTITY8);
|
|
3646
3657
|
var ENTITY9 = "expense";
|
|
3647
|
-
var expenseIntegration = createStandardEntityIntegration({
|
|
3658
|
+
var expenseIntegration = createStandardEntityIntegration$1({
|
|
3648
3659
|
key: ENTITY9,
|
|
3649
3660
|
fields: expenseQuery,
|
|
3650
3661
|
nested: {
|
|
3651
3662
|
features: expenseQuery
|
|
3652
3663
|
}
|
|
3653
3664
|
});
|
|
3654
|
-
var expenseListIntegration = createListIntegration({
|
|
3665
|
+
var expenseListIntegration = createListIntegration$1({
|
|
3655
3666
|
key: ENTITY9,
|
|
3656
3667
|
fields: expenseQuery,
|
|
3657
3668
|
nested: {
|
|
3658
3669
|
features: expenseQuery
|
|
3659
3670
|
}
|
|
3660
3671
|
});
|
|
3661
|
-
var expenseDeleteIntegration = createDeleteIntegration(ENTITY9);
|
|
3672
|
+
var expenseDeleteIntegration = createDeleteIntegration$1(ENTITY9);
|
|
3662
3673
|
|
|
3663
3674
|
// src/services/sales/schemas/expense-category.schema.ts
|
|
3664
3675
|
var expenseCategorySchema = {
|