repzo 1.0.192 → 1.0.194

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/lib/index.d.ts CHANGED
@@ -102,10 +102,11 @@ export declare const end_points: {
102
102
  readonly REPORT_SORT: "report-sort";
103
103
  readonly REPORT_FILTER: "report-filter";
104
104
  readonly SAFE_CRUD: "safe-crud";
105
+ readonly PAYMENT_METHOD: "payment-method";
105
106
  };
106
- export type EndPoints = typeof end_points[keyof typeof end_points];
107
+ export type EndPoints = (typeof end_points)[keyof typeof end_points];
107
108
  export declare const availableService: readonly ["client", "product", "variant", "category", "sub_category", "brand", "product_group", "tax", "measureunit", "measureunitFamily", "media", "priceList", "priceListItem", "team", "returnReason", "rep", "tag", "warehouse", "route", "productModifiersGroup", "channel", "speciality", "clientContact", "paymentTerm", "bank", "bank_list", "customStatus", "customList", "customListItem", "inventoryAdjustmentReason", "workorder", "workorderRequest", "supplier", "quickConvertToPdf", "visit", "activityFeedback", "activityFeedbackV2", "feedbackOption", "invoice", "proforma", "payment", "refund", "settlement", "check", "day", "receivingMaterial", "adjustAccount", "transfer", "msl", "mslProduct", "mediaStorage", "storecheckTemplate", "activityStorecheck", "adjustInventory", "inventory", "integrationApp", "joinActionsWebHook", "patchAction", "updateIntegrationMeta", "assetPartType", "assetPart", "assetPartUnit", "assetPartReceival", "assetPartTransfer", "returnAssetPartUnit", "storeAssetPartUnit", "ocrInvoiceJobTemplate", "ocrInvoiceJobGroup", "activityAiSalesOrder", "ocrInvoiceJob", "ocrInvoiceJobPage", "settings", "mailUnsubscribe", "approvalRequest", "safeInvoiceSerialCounter", "clientLocation", "assetType", "asset", "assetUnit", "workorderPortal", "approval", "workorderCategory", "contract", "contractInstallment", "repBalanceSummary", "workorderPortalLink", "customField", "salesAnalyticsReport"];
108
- export type AvailableService = typeof availableService[number];
109
+ export type AvailableService = (typeof availableService)[number];
109
110
  export default class Repzo {
110
111
  private svAPIEndpoint;
111
112
  headers: Headers;
@@ -215,6 +216,7 @@ export default class Repzo {
215
216
  readonly REPORT_SORT: "report-sort";
216
217
  readonly REPORT_FILTER: "report-filter";
217
218
  readonly SAFE_CRUD: "safe-crud";
219
+ readonly PAYMENT_METHOD: "payment-method";
218
220
  };
219
221
  private _fetch;
220
222
  private _create;
@@ -1022,4 +1024,12 @@ export default class Repzo {
1022
1024
  _path: "safe-crud";
1023
1025
  create: (body: Service.SafeCrud.Create.Body) => Promise<Service.SafeCrud.Create.Result>;
1024
1026
  };
1027
+ paymentMethod: {
1028
+ _path: "payment-method";
1029
+ find: (params?: Service.PaymentMethod.Find.Params) => Promise<Service.PaymentMethod.Find.Result>;
1030
+ get: (id: Service.PaymentMethod.Get.ID, params?: Service.PaymentMethod.Get.Params) => Promise<Service.PaymentMethod.Get.Result>;
1031
+ create: (body: Service.PaymentMethod.Create.Body) => Promise<Service.PaymentMethod.Create.Result>;
1032
+ update: (id: Service.PaymentMethod.Update.ID, body: Service.PaymentMethod.Update.Body) => Promise<Service.PaymentMethod.Update.Result>;
1033
+ remove: (id: Service.PaymentMethod.Update.ID, params: Service.PaymentMethod.Remove.Params) => Promise<Service.PaymentMethod.Remove.Result>;
1034
+ };
1025
1035
  }
package/lib/index.js CHANGED
@@ -103,6 +103,7 @@ export const end_points = {
103
103
  REPORT_SORT: "report-sort",
104
104
  REPORT_FILTER: "report-filter",
105
105
  SAFE_CRUD: "safe-crud",
106
+ PAYMENT_METHOD: "payment-method",
106
107
  };
107
108
  export const availableService = [
108
109
  "client",
@@ -2096,6 +2097,28 @@ class Repzo {
2096
2097
  return res;
2097
2098
  },
2098
2099
  };
2100
+ this.paymentMethod = {
2101
+ _path: Repzo._end_points.PAYMENT_METHOD,
2102
+ find: async (params) => {
2103
+ let res = await this._fetch(this.svAPIEndpoint, this.paymentMethod._path, params);
2104
+ return res;
2105
+ },
2106
+ get: async (id, params) => {
2107
+ return await this._fetch(this.svAPIEndpoint, this.paymentMethod._path + `/${id}`, params);
2108
+ },
2109
+ create: async (body) => {
2110
+ let res = await this._create(this.svAPIEndpoint, this.paymentMethod._path, body);
2111
+ return res;
2112
+ },
2113
+ update: async (id, body) => {
2114
+ let res = await this._update(this.svAPIEndpoint, this.paymentMethod._path + `/${id}`, body);
2115
+ return res;
2116
+ },
2117
+ remove: async (id, params) => {
2118
+ let res = await this._delete(this.svAPIEndpoint, this.paymentMethod._path + `/${id}`, params);
2119
+ return res;
2120
+ },
2121
+ };
2099
2122
  this.svAPIEndpoint =
2100
2123
  !options?.env || options?.env == "production"
2101
2124
  ? "https://sv.api.repzo.me"
@@ -5008,6 +5008,7 @@ export declare namespace Service {
5008
5008
  }
5009
5009
  type SortingKeys = "due_date" | "priority" | "updatedAt" | "createdAt" | "from_updatedAt" | "to_updatedAt" | "_id";
5010
5010
  type PopulatedKeys = "client" | "asset_units" | "asset_part_units" | "assets" | "assigned_to" | "client_location" | "workorder_categories" | "forms" | "media" | "cover_photo" | "teams" | "forms_v2" | "contract";
