rider partner page
This commit is contained in:
@@ -349,3 +349,20 @@ export function riderName(rider: RiderInfo): string {
|
||||
export function riderVehicle(rider: RiderInfo): string {
|
||||
return [rider.vehiclename, rider.vehicleno].map((part) => (part ?? '').trim()).filter(Boolean).join(' · ');
|
||||
}
|
||||
|
||||
/**
|
||||
* Which fleet to ask for, given the merchant and the source they chose.
|
||||
*
|
||||
* Its own function so the rule is testable and so the picker and anything that
|
||||
* follows it cannot drift apart on it. Never returns a region: `getriders`
|
||||
* scoped by city answers "who is on duty in Coimbatore", which for a merchant
|
||||
* is 82 riders belonging to other companies.
|
||||
*/
|
||||
export function riderScope(input: {
|
||||
tenantid: number;
|
||||
partnerid: number;
|
||||
source: 'own' | 'partner';
|
||||
}): { tenantid?: number | undefined; partnerid?: number | undefined } {
|
||||
if (input.source === 'partner' && input.partnerid > 0) return { partnerid: input.partnerid };
|
||||
return { tenantid: input.tenantid || undefined };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user