storemw-core-api 1.0.163 → 1.0.164
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/lib/model_factory/ModelFactory.d.ts +7 -6
- package/dist/lib/model_factory/ModelFactory.js +595 -197
- package/dist/lib/model_factory/ModelFactory.js.map +1 -1
- package/dist/models/access_control/AccessControlRoleModel.d.ts +4 -5
- package/dist/models/access_control/AccessControlRolePolicyModel.d.ts +4 -5
- package/dist/models/access_control/AccessControlUserRoleModel.d.ts +4 -5
- package/dist/models/account/AccountModel.d.ts +4 -5
- package/dist/models/auth/AccessKeyModel.d.ts +4 -5
- package/dist/models/branch/UserBranchModel.d.ts +4 -5
- package/dist/models/branch_user/BranchUserModel.d.ts +4 -5
- package/dist/models/business/BusinessModel.d.ts +4 -5
- package/dist/models/document/DocumentAmountModel.d.ts +4 -5
- package/dist/models/document/DocumentDocumentModel.d.ts +4 -5
- package/dist/models/document/DocumentItemModel.d.ts +4 -5
- package/dist/models/document/DocumentLocationModel.d.ts +4 -5
- package/dist/models/document/DocumentModel.d.ts +4 -5
- package/dist/models/document/DocumentPaymentModel.d.ts +4 -5
- package/dist/models/document/DocumentProfileModel.d.ts +4 -5
- package/dist/models/document/DocumentTotalModel.d.ts +4 -5
- package/dist/models/file/FileModel.d.ts +4 -5
- package/dist/models/group/GroupModel.d.ts +4 -5
- package/dist/models/group/GroupOwnerModel.d.ts +4 -5
- package/dist/models/injection_field/DocumentInjectionFieldModel.d.ts +4 -5
- package/dist/models/injection_field/InjectionFieldModel.d.ts +4 -5
- package/dist/models/injection_field/ItemInjectionFieldModel.d.ts +4 -5
- package/dist/models/injection_field/LogisticInjectionFieldModel.d.ts +4 -5
- package/dist/models/injection_field/RepositoryInjectionFieldModel.d.ts +4 -5
- package/dist/models/injection_field/UserInjectionFieldModel.d.ts +4 -5
- package/dist/models/item/BrandModel.d.ts +4 -5
- package/dist/models/item/CategoryModel.d.ts +4 -5
- package/dist/models/item/ItemModel.d.ts +4 -5
- package/dist/models/item/ProductModel.d.ts +4 -5
- package/dist/models/item/UomModel.d.ts +4 -5
- package/dist/models/location/LocationModel.d.ts +4 -5
- package/dist/models/location/LocationRackModel.d.ts +4 -5
- package/dist/models/location/LocationSlotModel.d.ts +4 -5
- package/dist/models/others/NumberDateSequenceModel.d.ts +4 -5
- package/dist/models/others/OneTimeCodeModel.d.ts +4 -5
- package/dist/models/region/AreaModel.d.ts +4 -5
- package/dist/models/region/CountryModel.d.ts +4 -5
- package/dist/models/region/StateModel.d.ts +4 -5
- package/dist/models/repository/RepositoryCartonModel.d.ts +4 -5
- package/dist/models/repository/RepositoryContainerModel.d.ts +4 -5
- package/dist/models/repository/RepositoryModel.d.ts +4 -5
- package/dist/models/repository/RepositoryPackageItemModel.d.ts +4 -5
- package/dist/models/repository/RepositoryPackageModel.d.ts +4 -5
- package/dist/models/repository/RepositoryPalletModel.d.ts +4 -5
- package/dist/models/scheduler/SchedulerLogModel.d.ts +4 -5
- package/dist/models/scheduler/SchedulerRequestModel.d.ts +4 -5
- package/dist/models/subscription/account/AccountSubscribeModel.d.ts +4 -5
- package/dist/models/subscription/plan/SubscribePlanModel.d.ts +4 -5
- package/dist/models/user/AdministratorModel.d.ts +4 -5
- package/dist/models/user/AgentModel.d.ts +4 -5
- package/dist/models/user/CustomerModel.d.ts +4 -5
- package/dist/models/user/DriverModel.d.ts +4 -5
- package/dist/models/user/MemberModel.d.ts +4 -5
- package/dist/models/user/OperatorModel.d.ts +4 -5
- package/dist/models/user/RetailerModel.d.ts +4 -5
- package/dist/models/user/UserModel.d.ts +4 -5
- package/dist/models/user/UserPropModel.d.ts +4 -5
- package/dist/models/user/WorkerModel.d.ts +4 -5
- package/dist/schema/payload/document/schemaDocumentCashSales.d.ts +64 -64
- package/dist/schema/payload/document/schemaDocumentDeliveryOrder.d.ts +64 -64
- package/dist/schema/payload/document/schemaDocumentProformaSales.d.ts +64 -64
- package/dist/schema/payload/document/schemaDocumentReplacementDeliveryOrder.d.ts +64 -64
- package/dist/schema/payload/document/schemaDocumentSalesOrder.d.ts +64 -64
- package/dist/utils/serviceUtils.d.ts +2 -0
- package/dist/utils/serviceUtils.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DefaultServiceProps } from "../../utils";
|
|
2
2
|
import { DefaultOmitFields } from "./default";
|
|
3
|
+
import type { Prisma } from "@prisma/client";
|
|
3
4
|
type Column = {
|
|
4
5
|
name: string;
|
|
5
6
|
type: string;
|
|
@@ -8,15 +9,16 @@ type ModelFactoryProps<TClient extends Record<string, any>, TName extends keyof
|
|
|
8
9
|
debug?: boolean;
|
|
9
10
|
modelName: TName;
|
|
10
11
|
primaryKey?: keyof TModel;
|
|
12
|
+
tx?: Prisma.TransactionClient;
|
|
11
13
|
} & Omit<DefaultServiceProps, "prisma">;
|
|
12
14
|
export declare const ModelFactory: <TClient extends Record<string, any>, // PrismaClient
|
|
13
15
|
TName extends keyof TClient, // "plant_clones"
|
|
14
16
|
TDelegate extends TClient[TName], // PrismaClient["plant_clones"]
|
|
15
|
-
TModel>({ debug, modelName, primaryKey, accountId, actionUserId, authToken, isOperator, }: ModelFactoryProps<TClient, TName, TModel>) => {
|
|
17
|
+
TModel>({ debug, modelName, primaryKey, accountId, actionUserId, authToken, isOperator, tx, }: ModelFactoryProps<TClient, TName, TModel>) => {
|
|
16
18
|
selectedPrisma: any;
|
|
17
19
|
primaryKey: keyof TModel;
|
|
18
20
|
getFields: (prefix?: string, excludeKeywords?: string[]) => Promise<Column[]>;
|
|
19
|
-
create: ({ data }: {
|
|
21
|
+
create: ({ data, }: {
|
|
20
22
|
data: Omit<any, DefaultOmitFields>;
|
|
21
23
|
}) => Promise<TModel>;
|
|
22
24
|
createMany: ({ dataList, disableRollback, }: {
|
|
@@ -28,8 +30,8 @@ TModel>({ debug, modelName, primaryKey, accountId, actionUserId, authToken, isOp
|
|
|
28
30
|
where?: Record<string, any>;
|
|
29
31
|
include?: any;
|
|
30
32
|
}) => Promise<TModel | null>;
|
|
31
|
-
list: ({ where, orderBy, offset, limit, include }?: any) => Promise<TModel[]>;
|
|
32
|
-
count: ({ where }?: {
|
|
33
|
+
list: ({ where, orderBy, offset, limit, include, }?: any) => Promise<TModel[]>;
|
|
34
|
+
count: ({ where, }?: {
|
|
33
35
|
where?: Record<string, any>;
|
|
34
36
|
}) => Promise<number>;
|
|
35
37
|
aggregate: ({ field, operation, where, }: {
|
|
@@ -41,7 +43,7 @@ TModel>({ debug, modelName, primaryKey, accountId, actionUserId, authToken, isOp
|
|
|
41
43
|
id?: number;
|
|
42
44
|
where?: Record<string, any>;
|
|
43
45
|
data: Partial<TModel>;
|
|
44
|
-
disableRollback?:
|
|
46
|
+
disableRollback?: boolean;
|
|
45
47
|
}) => Promise<TModel>;
|
|
46
48
|
updateMany: ({ dataList, disableRollback, }: {
|
|
47
49
|
dataList: {
|
|
@@ -58,6 +60,5 @@ TModel>({ debug, modelName, primaryKey, accountId, actionUserId, authToken, isOp
|
|
|
58
60
|
where?: Record<string, any>;
|
|
59
61
|
}) => Promise<TModel[]>;
|
|
60
62
|
raw: <T = any>(query: string, params?: any[]) => Promise<T[]>;
|
|
61
|
-
rawExec: (query: string, params?: any[]) => Promise<number>;
|
|
62
63
|
};
|
|
63
64
|
export {};
|