repzo 1.0.279 → 1.0.280

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.
@@ -21491,6 +21491,612 @@ export namespace Service {
21491
21491
  }
21492
21492
  }
21493
21493
 
21494
+ export namespace TargetRule {
21495
+ export type RuleType =
21496
+ | "rep-visit"
21497
+ | "time-clock"
21498
+ | "rep-photo"
21499
+ | "rep-invoice"
21500
+ | "rep-proforma"
21501
+ | "item-status"
21502
+ | "rep-payment";
21503
+
21504
+ export type Period =
21505
+ | "daily"
21506
+ | "weekly"
21507
+ | "monthly"
21508
+ | "quarterly"
21509
+ | "yearly";
21510
+
21511
+ export interface Point {
21512
+ ratio: number;
21513
+ points: number;
21514
+ }
21515
+
21516
+ export interface RepVisitFilter {
21517
+ filter:
21518
+ | "chain"
21519
+ | "channel"
21520
+ | "country"
21521
+ | "city"
21522
+ | "state"
21523
+ | "client"
21524
+ | "photoTag"
21525
+ | "clientTag"
21526
+ | "areaTag"
21527
+ | "from_total_time"
21528
+ | "to_total_time"
21529
+ | "from_call_total_time"
21530
+ | "to_call_total_time"
21531
+ | "feedback"
21532
+ | "activity"
21533
+ | "speciality";
21534
+ value: any[];
21535
+ photoCount?: number;
21536
+ }
21537
+ export interface RepVisitDetails {
21538
+ type?: "rep-visit";
21539
+ filter: RepVisitFilter[];
21540
+ limit?: number;
21541
+ aggregation_key: "count" | "count-distinct" | "duration";
21542
+ period: Period;
21543
+ required_target: {
21544
+ type: "absolute" | "assigned_to";
21545
+ value: number;
21546
+ };
21547
+ }
21548
+
21549
+ export interface TimeClockFilter {
21550
+ filter:
21551
+ | "from_startTime"
21552
+ | "to_startTime"
21553
+ | "from_endTime"
21554
+ | "to_endTime"
21555
+ | "from_timeOnDuty"
21556
+ | "to_timeOnDuty"
21557
+ | "from_breaksTime"
21558
+ | "to_breaksTime"
21559
+ | "from_timeInVisits"
21560
+ | "to_timeInVisits"
21561
+ | "from_totalTravelTime"
21562
+ | "to_totalTravelTime"
21563
+ | "from_travelTimeBetweenVisists"
21564
+ | "to_travelTimeBetweenVisists"
21565
+ | "from_scheduled"
21566
+ | "to_scheduled"
21567
+ | "from_unscheduled"
21568
+ | "to_unscheduled"
21569
+ | "from_missed"
21570
+ | "to_missed"
21571
+ | "closed_by_system";
21572
+ value: any;
21573
+ }
21574
+ export interface TimeClockDetails {
21575
+ type?: "time-clock";
21576
+ filter: TimeClockFilter[];
21577
+ aggregation_key:
21578
+ | "count"
21579
+ | "timeOnDuty"
21580
+ | "breaksTime"
21581
+ | "timeInVisits"
21582
+ | "totalTravelTime"
21583
+ | "travelTimeBetweenVisists"
21584
+ | "scheduled"
21585
+ | "unscheduled"
21586
+ | "missed";
21587
+ period: Period;
21588
+ limit?: number;
21589
+ required_target: {
21590
+ type: "absolute";
21591
+ value: number;
21592
+ };
21593
+ }
21594
+
21595
+ export interface RepPhotoFilter {
21596
+ filter:
21597
+ | "chain"
21598
+ | "channel"
21599
+ | "country"
21600
+ | "city"
21601
+ | "state"
21602
+ | "client"
21603
+ | "photoTag"
21604
+ | "clientTag"
21605
+ | "areaTag"
21606
+ | "speciality";
21607
+ value: any[];
21608
+ }
21609
+ export interface RepPhotoDetails {
21610
+ type?: "rep-photo";
21611
+ filter: RepPhotoFilter[];
21612
+ limit?: number;
21613
+ aggregation_key: "count" | "count-distinct";
21614
+ period: Period;
21615
+ required_target: {
21616
+ type: "absolute" | "assigned_to";
21617
+ value: number;
21618
+ };
21619
+ }
21620
+
21621
+ export interface ItemStatusFilter {
21622
+ filter:
21623
+ | "teams"
21624
+ | "route"
21625
+ | "client"
21626
+ | "chain"
21627
+ | "channel"
21628
+ | "country"
21629
+ | "city"
21630
+ | "state"
21631
+ | "clientTag"
21632
+ | "areaTag"
21633
+ | "speciality"
21634
+ | "product"
21635
+ | "category"
21636
+ | "sub_category"
21637
+ | "brand"
21638
+ | "product_group"
21639
+ | "status"
21640
+ | "previous_status"
21641
+ | "item_status_type";
21642
+ value: any[];
21643
+ }
21644
+ export interface ItemStatusDetails {
21645
+ type?: "item-status";
21646
+ filter: ItemStatusFilter[];
21647
+ limit?: number;
21648
+ aggregation_key: "count" | "prescriptions";
21649
+ period: Period;
21650
+ required_target: {
21651
+ type: "absolute";
21652
+ value: number;
21653
+ };
21654
+ }
21655
+
21656
+ export interface RepPaymentFilter {
21657
+ filter:
21658
+ | "route"
21659
+ | "payment_type"
21660
+ | "status"
21661
+ | "client"
21662
+ | "chain"
21663
+ | "channel"
21664
+ | "country"
21665
+ | "city"
21666
+ | "clientTag"
21667
+ | "areaTag"
21668
+ | "teams"
21669
+ | "from_amount"
21670
+ | "to_amount"
21671
+ | "speciality"
21672
+ | "custom_status";
21673
+ value: any[];
21674
+ }
21675
+ export interface RepPaymentDetails {
21676
+ type?: "rep-payment";
21677
+ filter: RepPaymentFilter[];
21678
+ limit?: number;
21679
+ aggregation_key: "count" | "count-distinct" | "amount";
21680
+ period: Period;
21681
+ required_target: {
21682
+ type: "absolute";
21683
+ value: number;
21684
+ };
21685
+ }
21686
+
21687
+ export interface RepInvoiceFilter {
21688
+ filter:
21689
+ | "client"
21690
+ | "chain"
21691
+ | "channel"
21692
+ | "country"
21693
+ | "city"
21694
+ | "state"
21695
+ | "clientTag"
21696
+ | "areaTag"
21697
+ | "teams"
21698
+ | "product"
21699
+ | "variant"
21700
+ | "category"
21701
+ | "sub_category"
21702
+ | "brand"
21703
+ | "product_group"
21704
+ | "status"
21705
+ | "speciality"
21706
+ | "custom_status"
21707
+ | "from_base_unit_qty"
21708
+ | "to_base_unit_qty";
21709
+ value: any[];
21710
+ }
21711
+ export interface RepInvoiceDetails {
21712
+ type?: "rep-invoice";
21713
+ filter: RepInvoiceFilter[];
21714
+ limit?: number;
21715
+ aggregation_key:
21716
+ | "count"
21717
+ | "total"
21718
+ | "pre_total"
21719
+ | "return_total"
21720
+ | "count-distinct"
21721
+ | "qty";
21722
+ period: Period;
21723
+ required_target: {
21724
+ type: "absolute";
21725
+ value: number;
21726
+ };
21727
+ }
21728
+ export interface RepProformaDetails {
21729
+ type?: "rep-proforma";
21730
+ filter: RepInvoiceFilter[];
21731
+ limit?: number;
21732
+ aggregation_key:
21733
+ | "count"
21734
+ | "total"
21735
+ | "pre_total"
21736
+ | "return_total"
21737
+ | "count-distinct"
21738
+ | "qty";
21739
+ period: Period;
21740
+ required_target: {
21741
+ type: "absolute";
21742
+ value: number;
21743
+ };
21744
+ }
21745
+
21746
+ export type Details =
21747
+ | RepVisitDetails
21748
+ | TimeClockDetails
21749
+ | RepPhotoDetails
21750
+ | ItemStatusDetails
21751
+ | RepPaymentDetails
21752
+ | RepInvoiceDetails
21753
+ | RepProformaDetails;
21754
+
21755
+ export interface Data {
21756
+ _id: StringId;
21757
+ name: string;
21758
+ points: Point[];
21759
+ allowOverOne?: boolean;
21760
+ type: RuleType;
21761
+ disabled: boolean;
21762
+ targets_group?: StringId;
21763
+ company_namespace: string[];
21764
+ details: Details;
21765
+ cycle?: any;
21766
+ createdAt: string;
21767
+ updatedAt: string;
21768
+ __v?: number;
21769
+ }
21770
+ export interface CreateBody {
21771
+ company_namespace?: string[];
21772
+ name: string;
21773
+ type: RuleType;
21774
+ details: Details;
21775
+ points?: Point[];
21776
+ allowOverOne?: boolean;
21777
+ targets_group?: StringId;
21778
+ disabled?: boolean;
21779
+ }
21780
+ export type UpdateBody = Partial<CreateBody>;
21781
+
21782
+ export namespace Find {
21783
+ export type Params = DefaultPaginationQueryParams & {
21784
+ _id?: StringId | StringId[];
21785
+ search?: string;
21786
+ name?: string | string[];
21787
+ type?: RuleType | RuleType[];
21788
+ targets_group?: StringId | StringId[];
21789
+ "details.period"?: Period | Period[];
21790
+ disabled?: boolean;
21791
+ from_updatedAt?: number;
21792
+ to_updatedAt?: number;
21793
+ from_createdAt?: number;
21794
+ to_createdAt?: number;
21795
+ };
21796
+ export interface Result extends DefaultPaginationResult {
21797
+ data: Data[];
21798
+ }
21799
+ }
21800
+ export namespace Get {
21801
+ export type ID = StringId;
21802
+ export type Result = Data;
21803
+ }
21804
+ export namespace Create {
21805
+ export type Body = CreateBody;
21806
+ export type Result = Data;
21807
+ }
21808
+ export namespace Update {
21809
+ export type ID = StringId;
21810
+ export type Body = UpdateBody;
21811
+ export type Result = Data;
21812
+ }
21813
+ export namespace Remove {
21814
+ export type ID = StringId;
21815
+ export type Result = Data;
21816
+ }
21817
+ }
21818
+
21819
+ export namespace Plan {
21820
+ export interface Editor {
21821
+ _id: StringId;
21822
+ type: "admin" | "rep";
21823
+ rep?: StringId;
21824
+ admin?: StringId;
21825
+ name?: string;
21826
+ }
21827
+ export interface BuildListItem {
21828
+ calendar?: StringId;
21829
+ route?: StringId;
21830
+ client?: StringId;
21831
+ note?: string;
21832
+ from?: string;
21833
+ to?: string;
21834
+ visit_reason?: StringId;
21835
+ visit_note?: string;
21836
+ }
21837
+ export interface BuildEntry {
21838
+ day: string;
21839
+ list: BuildListItem[];
21840
+ }
21841
+ export interface Data {
21842
+ _id: StringId;
21843
+ name: string;
21844
+ editor?: Editor;
21845
+ startsAt?: string;
21846
+ endsAt?: string;
21847
+ build: BuildEntry[];
21848
+ sync_id: string;
21849
+ calendars?: StringId[];
21850
+ disabled: boolean;
21851
+ builtAt: number;
21852
+ company_namespace: string[];
21853
+ createdAt: string;
21854
+ updatedAt: string;
21855
+ __v?: number;
21856
+ }
21857
+ export interface CreateBody {
21858
+ company_namespace?: string[];
21859
+ name: string;
21860
+ startsAt?: string;
21861
+ endsAt?: string;
21862
+ build?: BuildEntry[];
21863
+ sync_id: string;
21864
+ calendars?: StringId[];
21865
+ disabled?: boolean;
21866
+ builtAt?: number;
21867
+ }
21868
+ export type UpdateBody = Partial<CreateBody>;
21869
+
21870
+ export namespace Find {
21871
+ export type Params = DefaultPaginationQueryParams & {
21872
+ _id?: StringId | StringId[];
21873
+ search?: string;
21874
+ name?: string | string[];
21875
+ disabled?: boolean;
21876
+ myDailyPlan?: boolean;
21877
+ timezone?: string;
21878
+ from_updatedAt?: number;
21879
+ to_updatedAt?: number;
21880
+ from_createdAt?: number;
21881
+ to_createdAt?: number;
21882
+ populatedKeys?: string | string[];
21883
+ };
21884
+ export interface Result extends DefaultPaginationResult {
21885
+ data: Data[];
21886
+ }
21887
+ }
21888
+ export namespace Get {
21889
+ export type ID = StringId;
21890
+ export type Params = { populatedKeys?: string | string[] };
21891
+ export type Result = Data;
21892
+ }
21893
+ export namespace Create {
21894
+ export type Body = CreateBody;
21895
+ export type Result = Data;
21896
+ }
21897
+ export namespace Update {
21898
+ export type ID = StringId;
21899
+ export type Body = UpdateBody;
21900
+ export type Result = Data;
21901
+ }
21902
+ export namespace Remove {
21903
+ export type ID = StringId;
21904
+ export type Result = Data;
21905
+ }
21906
+ }
21907
+
21908
+ export namespace Calendar {
21909
+ export type CalendarType = "weekly" | "weeklyGroup";
21910
+
21911
+ export interface User {
21912
+ _id: StringId;
21913
+ type: "admin" | "rep";
21914
+ rep?: StringId;
21915
+ admin?: StringId;
21916
+ name?: string;
21917
+ }
21918
+ export interface ClientEntry {
21919
+ client: StringId;
21920
+ from?: string;
21921
+ to?: string;
21922
+ visit_reason?: StringId;
21923
+ visit_note?: string;
21924
+ }
21925
+ export interface WeeklyDetails {
21926
+ type?: "weekly";
21927
+ days: Day[];
21928
+ every: number;
21929
+ }
21930
+ export interface DaysGroup {
21931
+ days: Day[];
21932
+ }
21933
+ export interface WeeklyGroupDetails {
21934
+ type?: "weeklyGroup";
21935
+ daysGroups: DaysGroup[];
21936
+ groupSize: number;
21937
+ }
21938
+ export type Details = WeeklyDetails | WeeklyGroupDetails;
21939
+
21940
+ export interface Data {
21941
+ _id: StringId;
21942
+ name: string;
21943
+ type: CalendarType;
21944
+ details: Details;
21945
+ creator: User;
21946
+ editor: User;
21947
+ routes?: StringId[];
21948
+ sync_id: string;
21949
+ clients?: ClientEntry[];
21950
+ occurrences?: number;
21951
+ startsAt: string;
21952
+ endsAt?: string;
21953
+ disabled: boolean;
21954
+ note?: string;
21955
+ visit_reason?: StringId;
21956
+ visit_note?: string;
21957
+ company_namespace: string[];
21958
+ createdAt: string;
21959
+ updatedAt: string;
21960
+ __v?: number;
21961
+ }
21962
+ export interface CreateBody {
21963
+ company_namespace?: string[];
21964
+ name: string;
21965
+ type: CalendarType;
21966
+ details: Details;
21967
+ sync_id: string;
21968
+ startsAt: string;
21969
+ endsAt?: string;
21970
+ routes?: StringId[];
21971
+ clients?: ClientEntry[];
21972
+ occurrences?: number;
21973
+ disabled?: boolean;
21974
+ note?: string;
21975
+ visit_reason?: StringId;
21976
+ visit_note?: string;
21977
+ }
21978
+ export type UpdateBody = Partial<CreateBody>;
21979
+
21980
+ export namespace Find {
21981
+ export type Params = DefaultPaginationQueryParams & {
21982
+ _id?: StringId | StringId[];
21983
+ search?: string;
21984
+ name?: string | string[];
21985
+ type?: CalendarType | CalendarType[];
21986
+ rep?: StringId | StringId[];
21987
+ plan?: StringId | StringId[];
21988
+ visit_reason?: StringId | StringId[];
21989
+ groupSize?: number;
21990
+ from_groupSize?: number;
21991
+ to_groupSize?: number;
21992
+ disabled?: boolean;
21993
+ from_updatedAt?: number;
21994
+ to_updatedAt?: number;
21995
+ from_createdAt?: number;
21996
+ to_createdAt?: number;
21997
+ populatedKeys?: string | string[];
21998
+ };
21999
+ export interface Result extends DefaultPaginationResult {
22000
+ data: Data[];
22001
+ }
22002
+ }
22003
+ export namespace Get {
22004
+ export type ID = StringId;
22005
+ export type Params = { populatedKeys?: string | string[] };
22006
+ export type Result = Data;
22007
+ }
22008
+ export namespace Create {
22009
+ export type Body = CreateBody;
22010
+ export type Params = {
22011
+ assignTo?: StringId;
22012
+ assignedToMe?: boolean;
22013
+ };
22014
+ export type Result = Data;
22015
+ }
22016
+ export namespace Update {
22017
+ export type ID = StringId;
22018
+ export type Body = UpdateBody;
22019
+ export type Result = Data;
22020
+ }
22021
+ export namespace Remove {
22022
+ export type ID = StringId;
22023
+ export type Result = Data;
22024
+ }
22025
+ }
22026
+
22027
+ export namespace LineTarget {
22028
+ export type UserType = "rep" | "client";
22029
+ export interface User {
22030
+ _id: StringId;
22031
+ name?: string;
22032
+ type?: UserType;
22033
+ rep?: StringId;
22034
+ client?: StringId;
22035
+ }
22036
+ export interface Data {
22037
+ _id: StringId;
22038
+ line: StringId;
22039
+ target: number;
22040
+ classification: StringId;
22041
+ user?: User;
22042
+ company_namespace: string[];
22043
+ createdAt: string;
22044
+ updatedAt: string;
22045
+ __v?: number;
22046
+ }
22047
+ export interface CreateBody {
22048
+ company_namespace?: string[];
22049
+ line: StringId;
22050
+ target: number;
22051
+ classification: StringId;
22052
+ user?: User;
22053
+ }
22054
+ export type UpdateBody = Partial<CreateBody>;
22055
+
22056
+ type PopulatedKeys = "client" | "rep" | "classification" | "line";
22057
+
22058
+ export namespace Find {
22059
+ export type Params = DefaultPaginationQueryParams & {
22060
+ populatedKeys?: PopulatedKeys | PopulatedKeys[];
22061
+ _id?: StringId | StringId[];
22062
+ line?: StringId | StringId[];
22063
+ classification?: StringId | StringId[];
22064
+ "user._id"?: StringId | StringId[];
22065
+ rep?: StringId | StringId[];
22066
+ client?: StringId | StringId[];
22067
+ from_updatedAt?: number;
22068
+ to_updatedAt?: number;
22069
+ from_createdAt?: number;
22070
+ to_createdAt?: number;
22071
+ };
22072
+ export interface Result extends DefaultPaginationResult {
22073
+ data: Data[];
22074
+ }
22075
+ }
22076
+ export namespace Get {
22077
+ export type ID = StringId;
22078
+ export type Params = { populatedKeys?: PopulatedKeys | PopulatedKeys[] };
22079
+ export type Result = Data;
22080
+ }
22081
+ export namespace Create {
22082
+ export type Body = CreateBody;
22083
+ export type Result = Data;
22084
+ }
22085
+ export namespace Update {
22086
+ export type ID = StringId;
22087
+ export type Body = UpdateBody;
22088
+ export type Result = Data;
22089
+ }
22090
+ export namespace Remove {
22091
+ export type ID = StringId | null;
22092
+ export type Params = { all?: boolean };
22093
+ export interface Result {
22094
+ deletedCount: number;
22095
+ success: number;
22096
+ }
22097
+ }
22098
+ }
22099
+
21494
22100
  export namespace BulkImport {
21495
22101
  type BulkImportType =
21496
22102
  | "insertTags"