<"file: function\src\dto.ts">export interface CreateSubscriptionDto {planId: string;startDate: number;selectedMeals: SelectedMealDto[];deliveryLocation: LatLngDto;deliveryLocationName: string;deliveryTime: number;}export interface LatLngDto {latitude: number;longitude: number;}export interface SelectedMealDto {day: number;mealId: string;restaurantId: string;}export interface UpdateSubscriptionDto {subscriptionId: string;changes: DayChangeDto[];deliveryLocation: LatLngDto;deliveryLocationName: string;deliveryTime: number;}export interface DayChangeDto {day: number;changeType: string; // setMeal, skipmealId?: string;}</"file: function\src\dto.ts">

<"file: function\src\index.ts">import { UserRecord, getAuth } from "firebase-admin/auth";import {FieldPath,FieldValue,GeoPoint,Timestamp,Transaction,} from "firebase-admin/firestore";import { HttpsError, onCall } from "firebase-functions/v2/https";import * as moment from "moment-timezone";import * as dto from "./dto";import * as models from "./models";import { makeAdmin, makeRestaurant } from "./roleAssigners";import { updateRestaurantNameAndImage } from "./updaters";// This is a meal subscription app with Firebase functions and Firestore as the backend that// allows users to pick the meals in a plan, which could be a monthly plan or a weekly plan, and// then subscribe to it.When the user creates a new subscription,a pending transaction// will be made for him, and he will pay for it in the first delivery.// The admin will see the meals that should be delivered in the coming days that all users have picked.// Each day, the admin will see the meals (and their delivery locations) that should be delivered// that day and will notify some drivers to deliver the meal.// The driver will pick up the meals and deliver them to the users. and he will take any money that// the user should pay.// The admin will take the money from the driver and approve payment transactions for the users.// The admin can block users or subscriptions.// remember we only have a simple app for the users and one for the admin and one for the restaurants// so other things should be manual and there is no online payment but there is balance for users that// is increased when they remove a meal from their subscription or things like that.// because the database is nosql we should have instructions on when to duplicate data for example// a collection for daily meals that for example all restaurants read and it should have all the meals// that they have to make, for this to work we must have a firebase function  Make sure to only use capital letters in your entire response.
user