# 1. Goal A photo studio prices a photo shoot. A booking program calls the calculation before it shows the quote to the customer. The program needs the fee parts and the total fee. # 2. Open questions None. # 3. Context - The class {{P}}PHOTO_PRICER does not exist. Create it in package $TMP. - The booking program uses the public types, the public constants and the public method of the class. It does not use other parts of the class. # 4. Contract - Create the class {{P}}PHOTO_PRICER in package $TMP. - The class is public and final. It has a public constructor without parameters. - The class has these public types: - ty_session: type c, length 7. - ty_reason: type c, length 8. - ty_amount: type p, length 8, 2 decimal places. - ty_request: a structure with the components session (ty_session), minutes (i), persons (i), photos (i) and distance_km (i). - ty_quote: a structure with the components time_fee (ty_amount), person_fee (ty_amount), photo_fee (ty_amount), travel_fee (ty_amount), crew_fee (ty_amount), total (ty_amount) and reason (ty_reason). - The class has these public constants: - c_session with the components studio = 'STUDIO' and outdoor = 'OUTDOOR'. Both components have the type ty_session. - c_reason with the components ok = 'OK', session = 'SESSION', minutes = 'MINUTES', persons = 'PERSONS', photos = 'PHOTOS' and distance = 'DISTANCE'. All components have the type ty_reason. - The class has one public method: calculate IMPORTING is_request TYPE ty_request RETURNING VALUE(rs_quote) TYPE ty_quote. - Do not add other public methods. # 5. Business rules First check the input. Apply the checks in this sequence. If a check fails, set rs_quote-reason to the reason of that check, keep all fee components and the total at 0, and stop. 1. is_request-session must be STUDIO or OUTDOOR. Else reason = SESSION. 2. is_request-minutes must be 30 or more and 480 or less. Else reason = MINUTES. 3. is_request-persons must be 1 or more and 20 or less. Else reason = PERSONS. 4. is_request-photos must be 0 or more and 200 or less. Else reason = PHOTOS. 5. If the session is OUTDOOR, is_request-distance_km must be 1 or more. Else reason = DISTANCE. For a STUDIO session, ignore distance_km. If all checks pass, set reason = OK and calculate the fees. - time_fee: each started 15 minutes of the shoot costs 20.00. Example: 30 minutes cost 40.00. 31 minutes cost 60.00. 480 minutes cost 640.00. - person_fee: the first 2 persons are free. Each other person costs 10.00. - photo_fee: if photos is less than 50, each photo costs 5.00. If photos is 50 or more, each photo costs 4.00. - travel_fee: for a STUDIO session, 0.00. For an OUTDOOR session, 15.00 plus 2.00 for each kilometre of distance_km. - crew_fee: if persons is more than 8, the studio sends a second photographer. The crew_fee is then 40.00. Else the crew_fee is 0.00. - total: the sum of time_fee, person_fee, photo_fee, travel_fee and crew_fee. # 6. Constraints - Release target: SAP_BASIS 816. - Coding standards: Clean ABAP. Each method has less than 40 statements. No global variables. No comment that restates the code. - Out of scope: database access, ALV lists, CDS views, function modules, reports and dynpros. # 7. Acceptance - The class is active and has no syntax error. - The hidden tests pass. - Write your own ABAP Unit tests for the class.