5011
+ type GetPopulatedKey = PopulatedKeys | "fullinvoice" | "proforma" | "activity-form-v2" | "activity-form" | "receive-parts";
5011
5012
  export namespace Find {
5012
5013
  type Params = DefaultPaginationQueryParams & {
5013
5014
  name?: string | string[];
@@ -5062,7 +5063,7 @@ export declare namespace Service {
5062
5063
  export namespace Get {
5063
5064
  type ID = string;
5064
5065
  interface Params {
5065
- populatedKeys?: PopulatedKeys[];
5066
+ populatedKeys?: GetPopulatedKey[];
5066
5067
  sortPage?: SortingKeys;
5067
5068
  }
5068
5069
  type Result = WorkorderSchema | PopulatedData;
@@ -6977,22 +6978,23 @@ export declare namespace Service {
6977
6978
  }
6978
6979
  namespace Payment {
6979
6980
  export interface PaymentSchema {
6980
- _id: string;
6981
+ _id: StringId;
6981
6982
  status: PaymentStatus;
6982
6983
  remainder: number;
6983
6984
  amount: number;
6984
- client_id: string;
6985
+ client_id: StringId;
6985
6986
  client_name: string;
6986
6987
  creator: AdminCreator | RepCreator;
6987
6988
  implemented_by?: AdminCreator | RepCreator;
6988
6989
  transaction_processed: boolean;
6989
6990
  time?: number;
6990
6991
  serial_number: SerialNumber;
6991
- route?: string;
6992
+ route?: StringId;
6992
6993
  paytime: string;
6993
6994
  note?: string;
6994
6995
  currency: string;
6995
6996
  payment_type: PaymentType;
6997
+ payment_method?: StringId;
6996
6998
  check?: Check;
6997
6999
  LinkedTxn?: {
6998
7000
  Txn_serial_number: SerialNumber;
@@ -7008,18 +7010,28 @@ export declare namespace Service {
7008
7010
  [key: string]: any;
7009
7011
  };
7010
7012
  sync_id: string;
7011
- custom_status?: string;
7013
+ custom_status?: StringId;
7012
7014
  visit_id?: string;
7013
- teams?: string[];
7015
+ teams?: StringId[];
7014
7016
  paymentsData: {
7015
7017
  amount: number;
7016
7018
  paid: number;
7017
7019
  balance: number;
7018
7020
  payments: PaymentData[];
7019
7021
  };
7022
+ reference?: string;
7023
+ media?: StringId[];
7024
+ network_state?: number;
7025
+ platform?: string;
7026
+ version_name?: string;
7027
+ battery_level?: number;
7028
+ time_zone?: string;
7029
+ identifier?: number;
7030
+ device_id?: string;
7031
+ device_unique_id?: string;
7032
+ ending_balance?: number;
7020
7033
  createdAt: string;
7021
7034
  updatedAt: string;
7022
- ending_balance?: number;
7023
7035
  __v: number;
7024
7036
  }
7025
7037
  export type Data = PaymentSchema;
@@ -7034,6 +7046,7 @@ export declare namespace Service {
7034
7046
  note?: string;
7035
7047
  currency: string;
7036
7048
  payment_type: PaymentType;
7049
+ payment_method?: StringId;
7037
7050
  transaction_processed: boolean;
7038
7051
  check?: Check;
7039
7052
  LinkedTxn?: {
@@ -7053,6 +7066,8 @@ export declare namespace Service {
7053
7066
  custom_status?: string;
7054
7067
  visit_id?: string;
7055
7068
  teams?: string[];
7069
+ reference?: string;
7070
+ media?: StringId[];
7056
7071
  }
7057
7072
  export interface UpdateBody {
7058
7073
  integration_meta?: {
@@ -7072,11 +7087,13 @@ export declare namespace Service {
7072
7087
  original_amount: number;
7073
7088
  payment: number;
7074
7089
  };
7075
- teams?: string[] | Team.TeamSchema[];
7076
- route?: string | Route.RouteSchema;
7090
+ teams?: StringId[] | Team.TeamSchema[];
7091
+ route?: StringId | Route.RouteSchema;
7092
+ payment_method?: StringId | PaymentMethod.Data;
7093
+ media?: (StringId | PopulatedMediaStorage)[];
7077
7094
  };
7078
7095
  type PaymentType = "check" | "cash";
7079
- type PopulatedKeys = "custom_status" | "teams" | "route";
7096
+ type PopulatedKeys = "custom_status" | "teams" | "route" | "payment_method";
7080
7097
  type PaymentStatus = "consumed" | "unconsumed" | "partially_consumed";
7081
7098
  export namespace Find {
7082
7099
  type Params = DefaultPaginationQueryParams & {
@@ -11021,7 +11038,7 @@ export declare namespace Service {
11021
11038
  disabled: boolean;
11022
11039
  document_scan_listed: boolean;
11023
11040
  client?: StringId;
11024
- doc_type: "pdf" | "image";
11041
+ doc_type: "pdf" | "image" | "fixed-length-text";
11025
11042
  preparation_option?: {
11026
11043
  rotate?: boolean;
11027
11044
  convert_to_image: boolean;
@@ -11031,8 +11048,8 @@ export declare namespace Service {
11031
11048
  };
11032
11049
  };
11033
11050
  cart_option?: CartOptions;
11034
- ai_json_parsing_model: "gpt-4o-mini" | "gpt-4o";
11035
- ai_vision_model: "gpt-4o-mini" | "gpt-4o" | "local_vision";
11051
+ ai_json_parsing_model: "gpt-4o-mini" | "gpt-4o" | "fixed-length-text";
11052
+ ai_vision_model: "gpt-4o-mini" | "gpt-4o" | "local_vision" | "fixed-length-text";
11036
11053
  visible_columns: {
11037
11054
  key: "product_name" | "variant_name" | "product_sku" | "product_barcode" | "variant_barcode" | "variant_sku" | "price" | "qty" | "measure_unit" | "total_amount" | "total" | "code";
11038
11055
  visible: boolean;
@@ -11048,52 +11065,20 @@ export declare namespace Service {
11048
11065
  always_merge_pages_for_job?: boolean;
11049
11066
  trim_barcode_zero_from_left?: boolean;
11050
11067
  bypass_human_review?: boolean;
11068
+ fixed_length_text_layout_definition?: StringId;
11051
11069
  createdAt: Date;
11052
11070
  updatedAt: Date;
11053
11071
  }
11054
- interface PopulatedDoc {
11055
- _id: StringId;
11056
- name: string;
11057
- company_namespace: string[];
11058
- disabled: boolean;
11059
- document_scan_listed: boolean;
11060
- client?: StringId;
11072
+ type PopulatedDoc = Data & {
11061
11073
  client_populated?: Pick<Client.ClientSchema, "name" | "_id">;
11062
- doc_type: "pdf" | "image";
11063
- preparation_option?: {
11064
- rotate?: boolean;
11065
- convert_to_image: boolean;
11066
- lang?: {
11067
- en?: boolean;
11068
- ar?: boolean;
11069
- };
11070
- };
11071
- cart_option?: CartOptions;
11072
- ai_json_parsing_model: "gpt-4o-mini" | "gpt-4o";
11073
- ai_vision_model: "gpt-4o-mini" | "gpt-4o" | "local_vision";
11074
- visible_columns: {
11075
- key: "product_name" | "variant_name" | "product_sku" | "product_barcode" | "variant_barcode" | "variant_sku" | "price" | "qty" | "measure_unit" | "total_amount" | "total" | "code";
11076
- visible: boolean;
11077
- }[];
11078
- ai_parsing_prompt_amendment?: string;
11079
- ai_vision_prompt_amendment?: string;
11080
- ai_parsing_prompt_overwrite?: string;
11081
- ai_vision_prompt_overwrite?: string;
11082
- enable_ai_parsing_prompt_amendment?: boolean;
11083
- enable_ai_vision_prompt_amendment?: boolean;
11084
- enable_ai_parsing_prompt_overwrite?: boolean;
11085
- enable_ai_vision_prompt_overwrite?: boolean;
11086
- always_merge_pages_for_job?: boolean;
11087
- trim_zero_from_first?: boolean;
11088
- createdAt: Date;
11089
- updatedAt: Date;
11090
- }
11074
+ fixed_length_text_layout_definition_populated?: OcrInvoiceFixedLengthTextLayoutDefinition.Data;
11075
+ };
11091
11076
  interface CreateBody {
11092
11077
  name: string;
11093
11078
  company_namespace: string[];
11094
11079
  document_scan_listed: boolean;
11095
11080
  client?: StringId;
11096
- doc_type: "pdf" | "image";
11081
+ doc_type: "pdf" | "image" | "fixed-length-text";
11097
11082
  preparation_option?: {
11098
11083
  rotate?: boolean;
11099
11084
  convert_to_image: boolean;
@@ -11103,8 +11088,8 @@ export declare namespace Service {
11103
11088
  };
11104
11089
  };
11105
11090
  cart_option?: CartOptions;
11106
- ai_json_parsing_model: "gpt-4o-mini" | "gpt-4o";
11107
- ai_vision_model: "gpt-4o-mini" | "gpt-4o" | "local_vision";
11091
+ ai_json_parsing_model: "gpt-4o-mini" | "gpt-4o" | "fixed-length-text";
11092
+ ai_vision_model: "gpt-4o-mini" | "gpt-4o" | "local_vision" | "fixed-length-text";
11108
11093
  visible_columns: {
11109
11094
  key: "product_name" | "variant_name" | "product_sku" | "product_barcode" | "variant_barcode" | "variant_sku" | "price" | "qty" | "measure_unit" | "total_amount" | "total" | "code";
11110
11095
  visible: boolean;
@@ -11134,8 +11119,8 @@ export declare namespace Service {
11134
11119
  };
11135
11120
  };
11136
11121
  cart_option?: CartOptions;
11137
- ai_json_parsing_model: "gpt-4o-mini" | "gpt-4o";
11138
- ai_vision_model: "gpt-4o-mini" | "gpt-4o" | "local_vision";
11122
+ ai_json_parsing_model: "gpt-4o-mini" | "gpt-4o" | "fixed-length-text";
11123
+ ai_vision_model: "gpt-4o-mini" | "gpt-4o" | "local_vision" | "fixed-length-text";
11139
11124
  visible_columns: {
11140
11125
  key: "product_name" | "variant_name" | "product_sku" | "product_barcode" | "variant_barcode" | "variant_sku" | "price" | "qty" | "measure_unit" | "total_amount" | "total" | "code";
11141
11126
  visible: boolean;
@@ -11579,6 +11564,145 @@ export declare namespace Service {
11579
11564
  type Result = Data;
11580
11565
  }
11581
11566
  }
11567
+ namespace OcrInvoiceFixedLengthTextLayoutDefinition {
11568
+ interface Data {
11569
+ _id: StringId;
11570
+ name: string;
11571
+ company_namespace: string[];
11572
+ disabled: boolean;
11573
+ createdAt: Date;
11574
+ updatedAt: Date;
11575
+ }
11576
+ interface CreateBody {
11577
+ name: string;
11578
+ company_namespace?: string[];
11579
+ disabled?: boolean;
11580
+ }
11581
+ interface UpdateBody {
11582
+ _id?: StringId;
11583
+ name?: string;
11584
+ company_namespace?: string[];
11585
+ disabled?: boolean;
11586
+ createdAt?: Date;
11587
+ updatedAt?: Date;
11588
+ }
11589
+ namespace Find {
11590
+ type Params = DefaultPaginationQueryParams & {
11591
+ _id?: StringId | StringId[];
11592
+ name?: string | string[];
11593
+ disabled?: boolean | boolean[];
11594
+ search?: string;
11595
+ };
11596
+ interface Result extends DefaultPaginationResult {
11597
+ data: Data[];
11598
+ }
11599
+ }
11600
+ namespace Get {
11601
+ type ID = string;
11602
+ type Result = Data;
11603
+ }
11604
+ namespace Create {
11605
+ type Body = CreateBody;
11606
+ type Result = Data;
11607
+ }
11608
+ namespace Update {
11609
+ type ID = StringId;
11610
+ type Body = UpdateBody;
11611
+ type Result = Data;
11612
+ }
11613
+ namespace Remove {
11614
+ type ID = string;
11615
+ type Params = {};
11616
+ type Result = Data;
11617
+ }
11618
+ }
11619
+ namespace OcrInvoiceFixedLengthTextLayoutDefinitionField {
11620
+ export interface Data {
11621
+ _id: StringId;
11622
+ name: string;
11623
+ layout_definition: StringId;
11624
+ disabled: boolean;
11625
+ data_type: "Text" | "Number" | "Date";
11626
+ position: number;
11627
+ length: number;
11628
+ remarks?: string;
11629
+ decimal?: number;
11630
+ date_format?: string;
11631
+ default_ai_json_key?: "issue_date" | "reference" | "client_name" | "barcode" | "code" | "description" | "tax_amount" | "discount_amount" | "quantity" | "unit_price" | "total" | "measure_unit" | "total_amount";
11632
+ company_namespace: string[];
11633
+ createdAt: Date;
11634
+ updatedAt: Date;
11635
+ }
11636
+ export interface CreateBody {
11637
+ name: string;
11638
+ layout_definition: StringId;
11639
+ disabled?: boolean;
11640
+ data_type: "Text" | "Number" | "Date";
11641
+ position: number;
11642
+ length: number;
11643
+ remarks?: string;
11644
+ decimal?: number;
11645
+ date_format?: string;
11646
+ default_ai_json_key?: "issue_date" | "reference" | "client_name" | "barcode" | "code" | "description" | "tax_amount" | "discount_amount" | "quantity" | "unit_price" | "total" | "measure_unit" | "total_amount";
11647
+ company_namespace?: string[];
11648
+ }
11649
+ export interface UpdateBody {
11650
+ _id?: StringId;
11651
+ name?: string;
11652
+ layout_definition?: StringId;
11653
+ disabled?: boolean;
11654
+ data_type?: "Text" | "Number" | "Date";
11655
+ position?: number;
11656
+ length?: number;
11657
+ remarks?: string;
11658
+ decimal?: number;
11659
+ date_format?: string;
11660
+ default_ai_json_key?: "issue_date" | "reference" | "client_name" | "barcode" | "code" | "description" | "tax_amount" | "discount_amount" | "quantity" | "unit_price" | "total" | "measure_unit" | "total_amount";
11661
+ company_namespace?: string[];
11662
+ createdAt?: Date;
11663
+ updatedAt?: Date;
11664
+ }
11665
+ type PopulatedKeys = "layout_definition";
11666
+ export type PopulatedDoc = Data & {
11667
+ layout_definition_populated?: OcrInvoiceFixedLengthTextLayoutDefinition.Data;
11668
+ };
11669
+ export namespace Find {
11670
+ type Params = DefaultPaginationQueryParams & {
11671
+ _id?: StringId | StringId[];
11672
+ layout_definition?: StringId | StringId[];
11673
+ name?: string | string[];
11674
+ disabled?: boolean | boolean[];
11675
+ search?: string;
11676
+ sortBy?: {
11677
+ field: "_id" | "position";
11678
+ type: "asc" | "desc";
11679
+ }[];
11680
+ populatedKeys?: PopulatedKeys[];
11681
+ };
11682
+ interface Result extends DefaultPaginationResult {
11683
+ data: Data[] | PopulatedDoc[];
11684
+ }
11685
+ }
11686
+ export namespace Get {
11687
+ type ID = string;
11688
+ type Result = Data;
11689
+ }
11690
+ export namespace Create {
11691
+ type Body = CreateBody;
11692
+ type Result = Data;
11693
+ }
11694
+ export namespace Update {
11695
+ type ID = StringId;
11696
+ type Body = UpdateBody;
11697
+ type Result = Data;
11698
+ }
11699
+ export namespace Remove {
11700
+ type ID = string;
11701
+ type Params = {};
11702
+ type Result = Data;
11703
+ }
11704
+ export {};
11705
+ }
11582
11706
  namespace ActivityAiSalesOrder {
11583
11707
  interface Data {
11584
11708
  _id: string;
@@ -16260,6 +16384,94 @@ export declare namespace Service {
16260
16384
  }
16261
16385
  export {};
16262
16386
  }
16387
+ namespace PaymentMethod {
16388
+ export type PaymentMethodType = "online" | "offline";
16389
+ export type PaymentMethodAccountType = "cash";
16390
+ export interface Data {
16391
+ _id: StringId;
16392
+ name: string;
16393
+ local_name?: string;
16394
+ type: PaymentMethodType;
16395
+ account_type: PaymentMethodAccountType;
16396
+ fee?: number;
16397
+ rate?: number;
16398
+ disabled: boolean;
16399
+ logo?: StringId;
16400
+ rep_auto_settled?: boolean;
16401
+ creator: Admin;
16402
+ editor?: Admin;
16403
+ company_namespace: string[];
16404
+ createdAt: string;
16405
+ updatedAt: string;
16406
+ }
16407
+ export interface CreateBody {
16408
+ name: string;
16409
+ local_name?: string;
16410
+ type: PaymentMethodType;
16411
+ account_type: PaymentMethodAccountType;
16412
+ fee?: number;
16413
+ rate?: number;
16414
+ disabled?: boolean;
16415
+ logo?: StringId;
16416
+ rep_auto_settled?: boolean;
16417
+ creator?: Admin;
16418
+ company_namespace?: string[];
16419
+ }
16420
+ export interface UpdateBody {
16421
+ _id?: StringId;
16422
+ name?: string;
16423
+ local_name?: string;
16424
+ type?: PaymentMethodType;
16425
+ account_type?: PaymentMethodAccountType;
16426
+ fee?: number;
16427
+ rate?: number;
16428
+ disabled?: boolean;
16429
+ logo?: StringId;
16430
+ rep_auto_settled?: boolean;
16431
+ creator?: Admin;
16432
+ editor?: Admin;
16433
+ company_namespace?: string[];
16434
+ createdAt?: string;
16435
+ updatedAt?: string;
16436
+ }
16437
+ export type PopulatedDoc = Data & {
16438
+ logo_populated?: PopulatedMediaStorage;
16439
+ };
16440
+ type PopulatedKeys = "logo";
16441
+ export namespace Find {
16442
+ type Params = DefaultPaginationQueryParams & {
16443
+ _id?: StringId | StringId[];
16444
+ search?: string;
16445
+ name?: string | string[];
16446
+ disabled?: boolean;
16447
+ };
16448
+ interface Result extends DefaultPaginationResult {
16449
+ data: PopulatedDoc[];
16450
+ }
16451
+ }
16452
+ export namespace Get {
16453
+ type ID = string;
16454
+ type Params = {
16455
+ populatedKeys?: PopulatedKeys[];
16456
+ };
16457
+ type Result = PopulatedDoc;
16458
+ }
16459
+ export namespace Create {
16460
+ type Body = CreateBody;
16461
+ type Result = Data;
16462
+ }
16463
+ export namespace Update {
16464
+ type ID = StringId;
16465
+ type Body = UpdateBody;
16466
+ type Result = Data;
16467
+ }
16468
+ export namespace Remove {
16469
+ type ID = string;
16470
+ type Params = {};
16471
+ type Result = Data;
16472
+ }
16473
+ export {};
16474
+ }
16263
16475
  }
16264
16476
  export type StringId = string;
16265
16477
  export type NameSpaces = string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repzo",
3
- "version": "1.0.192",
3
+ "version": "1.0.194",
4
4
  "description": "Repzo TypeScript SDK",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
package/src/index.ts CHANGED
@@ -113,6 +113,7 @@ export const end_points = {
113
113
  REPORT_SORT: "report-sort",
114
114
  REPORT_FILTER: "report-filter",
115
115
  SAFE_CRUD: "safe-crud",
116
+ PAYMENT_METHOD: "payment-method",
116
117
  } as const;
117
118
  export type EndPoints = (typeof end_points)[keyof typeof end_points];
118
119
 
@@ -5342,6 +5343,62 @@ export default class Repzo {
5342
5343
  return res;
5343
5344
  },
5344
5345
  };
5346
+
5347
+ paymentMethod = {
5348
+ _path: Repzo._end_points.PAYMENT_METHOD,
5349
+ find: async (
5350
+ params?: Service.PaymentMethod.Find.Params,
5351
+ ): Promise<Service.PaymentMethod.Find.Result> => {
5352
+ let res: Service.PaymentMethod.Find.Result = await this._fetch(
5353
+ this.svAPIEndpoint,
5354
+ this.paymentMethod._path,
5355
+ params,
5356
+ );
5357
+ return res;
5358
+ },
5359
+ get: async (
5360
+ id: Service.PaymentMethod.Get.ID,
5361
+ params?: Service.PaymentMethod.Get.Params,
5362
+ ): Promise<Service.PaymentMethod.Get.Result> => {
5363
+ return await this._fetch(
5364
+ this.svAPIEndpoint,
5365
+ this.paymentMethod._path + `/${id}`,
5366
+ params,
5367
+ );
5368
+ },
5369
+ create: async (
5370
+ body: Service.PaymentMethod.Create.Body,
5371
+ ): Promise<Service.PaymentMethod.Create.Result> => {
5372
+ let res = await this._create(
5373
+ this.svAPIEndpoint,
5374
+ this.paymentMethod._path,
5375
+ body,
5376
+ );
5377
+ return res;
5378
+ },
5379
+ update: async (
5380
+ id: Service.PaymentMethod.Update.ID,
5381
+ body: Service.PaymentMethod.Update.Body,
5382
+ ): Promise<Service.PaymentMethod.Update.Result> => {
5383
+ let res: Service.PaymentMethod.Update.Result = await this._update(
5384
+ this.svAPIEndpoint,
5385
+ this.paymentMethod._path + `/${id}`,
5386
+ body,
5387
+ );
5388
+ return res;
5389
+ },
5390
+ remove: async (
5391
+ id: Service.PaymentMethod.Update.ID,
5392
+ params: Service.PaymentMethod.Remove.Params,
5393
+ ): Promise<Service.PaymentMethod.Remove.Result> => {
5394
+ let res: Service.PaymentMethod.Remove.Result = await this._delete(
5395
+ this.svAPIEndpoint,
5396
+ this.paymentMethod._path + `/${id}`,
5397
+ params,
5398
+ );
5399
+ return res;
5400
+ },
5401
+ };
5345
5402
  }
5346
5403
 
5347
5404
  function normalizeParams(params: Params): { [key: string]: any } {
@@ -5578,6 +5578,14 @@ export namespace Service {
5578
5578
  | "teams"
5579
5579
  | "forms_v2"
5580
5580
  | "contract";
5581
+
5582
+ type GetPopulatedKey =
5583
+ | PopulatedKeys
5584
+ | "fullinvoice"
5585
+ | "proforma"
5586
+ | "activity-form-v2"
5587
+ | "activity-form"
5588
+ | "receive-parts";
5581
5589
  export namespace Find {
5582
5590
  export type Params = DefaultPaginationQueryParams & {
5583
5591
  name?: string | string[];
@@ -5629,7 +5637,7 @@ export namespace Service {
5629
5637
  export namespace Get {
5630
5638
  export type ID = string;
5631
5639
  export interface Params {
5632
- populatedKeys?: PopulatedKeys[];
5640
+ populatedKeys?: GetPopulatedKey[];
5633
5641
  sortPage?: SortingKeys;
5634
5642
  }
5635
5643
  export type Result = WorkorderSchema | PopulatedData;
@@ -7494,22 +7502,23 @@ export namespace Service {
7494
7502
 
7495
7503
  export namespace Payment {
7496
7504
  export interface PaymentSchema {
7497
- _id: string;
7505
+ _id: StringId;
7498
7506
  status: PaymentStatus;
7499
7507
  remainder: number;
7500
7508
  amount: number;
7501
- client_id: string;
7509
+ client_id: StringId;
7502
7510
  client_name: string;
7503
7511
  creator: AdminCreator | RepCreator;
7504
7512
  implemented_by?: AdminCreator | RepCreator;
7505
7513
  transaction_processed: boolean;
7506
7514
  time?: number;
7507
7515
  serial_number: SerialNumber;
7508
- route?: string;
7516
+ route?: StringId;
7509
7517
  paytime: string;
7510
7518
  note?: string;
7511
7519
  currency: string;
7512
7520
  payment_type: PaymentType;
7521
+ payment_method?: StringId;
7513
7522
  check?: Check;
7514
7523
  LinkedTxn?: {
7515
7524
  Txn_serial_number: SerialNumber;
@@ -7523,18 +7532,28 @@ export namespace Service {
7523
7532
  company_namespace: string[];
7524
7533
  integration_meta?: { [key: string]: any };
7525
7534
  sync_id: string;
7526
- custom_status?: string;
7535
+ custom_status?: StringId;
7527
7536
  visit_id?: string;
7528
- teams?: string[];
7537
+ teams?: StringId[];
7529
7538
  paymentsData: {
7530
7539
  amount: number;
7531
7540
  paid: number;
7532
7541
  balance: number;
7533
7542
  payments: PaymentData[];
7534
7543
  };
7544
+ reference?: string;
7545
+ media?: StringId[];
7546
+ network_state?: number;
7547
+ platform?: string;
7548
+ version_name?: string;
7549
+ battery_level?: number;
7550
+ time_zone?: string;
7551
+ identifier?: number;
7552
+ device_id?: string;
7553
+ device_unique_id?: string;
7554
+ ending_balance?: number;
7535
7555
  createdAt: string;
7536
7556
  updatedAt: string;
7537
- ending_balance?: number;
7538
7557
  __v: number;
7539
7558
  }
7540
7559
  export type Data = PaymentSchema;
@@ -7549,6 +7568,7 @@ export namespace Service {
7549
7568
  note?: string;
7550
7569
  currency: string;
7551
7570
  payment_type: PaymentType;
7571
+ payment_method?: StringId;
7552
7572
  transaction_processed: boolean;
7553
7573
  check?: Check;
7554
7574
  LinkedTxn?: {
@@ -7566,6 +7586,8 @@ export namespace Service {
7566
7586
  custom_status?: string;
7567
7587
  visit_id?: string;
7568
7588
  teams?: string[];
7589
+ reference?: string;
7590
+ media?: StringId[];
7569
7591
  }
7570
7592
  export interface UpdateBody {
7571
7593
  integration_meta?: { [key: string]: any };
@@ -7582,11 +7604,13 @@ export namespace Service {
7582
7604
  original_amount: number;
7583
7605
  payment: number;
7584
7606
  };
7585
- teams?: string[] | Team.TeamSchema[];
7586
- route?: string | Route.RouteSchema;
7607
+ teams?: StringId[] | Team.TeamSchema[];
7608
+ route?: StringId | Route.RouteSchema;
7609
+ payment_method?: StringId | PaymentMethod.Data;
7610
+ media?: (StringId | PopulatedMediaStorage)[];
7587
7611
  };
7588
7612
  type PaymentType = "check" | "cash";
7589
- type PopulatedKeys = "custom_status" | "teams" | "route";
7613
+ type PopulatedKeys = "custom_status" | "teams" | "route" | "payment_method";
7590
7614
  type PaymentStatus = "consumed" | "unconsumed" | "partially_consumed";
7591
7615
  export namespace Find {
7592
7616
  export type Params = DefaultPaginationQueryParams & {
@@ -7606,10 +7630,7 @@ export namespace Service {
7606
7630
  populatedKeys?: PopulatedKeys[];
7607
7631
  from__id?: string;
7608
7632
  to__id?: string;
7609
- sortBy?: {
7610
- field: "_id";
7611
- type: "asc" | "desc";
7612
- }[];
7633
+ sortBy?: { field: "_id"; type: "asc" | "desc" }[];
7613
7634
  };
7614
7635
  export interface Result extends DefaultPaginationResult {
7615
7636
  data: PaymentSchemaWithPopulatedKeys[];
@@ -11591,7 +11612,7 @@ export namespace Service {
11591
11612
  disabled: boolean;
11592
11613
  document_scan_listed: boolean;
11593
11614
  client?: StringId;
11594
- doc_type: "pdf" | "image";
11615
+ doc_type: "pdf" | "image" | "fixed-length-text";
11595
11616
  preparation_option?: {
11596
11617
  rotate?: boolean;
11597
11618
  convert_to_image: boolean;
@@ -11601,8 +11622,12 @@ export namespace Service {
11601
11622
  };
11602
11623
  };
11603
11624
  cart_option?: CartOptions;
11604
- ai_json_parsing_model: "gpt-4o-mini" | "gpt-4o";
11605
- ai_vision_model: "gpt-4o-mini" | "gpt-4o" | "local_vision";
11625
+ ai_json_parsing_model: "gpt-4o-mini" | "gpt-4o" | "fixed-length-text";
11626
+ ai_vision_model:
11627
+ | "gpt-4o-mini"
11628
+ | "gpt-4o"
11629
+ | "local_vision"
11630
+ | "fixed-length-text";
11606
11631
  visible_columns: {
11607
11632
  key:
11608
11633
  | "product_name"
@@ -11630,64 +11655,20 @@ export namespace Service {
11630
11655
  always_merge_pages_for_job?: boolean;
11631
11656
  trim_barcode_zero_from_left?: boolean;
11632
11657
  bypass_human_review?: boolean;
11658
+ fixed_length_text_layout_definition?: StringId;
11633
11659
  createdAt: Date;
11634
11660
  updatedAt: Date;
11635
11661
  }
11636
- export interface PopulatedDoc {
11637
- _id: StringId;
11638
- name: string;
11639
- company_namespace: string[];
11640
- disabled: boolean;
11641
- document_scan_listed: boolean;
11642
- client?: StringId;
11662
+ export type PopulatedDoc = Data & {
11643
11663
  client_populated?: Pick<Client.ClientSchema, "name" | "_id">;
11644
- doc_type: "pdf" | "image";
11645
- preparation_option?: {
11646
- rotate?: boolean;
11647
- convert_to_image: boolean;
11648
- lang?: {
11649
- en?: boolean;
11650
- ar?: boolean;
11651
- };
11652
- };
11653
- cart_option?: CartOptions;
11654
- ai_json_parsing_model: "gpt-4o-mini" | "gpt-4o";
11655
- ai_vision_model: "gpt-4o-mini" | "gpt-4o" | "local_vision";
11656
- visible_columns: {
11657
- key:
11658
- | "product_name"
11659
- | "variant_name"
11660
- | "product_sku"
11661
- | "product_barcode"
11662
- | "variant_barcode"
11663
- | "variant_sku"
11664
- | "price"
11665
- | "qty"
11666
- | "measure_unit"
11667
- | "total_amount"
11668
- | "total"
11669
- | "code";
11670
- visible: boolean;
11671
- }[];
11672
- ai_parsing_prompt_amendment?: string;
11673
- ai_vision_prompt_amendment?: string;
11674
- ai_parsing_prompt_overwrite?: string;
11675
- ai_vision_prompt_overwrite?: string;
11676
- enable_ai_parsing_prompt_amendment?: boolean;
11677
- enable_ai_vision_prompt_amendment?: boolean;
11678
- enable_ai_parsing_prompt_overwrite?: boolean;
11679
- enable_ai_vision_prompt_overwrite?: boolean;
11680
- always_merge_pages_for_job?: boolean;
11681
- trim_zero_from_first?: boolean;
11682
- createdAt: Date;
11683
- updatedAt: Date;
11684
- }
11664
+ fixed_length_text_layout_definition_populated?: OcrInvoiceFixedLengthTextLayoutDefinition.Data;
11665
+ };
11685
11666
  export interface CreateBody {
11686
11667
  name: string;
11687
11668
  company_namespace: string[];
11688
11669
  document_scan_listed: boolean;
11689
11670
  client?: StringId;
11690
- doc_type: "pdf" | "image";
11671
+ doc_type: "pdf" | "image" | "fixed-length-text";
11691
11672
  preparation_option?: {
11692
11673
  rotate?: boolean;
11693
11674
  convert_to_image: boolean;
@@ -11697,8 +11678,12 @@ export namespace Service {
11697
11678
  };
11698
11679
  };
11699
11680
  cart_option?: CartOptions;
11700
- ai_json_parsing_model: "gpt-4o-mini" | "gpt-4o";
11701
- ai_vision_model: "gpt-4o-mini" | "gpt-4o" | "local_vision";
11681
+ ai_json_parsing_model: "gpt-4o-mini" | "gpt-4o" | "fixed-length-text";
11682
+ ai_vision_model:
11683
+ | "gpt-4o-mini"
11684
+ | "gpt-4o"
11685
+ | "local_vision"
11686
+ | "fixed-length-text";
11702
11687
  visible_columns: {
11703
11688
  key:
11704
11689
  | "product_name"
@@ -11740,8 +11725,12 @@ export namespace Service {
11740
11725
  };
11741
11726
  };
11742
11727
  cart_option?: CartOptions;
11743
- ai_json_parsing_model: "gpt-4o-mini" | "gpt-4o";
11744
- ai_vision_model: "gpt-4o-mini" | "gpt-4o" | "local_vision";
11728
+ ai_json_parsing_model: "gpt-4o-mini" | "gpt-4o" | "fixed-length-text";
11729
+ ai_vision_model:
11730
+ | "gpt-4o-mini"
11731
+ | "gpt-4o"
11732
+ | "local_vision"
11733
+ | "fixed-length-text";
11745
11734
  visible_columns: {
11746
11735
  key:
11747
11736
  | "product_name"
@@ -12292,6 +12281,189 @@ export namespace Service {
12292
12281
  }
12293
12282
  }
12294
12283
 
12284
+ export namespace OcrInvoiceFixedLengthTextLayoutDefinition {
12285
+ export interface Data {
12286
+ _id: StringId;
12287
+ name: string;
12288
+ company_namespace: string[];
12289
+ disabled: boolean;
12290
+ createdAt: Date;
12291
+ updatedAt: Date;
12292
+ }
12293
+ export interface CreateBody {
12294
+ name: string;
12295
+ company_namespace?: string[];
12296
+ disabled?: boolean;
12297
+ }
12298
+ export interface UpdateBody {
12299
+ _id?: StringId;
12300
+ name?: string;
12301
+ company_namespace?: string[];
12302
+ disabled?: boolean;
12303
+ createdAt?: Date;
12304
+ updatedAt?: Date;
12305
+ }
12306
+
12307
+ export namespace Find {
12308
+ export type Params = DefaultPaginationQueryParams & {
12309
+ _id?: StringId | StringId[];
12310
+ name?: string | string[];
12311
+ disabled?: boolean | boolean[];
12312
+ search?: string;
12313
+ };
12314
+ export interface Result extends DefaultPaginationResult {
12315
+ data: Data[];
12316
+ }
12317
+ }
12318
+ export namespace Get {
12319
+ export type ID = string;
12320
+ export type Result = Data;
12321
+ }
12322
+ export namespace Create {
12323
+ export type Body = CreateBody;
12324
+ export type Result = Data;
12325
+ }
12326
+ export namespace Update {
12327
+ export type ID = StringId;
12328
+ export type Body = UpdateBody;
12329
+ export type Result = Data;
12330
+ }
12331
+ export namespace Remove {
12332
+ export type ID = string;
12333
+ export type Params = {};
12334
+ export type Result = Data;
12335
+ }
12336
+ }
12337
+
12338
+ export namespace OcrInvoiceFixedLengthTextLayoutDefinitionField {
12339
+ export interface Data {
12340
+ _id: StringId;
12341
+ name: string;
12342
+ layout_definition: StringId;
12343
+ disabled: boolean;
12344
+ data_type: "Text" | "Number" | "Date";
12345
+ position: number;
12346
+ length: number;
12347
+ remarks?: string;
12348
+ decimal?: number;
12349
+ date_format?: string;
12350
+ default_ai_json_key?:
12351
+ | "issue_date"
12352
+ | "reference"
12353
+ | "client_name"
12354
+ | "barcode"
12355
+ | "code"
12356
+ | "description"
12357
+ | "tax_amount"
12358
+ | "discount_amount"
12359
+ | "quantity"
12360
+ | "unit_price"
12361
+ | "total"
12362
+ | "measure_unit"
12363
+ | "total_amount";
12364
+ company_namespace: string[];
12365
+ createdAt: Date;
12366
+ updatedAt: Date;
12367
+ }
12368
+ export interface CreateBody {
12369
+ name: string;
12370
+ layout_definition: StringId;
12371
+ disabled?: boolean;
12372
+ data_type: "Text" | "Number" | "Date";
12373
+ position: number;
12374
+ length: number;
12375
+ remarks?: string;
12376
+ decimal?: number;
12377
+ date_format?: string;
12378
+ default_ai_json_key?:
12379
+ | "issue_date"
12380
+ | "reference"
12381
+ | "client_name"
12382
+ | "barcode"
12383
+ | "code"
12384
+ | "description"
12385
+ | "tax_amount"
12386
+ | "discount_amount"
12387
+ | "quantity"
12388
+ | "unit_price"
12389
+ | "total"
12390
+ | "measure_unit"
12391
+ | "total_amount";
12392
+ company_namespace?: string[];
12393
+ }
12394
+ export interface UpdateBody {
12395
+ _id?: StringId;
12396
+ name?: string;
12397
+ layout_definition?: StringId;
12398
+ disabled?: boolean;
12399
+ data_type?: "Text" | "Number" | "Date";
12400
+ position?: number;
12401
+ length?: number;
12402
+ remarks?: string;
12403
+ decimal?: number;
12404
+ date_format?: string;
12405
+ default_ai_json_key?:
12406
+ | "issue_date"
12407
+ | "reference"
12408
+ | "client_name"
12409
+ | "barcode"
12410
+ | "code"
12411
+ | "description"
12412
+ | "tax_amount"
12413
+ | "discount_amount"
12414
+ | "quantity"
12415
+ | "unit_price"
12416
+ | "total"
12417
+ | "measure_unit"
12418
+ | "total_amount";
12419
+ company_namespace?: string[];
12420
+ createdAt?: Date;
12421
+ updatedAt?: Date;
12422
+ }
12423
+
12424
+ type PopulatedKeys = "layout_definition";
12425
+
12426
+ export type PopulatedDoc = Data & {
12427
+ layout_definition_populated?: OcrInvoiceFixedLengthTextLayoutDefinition.Data;
12428
+ };
12429
+
12430
+ export namespace Find {
12431
+ export type Params = DefaultPaginationQueryParams & {
12432
+ _id?: StringId | StringId[];
12433
+ layout_definition?: StringId | StringId[];
12434
+ name?: string | string[];
12435
+ disabled?: boolean | boolean[];
12436
+ search?: string;
12437
+ sortBy?: {
12438
+ field: "_id" | "position";
12439
+ type: "asc" | "desc";
12440
+ }[];
12441
+ populatedKeys?: PopulatedKeys[];
12442
+ };
12443
+ export interface Result extends DefaultPaginationResult {
12444
+ data: Data[] | PopulatedDoc[];
12445
+ }
12446
+ }
12447
+ export namespace Get {
12448
+ export type ID = string;
12449
+ export type Result = Data;
12450
+ }
12451
+ export namespace Create {
12452
+ export type Body = CreateBody;
12453
+ export type Result = Data;
12454
+ }
12455
+ export namespace Update {
12456
+ export type ID = StringId;
12457
+ export type Body = UpdateBody;
12458
+ export type Result = Data;
12459
+ }
12460
+ export namespace Remove {
12461
+ export type ID = string;
12462
+ export type Params = {};
12463
+ export type Result = Data;
12464
+ }
12465
+ }
12466
+
12295
12467
  export namespace ActivityAiSalesOrder {
12296
12468
  export interface Data {
12297
12469
  _id: string;
@@ -18447,6 +18619,94 @@ export namespace Service {
18447
18619
  }
18448
18620
  }
18449
18621
  }
18622
+
18623
+ export namespace PaymentMethod {
18624
+ export type PaymentMethodType = "online" | "offline";
18625
+ export type PaymentMethodAccountType = "cash";
18626
+ export interface Data {
18627
+ _id: StringId;
18628
+ name: string;
18629
+ local_name?: string;
18630
+ type: PaymentMethodType;
18631
+ account_type: PaymentMethodAccountType;
18632
+ fee?: number;
18633
+ rate?: number;
18634
+ disabled: boolean;
18635
+ logo?: StringId;
18636
+ rep_auto_settled?: boolean;
18637
+ creator: Admin;
18638
+ editor?: Admin;
18639
+ company_namespace: string[];
18640
+ createdAt: string;
18641
+ updatedAt: string;
18642
+ }
18643
+ export interface CreateBody {
18644
+ name: string;
18645
+ local_name?: string;
18646
+ type: PaymentMethodType;
18647
+ account_type: PaymentMethodAccountType;
18648
+ fee?: number;
18649
+ rate?: number;
18650
+ disabled?: boolean;
18651
+ logo?: StringId;
18652
+ rep_auto_settled?: boolean;
18653
+ creator?: Admin;
18654
+ company_namespace?: string[];
18655
+ }
18656
+ export interface UpdateBody {
18657
+ _id?: StringId;
18658
+ name?: string;
18659
+ local_name?: string;
18660
+ type?: PaymentMethodType;
18661
+ account_type?: PaymentMethodAccountType;
18662
+ fee?: number;
18663
+ rate?: number;
18664
+ disabled?: boolean;
18665
+ logo?: StringId;
18666
+ rep_auto_settled?: boolean;
18667
+ creator?: Admin;
18668
+ editor?: Admin;
18669
+ company_namespace?: string[];
18670
+ createdAt?: string;
18671
+ updatedAt?: string;
18672
+ }
18673
+ export type PopulatedDoc = Data & {
18674
+ logo_populated?: PopulatedMediaStorage;
18675
+ };
18676
+
18677
+ type PopulatedKeys = "logo";
18678
+
18679
+ export namespace Find {
18680
+ export type Params = DefaultPaginationQueryParams & {
18681
+ _id?: StringId | StringId[];
18682
+ search?: string;
18683
+ name?: string | string[];
18684
+ disabled?: boolean;
18685
+ };
18686
+ export interface Result extends DefaultPaginationResult {
18687
+ data: PopulatedDoc[];
18688
+ }
18689
+ }
18690
+ export namespace Get {
18691
+ export type ID = string;
18692
+ export type Params = { populatedKeys?: PopulatedKeys[] };
18693
+ export type Result = PopulatedDoc;
18694
+ }
18695
+ export namespace Create {
18696
+ export type Body = CreateBody;
18697
+ export type Result = Data;
18698
+ }
18699
+ export namespace Update {
18700
+ export type ID = StringId;
18701
+ export type Body = UpdateBody;
18702
+ export type Result = Data;
18703
+ }
18704
+ export namespace Remove {
18705
+ export type ID = string;
18706
+ export type Params = {};
18707
+ export type Result = Data;
18708
+ }
18709
+ }
18450
18710
  }
18451
18711
 
18452
18712
  export type StringId = string;