@hartl-services/medusa-contracts 1.3.0 → 1.5.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { AdminAffiliateCouponCode, AdminAffiliateCouponCodeResponse, Affiliate, AffiliateCouponLifecycleStatus, AffiliateCouponOrigin, AffiliateCouponProvisioningStatus, AffiliateCouponWireStatus, AffiliateCustomerAssignmentMode, AffiliateOrderAttribution, AffiliateReferralOverwritePolicy, AdminConsignmentReportResponse, AffiliateApplicationCompanyVerification, AffiliateCustomerSummary, AffiliateApplicationResponse, AffiliateDistributionReportsResponse, AffiliateDistributionReportRequest, AffiliateDistributionResponse, AffiliateProgramSettingsResponse, AffiliateReportDetailResponse, AffiliateReportEntry, AffiliateReportOverviewItem, AffiliateReportOverviewResponse, AffiliateReportTotals, AffiliateResponse, AffiliateSlugResponse, AppliedAffiliateCouponSnapshot, ApproveAffiliateApplicationRequest, ApproveAffiliateApplicationResponse, ApproveConsignmentReportRequest, ApproveConsignmentReportResponse, ConsignmentTransferResponse, CorrectConsignmentReportRequest, CorrectConsignmentReportResponse, CreateAdminAffiliateCouponCodeRequest, CreateAffiliateRequest, CreateAffiliateSlugRequest, CustomerAffiliateAssignmentResponse, CustomerAffiliateAssignment, EnableAffiliateDistributionRequest, ListAdminConsignmentReportsResponse, ListAdminAffiliateCouponCodesQuery, ListAdminAffiliateCouponCodesRequest, ListAdminAffiliateCouponCodesResponse, ListAffiliateApplicationsRequest, ListAffiliateApplicationsResponse, ListAffiliatesRequest, ListAffiliatesResponse, ListAffiliateSlugsResponse, OrderAffiliateAttributionResponse, PersistedAffiliateCustomerAssignmentMode, ListConsignmentReportsRequest, RejectAffiliateApplicationRequest, RejectConsignmentReportRequest, RejectConsignmentReportResponse, ReconcileAdminAffiliateCouponCodeResponse, ReportDateRangeRequest, ReportDetailRequest, RotateAdminAffiliateCouponCodeRequest, RotateAdminAffiliateCouponCodeResponse, RequestConsignmentReminder, RequestConsignmentReminderRequest, RequestConsignmentReminderResponse, SetCustomerAffiliateAssignmentRequest, SetOrderAffiliateAttributionRequest, TransferConsignmentStockRequest, UpdateAffiliateProgramSettingsRequest, UpdateAffiliateRequest, UpdateAffiliateSlugRequest, } from "./types";
|
|
1
|
+
export type { AdminAffiliateCouponCode, AdminAffiliateCouponCodeResponse, Affiliate, AffiliateCouponLifecycleStatus, AffiliateCouponOrigin, AffiliateCouponProvisioningStatus, AffiliateCouponWireStatus, AffiliateCustomerAssignmentMode, AffiliateOrderAttribution, AffiliateReferralOverwritePolicy, AdminConsignmentReportResponse, AffiliateApplicationCompanyVerification, AffiliateCustomerSummary, AffiliateApplicationResponse, AffiliateDistributionReportsResponse, AffiliateDistributionReportRequest, AffiliateDistributionResponse, AffiliateProgramSettingsResponse, AffiliateReportDetailResponse, AffiliateReportEntry, AffiliateReportOverviewItem, AffiliateReportOverviewResponse, AffiliateReportTotals, AffiliateResponse, AffiliateSlugResponse, AppliedAffiliateCouponSnapshot, ApproveAffiliateApplicationRequest, ApproveAffiliateApplicationResponse, ApproveConsignmentReportRequest, ConsignmentNonSaleQuantity, ApproveConsignmentReportResponse, ConsignmentTransferResponse, CorrectConsignmentReportRequest, CorrectConsignmentReportResponse, CreateAdminAffiliateCouponCodeRequest, CreateAffiliateRequest, CreateAffiliateSlugRequest, CustomerAffiliateAssignmentResponse, CustomerAffiliateAssignment, EnableAffiliateDistributionRequest, ListAdminConsignmentReportsResponse, ListAdminAffiliateCouponCodesQuery, ListAdminAffiliateCouponCodesRequest, ListAdminAffiliateCouponCodesResponse, ListAffiliateApplicationsRequest, ListAffiliateApplicationsResponse, ListAffiliatesRequest, ListAffiliatesResponse, ListAffiliateSlugsResponse, OrderAffiliateAttributionResponse, PersistedAffiliateCustomerAssignmentMode, ListConsignmentReportsRequest, RejectAffiliateApplicationRequest, RejectConsignmentReportRequest, RejectConsignmentReportResponse, ReconcileAdminAffiliateCouponCodeResponse, ReportDateRangeRequest, ReportDetailRequest, RotateAdminAffiliateCouponCodeRequest, RotateAdminAffiliateCouponCodeResponse, RequestConsignmentReminder, RequestConsignmentReminderRequest, RequestConsignmentReminderResponse, SetCustomerAffiliateAssignmentRequest, SetOrderAffiliateAttributionRequest, TransferConsignmentStockRequest, UpdateAffiliateProgramSettingsRequest, UpdateAffiliateRequest, UpdateAffiliateSlugRequest, } from "./types";
|
|
@@ -119,6 +119,22 @@ export declare const AffiliateCouponLabelsResponseSchema: z.ZodObject<{
|
|
|
119
119
|
discount_percentage: z.ZodNumber;
|
|
120
120
|
}, z.core.$strip>>;
|
|
121
121
|
}, z.core.$strip>;
|
|
122
|
+
export declare const ConsignmentNonSaleReasonSchema: z.ZodEnum<{
|
|
123
|
+
expired: "expired";
|
|
124
|
+
damaged: "damaged";
|
|
125
|
+
returned: "returned";
|
|
126
|
+
correction: "correction";
|
|
127
|
+
}>;
|
|
128
|
+
/** A part of a line's not-sold shortage with its reason. */
|
|
129
|
+
export declare const ConsignmentNonSaleQuantitySchema: z.ZodObject<{
|
|
130
|
+
reason: z.ZodEnum<{
|
|
131
|
+
expired: "expired";
|
|
132
|
+
damaged: "damaged";
|
|
133
|
+
returned: "returned";
|
|
134
|
+
correction: "correction";
|
|
135
|
+
}>;
|
|
136
|
+
quantity: z.ZodNumber;
|
|
137
|
+
}, z.core.$strip>;
|
|
122
138
|
export declare const SubmitConsignmentReportSchema: z.ZodObject<{
|
|
123
139
|
period_start: z.ZodString;
|
|
124
140
|
submission_idempotency_key: z.ZodString;
|
|
@@ -126,6 +142,15 @@ export declare const SubmitConsignmentReportSchema: z.ZodObject<{
|
|
|
126
142
|
inventory_item_id: z.ZodString;
|
|
127
143
|
batch_id: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
128
144
|
counted_quantity: z.ZodNumber;
|
|
145
|
+
non_sale_quantities: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
146
|
+
reason: z.ZodEnum<{
|
|
147
|
+
expired: "expired";
|
|
148
|
+
damaged: "damaged";
|
|
149
|
+
returned: "returned";
|
|
150
|
+
correction: "correction";
|
|
151
|
+
}>;
|
|
152
|
+
quantity: z.ZodNumber;
|
|
153
|
+
}, z.core.$strip>>>;
|
|
129
154
|
}, z.core.$strip>>;
|
|
130
155
|
}, z.core.$strip>;
|
|
131
156
|
export declare const SubmitExistingConsignmentReportSchema: z.ZodObject<{
|
|
@@ -134,6 +159,15 @@ export declare const SubmitExistingConsignmentReportSchema: z.ZodObject<{
|
|
|
134
159
|
inventory_item_id: z.ZodString;
|
|
135
160
|
batch_id: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
136
161
|
counted_quantity: z.ZodNumber;
|
|
162
|
+
non_sale_quantities: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
163
|
+
reason: z.ZodEnum<{
|
|
164
|
+
expired: "expired";
|
|
165
|
+
damaged: "damaged";
|
|
166
|
+
returned: "returned";
|
|
167
|
+
correction: "correction";
|
|
168
|
+
}>;
|
|
169
|
+
quantity: z.ZodNumber;
|
|
170
|
+
}, z.core.$strip>>>;
|
|
137
171
|
}, z.core.$strip>>;
|
|
138
172
|
}, z.core.$strip>;
|
|
139
173
|
type ResolvedPartnerPortalDateRange = {
|
|
@@ -412,6 +446,15 @@ export declare const StoreConsignmentReportLineSchema: z.ZodObject<{
|
|
|
412
446
|
confirmed_sale_quantity: z.ZodNumber;
|
|
413
447
|
requires_admin_clarification: z.ZodBoolean;
|
|
414
448
|
non_sale_reason: z.ZodNullable<z.ZodString>;
|
|
449
|
+
non_sale_quantities: z.ZodArray<z.ZodObject<{
|
|
450
|
+
reason: z.ZodEnum<{
|
|
451
|
+
expired: "expired";
|
|
452
|
+
damaged: "damaged";
|
|
453
|
+
returned: "returned";
|
|
454
|
+
correction: "correction";
|
|
455
|
+
}>;
|
|
456
|
+
quantity: z.ZodNumber;
|
|
457
|
+
}, z.core.$strip>>;
|
|
415
458
|
resolved_unit_price: z.ZodNullable<z.ZodNumber>;
|
|
416
459
|
discounted_line_total: z.ZodNullable<z.ZodNumber>;
|
|
417
460
|
currency_code: z.ZodNullable<z.ZodString>;
|
|
@@ -444,6 +487,15 @@ export declare const StoreConsignmentReportSchema: z.ZodObject<{
|
|
|
444
487
|
confirmed_sale_quantity: z.ZodNumber;
|
|
445
488
|
requires_admin_clarification: z.ZodBoolean;
|
|
446
489
|
non_sale_reason: z.ZodNullable<z.ZodString>;
|
|
490
|
+
non_sale_quantities: z.ZodArray<z.ZodObject<{
|
|
491
|
+
reason: z.ZodEnum<{
|
|
492
|
+
expired: "expired";
|
|
493
|
+
damaged: "damaged";
|
|
494
|
+
returned: "returned";
|
|
495
|
+
correction: "correction";
|
|
496
|
+
}>;
|
|
497
|
+
quantity: z.ZodNumber;
|
|
498
|
+
}, z.core.$strip>>;
|
|
447
499
|
resolved_unit_price: z.ZodNullable<z.ZodNumber>;
|
|
448
500
|
discounted_line_total: z.ZodNullable<z.ZodNumber>;
|
|
449
501
|
currency_code: z.ZodNullable<z.ZodString>;
|
|
@@ -478,6 +530,15 @@ export declare const SubmitConsignmentReportResponseSchema: z.ZodObject<{
|
|
|
478
530
|
confirmed_sale_quantity: z.ZodNumber;
|
|
479
531
|
requires_admin_clarification: z.ZodBoolean;
|
|
480
532
|
non_sale_reason: z.ZodNullable<z.ZodString>;
|
|
533
|
+
non_sale_quantities: z.ZodArray<z.ZodObject<{
|
|
534
|
+
reason: z.ZodEnum<{
|
|
535
|
+
expired: "expired";
|
|
536
|
+
damaged: "damaged";
|
|
537
|
+
returned: "returned";
|
|
538
|
+
correction: "correction";
|
|
539
|
+
}>;
|
|
540
|
+
quantity: z.ZodNumber;
|
|
541
|
+
}, z.core.$strip>>;
|
|
481
542
|
resolved_unit_price: z.ZodNullable<z.ZodNumber>;
|
|
482
543
|
discounted_line_total: z.ZodNullable<z.ZodNumber>;
|
|
483
544
|
currency_code: z.ZodNullable<z.ZodString>;
|
|
@@ -516,6 +577,15 @@ export declare const ListConsignmentReportsResponseSchema: z.ZodObject<{
|
|
|
516
577
|
confirmed_sale_quantity: z.ZodNumber;
|
|
517
578
|
requires_admin_clarification: z.ZodBoolean;
|
|
518
579
|
non_sale_reason: z.ZodNullable<z.ZodString>;
|
|
580
|
+
non_sale_quantities: z.ZodArray<z.ZodObject<{
|
|
581
|
+
reason: z.ZodEnum<{
|
|
582
|
+
expired: "expired";
|
|
583
|
+
damaged: "damaged";
|
|
584
|
+
returned: "returned";
|
|
585
|
+
correction: "correction";
|
|
586
|
+
}>;
|
|
587
|
+
quantity: z.ZodNumber;
|
|
588
|
+
}, z.core.$strip>>;
|
|
519
589
|
resolved_unit_price: z.ZodNullable<z.ZodNumber>;
|
|
520
590
|
discounted_line_total: z.ZodNullable<z.ZodNumber>;
|
|
521
591
|
currency_code: z.ZodNullable<z.ZodString>;
|
|
@@ -857,17 +927,20 @@ export declare const TransferConsignmentStockSchema: z.ZodObject<{
|
|
|
857
927
|
quantity: z.ZodNumber;
|
|
858
928
|
}, z.core.$strip>>;
|
|
859
929
|
}, z.core.$strip>;
|
|
860
|
-
export declare const ConsignmentNonSaleReasonSchema: z.ZodEnum<{
|
|
861
|
-
expired: "expired";
|
|
862
|
-
damaged: "damaged";
|
|
863
|
-
returned: "returned";
|
|
864
|
-
correction: "correction";
|
|
865
|
-
}>;
|
|
866
930
|
export declare const ApproveConsignmentReportSchema: z.ZodObject<{
|
|
867
931
|
expected_version: z.ZodOptional<z.ZodNumber>;
|
|
868
932
|
confirmed_lines: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
869
933
|
report_line_id: z.ZodString;
|
|
870
934
|
confirmed_sale_quantity: z.ZodNumber;
|
|
935
|
+
non_sale_quantities: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
936
|
+
reason: z.ZodEnum<{
|
|
937
|
+
expired: "expired";
|
|
938
|
+
damaged: "damaged";
|
|
939
|
+
returned: "returned";
|
|
940
|
+
correction: "correction";
|
|
941
|
+
}>;
|
|
942
|
+
quantity: z.ZodNumber;
|
|
943
|
+
}, z.core.$strip>>>;
|
|
871
944
|
non_sale_reason: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
|
|
872
945
|
expired: "expired";
|
|
873
946
|
damaged: "damaged";
|
|
@@ -2533,6 +2606,15 @@ export declare const AdminConsignmentReportLineSchema: z.ZodObject<{
|
|
|
2533
2606
|
confirmed_sale_quantity: z.ZodNumber;
|
|
2534
2607
|
requires_admin_clarification: z.ZodBoolean;
|
|
2535
2608
|
non_sale_reason: z.ZodNullable<z.ZodString>;
|
|
2609
|
+
non_sale_quantities: z.ZodArray<z.ZodObject<{
|
|
2610
|
+
reason: z.ZodEnum<{
|
|
2611
|
+
expired: "expired";
|
|
2612
|
+
damaged: "damaged";
|
|
2613
|
+
returned: "returned";
|
|
2614
|
+
correction: "correction";
|
|
2615
|
+
}>;
|
|
2616
|
+
quantity: z.ZodNumber;
|
|
2617
|
+
}, z.core.$strip>>;
|
|
2536
2618
|
correction_reason: z.ZodNullable<z.ZodString>;
|
|
2537
2619
|
unit_price_snapshot: z.ZodNullable<z.ZodNumber>;
|
|
2538
2620
|
discounted_line_total: z.ZodNullable<z.ZodNumber>;
|
|
@@ -2599,6 +2681,15 @@ export declare const AdminConsignmentReportSchema: z.ZodObject<{
|
|
|
2599
2681
|
confirmed_sale_quantity: z.ZodNumber;
|
|
2600
2682
|
requires_admin_clarification: z.ZodBoolean;
|
|
2601
2683
|
non_sale_reason: z.ZodNullable<z.ZodString>;
|
|
2684
|
+
non_sale_quantities: z.ZodArray<z.ZodObject<{
|
|
2685
|
+
reason: z.ZodEnum<{
|
|
2686
|
+
expired: "expired";
|
|
2687
|
+
damaged: "damaged";
|
|
2688
|
+
returned: "returned";
|
|
2689
|
+
correction: "correction";
|
|
2690
|
+
}>;
|
|
2691
|
+
quantity: z.ZodNumber;
|
|
2692
|
+
}, z.core.$strip>>;
|
|
2602
2693
|
correction_reason: z.ZodNullable<z.ZodString>;
|
|
2603
2694
|
unit_price_snapshot: z.ZodNullable<z.ZodNumber>;
|
|
2604
2695
|
discounted_line_total: z.ZodNullable<z.ZodNumber>;
|
|
@@ -2660,6 +2751,15 @@ export declare const ListAdminConsignmentReportsResponseSchema: z.ZodObject<{
|
|
|
2660
2751
|
confirmed_sale_quantity: z.ZodNumber;
|
|
2661
2752
|
requires_admin_clarification: z.ZodBoolean;
|
|
2662
2753
|
non_sale_reason: z.ZodNullable<z.ZodString>;
|
|
2754
|
+
non_sale_quantities: z.ZodArray<z.ZodObject<{
|
|
2755
|
+
reason: z.ZodEnum<{
|
|
2756
|
+
expired: "expired";
|
|
2757
|
+
damaged: "damaged";
|
|
2758
|
+
returned: "returned";
|
|
2759
|
+
correction: "correction";
|
|
2760
|
+
}>;
|
|
2761
|
+
quantity: z.ZodNumber;
|
|
2762
|
+
}, z.core.$strip>>;
|
|
2663
2763
|
correction_reason: z.ZodNullable<z.ZodString>;
|
|
2664
2764
|
unit_price_snapshot: z.ZodNullable<z.ZodNumber>;
|
|
2665
2765
|
discounted_line_total: z.ZodNullable<z.ZodNumber>;
|
|
@@ -2725,6 +2825,15 @@ export declare const AdminConsignmentReportResponseSchema: z.ZodObject<{
|
|
|
2725
2825
|
confirmed_sale_quantity: z.ZodNumber;
|
|
2726
2826
|
requires_admin_clarification: z.ZodBoolean;
|
|
2727
2827
|
non_sale_reason: z.ZodNullable<z.ZodString>;
|
|
2828
|
+
non_sale_quantities: z.ZodArray<z.ZodObject<{
|
|
2829
|
+
reason: z.ZodEnum<{
|
|
2830
|
+
expired: "expired";
|
|
2831
|
+
damaged: "damaged";
|
|
2832
|
+
returned: "returned";
|
|
2833
|
+
correction: "correction";
|
|
2834
|
+
}>;
|
|
2835
|
+
quantity: z.ZodNumber;
|
|
2836
|
+
}, z.core.$strip>>;
|
|
2728
2837
|
correction_reason: z.ZodNullable<z.ZodString>;
|
|
2729
2838
|
unit_price_snapshot: z.ZodNullable<z.ZodNumber>;
|
|
2730
2839
|
discounted_line_total: z.ZodNullable<z.ZodNumber>;
|
|
@@ -2788,6 +2897,15 @@ export declare const ApproveConsignmentReportResponseSchema: z.ZodObject<{
|
|
|
2788
2897
|
confirmed_sale_quantity: z.ZodNumber;
|
|
2789
2898
|
requires_admin_clarification: z.ZodBoolean;
|
|
2790
2899
|
non_sale_reason: z.ZodNullable<z.ZodString>;
|
|
2900
|
+
non_sale_quantities: z.ZodArray<z.ZodObject<{
|
|
2901
|
+
reason: z.ZodEnum<{
|
|
2902
|
+
expired: "expired";
|
|
2903
|
+
damaged: "damaged";
|
|
2904
|
+
returned: "returned";
|
|
2905
|
+
correction: "correction";
|
|
2906
|
+
}>;
|
|
2907
|
+
quantity: z.ZodNumber;
|
|
2908
|
+
}, z.core.$strip>>;
|
|
2791
2909
|
correction_reason: z.ZodNullable<z.ZodString>;
|
|
2792
2910
|
unit_price_snapshot: z.ZodNullable<z.ZodNumber>;
|
|
2793
2911
|
discounted_line_total: z.ZodNullable<z.ZodNumber>;
|
|
@@ -2877,6 +2995,15 @@ export declare const RejectConsignmentReportResponseSchema: z.ZodObject<{
|
|
|
2877
2995
|
confirmed_sale_quantity: z.ZodNumber;
|
|
2878
2996
|
requires_admin_clarification: z.ZodBoolean;
|
|
2879
2997
|
non_sale_reason: z.ZodNullable<z.ZodString>;
|
|
2998
|
+
non_sale_quantities: z.ZodArray<z.ZodObject<{
|
|
2999
|
+
reason: z.ZodEnum<{
|
|
3000
|
+
expired: "expired";
|
|
3001
|
+
damaged: "damaged";
|
|
3002
|
+
returned: "returned";
|
|
3003
|
+
correction: "correction";
|
|
3004
|
+
}>;
|
|
3005
|
+
quantity: z.ZodNumber;
|
|
3006
|
+
}, z.core.$strip>>;
|
|
2880
3007
|
correction_reason: z.ZodNullable<z.ZodString>;
|
|
2881
3008
|
unit_price_snapshot: z.ZodNullable<z.ZodNumber>;
|
|
2882
3009
|
discounted_line_total: z.ZodNullable<z.ZodNumber>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.CorrectConsignmentReportResponseSchema = exports.RejectConsignmentReportResponseSchema = exports.ApproveConsignmentReportResponseSchema = exports.AdminConsignmentReportResponseSchema = exports.ListAdminConsignmentReportsResponseSchema = exports.AdminConsignmentReportSchema = exports.AdminConsignmentReportCorrectionSchema = exports.AdminConsignmentReportLineSchema = exports.RequestConsignmentReminderResponseSchema = exports.ConsignmentTransferResponseSchema = exports.ConsignmentTransferSchema = exports.AffiliateDistributionResponseSchema = exports.AffiliateDistributionSettingsSchema = exports.AffiliateDistributionReportsResponseSchema = exports.AffiliateDistributionReportItemSchema = exports.AffiliateDistributionCurrencyTotalSchema = exports.AffiliateProgramSettingsResponseSchema = exports.AffiliateProgramSettingsSchema = exports.AffiliateReportDetailResponseSchema = exports.AffiliateReportEntrySchema = exports.AffiliateReportTotalsSchema = exports.AffiliateReportOverviewResponseSchema = exports.AffiliateReportOverviewItemSchema = exports.OrderAffiliateAttributionResponseSchema = exports.AffiliateOrderAttributionSchema = exports.CustomerAffiliateAssignmentResponseSchema = exports.ReconcileAdminAffiliateCouponCodeResponseSchema = exports.RotateAdminAffiliateCouponCodeResponseSchema = exports.AdminAffiliateCouponCodeResponseSchema = exports.ListAdminAffiliateCouponCodesResponseSchema = exports.RotateStoreAffiliateCouponCodeResponseSchema = exports.StoreAffiliateCouponCodeResponseSchema = exports.ListStoreAffiliateCouponCodesResponseSchema = exports.AppliedAffiliateCouponSnapshotSchema = exports.AdminAffiliateCouponCodeSchema = exports.StoreAffiliateCouponCodeSchema = exports.ListAffiliateSlugsResponseSchema = exports.AffiliateSlugResponseSchema = exports.AffiliateResponseSchema = exports.ListAffiliatesResponseSchema = exports.ApproveAffiliateApplicationResponseSchema = exports.AffiliateApplicationResponseSchema = void 0;
|
|
3
|
+
exports.StoreConsignmentReportLineSchema = exports.GetConsignmentInventoryResponseSchema = exports.StoreConsignmentInventoryLineSchema = exports.ConsignmentLineLabelsSchema = exports.ApplyOwnOrderPromotionResponseSchema = exports.GetOwnOrderDiscountResponseSchema = exports.GetAffiliateCartReferralResponseSchema = exports.ApplyAffiliateCouponResponseSchema = exports.CaptureAffiliateReferralResponseSchema = exports.StoreAffiliateReferralSchema = exports.ResolveAffiliateReferralResponseSchema = exports.SubmitAffiliateApplicationResponseSchema = exports.StoreAffiliateApplicationSchema = exports.StoreAffiliateSlugSchema = exports.StoreAffiliateSchema = exports.UpdatePartnerPortalSlugSchema = exports.CreatePartnerPortalSlugSchema = exports.PartnerPortalEmptyQuerySchema = exports.PartnerPortalCommissionsQuerySchema = exports.PartnerPortalDateRangeQuerySchema = exports.createPartnerPortalDateRangeQuerySchema = exports.SubmitExistingConsignmentReportSchema = exports.SubmitConsignmentReportSchema = exports.ConsignmentNonSaleQuantitySchema = exports.ConsignmentNonSaleReasonSchema = exports.AffiliateCouponLabelsResponseSchema = exports.AffiliateCouponLabelSchema = exports.ResolveAffiliateCouponLabelsPayloadSchema = exports.ApplyAffiliateCouponSchema = exports.CaptureAffiliateReferralSchema = exports.ApplyOwnOrderPromotionSchema = exports.ResolveReferralQuerySchema = exports.SubmitAffiliateApplicationSchema = exports.CalendarMonthSchema = exports.CalendarDateSchema = exports.CommissionEntryTypeSchema = exports.AffiliateReferralResultStatusSchema = exports.AffiliateCartReferralRecordStatusSchema = exports.AffiliateCouponOriginSchema = exports.AffiliateCouponWireStatusSchema = exports.AffiliateCouponProvisioningStatusSchema = exports.AffiliateCouponLifecycleStatusSchema = exports.AffiliateReferralSignalSourceSchema = exports.AffiliateReferralOverwritePolicySchema = exports.PersistedAffiliateCustomerAssignmentModeSchema = exports.AffiliateCustomerAssignmentModeSchema = exports.AssignmentSourceSchema = exports.AffiliateApplicationStatusSchema = exports.AffiliateStatusSchema = exports.WireDateSchema = void 0;
|
|
4
|
+
exports.CommissionEntrySchema = exports.CustomerAffiliateAssignmentSchema = exports.AffiliateApplicationSchema = exports.AffiliateApplicationCompanyVerificationSchema = exports.AffiliateSchema = exports.AffiliateCustomerSummarySchema = exports.AffiliateSlugSchema = exports.ListConsignmentReportsQuerySchema = exports.AffiliateDistributionReportQuerySchema = exports.UpdateAffiliateProgramSettingsSchema = exports.ReportDetailQuerySchema = exports.ReportDateRangeQuerySchema = exports.RequestConsignmentReminderSchema = exports.CorrectConsignmentReportSchema = exports.RejectConsignmentReportSchema = exports.ApproveConsignmentReportSchema = exports.TransferConsignmentStockSchema = exports.EnableAffiliateDistributionSchema = exports.SetCustomerAffiliateAssignmentSchema = exports.SetOrderAffiliateAttributionSchema = exports.UpdateAffiliateSlugSchema = exports.CreateAffiliateSlugSchema = exports.UpdateAffiliateSchema = exports.CreateAffiliateSchema = exports.ListAffiliatesQuerySchema = exports.RejectAffiliateApplicationSchema = exports.ApproveAffiliateApplicationSchema = exports.ListAffiliateApplicationsQuerySchema = exports.OwnOrderDiscountQuerySchema = exports.PaginationQuerySchema = exports.RotateAdminAffiliateCouponCodeSchema = exports.CreateAdminAffiliateCouponCodeSchema = exports.ListAdminAffiliateCouponCodesQuerySchema = exports.RotateStoreAffiliateCouponCodeSchema = exports.CreateStoreAffiliateCouponCodeSchema = exports.ListStoreAffiliateCouponCodesQuerySchema = exports.GetAffiliatePortalCommissionsResponseSchema = exports.StoreAffiliatePortalCommissionSchema = exports.GetAffiliatePortalDashboardResponseSchema = exports.PortalCurrencyTotalsSchema = exports.UpdatePartnerPortalSlugResponseSchema = exports.CreatePartnerPortalSlugResponseSchema = exports.ListPartnerPortalSlugsResponseSchema = exports.StoreAffiliatePortalContextResponseSchema = exports.StoreAffiliatePortalSlugSchema = exports.StoreAffiliatePortalAffiliateSchema = exports.StoreAffiliatePortalApplicationSchema = exports.ListConsignmentReportsResponseSchema = exports.SubmitConsignmentReportResponseSchema = exports.StoreConsignmentReportSchema = void 0;
|
|
5
|
+
exports.CorrectConsignmentReportResponseSchema = exports.RejectConsignmentReportResponseSchema = exports.ApproveConsignmentReportResponseSchema = exports.AdminConsignmentReportResponseSchema = exports.ListAdminConsignmentReportsResponseSchema = exports.AdminConsignmentReportSchema = exports.AdminConsignmentReportCorrectionSchema = exports.AdminConsignmentReportLineSchema = exports.RequestConsignmentReminderResponseSchema = exports.ConsignmentTransferResponseSchema = exports.ConsignmentTransferSchema = exports.AffiliateDistributionResponseSchema = exports.AffiliateDistributionSettingsSchema = exports.AffiliateDistributionReportsResponseSchema = exports.AffiliateDistributionReportItemSchema = exports.AffiliateDistributionCurrencyTotalSchema = exports.AffiliateProgramSettingsResponseSchema = exports.AffiliateProgramSettingsSchema = exports.AffiliateReportDetailResponseSchema = exports.AffiliateReportEntrySchema = exports.AffiliateReportTotalsSchema = exports.AffiliateReportOverviewResponseSchema = exports.AffiliateReportOverviewItemSchema = exports.OrderAffiliateAttributionResponseSchema = exports.AffiliateOrderAttributionSchema = exports.CustomerAffiliateAssignmentResponseSchema = exports.ReconcileAdminAffiliateCouponCodeResponseSchema = exports.RotateAdminAffiliateCouponCodeResponseSchema = exports.AdminAffiliateCouponCodeResponseSchema = exports.ListAdminAffiliateCouponCodesResponseSchema = exports.RotateStoreAffiliateCouponCodeResponseSchema = exports.StoreAffiliateCouponCodeResponseSchema = exports.ListStoreAffiliateCouponCodesResponseSchema = exports.AppliedAffiliateCouponSnapshotSchema = exports.AdminAffiliateCouponCodeSchema = exports.StoreAffiliateCouponCodeSchema = exports.ListAffiliateSlugsResponseSchema = exports.AffiliateSlugResponseSchema = exports.AffiliateResponseSchema = exports.ListAffiliatesResponseSchema = exports.ApproveAffiliateApplicationResponseSchema = exports.AffiliateApplicationResponseSchema = exports.ListAffiliateApplicationsResponseSchema = void 0;
|
|
6
6
|
const zod_1 = require("@medusajs/framework/zod");
|
|
7
7
|
const primitives_1 = require("../shared/primitives");
|
|
8
8
|
Object.defineProperty(exports, "WireDateSchema", { enumerable: true, get: function () { return primitives_1.WireDateSchema; } });
|
|
@@ -158,10 +158,30 @@ exports.AffiliateCouponLabelSchema = zod_1.z.object({
|
|
|
158
158
|
exports.AffiliateCouponLabelsResponseSchema = zod_1.z.object({
|
|
159
159
|
labels: zod_1.z.array(exports.AffiliateCouponLabelSchema),
|
|
160
160
|
});
|
|
161
|
+
exports.ConsignmentNonSaleReasonSchema = zod_1.z.enum([
|
|
162
|
+
"damaged",
|
|
163
|
+
"expired",
|
|
164
|
+
"returned",
|
|
165
|
+
"correction",
|
|
166
|
+
]);
|
|
167
|
+
/** A part of a line's not-sold shortage with its reason. */
|
|
168
|
+
exports.ConsignmentNonSaleQuantitySchema = zod_1.z.object({
|
|
169
|
+
reason: exports.ConsignmentNonSaleReasonSchema,
|
|
170
|
+
quantity: zod_1.z.number().int().positive(),
|
|
171
|
+
});
|
|
161
172
|
const ConsignmentCountSchema = zod_1.z.object({
|
|
162
173
|
inventory_item_id: zod_1.z.string().trim().min(1),
|
|
163
174
|
batch_id: zod_1.z.string().trim().min(1).nullable().optional().default(null),
|
|
164
175
|
counted_quantity: zod_1.z.number().int().min(0),
|
|
176
|
+
/**
|
|
177
|
+
* The affiliate's split of the line's shortage (expected minus counted):
|
|
178
|
+
* the not-sold part by reason; the rest counts as sold. Empty or missing
|
|
179
|
+
* means the whole shortage was sold. Only allowed with a shortage.
|
|
180
|
+
*/
|
|
181
|
+
non_sale_quantities: zod_1.z
|
|
182
|
+
.array(exports.ConsignmentNonSaleQuantitySchema)
|
|
183
|
+
.max(20)
|
|
184
|
+
.optional(),
|
|
165
185
|
});
|
|
166
186
|
exports.SubmitConsignmentReportSchema = zod_1.z.object({
|
|
167
187
|
period_start: exports.CalendarMonthSchema,
|
|
@@ -339,6 +359,8 @@ exports.StoreConsignmentReportLineSchema = zod_1.z
|
|
|
339
359
|
confirmed_sale_quantity: zod_1.z.number(),
|
|
340
360
|
requires_admin_clarification: zod_1.z.boolean(),
|
|
341
361
|
non_sale_reason: zod_1.z.string().nullable(),
|
|
362
|
+
/** Not-sold shortage by reason; empty when everything missing was sold. */
|
|
363
|
+
non_sale_quantities: zod_1.z.array(exports.ConsignmentNonSaleQuantitySchema),
|
|
342
364
|
resolved_unit_price: zod_1.z.number().nullable(),
|
|
343
365
|
discounted_line_total: zod_1.z.number().nullable(),
|
|
344
366
|
currency_code: zod_1.z.string().nullable(),
|
|
@@ -627,18 +649,22 @@ exports.TransferConsignmentStockSchema = zod_1.z.object({
|
|
|
627
649
|
.min(1)
|
|
628
650
|
.max(100),
|
|
629
651
|
});
|
|
630
|
-
exports.ConsignmentNonSaleReasonSchema = zod_1.z.enum([
|
|
631
|
-
"damaged",
|
|
632
|
-
"expired",
|
|
633
|
-
"returned",
|
|
634
|
-
"correction",
|
|
635
|
-
]);
|
|
636
652
|
exports.ApproveConsignmentReportSchema = zod_1.z.object({
|
|
637
653
|
expected_version: zod_1.z.number().int().positive().optional(),
|
|
638
654
|
confirmed_lines: zod_1.z
|
|
639
655
|
.array(zod_1.z.object({
|
|
640
656
|
report_line_id: zod_1.z.string().trim().min(1),
|
|
641
657
|
confirmed_sale_quantity: zod_1.z.number().int().min(0),
|
|
658
|
+
/**
|
|
659
|
+
* Split of the not-sold shortage (shortage minus confirmed sale) by
|
|
660
|
+
* reason; the quantities must add up to it. Takes precedence over
|
|
661
|
+
* `non_sale_reason`.
|
|
662
|
+
*/
|
|
663
|
+
non_sale_quantities: zod_1.z
|
|
664
|
+
.array(exports.ConsignmentNonSaleQuantitySchema)
|
|
665
|
+
.max(20)
|
|
666
|
+
.optional(),
|
|
667
|
+
/** Legacy: one reason for the whole not-sold shortage. */
|
|
642
668
|
non_sale_reason: exports.ConsignmentNonSaleReasonSchema.optional().nullable(),
|
|
643
669
|
}))
|
|
644
670
|
.max(500)
|
|
@@ -1086,7 +1112,10 @@ exports.AdminConsignmentReportLineSchema = zod_1.z.object({
|
|
|
1086
1112
|
proposed_sale_quantity: zod_1.z.number(),
|
|
1087
1113
|
confirmed_sale_quantity: zod_1.z.number(),
|
|
1088
1114
|
requires_admin_clarification: zod_1.z.boolean(),
|
|
1115
|
+
/** The single reason, null with several reasons or none. */
|
|
1089
1116
|
non_sale_reason: zod_1.z.string().nullable(),
|
|
1117
|
+
/** Not-sold shortage by reason; empty when everything missing was sold. */
|
|
1118
|
+
non_sale_quantities: zod_1.z.array(exports.ConsignmentNonSaleQuantitySchema),
|
|
1090
1119
|
correction_reason: zod_1.z.string().nullable(),
|
|
1091
1120
|
unit_price_snapshot: zod_1.z.number().nullable(),
|
|
1092
1121
|
discounted_line_total: zod_1.z.number().nullable(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { z } from "@medusajs/framework/zod";
|
|
2
|
-
import type { AdminAffiliateCouponCodeResponseSchema, AdminAffiliateCouponCodeSchema, AdminConsignmentReportResponseSchema, AdminConsignmentReportSchema, AffiliateCartReferralRecordStatusSchema, AffiliateCouponLifecycleStatusSchema, AffiliateCouponOriginSchema, AffiliateCouponProvisioningStatusSchema, AffiliateCouponWireStatusSchema, AffiliateCustomerAssignmentModeSchema, AffiliateOrderAttributionSchema, AffiliateReferralOverwritePolicySchema, AffiliateReferralResultStatusSchema, AffiliateReferralSignalSourceSchema, AffiliateApplicationCompanyVerificationSchema, AffiliateCustomerSummarySchema, AffiliateApplicationResponseSchema, AffiliateDistributionReportsResponseSchema, AffiliateDistributionReportQuerySchema, AffiliateDistributionResponseSchema, AffiliateProgramSettingsResponseSchema, AffiliateReportDetailResponseSchema, AffiliateReportEntrySchema, AffiliateReportOverviewItemSchema, AffiliateReportOverviewResponseSchema, AffiliateReportTotalsSchema, AffiliateResponseSchema, AffiliateSchema, AffiliateSlugResponseSchema, ApplyOwnOrderPromotionResponseSchema, ApplyOwnOrderPromotionSchema, ApplyAffiliateCouponResponseSchema, ApplyAffiliateCouponSchema, AppliedAffiliateCouponSnapshotSchema, AffiliateCouponLabelSchema, AffiliateCouponLabelsResponseSchema, ResolveAffiliateCouponLabelsPayloadSchema, ApproveAffiliateApplicationResponseSchema, ApproveAffiliateApplicationSchema, ApproveConsignmentReportResponseSchema, ApproveConsignmentReportSchema, CaptureAffiliateReferralResponseSchema, CaptureAffiliateReferralSchema, ConsignmentTransferResponseSchema, CorrectConsignmentReportResponseSchema, CorrectConsignmentReportSchema, CreateAdminAffiliateCouponCodeSchema, CreateAffiliateSchema, CreateAffiliateSlugSchema, CreatePartnerPortalSlugResponseSchema, CreatePartnerPortalSlugSchema, CreateStoreAffiliateCouponCodeSchema, CustomerAffiliateAssignmentResponseSchema, CustomerAffiliateAssignmentSchema, EnableAffiliateDistributionSchema, GetAffiliatePortalCommissionsResponseSchema, GetAffiliatePortalDashboardResponseSchema, GetAffiliateCartReferralResponseSchema, GetConsignmentInventoryResponseSchema, GetOwnOrderDiscountResponseSchema, ListAdminConsignmentReportsResponseSchema, ListAdminAffiliateCouponCodesQuerySchema, ListAdminAffiliateCouponCodesResponseSchema, ListAffiliateApplicationsQuerySchema, ListAffiliateApplicationsResponseSchema, ListAffiliatesQuerySchema, ListAffiliatesResponseSchema, ListAffiliateSlugsResponseSchema, ListConsignmentReportsQuerySchema, ListConsignmentReportsResponseSchema, ListPartnerPortalSlugsResponseSchema, ListStoreAffiliateCouponCodesQuerySchema, ListStoreAffiliateCouponCodesResponseSchema, PartnerPortalCommissionsQuerySchema, PartnerPortalDateRangeQuerySchema, OrderAffiliateAttributionResponseSchema, PortalCurrencyTotalsSchema, PersistedAffiliateCustomerAssignmentModeSchema, RejectAffiliateApplicationSchema, RejectConsignmentReportResponseSchema, RejectConsignmentReportSchema, ReconcileAdminAffiliateCouponCodeResponseSchema, ReportDateRangeQuerySchema, ReportDetailQuerySchema, ResolveAffiliateReferralResponseSchema, ResolveReferralQuerySchema, RotateAdminAffiliateCouponCodeResponseSchema, RotateAdminAffiliateCouponCodeSchema, RotateStoreAffiliateCouponCodeResponseSchema, RotateStoreAffiliateCouponCodeSchema, RequestConsignmentReminderResponseSchema, RequestConsignmentReminderSchema, SetCustomerAffiliateAssignmentSchema, SetOrderAffiliateAttributionSchema, StoreAffiliateApplicationSchema, StoreAffiliateCouponCodeResponseSchema, StoreAffiliateCouponCodeSchema, StoreAffiliateReferralSchema, StoreAffiliatePortalAffiliateSchema, StoreAffiliatePortalApplicationSchema, StoreAffiliatePortalCommissionSchema, StoreAffiliatePortalContextResponseSchema, StoreAffiliatePortalSlugSchema, StoreConsignmentInventoryLineSchema, StoreConsignmentReportLineSchema, StoreConsignmentReportSchema, ConsignmentLineLabelsSchema, SubmitAffiliateApplicationResponseSchema, SubmitAffiliateApplicationSchema, SubmitConsignmentReportResponseSchema, SubmitConsignmentReportSchema, SubmitExistingConsignmentReportSchema, TransferConsignmentStockSchema, UpdateAffiliateProgramSettingsSchema, UpdateAffiliateSchema, UpdateAffiliateSlugSchema, UpdatePartnerPortalSlugResponseSchema, UpdatePartnerPortalSlugSchema } from "./schemas";
|
|
2
|
+
import type { AdminAffiliateCouponCodeResponseSchema, AdminAffiliateCouponCodeSchema, AdminConsignmentReportResponseSchema, AdminConsignmentReportSchema, AffiliateCartReferralRecordStatusSchema, AffiliateCouponLifecycleStatusSchema, AffiliateCouponOriginSchema, AffiliateCouponProvisioningStatusSchema, AffiliateCouponWireStatusSchema, AffiliateCustomerAssignmentModeSchema, AffiliateOrderAttributionSchema, AffiliateReferralOverwritePolicySchema, AffiliateReferralResultStatusSchema, AffiliateReferralSignalSourceSchema, AffiliateApplicationCompanyVerificationSchema, AffiliateCustomerSummarySchema, AffiliateApplicationResponseSchema, AffiliateDistributionReportsResponseSchema, AffiliateDistributionReportQuerySchema, AffiliateDistributionResponseSchema, AffiliateProgramSettingsResponseSchema, AffiliateReportDetailResponseSchema, AffiliateReportEntrySchema, AffiliateReportOverviewItemSchema, AffiliateReportOverviewResponseSchema, AffiliateReportTotalsSchema, AffiliateResponseSchema, AffiliateSchema, AffiliateSlugResponseSchema, ApplyOwnOrderPromotionResponseSchema, ApplyOwnOrderPromotionSchema, ApplyAffiliateCouponResponseSchema, ApplyAffiliateCouponSchema, AppliedAffiliateCouponSnapshotSchema, AffiliateCouponLabelSchema, AffiliateCouponLabelsResponseSchema, ResolveAffiliateCouponLabelsPayloadSchema, ApproveAffiliateApplicationResponseSchema, ApproveAffiliateApplicationSchema, ApproveConsignmentReportResponseSchema, ApproveConsignmentReportSchema, CaptureAffiliateReferralResponseSchema, CaptureAffiliateReferralSchema, ConsignmentTransferResponseSchema, CorrectConsignmentReportResponseSchema, CorrectConsignmentReportSchema, CreateAdminAffiliateCouponCodeSchema, CreateAffiliateSchema, CreateAffiliateSlugSchema, CreatePartnerPortalSlugResponseSchema, CreatePartnerPortalSlugSchema, CreateStoreAffiliateCouponCodeSchema, CustomerAffiliateAssignmentResponseSchema, CustomerAffiliateAssignmentSchema, EnableAffiliateDistributionSchema, GetAffiliatePortalCommissionsResponseSchema, GetAffiliatePortalDashboardResponseSchema, GetAffiliateCartReferralResponseSchema, GetConsignmentInventoryResponseSchema, GetOwnOrderDiscountResponseSchema, ListAdminConsignmentReportsResponseSchema, ListAdminAffiliateCouponCodesQuerySchema, ListAdminAffiliateCouponCodesResponseSchema, ListAffiliateApplicationsQuerySchema, ListAffiliateApplicationsResponseSchema, ListAffiliatesQuerySchema, ListAffiliatesResponseSchema, ListAffiliateSlugsResponseSchema, ListConsignmentReportsQuerySchema, ListConsignmentReportsResponseSchema, ListPartnerPortalSlugsResponseSchema, ListStoreAffiliateCouponCodesQuerySchema, ListStoreAffiliateCouponCodesResponseSchema, PartnerPortalCommissionsQuerySchema, PartnerPortalDateRangeQuerySchema, OrderAffiliateAttributionResponseSchema, PortalCurrencyTotalsSchema, PersistedAffiliateCustomerAssignmentModeSchema, RejectAffiliateApplicationSchema, RejectConsignmentReportResponseSchema, RejectConsignmentReportSchema, ReconcileAdminAffiliateCouponCodeResponseSchema, ReportDateRangeQuerySchema, ReportDetailQuerySchema, ResolveAffiliateReferralResponseSchema, ResolveReferralQuerySchema, RotateAdminAffiliateCouponCodeResponseSchema, RotateAdminAffiliateCouponCodeSchema, RotateStoreAffiliateCouponCodeResponseSchema, RotateStoreAffiliateCouponCodeSchema, RequestConsignmentReminderResponseSchema, RequestConsignmentReminderSchema, SetCustomerAffiliateAssignmentSchema, SetOrderAffiliateAttributionSchema, StoreAffiliateApplicationSchema, StoreAffiliateCouponCodeResponseSchema, StoreAffiliateCouponCodeSchema, StoreAffiliateReferralSchema, StoreAffiliatePortalAffiliateSchema, StoreAffiliatePortalApplicationSchema, StoreAffiliatePortalCommissionSchema, StoreAffiliatePortalContextResponseSchema, StoreAffiliatePortalSlugSchema, StoreConsignmentInventoryLineSchema, StoreConsignmentReportLineSchema, StoreConsignmentReportSchema, ConsignmentLineLabelsSchema, ConsignmentNonSaleQuantitySchema, SubmitAffiliateApplicationResponseSchema, SubmitAffiliateApplicationSchema, SubmitConsignmentReportResponseSchema, SubmitConsignmentReportSchema, SubmitExistingConsignmentReportSchema, TransferConsignmentStockSchema, UpdateAffiliateProgramSettingsSchema, UpdateAffiliateSchema, UpdateAffiliateSlugSchema, UpdatePartnerPortalSlugResponseSchema, UpdatePartnerPortalSlugSchema } from "./schemas";
|
|
3
3
|
export type AffiliateCouponLifecycleStatus = z.infer<typeof AffiliateCouponLifecycleStatusSchema>;
|
|
4
4
|
export type AffiliateCouponProvisioningStatus = z.infer<typeof AffiliateCouponProvisioningStatusSchema>;
|
|
5
5
|
export type AffiliateCouponWireStatus = z.infer<typeof AffiliateCouponWireStatusSchema>;
|
|
@@ -50,6 +50,7 @@ export type GetOwnOrderDiscountResponse = z.infer<typeof GetOwnOrderDiscountResp
|
|
|
50
50
|
export type StoreConsignmentInventoryLine = z.infer<typeof StoreConsignmentInventoryLineSchema>;
|
|
51
51
|
export type StoreConsignmentReportLine = z.infer<typeof StoreConsignmentReportLineSchema>;
|
|
52
52
|
export type ConsignmentLineLabels = z.infer<typeof ConsignmentLineLabelsSchema>;
|
|
53
|
+
export type ConsignmentNonSaleQuantity = z.infer<typeof ConsignmentNonSaleQuantitySchema>;
|
|
53
54
|
export type GetConsignmentInventoryResponse = z.infer<typeof GetConsignmentInventoryResponseSchema>;
|
|
54
55
|
export type SubmitConsignmentReportRequest = z.input<typeof SubmitConsignmentReportSchema>;
|
|
55
56
|
export type SubmitExistingConsignmentReportRequest = z.input<typeof SubmitExistingConsignmentReportSchema>;
|
|
@@ -153,10 +153,30 @@ export const AffiliateCouponLabelSchema = z.object({
|
|
|
153
153
|
export const AffiliateCouponLabelsResponseSchema = z.object({
|
|
154
154
|
labels: z.array(AffiliateCouponLabelSchema),
|
|
155
155
|
});
|
|
156
|
+
export const ConsignmentNonSaleReasonSchema = z.enum([
|
|
157
|
+
"damaged",
|
|
158
|
+
"expired",
|
|
159
|
+
"returned",
|
|
160
|
+
"correction",
|
|
161
|
+
]);
|
|
162
|
+
/** A part of a line's not-sold shortage with its reason. */
|
|
163
|
+
export const ConsignmentNonSaleQuantitySchema = z.object({
|
|
164
|
+
reason: ConsignmentNonSaleReasonSchema,
|
|
165
|
+
quantity: z.number().int().positive(),
|
|
166
|
+
});
|
|
156
167
|
const ConsignmentCountSchema = z.object({
|
|
157
168
|
inventory_item_id: z.string().trim().min(1),
|
|
158
169
|
batch_id: z.string().trim().min(1).nullable().optional().default(null),
|
|
159
170
|
counted_quantity: z.number().int().min(0),
|
|
171
|
+
/**
|
|
172
|
+
* The affiliate's split of the line's shortage (expected minus counted):
|
|
173
|
+
* the not-sold part by reason; the rest counts as sold. Empty or missing
|
|
174
|
+
* means the whole shortage was sold. Only allowed with a shortage.
|
|
175
|
+
*/
|
|
176
|
+
non_sale_quantities: z
|
|
177
|
+
.array(ConsignmentNonSaleQuantitySchema)
|
|
178
|
+
.max(20)
|
|
179
|
+
.optional(),
|
|
160
180
|
});
|
|
161
181
|
export const SubmitConsignmentReportSchema = z.object({
|
|
162
182
|
period_start: CalendarMonthSchema,
|
|
@@ -333,6 +353,8 @@ export const StoreConsignmentReportLineSchema = z
|
|
|
333
353
|
confirmed_sale_quantity: z.number(),
|
|
334
354
|
requires_admin_clarification: z.boolean(),
|
|
335
355
|
non_sale_reason: z.string().nullable(),
|
|
356
|
+
/** Not-sold shortage by reason; empty when everything missing was sold. */
|
|
357
|
+
non_sale_quantities: z.array(ConsignmentNonSaleQuantitySchema),
|
|
336
358
|
resolved_unit_price: z.number().nullable(),
|
|
337
359
|
discounted_line_total: z.number().nullable(),
|
|
338
360
|
currency_code: z.string().nullable(),
|
|
@@ -621,18 +643,22 @@ export const TransferConsignmentStockSchema = z.object({
|
|
|
621
643
|
.min(1)
|
|
622
644
|
.max(100),
|
|
623
645
|
});
|
|
624
|
-
export const ConsignmentNonSaleReasonSchema = z.enum([
|
|
625
|
-
"damaged",
|
|
626
|
-
"expired",
|
|
627
|
-
"returned",
|
|
628
|
-
"correction",
|
|
629
|
-
]);
|
|
630
646
|
export const ApproveConsignmentReportSchema = z.object({
|
|
631
647
|
expected_version: z.number().int().positive().optional(),
|
|
632
648
|
confirmed_lines: z
|
|
633
649
|
.array(z.object({
|
|
634
650
|
report_line_id: z.string().trim().min(1),
|
|
635
651
|
confirmed_sale_quantity: z.number().int().min(0),
|
|
652
|
+
/**
|
|
653
|
+
* Split of the not-sold shortage (shortage minus confirmed sale) by
|
|
654
|
+
* reason; the quantities must add up to it. Takes precedence over
|
|
655
|
+
* `non_sale_reason`.
|
|
656
|
+
*/
|
|
657
|
+
non_sale_quantities: z
|
|
658
|
+
.array(ConsignmentNonSaleQuantitySchema)
|
|
659
|
+
.max(20)
|
|
660
|
+
.optional(),
|
|
661
|
+
/** Legacy: one reason for the whole not-sold shortage. */
|
|
636
662
|
non_sale_reason: ConsignmentNonSaleReasonSchema.optional().nullable(),
|
|
637
663
|
}))
|
|
638
664
|
.max(500)
|
|
@@ -1080,7 +1106,10 @@ export const AdminConsignmentReportLineSchema = z.object({
|
|
|
1080
1106
|
proposed_sale_quantity: z.number(),
|
|
1081
1107
|
confirmed_sale_quantity: z.number(),
|
|
1082
1108
|
requires_admin_clarification: z.boolean(),
|
|
1109
|
+
/** The single reason, null with several reasons or none. */
|
|
1083
1110
|
non_sale_reason: z.string().nullable(),
|
|
1111
|
+
/** Not-sold shortage by reason; empty when everything missing was sold. */
|
|
1112
|
+
non_sale_quantities: z.array(ConsignmentNonSaleQuantitySchema),
|
|
1084
1113
|
correction_reason: z.string().nullable(),
|
|
1085
1114
|
unit_price_snapshot: z.number().nullable(),
|
|
1086
1115
|
discounted_line_total: z.number().nullable(),
|