Coder Social home page Coder Social logo

Comments (14)

veshu avatar veshu commented on August 21, 2024

Contest https://www.topcoder.com/challenges/30154003 has been created for this ticket.

This is an automated message for veshu via Topcoder X

from taas-apis.

veshu avatar veshu commented on August 21, 2024

Contest https://www.topcoder.com/challenges/30154003 has been updated - it has been assigned to aaron2017.

This is an automated message for veshu via Topcoder X

from taas-apis.

imcaizheng avatar imcaizheng commented on August 21, 2024

@veshu
I am not quite sure if current implementation of weekly count is correct or not.

I tried to extract the business logic about the weekly count from the source code, as follows:

For a team, for every resource bookings of the team, only when the resource booking was started before the first day of current week and is to be ended after the last day of current week, the customer rate of the resource booking would be added to weekly count(cost).

Let's take an example, say, today is Nov 27, so the beginning of this week is Nov 22(Sunday) and the end of this week is Nov 28(Saturday).

  1. the following resourceBooking won't fullfilled the conditions because its startDate is larger than Nov 22.
{
    "projectId": 16704,
    "userId": "3f64739e-10bf-42ca-8314-8aea0245cd0f",
    "jobId": "1a5f81ca-65e1-4022-b997-6ab0f9140aa0",
    "startDate": "2020-11-27T04:17:23.131Z",
    "endDate": "2020-12-27T04:17:23.131Z",
    "memberRate": 13.23,
    "customerRate": 113,
    "rateType": "weekly",
    "createdAt": "2020-11-19T09:55:40.896Z",
    "createdBy": "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a",
    "status": "sourcing",
    "updatedBy": "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a",
    "updatedAt": "2020-11-19T09:58:08.413Z",
    "id": "cd32fce8-7cbb-4a8e-ad32-b5dc8e495f47"
}
  1. this one won't fullfilled the conditions as well. Because its endDate is less than Nov 22.
{
    "projectId": 61,
    "userId": "3f64739e-10bf-42ca-8314-8aea0245cd0f",
    "jobId": "0c1e518f-7aad-47f6-81e1-1d0aedb1e9b6",
    "startDate": "2020-09-27T04:17:23.131Z",
    "endDate": "2020-09-27T04:17:23.131Z",
    "memberRate": 61,
    "customerRate": 61,
    "rateType": "weekly",
    "createdAt": "2020-11-18T08:24:59.286Z",
    "createdBy": "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a",
    "status": "sourcing",
    "id": "c8189e84-6cd6-41f8-bbf5-0c692a38594d"
}
  1. this one's customerRate will be added to weekly count.
{
  "projectId": 16705,
  "userId": "df2f0027-f74f-45fa-85cd-84c9fdc2faf4",
  "jobId": "2de6b167-8c6a-44dd-a6a2-8abd8bf6443b",
  "startDate": "2020-11-15T04:17:23.131Z",
  "endDate": "2020-12-15T04:17:23.131Z",
  "memberRate": 200,
  "customerRate": 200,
  "rateType": "weekly",
  "createdAt": "2020-11-18T16:24:02.682Z",
  "createdBy": "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a",
  "status": "assigned",
  "updatedBy": "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a",
  "updatedAt": "2020-11-18T16:24:56.797Z",
  "id": "a7a65205-d7c5-4725-a1db-923543e621b1"
}

Is current implementation desired? If not, please tell me what it should be so that I can fix it.

from taas-apis.

veshu avatar veshu commented on August 21, 2024

@imcaizheng if the startdate and end date overlaps the current week then only show.
So for this week any resources whose startdate is less the weekEndDate and end date is greater than weekStartDate should be considered

from taas-apis.

imcaizheng avatar imcaizheng commented on August 21, 2024

@veshu
Thanks for clarification. PR submitted. See #20

from taas-apis.

veshu avatar veshu commented on August 21, 2024

Payment task has been updated: https://software.topcoder.com/review/actions/ViewProjectDetails?pid=30154003

This is an automated message for veshu via Topcoder X

from taas-apis.

nkumar-topcoder avatar nkumar-topcoder commented on August 21, 2024

@wdprice
Check the logic for weekly count above. As this involves $ calculation :-)

  1. I would prefer, weekly count to be counting the (first resource booking start date - last resource booking end date)/7. If it comes in decimal ex: 25/7 = 3.51. above 0.5 round-off 4 weeks. Below 0.5 round-down to week as 3 weeks.
  2. Business logic wise backdate of resource is possible, right ? If I backdate and resource is assigned status ideally from that start date weekly count should be calculated.
  3. If we go by sunday as startdate as given in the above example (1), we might miss weekly count completely.

@imcaizheng
Check my email, I have given as start and enddate as per your example (3), but still I am not getting weekly count.

from taas-apis.

imcaizheng avatar imcaizheng commented on August 21, 2024

@nkumar-topcoder
It is because weekEndDate is not correctly calculated. See PR #28

from taas-apis.

nkumar-topcoder avatar nkumar-topcoder commented on August 21, 2024

@veshu need your input.

We have weekly count vs weekly cost and time remaining in week. can you pls clarify how these calculated and displayed at frontend.

@maxceem @imcaizheng

from taas-apis.

nkumar-topcoder avatar nkumar-topcoder commented on August 21, 2024

Going by our earlier challenge
https://www.topcoder.com/challenges/742acfca-da8f-447c-b700-67298ac9a8c4
weeklycost and weeklycount got mixed up ?

from taas-apis.

veshu avatar veshu commented on August 21, 2024

@nkumar-topcoder

what does weekly count mean?
Currently, the weekly cost is the sum of all resources that are billed this week.
what is time remaining in week field?

from taas-apis.

nkumar-topcoder avatar nkumar-topcoder commented on August 21, 2024

The weekly count is output of {{URL}}/taas-teams/{projectid}
that's what i meant weeklycost and weeklycount mix up

{
"id":,
"name": "",
"weeklyCount": 2913,
"resources": [
{
"id": "5bd69a82-c2cb-476f-9462-0883d3b28b90",
"handle": "",
"firstName": "Mekhi",

from taas-apis.

veshu avatar veshu commented on August 21, 2024

oh @nkumar-topcoder we can rename that field to weeklyCost

from taas-apis.

maxceem avatar maxceem commented on August 21, 2024

Closing this issue as it's done per description and created a new one to handle renaming #47

from taas-apis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.