-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release 1.0.0-beta.1
- Loading branch information
Showing
46 changed files
with
1,277 additions
and
15,811 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ full_name: Sven Fillinger | |
email: [email protected] | ||
project_name: qoffer-2-portlet | ||
project_short_description: qOffer assists in managing and creating offers | ||
version: 1.0.0-SNAPSHOT | ||
version: 1.0.0-beta.1 | ||
domain: portlet | ||
language: groovy | ||
project_slug: qoffer-2-portlet | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...r-manager-app/src/main/groovy/life/qbic/portal/offermanager/OfferFileNameFormatter.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package life.qbic.portal.offermanager | ||
|
||
import life.qbic.datamodel.dtos.business.Offer | ||
|
||
import java.time.LocalDate | ||
|
||
/** | ||
* <h1>Formats the filename for an offer</h1> | ||
* | ||
* <p>An offers file name should contain the date of the offer creation, the project conserved part and the offer version</p> | ||
* | ||
* @since 1.0.0 | ||
* | ||
*/ | ||
class OfferFileNameFormatter { | ||
|
||
/** | ||
* Returns an offer file name in this schema: | ||
* | ||
* Q_<year>_<month>_<day>_<project-conserved-part>_<random-id-part>_v<offer-version>.pdf | ||
* @param offer | ||
* @return | ||
*/ | ||
static String getFileNameForOffer(Offer offer) { | ||
LocalDate date = offer.modificationDate.toLocalDate() | ||
String dateString = createDateString(date) | ||
return "Q_${dateString}_" + | ||
"${offer.identifier.projectConservedPart}_${offer.identifier.randomPart}_" + | ||
"v${offer.identifier.version}.pdf" | ||
} | ||
|
||
private static String createDateString(LocalDate date) { | ||
return String.format("%04d_%02d_%02d", date.getYear(), date.getMonthValue(), date.getDayOfMonth()) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.