storemw-core-client 1.0.26 → 1.0.28
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.
|
@@ -8,6 +8,8 @@ export declare const userTypes: {
|
|
|
8
8
|
readonly driver: "driver";
|
|
9
9
|
readonly retailer: "retailer";
|
|
10
10
|
readonly member: "member";
|
|
11
|
+
readonly operator: "operator";
|
|
12
|
+
readonly agent: "agent";
|
|
11
13
|
};
|
|
12
14
|
export declare const userTargetTypes: {
|
|
13
15
|
readonly administrator: "administrator";
|
|
@@ -17,6 +19,8 @@ export declare const userTargetTypes: {
|
|
|
17
19
|
readonly driver: "driver";
|
|
18
20
|
readonly retailer: "retailer";
|
|
19
21
|
readonly member: "member";
|
|
22
|
+
readonly operator: "operator";
|
|
23
|
+
readonly agent: "agent";
|
|
20
24
|
};
|
|
21
25
|
export type UserType = typeof userTypes[keyof typeof userTypes];
|
|
22
26
|
export type UserTargetType = typeof userTargetTypes[keyof typeof userTargetTypes];
|
|
@@ -10,6 +10,8 @@ exports.userTypes = {
|
|
|
10
10
|
driver: "driver",
|
|
11
11
|
retailer: "retailer",
|
|
12
12
|
member: "member",
|
|
13
|
+
operator: "operator",
|
|
14
|
+
agent: "agent",
|
|
13
15
|
};
|
|
14
16
|
exports.userTargetTypes = {
|
|
15
17
|
administrator: "administrator",
|
|
@@ -19,6 +21,8 @@ exports.userTargetTypes = {
|
|
|
19
21
|
driver: "driver",
|
|
20
22
|
retailer: "retailer",
|
|
21
23
|
member: "member",
|
|
24
|
+
operator: "operator",
|
|
25
|
+
agent: "agent",
|
|
22
26
|
};
|
|
23
27
|
const getCreatePayload = (userType, data) => {
|
|
24
28
|
if (userType === "administrator" && "administrator" in data) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserService.js","sourceRoot":"","sources":["../../../src/services/user/UserService.ts"],"names":[],"mappings":";;;AAEA,+BAMe;AAEF,QAAA,SAAS,GAAG;IACrB,aAAa,EAA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;YACb,KAAK,EAAE;gBACH,MAAM,EAAE,sBAAsB,IAAI,cAAc;aACnD;YACD,OAAO,EAAE;gBACL,GAAG;aACN;SACJ,CAAA;QAED,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC;YAC5B,GAAG;YACH,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,QAAQ;SACpB,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;IAEpB,CAAC,CAAA;IAED,MAAM,YAAY,GAAG,KAAK,EAAE,EAAE,QAAQ,EAAE,gBAAgB,EAAwB,EAAE,EAAE;QAEhF,IAAI,GAAG,GAAG,GAAG,SAAS,eAAe,gBAAgB,IAAI,QAAQ,EAAE,CAAA;QAEnE,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC;YAC5B,GAAG;YACH,MAAM,EAAE,KAAK;SAChB,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;IAEpB,CAAC,CAAA;IAED,OAAO;QACH,IAAI;QACJ,GAAG;QACH,MAAM;QACN,MAAM;QACN,MAAM;QACN,YAAY;KACf,CAAC;AACN,CAAC,CAAA;AApJY,QAAA,WAAW,eAoJvB","sourcesContent":["import { DefaultServiceProps } from '@/lib';\n\nimport {\n buildApiListUrl,\n BuildApiListParamsProps,\n buildApiGetUrl,\n BuildApiGetParamsProps,\n filterOperatorTypes\n} from '@/lib';\n\nexport const userTypes = {\n administrator: \"administrator\",\n worker: \"worker\",\n supplier: \"supplier\",\n customer: \"customer\",\n driver: \"driver\",\n retailer: \"retailer\",\n member: \"member\",\n} as const\n\nexport const userTargetTypes = {\n administrator: \"administrator\",\n worker: \"worker\",\n supplier: \"supplier\",\n customer: \"customer\",\n driver: \"driver\",\n retailer: \"retailer\",\n member: \"member\",\n} as const\n\nexport type UserType = typeof userTypes[keyof typeof userTypes]\nexport type UserTargetType = typeof userTargetTypes[keyof typeof userTargetTypes]\nexport type UserTargetKey = keyof typeof userTargetTypes\n\nexport type UserServiceProps = DefaultServiceProps & {\n userTargetType?: UserTargetType\n userType?: UserType\n};\n\nexport type ListUserProps = BuildApiListParamsProps & {\n userType?: UserType\n}\n\nexport type GetUserProps = BuildApiGetParamsProps & {\n id: number | string\n userType?: UserType\n}\n\ntype Gender = \"male\" | \"female\"\ntype AssignSupplierType = \"admin\" | \"retail\"\n\ntype UserCredential = {\n username: string\n password: string\n // userType: UserTargetType\n firstname: string\n lastname: string\n contact: string\n email: string\n status: boolean\n address: string\n}\n\nexport type CreateUserProps = {\n userTargetType?: UserTargetType\n userType?: UserType\n data:\n // administrator\n {\n administrator: {\n credential: UserCredential,\n locationIds: number[]\n }\n } |\n // customer\n {\n customer: {\n credential: UserCredential,\n code: string\n accountCode: string\n companyName: string\n regNo: string\n secondaryRegNo: string\n taxIdentificationNo: string,\n taxRegistrationNo: string,\n remark: string\n salesperson: string\n excludeTaxRate: number[]\n }\n } |\n // retailer\n {\n retailer: {\n credential: UserCredential,\n code: string\n accountCode: string\n companyName: string\n regNo: string\n remark: string\n isDifferentBusiness: boolean\n businessId: number\n }\n } |\n // worker\n {\n worker: {\n credential: UserCredential,\n remark: string\n locationIds: number[]\n }\n } |\n // driver\n {\n driver: {\n credential: UserCredential,\n companyName: string\n remark: string\n locationIds: number[]\n }\n } |\n // supplier\n {\n supplier: {\n credential: UserCredential,\n // supplier: {\n type: AssignSupplierType\n companyName: string\n contact: string\n code: string\n regNo: string\n remark: string\n address1: string\n address2: string\n postcode: string\n countryId: number\n stateId: number\n areaId: number\n bankName: string\n bankAcc: string\n itemIds: number[],\n retailerId?: number /* Optional */\n }\n } &\n // member\n {\n member: {\n credential: UserCredential,\n ownerUserId: number | 0 /* retailer_user_id or empty if global */\n companyName: string\n identityNo: string\n gender: Gender,\n dob: string\n address1: string\n address2: string\n countryId: number\n stateId: number\n areaId: number\n postcode: string\n remark: string\n }\n }\n}\n\nexport type UpdateUserProps = {\n id: number\n userTargetType?: UserTargetType\n userType?: UserType\n data:\n // administatrator\n {\n administrator: {\n credential: Omit<UserCredential, \"username\" | \"password\"> & { password?: string },\n locationIds: number[]\n }\n } |\n // customer\n {\n customer: {\n credential: Omit<UserCredential, \"username\" | \"password\"> & { password?: string },\n code: string\n accountCode: string\n companyName: string\n regNo: string\n secondaryRegNo: string\n taxIdentificationNo: string,\n taxRegistrationNo: string,\n remark: string\n salesperson: string\n excludeTaxRate: number[]\n }\n } |\n // retailer\n {\n retailer: {\n credential: Omit<UserCredential, \"username\" | \"password\"> & { password?: string },\n code: string\n accountCode: string\n companyName: string\n regNo: string\n remark: string\n isDifferentBusiness: boolean\n businessId: number\n }\n } |\n // worker\n {\n worker: {\n credential: Omit<UserCredential, \"username\" | \"password\"> & { password?: string },\n remark: string\n locationIds: number[]\n }\n } |\n // driver\n {\n driver: {\n credential: Omit<UserCredential, \"username\" | \"password\"> & { password?: string },\n companyName: string\n remark: string\n locationIds: number[]\n }\n } |\n // supplier\n {\n supplier: {\n credential: Omit<UserCredential, \"username\" | \"password\"> & { password?: string },\n type: AssignSupplierType\n companyName: string\n contact: string\n code: string\n regNo: string\n remark: string\n address1: string\n address2: string\n postcode: string\n countryId: number\n stateId: number\n areaId: number\n bankName: string\n bankAcc: string\n itemIds: number[],\n retailerId?: number /* Optional */\n }\n } |\n // member\n {\n member: {\n credential: Omit<UserCredential, \"username\" | \"password\"> & { password?: string },\n ownerUserId: number /* retailer_user_id or empty if global */\n companyName: string\n identityNo: string\n gender: Gender,\n dob: string\n address1: string\n address2: string\n countryId: number\n stateId: number\n areaId: number\n postcode: string\n remark: string\n }\n }\n}\n\nexport type RemoveUserProps = {\n userTargetType?: UserTargetType\n ids: number[]\n}\n\nexport type GetDataTypeUserProps = {\n userType?: UserType\n}\n\nconst getCreatePayload = (userType: UserType, data: CreateUserProps[\"data\"]) => {\n\n if (userType === \"administrator\" && \"administrator\" in data) {\n\n return {\n credential: {\n username: data.administrator.credential.username,\n password: data.administrator.credential.password,\n user_type: userType,\n firstname: data.administrator.credential.firstname,\n lastname: data.administrator.credential.lastname,\n contact: data.administrator.credential.contact,\n email: data.administrator.credential.email,\n status: (data.administrator.credential.status === true) ? 1 : 0,\n address: data.administrator.credential.address\n },\n administrator: [],\n props: {\n location_id: data.administrator.locationIds\n }\n }\n }\n\n if (userType === \"customer\" && \"customer\" in data) {\n\n return {\n credential: {\n username: data.customer.credential.username,\n password: data.customer.credential.password,\n user_type: userType,\n firstname: data.customer.credential.firstname,\n lastname: data.customer.credential.lastname,\n contact: data.customer.credential.contact,\n email: data.customer.credential.email,\n status: (data.customer.credential.status === true) ? 1 : 0,\n address: data.customer.credential.address\n },\n customer: {\n code: data.customer.code,\n account_code: data.customer.accountCode,\n company_name: data.customer.companyName,\n reg_no: data.customer.regNo,\n secondary_reg_no: data.customer.secondaryRegNo,\n remark: data.customer.remark,\n tax_identification_no: data.customer.taxIdentificationNo,\n tax_registration_no: data.customer.taxRegistrationNo,\n },\n props: {\n salesperson: data.customer.salesperson,\n exclude_tax_rate: data.customer.excludeTaxRate\n }\n }\n }\n\n if (userType === \"retailer\" && \"retailer\" in data) {\n\n return {\n credential: {\n username: data.retailer.credential.username,\n password: data.retailer.credential.password,\n user_type: userType,\n firstname: data.retailer.credential.firstname,\n lastname: data.retailer.credential.lastname,\n contact: data.retailer.credential.contact,\n email: data.retailer.credential.email,\n status: (data.retailer.credential.status === true) ? 1 : 0,\n address: data.retailer.credential.address\n },\n retailer: {\n code: data.retailer.code,\n account_code: data.retailer.accountCode,\n company_name: data.retailer.companyName,\n reg_no: data.retailer.regNo,\n remark: data.retailer.remark\n },\n props: {\n business_id: data.retailer.businessId\n },\n status: {\n is_different_business: (data.retailer.isDifferentBusiness === true) ? 1 : 0\n }\n }\n }\n\n if (userType === \"worker\" && \"worker\" in data) {\n\n return {\n credential: {\n username: data.worker.credential.username,\n password: data.worker.credential.password,\n user_type: userType,\n firstname: data.worker.credential.firstname,\n lastname: data.worker.credential.lastname,\n contact: data.worker.credential.contact,\n email: data.worker.credential.email,\n status: (data.worker.credential.status === true) ? 1 : 0,\n address: data.worker.credential.address\n },\n worker: {\n remark: data.worker.remark\n },\n props: {\n location_id: data.worker.locationIds\n }\n }\n }\n\n if (userType === \"driver\" && \"driver\" in data) {\n\n return {\n credential: {\n username: data.driver.credential.username,\n password: data.driver.credential.password,\n user_type: userType,\n firstname: data.driver.credential.firstname,\n lastname: data.driver.credential.lastname,\n contact: data.driver.credential.contact,\n email: data.driver.credential.email,\n status: (data.driver.credential.status === true) ? 1 : 0,\n address: data.driver.credential.address\n },\n driver: {\n company_name: data.driver.companyName,\n remark: data.driver.remark\n },\n props: {\n location_id: data.driver.locationIds\n }\n }\n }\n\n if (userType === \"supplier\" && \"supplier\" in data) {\n\n return {\n credential: {\n username: data.supplier.credential.username,\n password: data.supplier.credential.password,\n user_type: userType,\n firstname: data.supplier.credential.firstname,\n lastname: data.supplier.credential.lastname,\n contact: data.supplier.credential.contact,\n email: data.supplier.credential.email,\n status: (data.supplier.credential.status === true) ? 1 : 0,\n address: data.supplier.credential.address\n },\n supplier: {\n type: data.supplier.type,\n company_name: data.supplier.companyName,\n contact: data.supplier.contact,\n code: data.supplier.code,\n reg_no: data.supplier.regNo,\n remark: data.supplier.remark,\n address_1: data.supplier.address1,\n address_2: data.supplier.address2,\n postcode: data.supplier.postcode,\n country_id: data.supplier.countryId,\n state_id: data.supplier.stateId,\n area_id: data.supplier.areaId,\n bank_name: data.supplier.bankName,\n bank_acc: data.supplier.bankAcc\n },\n props: {\n item_id: data.supplier.itemIds,\n retailer_id: data.supplier.retailerId\n }\n }\n }\n\n if (userType === \"member\" && \"member\" in data) {\n\n return {\n credential: {\n username: data.member.credential.username,\n password: data.member.credential.password,\n user_type: userType,\n firstname: data.member.credential.firstname,\n lastname: data.member.credential.lastname,\n contact: data.member.credential.contact,\n email: data.member.credential.email,\n status: (data.member.credential.status === true) ? 1 : 0,\n address: data.member.credential.address\n },\n member: {\n owner_user_id: (data.member.ownerUserId === 0) ? \"\" : data.member.ownerUserId, /* retailer_user_id or empty if global */\n company_name: data.member.companyName,\n identity_no: data.member.identityNo,\n gender: data.member.gender,\n dob: data.member.dob,\n address_1: data.member.address1,\n address_2: data.member.address2,\n country_id: data.member.countryId,\n state_id: data.member.stateId,\n area_id: data.member.areaId,\n postcode: data.member.postcode,\n remark: data.member.remark\n }\n }\n }\n}\n\nconst getUpdatePayload = (userType: UserType, data: UpdateUserProps[\"data\"]) => {\n\n if (userType === \"administrator\" && \"administrator\" in data) {\n\n return {\n credential: {\n ...(data.administrator.credential.password ? { password: data.administrator.credential.password } : {}),\n firstname: data.administrator.credential.firstname,\n lastname: data.administrator.credential.lastname,\n contact: data.administrator.credential.contact,\n email: data.administrator.credential.email,\n status: (data.administrator.credential.status === true) ? 1 : 0,\n address: data.administrator.credential.address\n },\n administrator: [],\n props: {\n location_id: data.administrator.locationIds\n }\n }\n }\n\n if (userType === \"customer\" && \"customer\" in data) {\n\n return {\n credential: {\n ...(data.customer.credential.password ? { password: data.customer.credential.password } : {}),\n firstname: data.customer.credential.firstname,\n lastname: data.customer.credential.lastname,\n contact: data.customer.credential.contact,\n email: data.customer.credential.email,\n status: (data.customer.credential.status === true) ? 1 : 0,\n address: data.customer.credential.address\n },\n customer: {\n code: data.customer.code,\n account_code: data.customer.accountCode,\n company_name: data.customer.companyName,\n reg_no: data.customer.regNo,\n secondary_reg_no: data.customer.secondaryRegNo,\n remark: data.customer.remark,\n tax_identification_no: data.customer.taxIdentificationNo,\n tax_registration_no: data.customer.taxRegistrationNo,\n },\n props: {\n salesperson: data.customer.salesperson,\n exclude_tax_rate: data.customer.excludeTaxRate\n }\n }\n\n }\n\n if (userType === \"retailer\" && \"retailer\" in data) {\n\n return {\n credential: {\n ...(data.retailer.credential.password ? { password: data.retailer.credential.password } : {}),\n firstname: data.retailer.credential.firstname,\n lastname: data.retailer.credential.lastname,\n contact: data.retailer.credential.contact,\n email: data.retailer.credential.email,\n status: (data.retailer.credential.status === true) ? 1 : 0,\n address: data.retailer.credential.address\n },\n retailer: {\n code: data.retailer.code,\n account_code: data.retailer.accountCode,\n company_name: data.retailer.companyName,\n reg_no: data.retailer.regNo,\n remark: data.retailer.remark\n },\n props: {\n business_id: data.retailer.businessId\n },\n status: {\n is_different_business: (data.retailer.isDifferentBusiness === true) ? 1 : 0\n }\n }\n }\n\n if (userType === \"worker\" && \"worker\" in data) {\n\n return {\n credential: {\n ...(data.worker.credential.password ? { password: data.worker.credential.password } : {}),\n firstname: data.worker.credential.firstname,\n lastname: data.worker.credential.lastname,\n contact: data.worker.credential.contact,\n email: data.worker.credential.email,\n status: (data.worker.credential.status === true) ? 1 : 0,\n address: data.worker.credential.address\n },\n worker: {\n remark: data.worker.remark\n },\n props: {\n location_id: data.worker.locationIds\n }\n }\n }\n\n if (userType === \"driver\" && \"driver\" in data) {\n\n return {\n credential: {\n ...(data.driver.credential.password ? { password: data.driver.credential.password } : {}),\n firstname: data.driver.credential.firstname,\n lastname: data.driver.credential.lastname,\n contact: data.driver.credential.contact,\n email: data.driver.credential.email,\n status: (data.driver.credential.status === true) ? 1 : 0,\n address: data.driver.credential.address\n },\n driver: {\n company_name: data.driver.companyName,\n remark: data.driver.remark\n },\n props: {\n location_id: data.driver.locationIds\n }\n }\n }\n\n if (userType === \"supplier\" && \"supplier\" in data) {\n\n return {\n credential: {\n ...(data.supplier.credential.password ? { password: data.supplier.credential.password } : {}),\n firstname: data.supplier.credential.firstname,\n lastname: data.supplier.credential.lastname,\n contact: data.supplier.credential.contact,\n email: data.supplier.credential.email,\n status: (data.supplier.credential.status === true) ? 1 : 0,\n address: data.supplier.credential.address\n },\n supplier: {\n type: data.supplier.type,\n company_name: data.supplier.companyName,\n contact: data.supplier.contact,\n code: data.supplier.code,\n reg_no: data.supplier.regNo,\n remark: data.supplier.remark,\n address_1: data.supplier.address1,\n address_2: data.supplier.address2,\n postcode: data.supplier.postcode,\n country_id: data.supplier.countryId,\n state_id: data.supplier.stateId,\n area_id: data.supplier.areaId,\n bank_name: data.supplier.bankName,\n bank_acc: data.supplier.bankAcc\n },\n props: {\n item_id: data.supplier.itemIds,\n retailer_id: data.supplier.retailerId\n }\n }\n }\n\n if (userType === \"member\" && \"member\" in data) {\n\n return {\n credential: {\n ...(data.member.credential.password ? { password: data.member.credential.password } : {}),\n firstname: data.member.credential.firstname,\n lastname: data.member.credential.lastname,\n contact: data.member.credential.contact,\n email: data.member.credential.email,\n status: (data.member.credential.status === true) ? 1 : 0,\n address: data.member.credential.address\n },\n member: {\n owner_user_id: (data.member.ownerUserId === 0) ? \"\" : data.member.ownerUserId, /* retailer_user_id or empty if global */\n company_name: data.member.companyName,\n identity_no: data.member.identityNo,\n gender: data.member.gender,\n dob: data.member.dob,\n address_1: data.member.address1,\n address_2: data.member.address2,\n country_id: data.member.countryId,\n state_id: data.member.stateId,\n area_id: data.member.areaId,\n postcode: data.member.postcode,\n remark: data.member.remark\n }\n }\n }\n\n}\n\nexport const UserService = (props: UserServiceProps) => {\n\n const { userType = \"administrator\", userTargetType, ...rest } = props ?? {};\n\n // const { makeCall } = ApiService(rest?.customToken ? { customToken: rest.customToken } : {})\n\n const { makeCall } = props.apiService\n\n const endpoint1 = \"user\";\n const endpoint2 = \"users\"\n\n const list = async (props: ListUserProps) => {\n\n const { userType: overrideUserType } = props;\n\n const url = buildApiListUrl(\n `${endpoint2}/${overrideUserType || userType}`,\n props\n );\n\n const response = await makeCall({\n url,\n method: \"get\",\n payload: {},\n // configuration\n });\n\n return response;\n\n }\n\n const get = async (props: GetUserProps) => {\n\n const { id, userType: overrideUserType } = props;\n\n const url = buildApiGetUrl(\n `${endpoint1}/${overrideUserType || userType}/${id}`,\n props\n );\n\n const response = await makeCall({\n url,\n method: \"get\",\n payload: {},\n // configuration\n });\n\n return response;\n\n }\n\n const create = async ({ data, userType: overrideUserType, userTargetType: overrideUserTargetType }: CreateUserProps) => {\n\n let _userType = overrideUserType || userType\n\n let payload: any = getCreatePayload(_userType, data)\n\n let url = `${endpoint1}`;\n\n let postData = {\n scope: {\n target: overrideUserTargetType || userTargetType,\n action: \"\",\n },\n payload\n }\n\n const response = await makeCall({\n url,\n method: \"post\",\n payload: postData\n });\n\n return response;\n\n }\n\n const update = async ({ id, data, userType: overrideUserType, userTargetType: overrideUserTargetType }: UpdateUserProps) => {\n\n let url = `${endpoint1}/${id}`\n\n let _userType = overrideUserType || userType\n\n let payload: any = getUpdatePayload(_userType, data)\n\n\n const postData = {\n scope: {\n target: overrideUserTargetType || userTargetType,\n action: \"\",\n },\n payload\n }\n\n const response = await makeCall({\n url,\n method: \"put\",\n payload: postData\n });\n\n return response;\n\n }\n\n const remove = async ({ ids, userTargetType: overrideUserTargetType }: RemoveUserProps) => {\n\n let url = `${endpoint2}/delete`\n\n const postData = {\n scope: {\n target: overrideUserTargetType || userTargetType,\n },\n payload: {\n ids\n }\n }\n\n const response = await makeCall({\n url,\n method: \"post\",\n payload: postData\n });\n\n return response;\n\n }\n\n const getDataTypes = async ({ userType: overrideUserType }: GetDataTypeUserProps) => {\n\n let url = `${endpoint2}/data_types/${overrideUserType || userType}`\n\n const response = await makeCall({\n url,\n method: \"get\",\n });\n\n return response;\n\n }\n\n return {\n list,\n get,\n create,\n update,\n remove,\n getDataTypes\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"UserService.js","sourceRoot":"","sources":["../../../src/services/user/UserService.ts"],"names":[],"mappings":";;;AAEA,+BAMe;AAEF,QAAA,SAAS,GAAG;IACrB,aAAa,EAAE,eAAe;IAC9B,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;CACR,CAAA;AAEG,QAAA,eAAe,GAAG;IAC3B,aAAa,EAAE,eAAe;IAC9B,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;IAChB,QAAQ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YAAY,GAAG,KAAK,EAAE,EAAE,QAAQ,EAAE,gBAAgB,EAAwB,EAAE,EAAE;QAEhF,IAAI,GAAG,GAAG,GAAG,SAAS,eAAe,gBAAgB,IAAI,QAAQ,EAAE,CAAA;QAEnE,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC;YAC5B,GAAG;YACH,MAAM,EAAE,KAAK;SAChB,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;IAEpB,CAAC,CAAA;IAED,OAAO;QACH,IAAI;QACJ,GAAG;QACH,MAAM;QACN,MAAM;QACN,MAAM;QACN,YAAY;KACf,CAAC;AACN,CAAC,CAAA;AApJY,QAAA,WAAW,eAoJvB","sourcesContent":["import { DefaultServiceProps } from '@/lib';\n\nimport {\n buildApiListUrl,\n BuildApiListParamsProps,\n buildApiGetUrl,\n BuildApiGetParamsProps,\n filterOperatorTypes\n} from '@/lib';\n\nexport const userTypes = {\n administrator: \"administrator\",\n worker: \"worker\",\n supplier: \"supplier\",\n customer: \"customer\",\n driver: \"driver\",\n retailer: \"retailer\",\n member: \"member\",\n operator: \"operator\",\n agent: \"agent\",\n} as const\n\nexport const userTargetTypes = {\n administrator: \"administrator\",\n worker: \"worker\",\n supplier: \"supplier\",\n customer: \"customer\",\n driver: \"driver\",\n retailer: \"retailer\",\n member: \"member\",\n operator: \"operator\",\n agent: \"agent\",\n} as const\n\nexport type UserType = typeof userTypes[keyof typeof userTypes]\nexport type UserTargetType = typeof userTargetTypes[keyof typeof userTargetTypes]\nexport type UserTargetKey = keyof typeof userTargetTypes\n\nexport type UserServiceProps = DefaultServiceProps & {\n userTargetType?: UserTargetType\n userType?: UserType\n};\n\nexport type ListUserProps = BuildApiListParamsProps & {\n userType?: UserType\n}\n\nexport type GetUserProps = BuildApiGetParamsProps & {\n id: number | string\n userType?: UserType\n}\n\ntype Gender = \"male\" | \"female\"\ntype AssignSupplierType = \"admin\" | \"retail\"\n\ntype UserCredential = {\n username: string\n password: string\n // userType: UserTargetType\n firstname: string\n lastname: string\n contact: string\n email: string\n status: boolean\n address: string\n}\n\nexport type CreateUserProps = {\n userTargetType?: UserTargetType\n userType?: UserType\n data:\n // administrator\n {\n administrator: {\n credential: UserCredential,\n locationIds: number[]\n }\n } |\n // customer\n {\n customer: {\n credential: UserCredential,\n code: string\n accountCode: string\n companyName: string\n regNo: string\n secondaryRegNo: string\n taxIdentificationNo: string,\n taxRegistrationNo: string,\n remark: string\n salesperson: string\n excludeTaxRate: number[]\n }\n } |\n // retailer\n {\n retailer: {\n credential: UserCredential,\n code: string\n accountCode: string\n companyName: string\n regNo: string\n remark: string\n isDifferentBusiness: boolean\n businessId: number\n }\n } |\n // worker\n {\n worker: {\n credential: UserCredential,\n remark: string\n locationIds: number[]\n }\n } |\n // driver\n {\n driver: {\n credential: UserCredential,\n companyName: string\n remark: string\n locationIds: number[]\n }\n } |\n // supplier\n {\n supplier: {\n credential: UserCredential,\n // supplier: {\n type: AssignSupplierType\n companyName: string\n contact: string\n code: string\n regNo: string\n remark: string\n address1: string\n address2: string\n postcode: string\n countryId: number\n stateId: number\n areaId: number\n bankName: string\n bankAcc: string\n itemIds: number[],\n retailerId?: number /* Optional */\n }\n } &\n // member\n {\n member: {\n credential: UserCredential,\n ownerUserId: number | 0 /* retailer_user_id or empty if global */\n companyName: string\n identityNo: string\n gender: Gender,\n dob: string\n address1: string\n address2: string\n countryId: number\n stateId: number\n areaId: number\n postcode: string\n remark: string\n }\n }\n}\n\nexport type UpdateUserProps = {\n id: number\n userTargetType?: UserTargetType\n userType?: UserType\n data:\n // administatrator\n {\n administrator: {\n credential: Omit<UserCredential, \"username\" | \"password\"> & { password?: string },\n locationIds: number[]\n }\n } |\n // customer\n {\n customer: {\n credential: Omit<UserCredential, \"username\" | \"password\"> & { password?: string },\n code: string\n accountCode: string\n companyName: string\n regNo: string\n secondaryRegNo: string\n taxIdentificationNo: string,\n taxRegistrationNo: string,\n remark: string\n salesperson: string\n excludeTaxRate: number[]\n }\n } |\n // retailer\n {\n retailer: {\n credential: Omit<UserCredential, \"username\" | \"password\"> & { password?: string },\n code: string\n accountCode: string\n companyName: string\n regNo: string\n remark: string\n isDifferentBusiness: boolean\n businessId: number\n }\n } |\n // worker\n {\n worker: {\n credential: Omit<UserCredential, \"username\" | \"password\"> & { password?: string },\n remark: string\n locationIds: number[]\n }\n } |\n // driver\n {\n driver: {\n credential: Omit<UserCredential, \"username\" | \"password\"> & { password?: string },\n companyName: string\n remark: string\n locationIds: number[]\n }\n } |\n // supplier\n {\n supplier: {\n credential: Omit<UserCredential, \"username\" | \"password\"> & { password?: string },\n type: AssignSupplierType\n companyName: string\n contact: string\n code: string\n regNo: string\n remark: string\n address1: string\n address2: string\n postcode: string\n countryId: number\n stateId: number\n areaId: number\n bankName: string\n bankAcc: string\n itemIds: number[],\n retailerId?: number /* Optional */\n }\n } |\n // member\n {\n member: {\n credential: Omit<UserCredential, \"username\" | \"password\"> & { password?: string },\n ownerUserId: number /* retailer_user_id or empty if global */\n companyName: string\n identityNo: string\n gender: Gender,\n dob: string\n address1: string\n address2: string\n countryId: number\n stateId: number\n areaId: number\n postcode: string\n remark: string\n }\n }\n}\n\nexport type RemoveUserProps = {\n userTargetType?: UserTargetType\n ids: number[]\n}\n\nexport type GetDataTypeUserProps = {\n userType?: UserType\n}\n\nconst getCreatePayload = (userType: UserType, data: CreateUserProps[\"data\"]) => {\n\n if (userType === \"administrator\" && \"administrator\" in data) {\n\n return {\n credential: {\n username: data.administrator.credential.username,\n password: data.administrator.credential.password,\n user_type: userType,\n firstname: data.administrator.credential.firstname,\n lastname: data.administrator.credential.lastname,\n contact: data.administrator.credential.contact,\n email: data.administrator.credential.email,\n status: (data.administrator.credential.status === true) ? 1 : 0,\n address: data.administrator.credential.address\n },\n administrator: [],\n props: {\n location_id: data.administrator.locationIds\n }\n }\n }\n\n if (userType === \"customer\" && \"customer\" in data) {\n\n return {\n credential: {\n username: data.customer.credential.username,\n password: data.customer.credential.password,\n user_type: userType,\n firstname: data.customer.credential.firstname,\n lastname: data.customer.credential.lastname,\n contact: data.customer.credential.contact,\n email: data.customer.credential.email,\n status: (data.customer.credential.status === true) ? 1 : 0,\n address: data.customer.credential.address\n },\n customer: {\n code: data.customer.code,\n account_code: data.customer.accountCode,\n company_name: data.customer.companyName,\n reg_no: data.customer.regNo,\n secondary_reg_no: data.customer.secondaryRegNo,\n remark: data.customer.remark,\n tax_identification_no: data.customer.taxIdentificationNo,\n tax_registration_no: data.customer.taxRegistrationNo,\n },\n props: {\n salesperson: data.customer.salesperson,\n exclude_tax_rate: data.customer.excludeTaxRate\n }\n }\n }\n\n if (userType === \"retailer\" && \"retailer\" in data) {\n\n return {\n credential: {\n username: data.retailer.credential.username,\n password: data.retailer.credential.password,\n user_type: userType,\n firstname: data.retailer.credential.firstname,\n lastname: data.retailer.credential.lastname,\n contact: data.retailer.credential.contact,\n email: data.retailer.credential.email,\n status: (data.retailer.credential.status === true) ? 1 : 0,\n address: data.retailer.credential.address\n },\n retailer: {\n code: data.retailer.code,\n account_code: data.retailer.accountCode,\n company_name: data.retailer.companyName,\n reg_no: data.retailer.regNo,\n remark: data.retailer.remark\n },\n props: {\n business_id: data.retailer.businessId\n },\n status: {\n is_different_business: (data.retailer.isDifferentBusiness === true) ? 1 : 0\n }\n }\n }\n\n if (userType === \"worker\" && \"worker\" in data) {\n\n return {\n credential: {\n username: data.worker.credential.username,\n password: data.worker.credential.password,\n user_type: userType,\n firstname: data.worker.credential.firstname,\n lastname: data.worker.credential.lastname,\n contact: data.worker.credential.contact,\n email: data.worker.credential.email,\n status: (data.worker.credential.status === true) ? 1 : 0,\n address: data.worker.credential.address\n },\n worker: {\n remark: data.worker.remark\n },\n props: {\n location_id: data.worker.locationIds\n }\n }\n }\n\n if (userType === \"driver\" && \"driver\" in data) {\n\n return {\n credential: {\n username: data.driver.credential.username,\n password: data.driver.credential.password,\n user_type: userType,\n firstname: data.driver.credential.firstname,\n lastname: data.driver.credential.lastname,\n contact: data.driver.credential.contact,\n email: data.driver.credential.email,\n status: (data.driver.credential.status === true) ? 1 : 0,\n address: data.driver.credential.address\n },\n driver: {\n company_name: data.driver.companyName,\n remark: data.driver.remark\n },\n props: {\n location_id: data.driver.locationIds\n }\n }\n }\n\n if (userType === \"supplier\" && \"supplier\" in data) {\n\n return {\n credential: {\n username: data.supplier.credential.username,\n password: data.supplier.credential.password,\n user_type: userType,\n firstname: data.supplier.credential.firstname,\n lastname: data.supplier.credential.lastname,\n contact: data.supplier.credential.contact,\n email: data.supplier.credential.email,\n status: (data.supplier.credential.status === true) ? 1 : 0,\n address: data.supplier.credential.address\n },\n supplier: {\n type: data.supplier.type,\n company_name: data.supplier.companyName,\n contact: data.supplier.contact,\n code: data.supplier.code,\n reg_no: data.supplier.regNo,\n remark: data.supplier.remark,\n address_1: data.supplier.address1,\n address_2: data.supplier.address2,\n postcode: data.supplier.postcode,\n country_id: data.supplier.countryId,\n state_id: data.supplier.stateId,\n area_id: data.supplier.areaId,\n bank_name: data.supplier.bankName,\n bank_acc: data.supplier.bankAcc\n },\n props: {\n item_id: data.supplier.itemIds,\n retailer_id: data.supplier.retailerId\n }\n }\n }\n\n if (userType === \"member\" && \"member\" in data) {\n\n return {\n credential: {\n username: data.member.credential.username,\n password: data.member.credential.password,\n user_type: userType,\n firstname: data.member.credential.firstname,\n lastname: data.member.credential.lastname,\n contact: data.member.credential.contact,\n email: data.member.credential.email,\n status: (data.member.credential.status === true) ? 1 : 0,\n address: data.member.credential.address\n },\n member: {\n owner_user_id: (data.member.ownerUserId === 0) ? \"\" : data.member.ownerUserId, /* retailer_user_id or empty if global */\n company_name: data.member.companyName,\n identity_no: data.member.identityNo,\n gender: data.member.gender,\n dob: data.member.dob,\n address_1: data.member.address1,\n address_2: data.member.address2,\n country_id: data.member.countryId,\n state_id: data.member.stateId,\n area_id: data.member.areaId,\n postcode: data.member.postcode,\n remark: data.member.remark\n }\n }\n }\n}\n\nconst getUpdatePayload = (userType: UserType, data: UpdateUserProps[\"data\"]) => {\n\n if (userType === \"administrator\" && \"administrator\" in data) {\n\n return {\n credential: {\n ...(data.administrator.credential.password ? { password: data.administrator.credential.password } : {}),\n firstname: data.administrator.credential.firstname,\n lastname: data.administrator.credential.lastname,\n contact: data.administrator.credential.contact,\n email: data.administrator.credential.email,\n status: (data.administrator.credential.status === true) ? 1 : 0,\n address: data.administrator.credential.address\n },\n administrator: [],\n props: {\n location_id: data.administrator.locationIds\n }\n }\n }\n\n if (userType === \"customer\" && \"customer\" in data) {\n\n return {\n credential: {\n ...(data.customer.credential.password ? { password: data.customer.credential.password } : {}),\n firstname: data.customer.credential.firstname,\n lastname: data.customer.credential.lastname,\n contact: data.customer.credential.contact,\n email: data.customer.credential.email,\n status: (data.customer.credential.status === true) ? 1 : 0,\n address: data.customer.credential.address\n },\n customer: {\n code: data.customer.code,\n account_code: data.customer.accountCode,\n company_name: data.customer.companyName,\n reg_no: data.customer.regNo,\n secondary_reg_no: data.customer.secondaryRegNo,\n remark: data.customer.remark,\n tax_identification_no: data.customer.taxIdentificationNo,\n tax_registration_no: data.customer.taxRegistrationNo,\n },\n props: {\n salesperson: data.customer.salesperson,\n exclude_tax_rate: data.customer.excludeTaxRate\n }\n }\n\n }\n\n if (userType === \"retailer\" && \"retailer\" in data) {\n\n return {\n credential: {\n ...(data.retailer.credential.password ? { password: data.retailer.credential.password } : {}),\n firstname: data.retailer.credential.firstname,\n lastname: data.retailer.credential.lastname,\n contact: data.retailer.credential.contact,\n email: data.retailer.credential.email,\n status: (data.retailer.credential.status === true) ? 1 : 0,\n address: data.retailer.credential.address\n },\n retailer: {\n code: data.retailer.code,\n account_code: data.retailer.accountCode,\n company_name: data.retailer.companyName,\n reg_no: data.retailer.regNo,\n remark: data.retailer.remark\n },\n props: {\n business_id: data.retailer.businessId\n },\n status: {\n is_different_business: (data.retailer.isDifferentBusiness === true) ? 1 : 0\n }\n }\n }\n\n if (userType === \"worker\" && \"worker\" in data) {\n\n return {\n credential: {\n ...(data.worker.credential.password ? { password: data.worker.credential.password } : {}),\n firstname: data.worker.credential.firstname,\n lastname: data.worker.credential.lastname,\n contact: data.worker.credential.contact,\n email: data.worker.credential.email,\n status: (data.worker.credential.status === true) ? 1 : 0,\n address: data.worker.credential.address\n },\n worker: {\n remark: data.worker.remark\n },\n props: {\n location_id: data.worker.locationIds\n }\n }\n }\n\n if (userType === \"driver\" && \"driver\" in data) {\n\n return {\n credential: {\n ...(data.driver.credential.password ? { password: data.driver.credential.password } : {}),\n firstname: data.driver.credential.firstname,\n lastname: data.driver.credential.lastname,\n contact: data.driver.credential.contact,\n email: data.driver.credential.email,\n status: (data.driver.credential.status === true) ? 1 : 0,\n address: data.driver.credential.address\n },\n driver: {\n company_name: data.driver.companyName,\n remark: data.driver.remark\n },\n props: {\n location_id: data.driver.locationIds\n }\n }\n }\n\n if (userType === \"supplier\" && \"supplier\" in data) {\n\n return {\n credential: {\n ...(data.supplier.credential.password ? { password: data.supplier.credential.password } : {}),\n firstname: data.supplier.credential.firstname,\n lastname: data.supplier.credential.lastname,\n contact: data.supplier.credential.contact,\n email: data.supplier.credential.email,\n status: (data.supplier.credential.status === true) ? 1 : 0,\n address: data.supplier.credential.address\n },\n supplier: {\n type: data.supplier.type,\n company_name: data.supplier.companyName,\n contact: data.supplier.contact,\n code: data.supplier.code,\n reg_no: data.supplier.regNo,\n remark: data.supplier.remark,\n address_1: data.supplier.address1,\n address_2: data.supplier.address2,\n postcode: data.supplier.postcode,\n country_id: data.supplier.countryId,\n state_id: data.supplier.stateId,\n area_id: data.supplier.areaId,\n bank_name: data.supplier.bankName,\n bank_acc: data.supplier.bankAcc\n },\n props: {\n item_id: data.supplier.itemIds,\n retailer_id: data.supplier.retailerId\n }\n }\n }\n\n if (userType === \"member\" && \"member\" in data) {\n\n return {\n credential: {\n ...(data.member.credential.password ? { password: data.member.credential.password } : {}),\n firstname: data.member.credential.firstname,\n lastname: data.member.credential.lastname,\n contact: data.member.credential.contact,\n email: data.member.credential.email,\n status: (data.member.credential.status === true) ? 1 : 0,\n address: data.member.credential.address\n },\n member: {\n owner_user_id: (data.member.ownerUserId === 0) ? \"\" : data.member.ownerUserId, /* retailer_user_id or empty if global */\n company_name: data.member.companyName,\n identity_no: data.member.identityNo,\n gender: data.member.gender,\n dob: data.member.dob,\n address_1: data.member.address1,\n address_2: data.member.address2,\n country_id: data.member.countryId,\n state_id: data.member.stateId,\n area_id: data.member.areaId,\n postcode: data.member.postcode,\n remark: data.member.remark\n }\n }\n }\n\n}\n\nexport const UserService = (props: UserServiceProps) => {\n\n const { userType = \"administrator\", userTargetType, ...rest } = props ?? {};\n\n // const { makeCall } = ApiService(rest?.customToken ? { customToken: rest.customToken } : {})\n\n const { makeCall } = props.apiService\n\n const endpoint1 = \"user\";\n const endpoint2 = \"users\"\n\n const list = async (props: ListUserProps) => {\n\n const { userType: overrideUserType } = props;\n\n const url = buildApiListUrl(\n `${endpoint2}/${overrideUserType || userType}`,\n props\n );\n\n const response = await makeCall({\n url,\n method: \"get\",\n payload: {},\n // configuration\n });\n\n return response;\n\n }\n\n const get = async (props: GetUserProps) => {\n\n const { id, userType: overrideUserType } = props;\n\n const url = buildApiGetUrl(\n `${endpoint1}/${overrideUserType || userType}/${id}`,\n props\n );\n\n const response = await makeCall({\n url,\n method: \"get\",\n payload: {},\n // configuration\n });\n\n return response;\n\n }\n\n const create = async ({ data, userType: overrideUserType, userTargetType: overrideUserTargetType }: CreateUserProps) => {\n\n let _userType = overrideUserType || userType\n\n let payload: any = getCreatePayload(_userType, data)\n\n let url = `${endpoint1}`;\n\n let postData = {\n scope: {\n target: overrideUserTargetType || userTargetType,\n action: \"\",\n },\n payload\n }\n\n const response = await makeCall({\n url,\n method: \"post\",\n payload: postData\n });\n\n return response;\n\n }\n\n const update = async ({ id, data, userType: overrideUserType, userTargetType: overrideUserTargetType }: UpdateUserProps) => {\n\n let url = `${endpoint1}/${id}`\n\n let _userType = overrideUserType || userType\n\n let payload: any = getUpdatePayload(_userType, data)\n\n\n const postData = {\n scope: {\n target: overrideUserTargetType || userTargetType,\n action: \"\",\n },\n payload\n }\n\n const response = await makeCall({\n url,\n method: \"put\",\n payload: postData\n });\n\n return response;\n\n }\n\n const remove = async ({ ids, userTargetType: overrideUserTargetType }: RemoveUserProps) => {\n\n let url = `${endpoint2}/delete`\n\n const postData = {\n scope: {\n target: overrideUserTargetType || userTargetType,\n },\n payload: {\n ids\n }\n }\n\n const response = await makeCall({\n url,\n method: \"post\",\n payload: postData\n });\n\n return response;\n\n }\n\n const getDataTypes = async ({ userType: overrideUserType }: GetDataTypeUserProps) => {\n\n let url = `${endpoint2}/data_types/${overrideUserType || userType}`\n\n const response = await makeCall({\n url,\n method: \"get\",\n });\n\n return response;\n\n }\n\n return {\n list,\n get,\n create,\n update,\n remove,\n getDataTypes\n };\n}\n"]}
|