1404/11/04- first

This commit is contained in:
2026-01-24 17:45:54 +03:30
commit edf1824229
554 changed files with 59581 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
import useAxios from "@core/utils/useAxios";
import type {Accounting, TotalAccounting} from "@/model/accounting";
export const getAccountingTable = async (start: string,end: string) =>
await useAxios.post<Accounting>('/admin/dashboard/finance', {startDate: start, endDate: end});
//Accounting Tab
export const getTotalAccountingTable = async () =>
await useAxios.post<TotalAccounting>('/admin/finance');
+10
View File
@@ -0,0 +1,10 @@
import useAxios from '@core/utils/useAxios'
import type { AddId, Customer } from '@/model/customer'
import type { TableInput } from '@core/type/baseTable'
import type { Card, cardSts } from '@/model/card'
export const changeAccountSts = async (obj: cardSts) =>
await useAxios.post<boolean>(`/admin/account/sts`, obj)
export const getAccountTable = async (params: TableInput) =>
await useAxios.post<Array<Card>>('/admin/account/table', params)
+16
View File
@@ -0,0 +1,16 @@
import useAxios from '@core/utils/useAxios'
import type { City, Province } from '@/model/city'
import type { TableInput } from '@core/type/baseTable'
export const getProvinces = async () => await useAxios.get<Array<Province>>(`/api/city/state`)
export const getAllCities = async () => await useAxios.get<Array<City>>(`/api/city/all`)
export const getCitiesList = async (id: number) =>
await useAxios.get<Array<Province>>(`/api/city/${id}`)
export const getCitiesTable = async (params: TableInput) =>
await useAxios.post<Array<Province>>(`/api/city/table`, params)
export const addCity = async (id?: number, title?: string) =>
await useAxios.post<Province>(`/api/city`, { parent_id: id, title: title })
+21
View File
@@ -0,0 +1,21 @@
import useAxios from '@core/utils/useAxios'
import type { Const } from '@/model/const'
export const getNatureConst = async () => await useAxios.get<Array<Const>>('/api/const/key/nature')
export const getBudgetConst = async () => await useAxios.get<Array<Const>>('/api/const/key/budget')
export const getProjectConst = async () => await useAxios.get<Array<Const>>('/api/const/key/type')
export const getUserTypeConst = async () =>
await useAxios.get<Array<Const>>('/api/const/key/user_type')
export const getSectionConst = async () =>
await useAxios.get<Array<Const>>('/api/const/key/section')
export const updateEditConst = async (obj: Const) =>
await useAxios.put<Const>(`/admin/const/1`, obj)
export const createAddConst = async (obj: Const) => await useAxios.post<Const>(`/admin/const`, obj)
export const deleteConst = async (id: number) => await useAxios.delete<boolean>(`/api/const/${id}`)
+36
View File
@@ -0,0 +1,36 @@
import useAxios from '@core/utils/useAxios'
import type { AddId, Customer } from '@/model/customer'
import type { TableInput } from '@core/type/baseTable'
export const createCustomer = async (obj: Customer) =>
await useAxios.post<AddId>(`/admin/customer`, obj)
export const deleteCustomer = async (id: number) => await useAxios.delete(`/admin/customer/${id}`)
export const updateCustomer = async (id: number, obj: Customer) =>
await useAxios.put<AddId>(`/admin/customer/${id}`, obj)
export const getCustomerTable = async (params: TableInput) =>
await useAxios.post<Array<Customer>>('/admin/customer/table', params)
export const getCustomersList = async () => await useAxios.get<Customer[]>(`/admin/customer/list`)
export const changeCustomerActivation = async (id: number) =>
await useAxios.get(`/admin/customer/active/${id}`)
export const changeCustomerOrderActivation = async (id: number) =>
await useAxios.get(`/admin/customer/trade/${id}`)
export const changeCustomerArchive = async (id: number) =>
await useAxios.get(`/admin/customer/archive/${id}`)
export const confirmUser = async (id: number) =>
await useAxios.get(`/admin/customer/is_valid/${id}`)
export const getCustomerArchiveTable = async (params: TableInput) =>
await useAxios.post<Array<Customer>>('/admin/customer/archive/table', params)
export const getSingleTable = async (params: TableInput) =>
await useAxios.post<Array<Customer>>('/admin/customer/single/table', params)
export const getSingleArchiveTable = async (params: TableInput) =>
await useAxios.post<Array<Customer>>('/admin/customer/single/archive/table', params)
+13
View File
@@ -0,0 +1,13 @@
import useAxios from '@core/utils/useAxios'
import type { AddId, User } from '@/model/user'
import type { TableInput } from '@core/type/baseTable'
import type {Dashboard} from '@/model/dashboard'
import type {PriceChart} from "@/model/priceChart";
export const getDashboard = async () => await useAxios.get<Dashboard>('/admin/dashboard')
export const updateMyInformation = async (val: User) =>
await useAxios.post<User>('/admin/me/update', val)
//priceChart
export const getAllPrices = async () => await useAxios.post('/admin/prices')
+8
View File
@@ -0,0 +1,8 @@
import useAxios from '@core/utils/useAxios'
import type { Token, UserLoginState } from '@/model/login'
export const Login = async (values: UserLoginState) =>
await useAxios.post<Token>('/auth/login', values)
export const Verify = async (values: UserLoginState) =>
await useAxios.post<Token>('/auth/verify', values)
+23
View File
@@ -0,0 +1,23 @@
import type { TableInput,TableOutput } from '@core/type/baseTable'
import useAxios from '@core/utils/useAxios'
import type { Order,OrderSts } from '@/model/order'
import type { AddId, Customer } from '@/model/customer'
export const getOrderTable = async (params: TableInput) =>
await useAxios.post<Array<Order>>('/admin/order/table', params)
export const createOrder = async (obj: Order) =>
await useAxios.post<AddId>(`/admin/single/order`, obj)
export const getSingleOrder = async (id: number) =>
await useAxios.get<Order>(`/admin/order/single/${id}`)
export const getNewOrderTable = async (params: TableInput) =>
await useAxios.post<TableOutput<Order>>('/admin/order/table/new', params)
export const getSingleTable = async (params: TableInput) =>
await useAxios.post<Array<Customer>>('/admin/customer/single/table', params)
export const changeOrderSts = async (params: OrderSts) =>
await useAxios.post<OrderSts>('/admin/order/sts', params)
+4
View File
@@ -0,0 +1,4 @@
import useAxios from "@core/utils/useAxios";
import type {OthersPrices} from "@/model/othersPrices";
export const getOthersPrices = async () => await useAxios.get<OthersPrices>('api/price/last')
+19
View File
@@ -0,0 +1,19 @@
import useAxios from '@core/utils/useAxios'
import type { Permission, UserPermission } from '@/model/permission'
export const getTreeData = async () => await useAxios.get('/api/permission/show/rid')
export const updatePermission = async (obj: Permission) =>
await useAxios.post('/api/permission', obj)
export const getSelectedData = async (user_type_id?: number, section_id?: number) =>
await useAxios.get(`/api/permission/${user_type_id}/${section_id}`)
export const updateUserPermission = async (obj: UserPermission) =>
await useAxios.post('/api/exclude', obj)
export const getUserSelectedData = async (id?: number) => await useAxios.get(`/api/exclude/${id}`)
export async function getUserPermissions(user_id: number) {
return await useAxios.get(`/api/exclude/user/permission/${user_id}`)
}
+14
View File
@@ -0,0 +1,14 @@
import type { AddId } from '@/model/customer'
import useAxios from '@core/utils/useAxios'
import type { last, Price } from "@/model/price";
import type { TableInput } from '@core/type/baseTable'
import type { MethodePrices } from "@/model/product";
export const createPrice = async (obj: Price) => await useAxios.post<AddId>(`/admin/price`, obj)
export const getPriceTable = async (params: TableInput) =>
await useAxios.post<Array<Price>>('/admin/price/table', params)
export const getLastPrice = async () => await useAxios.get<last>(`/api/price/last`)
export const methodePrices = async () => await useAxios.get<MethodePrices[]>('/admin/p')
+6
View File
@@ -0,0 +1,6 @@
import type {TableInput} from "@core/type/baseTable";
import useAxios from "@core/utils/useAxios";
import type {PriceTriggers} from "@/model/priceTriggers";
export const getPriceTriggersTable = async (params: TableInput) =>
await useAxios.post<Array<PriceTriggers>>('/admin/price_triggers/table', params)
+61
View File
@@ -0,0 +1,61 @@
import useAxios from '@core/utils/useAxios'
import type { AddId, Customer } from '@/model/customer'
import type { TableInput } from '@core/type/baseTable'
import type { Accounting } from "@/model/accounting"
import type { Balance, SetActiveTime } from "@/model/product";
export const createProduct = async (obj: Customer) =>
await useAxios.post<AddId>(`/admin/product`, obj)
export const deleteCustomer = async (id: number) => await useAxios.delete(`/admin/product/${id}`)
export const updateCustomer = async (id: number, obj: Customer) =>
await useAxios.put<AddId>(`/admin/product/${id}`, obj)
export const getCustomerTable = async (params: TableInput) =>
await useAxios.post<Array<Customer>>('/admin/product/table', params)
export const getCustomersList = async () => await useAxios.get<Customer[]>(`/admin/product/list`)
export const changeProductActivation = async (id: number) =>
await useAxios.get(`/admin/product/active/${id}`)
export const changeCustomerOrderActivation = async (id: number) =>
await useAxios.get(`/admin/product/trade/${id}`)
export const changeCustomerArchive = async (id: number) =>
await useAxios.get(`/admin/product/archive/${id}`)
export const confirmUser = async (id: number) =>
await useAxios.get(`/admin/product/is_valid/${id}`)
export const getCustomerArchiveTable = async (params: TableInput) =>
await useAxios.post<Array<Customer>>('/admin/product/archive/table', params)
export const getSingleTable = async (params: TableInput) =>
await useAxios.post<Array<Customer>>('/admin/product/single/table', params)
export const getSingleArchiveTable = async (params: TableInput) =>
await useAxios.post<Array<Customer>>('/admin/product/single/archive/table', params)
export const getCustomerById = async (id: number) => {
return await useAxios.get(`/admin/product/${id}`)
}
export const changeBuyActiveProduct = async (id?: number) => {
return await useAxios.get(`/admin/product/open_buy/${id}`)
}
export const changeSellActiveProduct = async (id?: number) => {
return await useAxios.get(`/admin/product/open_sell/${id}`)
}
export const changeActiveProduct = async (id: number) => {
return await useAxios.get(`/admin/product/active/${id}`)
}
export const changeVisibilityProduct = async (id: number) => {
return await useAxios.get(`/admin/product/hide/${id}`)
}
export const setActiveTime = async (open: string, close: string) =>{
await useAxios.put<SetActiveTime>(`/admin/products`, {auto_open_at: open, auto_close_at: close})
}
export const getBalance = async (startDate: string, endDate: string) => {
return await useAxios.post<Balance>('/admin/getBalance', {startDate, endDate})
}
+25
View File
@@ -0,0 +1,25 @@
import type { AddId, Customer } from '@/model/customer'
import useAxios from '@core/utils/useAxios'
import type { last, Price } from '@/model/price'
import type { TableInput } from '@core/type/baseTable'
import type { Order } from '@/model/order'
import type { FunctionItem } from '@/model/Item'
import sms from '@/router/routes/sms'
import type { Sms } from '@/model/sms'
export const getSMSTable = async (params: TableInput) =>
await useAxios.post<Array<Price>>('/admin/messages/table', params)
export const getNumbersTable = async (params: TableInput) =>
await useAxios.post<Array<Price>>('/admin/messages/get_customer_list/table', params)
export const getGroupsList = async () =>
await useAxios.get<FunctionItem[]>(`/admin/messages/functions`)
export const getCustomerList = async (obj: string[]) =>
await useAxios.post<{ customers: Customer[] }>(`/admin/messages/get_customer_list`, {
functions: obj
})
export const createSMS = async (obj: Sms) =>
await useAxios.post<AddId>(`/admin/messages/send_message`, obj)
+8
View File
@@ -0,0 +1,8 @@
import type { TableInput } from '@core/type/baseTable'
import useAxios from '@core/utils/useAxios'
// import { Customer } from '@/model/customer'
import type { Wallet } from '@/model/wallet'
import type { Transaction } from '@/model/transaction'
export const getTransactionTable = async (params: TableInput) =>
await useAxios.post<Array<Transaction>>('/admin/wallet/transaction/table', params)
+30
View File
@@ -0,0 +1,30 @@
import useAxios from '@core/utils/useAxios'
import type { AddId, User } from '@/model/user'
import type { TableInput } from '@core/type/baseTable'
import type {Referrals} from '@/model/referrals'
import type {Funds} from "@/model/funds";
//referrals
export const getReferralsTable = async (params: TableInput,customer_id: number) => await useAxios.post<Array<Referrals>>(`/admin/customers/${customer_id}/referrals`, params)
//funds
export const getFundsTable = async (params: TableInput,customer_id: number) => await useAxios.post<Array<Funds>>(`/admin/customers/${customer_id}/funds`, params)
export const getReferrals = async (val: Referrals) => await useAxios.post<Funds>(`/admin/customers/4/referrals`, val)
//me
export const getMyInformation = async () => await useAxios.get<User>('/admin/me')
export const updateMyInformation = async (val: User) => await useAxios.post<User>('/admin/me/update', val)
//users
export const createUser = async (obj: User) => await useAxios.post<AddId>(`/admin/user`, obj)
export const updateUser = async (id: number, obj: User) =>
await useAxios.put<AddId>(`/admin/user/${id}`, obj)
export const deleteUser = async (id: number) => await useAxios.delete(`/admin/user/${id}`)
export const getUserTable = async (params: TableInput) =>
await useAxios.post<Array<User>>('/admin/user/table', params)
export const changeUserActivation = async (id: number) =>
await useAxios.get(`/admin/user/active/${id}`)
+29
View File
@@ -0,0 +1,29 @@
import type { TableInput } from '@core/type/baseTable'
import useAxios from '@core/utils/useAxios'
// import { Customer } from '@/model/customer'
import type { Charge, Wallet, Withdraw, SendWeight } from '@/model/wallet'
export const getWalletTable = async (params?: TableInput) =>
await useAxios.post<Array<Wallet>>('/admin/wallet/table', params)
export const chargeWallet = async (params: Charge, type: 'gold' | 'money') =>
type === 'money'
? await useAxios.post<boolean>('/admin/wallet/charge', params)
: await useAxios.post<boolean>('/admin/wallet/charge_gold', params)
export const getWithdrawTable = async (params: TableInput) =>
await useAxios.post<Array<Withdraw>>('/admin/wallet/withdraw/table', params)
export const completeWithdraw = async (params: Withdraw) =>
await useAxios.post<boolean>('/admin/wallet/withdraw/complete', params)
export const updateSts = async (id: number, sts: Object) => {
return await useAxios.put(`/admin/wallet/withdraw/${id}`, sts)
}
export const getWithdrawById = async (id: number) => {
return await useAxios.get(`/admin/wallet/withdraw/${id}`)
}
export const sendWeights = async (params: SendWeight ) => {
return await useAxios.put(`/admin/wallet/transaction/reprice`, params)
}