Location service

Constructors

Methods

  • Delete the location by id. Also need to delete all the locations which location path contains the id. e.g. Assume, Prefecture A have children City X, City Y, and City X have Ward 1, Ward 2 if delete Prefecture A, City X, City Y, Ward 1, Ward 2 all deleted

    Parameters

    • id: string

      location Id to delete

    Returns Promise<boolean>

    true if deleted, false if delete failed blocks-2055

  • Return two layer location tree. Location object with a children property, which is a locationList

    Parameters

    • parentId: string

      parentId of a locationTreeList

    • orderParams: OrderParam<string>[]
    • paginationOptions: PaginationOptions

    Returns Promise<{
        count: number;
        limit?: number;
        nextToken?: string;
        previousToken?: string;
        result: LocationTree[];
        total: number;
    }>

    locationTree blocks-6a17

  • Update location data. If location parentId is updated, all the location have this location id in path, will get updated.

    Parameters

    • id: string

      blocks-2055

    • locationInfo: Partial<Location>

    Returns Promise<{
        id: string;
    }>

Properties

db: Db
locationRepository: MongoRepository<LocationEntity>
COLLECTION_LOCATION: "locations" = 'locations'
LOCATION_STATUS_ACTIVE: "ACTIVE" = 'ACTIVE'

Generated using TypeDoc