update pos consumer
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
import { TAccountType } from '@/core/constants/accountTypes.const';
|
||||
|
||||
export interface IAccountRawResponse {
|
||||
username: string;
|
||||
id: string;
|
||||
}
|
||||
export interface IAccountResponse extends IAccountRawResponse {}
|
||||
|
||||
export interface IAccountRequest {
|
||||
username: string;
|
||||
password?: string;
|
||||
type: TAccountType;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
export interface IIndividualCustomer {
|
||||
first_name: string;
|
||||
last_name: string;
|
||||
national_id: string;
|
||||
postal_code: string;
|
||||
economic_code: string;
|
||||
is_favorite?: boolean;
|
||||
}
|
||||
export interface ILegalCustomer {
|
||||
company_name: string;
|
||||
economic_code: string;
|
||||
registration_number: string;
|
||||
postal_code: string;
|
||||
is_favorite?: boolean;
|
||||
}
|
||||
|
||||
export interface IUnknownCustomer {
|
||||
national_id: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface ICustomer {
|
||||
customerIndividuals?: IIndividualCustomer;
|
||||
customerLegals?: ILegalCustomer;
|
||||
customerUnknown?: IUnknownCustomer;
|
||||
}
|
||||
|
||||
export type TCustomerInfo = IIndividualCustomer | ILegalCustomer | IUnknownCustomer;
|
||||
@@ -1,2 +1,5 @@
|
||||
export * from './accounts_io';
|
||||
export * from './customer';
|
||||
export * from './io';
|
||||
export * from './payload';
|
||||
export * from './payment';
|
||||
export * from './types';
|
||||
|
||||
+15
-15
@@ -1,18 +1,18 @@
|
||||
import { TRoles } from '@/core';
|
||||
import { CustomerType } from '@/shared/localEnum/constants/customerTypes';
|
||||
import { ICustomer } from './customer';
|
||||
import { IPayment } from './payment';
|
||||
import { IPosOrderItem } from './types';
|
||||
|
||||
export interface IUserRawResponse {
|
||||
mobile_number: string;
|
||||
first_name: string;
|
||||
last_name: string;
|
||||
fullname: string;
|
||||
id: string;
|
||||
role: TRoles;
|
||||
export interface IPosOrderRequest {
|
||||
total_amount: number;
|
||||
invoice_date: string;
|
||||
payments: IPayment;
|
||||
items: IPosOrderItem[];
|
||||
notes?: string;
|
||||
customer_type?: CustomerType;
|
||||
customerId?: string;
|
||||
customer?: ICustomer;
|
||||
}
|
||||
export interface IUserResponse extends IUserRawResponse {}
|
||||
|
||||
export interface IUserRequest {
|
||||
first_name: string;
|
||||
last_name: string;
|
||||
mobile_number: string;
|
||||
role: TRoles;
|
||||
}
|
||||
export interface IPosOrderRawResponse {}
|
||||
export interface IPosOrderResponse extends IPosOrderRawResponse {}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import { TGoldKarat } from '@/shared/localEnum/constants/goldKarat';
|
||||
|
||||
export interface IGoldPayload {
|
||||
karat: TGoldKarat;
|
||||
wages: number;
|
||||
profit: number;
|
||||
commission: number;
|
||||
wages_amount: number;
|
||||
profit_amount: number;
|
||||
commission_amount: number;
|
||||
}
|
||||
|
||||
export interface IStandardPayload {}
|
||||
|
||||
export type TPosOrderGoodPayload = IGoldPayload | IStandardPayload;
|
||||
@@ -0,0 +1,7 @@
|
||||
export interface IPayment {
|
||||
terminal: number;
|
||||
cash: number;
|
||||
set_off: number;
|
||||
}
|
||||
|
||||
export type TOrderPaymentTypes = 'TERMINAL' | 'CASH' | 'SET_OFF';
|
||||
@@ -0,0 +1,24 @@
|
||||
import { IGoodResponse } from '@/domains/pos/models/good.io';
|
||||
import { UnitType } from '@/utils';
|
||||
import { TPosOrderGoodPayload } from './payload';
|
||||
|
||||
export interface IPosOrderItem<T = TPosOrderGoodPayload> {
|
||||
unit_price: number;
|
||||
quantity: number;
|
||||
total_amount: number;
|
||||
discount_amount: number;
|
||||
unit_type: UnitType;
|
||||
good_id?: string;
|
||||
service_id?: string;
|
||||
notes?: string;
|
||||
payload: T;
|
||||
|
||||
base_total_amount: number;
|
||||
discount: number;
|
||||
tax_amount: number;
|
||||
}
|
||||
|
||||
export interface IPosInOrderGood extends Omit<IPosOrderItem, 'good_id' | 'service_id' | 'notes'> {
|
||||
id: string;
|
||||
good: IGoodResponse;
|
||||
}
|
||||
Reference in New Issue
Block a user